refactor(admin): remove content-type resource/post module option
This commit is contained in:
@@ -215,7 +215,7 @@ class AKSRT_Home_Modules {
|
||||
case 'mixed':
|
||||
return [
|
||||
['type' => 'hero', 'config' => []],
|
||||
['type' => 'recent', 'config' => ['post_type' => 'post', 'count' => 6, 'layout' => 'card']],
|
||||
['type' => 'recent', 'config' => ['count' => 6, 'layout' => 'card']],
|
||||
['type' => 'category', 'config' => ['count' => 6, 'columns' => 3]],
|
||||
['type' => 'category', 'config' => ['count' => 6, 'columns' => 3]],
|
||||
];
|
||||
@@ -225,8 +225,8 @@ class AKSRT_Home_Modules {
|
||||
return [
|
||||
['type' => 'hero', 'config' => []],
|
||||
['type' => 'tabs', 'config' => ['count' => 8]],
|
||||
['type' => 'recent', 'config' => ['post_type' => 'resource', 'count' => 8, 'layout' => 'grid-cms']],
|
||||
['type' => 'ranking', 'config' => ['metric' => 'downloads', 'count' => 6, 'post_type' => 'resource']],
|
||||
['type' => 'recent', 'config' => ['count' => 8, 'layout' => 'grid-cms']],
|
||||
['type' => 'ranking', 'config' => ['metric' => 'downloads', 'count' => 6]],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,19 +443,6 @@ if (!function_exists('aksrt_is_resource_archive')) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize homepage-module content scope.
|
||||
* Values: post | resource (resource = posts marked _aksrt_is_resource).
|
||||
*/
|
||||
if (!function_exists('aksrt_normalize_content_scope')) {
|
||||
function aksrt_normalize_content_scope($scope): string {
|
||||
$scope = sanitize_key((string) $scope);
|
||||
if ($scope === 'resource') {
|
||||
return 'resource';
|
||||
}
|
||||
return 'post';
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('aksrt_detect_cloud_service')) {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user