diff --git a/editor/editor/editor.php b/editor/editor/editor.php index 4750339b2..88c9de34a 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -487,10 +487,16 @@ private function addContentDefaults( $config, $context ) { } private function getPostLoopSources( $config, $isTemplate, $wp_post_id, $context ) { - $excludePostTypes = [ 'attachment' ]; + $types = get_post_types(['public' => true]); - $types = get_post_types( [ 'public' => true ] ); - $result = []; + $typesSort = ['page', 'post', 'editor-story']; + $excludePostTypes = ['page', 'post', 'editor-story', 'attachment']; + + $types = array_merge($typesSort, array_filter($types, function ($type) use ($excludePostTypes) { + return !in_array($type, $excludePostTypes); + })); + + $result = []; $templateTypeArchive = false; if ( $isTemplate ) { @@ -508,9 +514,6 @@ private function getPostLoopSources( $config, $isTemplate, $wp_post_id, $context } foreach ( $types as $type ) { - if ( in_array( $type, $excludePostTypes ) ) { - continue; - } $typeObj = get_post_type_object( $type ); $typeDto = [ 'name' => $typeObj->name,