/home/techb158/public_html/wp-includes
NameSizeModeActions
abilities-api/-0755rm
ai-client/-0755rm
assets/-0777rm
block-bindings/-0755rm
block-patterns/-0777rm
block-supports/-0777rm
blocks/-0777rm
build/-0755rm
certificates/-0777rm
css/-0777rm
customize/-0777rm
fonts/-0777rm
html-api/-0755rm
ID3/-0777rm
images/-0777rm
interactivity-api/-0755rm
IXR/-0777rm
js/-0777rm
l10n/-0755rm
php-ai-client/-0755rm
php-compat/-0777rm
PHPMailer/-0777rm
pomo/-0777rm
Requests/-0777rm
rest-api/-0777rm
SimplePie/-0777rm
sitemaps/-0777rm
sodium_compat/-0777rm
style-engine/-0777rm
Text/-0777rm
theme-compat/-0777rm
widgets/-0777rm
.htaccess1780644editdlrm
abilities-api.php328000666editdlrm
abilities.php117970666editdlrm
admin-bar.php400670666editdlrm
ai-client.php25490666editdlrm
atomlib.php121810666editdlrm
author-template.php198440666editdlrm
block-bindings.php76320666editdlrm
block-editor.php287240666editdlrm
block-i18n.json3160666editdlrm
block-patterns.php156060666editdlrm
block-template-utils.php631680666editdlrm
block-template.php182570666editdlrm
blocks.php1242050666editdlrm
bookmark-template.php127680666editdlrm
bookmark.php154270666editdlrm
cache-compat.php110210666editdlrm
cache.php134860666editdlrm
canonical.php347860666editdlrm
capabilities.php435840666editdlrm
category-template.php569900666editdlrm
category.php128340666editdlrm
class-avif-info.php300080666editdlrm
class-feed.php5390666editdlrm
class-http.php3670666editdlrm
class-IXR.php26090666editdlrm
class-json.php436760666editdlrm
class-oembed.php4010666editdlrm
class-phpass.php67710666editdlrm
class-phpmailer.php6640666editdlrm
class-pop3.php211000666editdlrm
class-requests.php22370666editdlrm
class-simplepie.php4530666editdlrm
class-smtp.php4570666editdlrm
class-snoopy.php377150666editdlrm
class-walker-category-dropdown.php24690666editdlrm
class-walker-category.php84770666editdlrm
class-walker-comment.php142210666editdlrm
class-walker-nav-menu.php120440666editdlrm
class-walker-page-dropdown.php27100666editdlrm
class-walker-page.php76120666editdlrm
class-wp-admin-bar.php180020666editdlrm
class-wp-ajax-response.php52880666editdlrm
class-wp-application-passwords.php170990666editdlrm
class-wp-block-bindings-registry.php82630666editdlrm
class-wp-block-bindings-source.php29920666editdlrm
class-wp-block-editor-context.php13500666editdlrm
class-wp-block-list.php47130666editdlrm
class-wp-block-metadata-registry.php118460666editdlrm
class-wp-block-parser-block.php25550666editdlrm
class-wp-block-parser-frame.php19940666editdlrm
class-wp-block-parser.php115250666editdlrm
class-wp-block-pattern-categories-registry.php43830666editdlrm
class-wp-block-patterns-registry.php102650666editdlrm
class-wp-block-processor.php699140666editdlrm
class-wp-block-styles-registry.php64190666editdlrm
class-wp-block-supports.php75780666editdlrm
class-wp-block-template.php21110666editdlrm
class-wp-block-templates-registry.php70800666editdlrm
class-wp-block-type-registry.php53050666editdlrm
class-wp-block-type.php172220666editdlrm
class-wp-block.php282360666editdlrm
class-wp-classic-to-block-menu-converter.php40260666editdlrm
class-wp-comment-query.php490400666editdlrm
class-wp-comment.php172490666editdlrm
class-wp-connector-registry.php151810666editdlrm
class-wp-customize-control.php261120666editdlrm
class-wp-customize-manager.php2029080666editdlrm
class-wp-customize-nav-menus.php580340666editdlrm
class-wp-customize-panel.php107030666editdlrm
class-wp-customize-section.php112090666editdlrm
class-wp-customize-setting.php299560666editdlrm
class-wp-customize-widgets.php725960666editdlrm
class-wp-date-query.php359700666editdlrm
class-wp-dependencies.php170890666editdlrm
class-wp-dependency.php26530666editdlrm
class-wp-duotone.php408360666editdlrm
class-wp-editor.php722280666editdlrm
class-wp-embed.php159080666editdlrm
class-wp-error.php75140666editdlrm
class-wp-exception.php2530666editdlrm
class-wp-fatal-error-handler.php81500666editdlrm
class-wp-feed-cache-transient.php33040666editdlrm
class-wp-feed-cache.php9690666editdlrm
class-wp-filter-sentinel.php7600666editdlrm
class-wp-hook.php174720666editdlrm
class-wp-http-cookie.php72690666editdlrm
class-wp-http-curl.php132610666editdlrm
class-wp-http-encoding.php66890666editdlrm
class-wp-http-ixr-client.php35160666editdlrm
class-wp-http-proxy.php59800666editdlrm
class-wp-http-requests-hooks.php20220666editdlrm
class-wp-http-requests-response.php42430666editdlrm
class-wp-http-response.php29770666editdlrm
class-wp-http-streams.php167640666editdlrm
class-wp-http.php416410666editdlrm
class-wp-icon-collections-registry.php58050666editdlrm
class-wp-icons-registry.php99030666editdlrm
class-wp-image-editor-gd.php207410666editdlrm
class-wp-image-editor-imagick.php434540666editdlrm
class-wp-image-editor.php174560666editdlrm
class-wp-list-util.php74430666editdlrm
class-wp-locale-switcher.php67760666editdlrm
class-wp-locale.php168480666editdlrm
class-wp-matchesmapregex.php18280666editdlrm
class-wp-meta-query.php305070666editdlrm
class-wp-metadata-lazyloader.php68330666editdlrm
class-wp-navigation-fallback.php91930666editdlrm
class-wp-network-query.php199890666editdlrm
class-wp-network.php124110666editdlrm
class-wp-object-cache.php175240666editdlrm
class-wp-oembed-controller.php69050666editdlrm
class-wp-oembed.php343720666editdlrm
class-wp-paused-extensions-storage.php50670666editdlrm
class-wp-phpmailer.php43480666editdlrm
class-wp-plugin-dependencies.php252090666editdlrm
class-wp-post-type.php306720666editdlrm
class-wp-post.php88060666editdlrm
class-wp-query.php1641480666editdlrm
class-wp-recovery-mode-cookie-service.php68770666editdlrm
class-wp-recovery-mode-email-service.php111620666editdlrm
class-wp-recovery-mode-key-service.php49140666editdlrm
class-wp-recovery-mode-link-service.php35230666editdlrm
class-wp-recovery-mode.php114600666editdlrm
class-wp-rewrite.php636930666editdlrm
class-wp-role.php25230666editdlrm
class-wp-roles.php93260666editdlrm
class-wp-script-modules.php407430666editdlrm
class-wp-scripts.php367540666editdlrm
class-wp-session-tokens.php73190666editdlrm
class-wp-simplepie-file.php35520666editdlrm
class-wp-simplepie-sanitize-kses.php19030666editdlrm
class-wp-site-query.php314820666editdlrm
class-wp-site.php78360666editdlrm
class-wp-speculation-rules.php78840666editdlrm
class-wp-styles.php133160666editdlrm
class-wp-tax-query.php195770666editdlrm
class-wp-taxonomy.php185590666editdlrm
class-wp-term-query.php407510666editdlrm
class-wp-term.php52630666editdlrm
class-wp-text-diff-renderer-inline.php9790666editdlrm
class-wp-text-diff-renderer-table.php189250666editdlrm
class-wp-textdomain-registry.php104810666editdlrm
class-wp-theme-json-data.php18050666editdlrm
class-wp-theme-json-resolver.php356920666editdlrm
class-wp-theme-json-schema.php73670666editdlrm
class-wp-theme-json.php2215060666editdlrm
class-wp-theme.php658110666editdlrm
class-wp-token-map.php290320666editdlrm
class-wp-url-pattern-prefixer.php48020666editdlrm
class-wp-user-meta-session-tokens.php29540666editdlrm
class-wp-user-query.php441020666editdlrm
class-wp-user-request.php23420666editdlrm
class-wp-user.php231890666editdlrm
class-wp-view-config-data.php294270666editdlrm
class-wp-walker.php132920666editdlrm
class-wp-widget-factory.php33430666editdlrm
class-wp-widget.php191290644editdlrm
class-wp-xmlrpc-server.php2162720666editdlrm
class-wp.php263710666editdlrm
class-wpdb.php1214370666editdlrm
class.wp-dependencies.php3730666editdlrm
class.wp-scripts.php3430666editdlrm
class.wp-styles.php3380666editdlrm
comment-template.php1032110666editdlrm
comment.php1506300666editdlrm
compat-utf8.php193860666editdlrm
compat.php231050644editdlrm
connectors.php329220666editdlrm
cron.php462660666editdlrm
date.php4000666editdlrm
default-constants.php113650666editdlrm
default-filters.php395000666editdlrm
default-widgets.php22880666editdlrm
deprecated.php1939770666editdlrm
embed-template.php3380666editdlrm
embed.php392150666editdlrm
error-protection.php40920666editdlrm
feed-atom-comments.php55040666editdlrm
feed-atom.php31140666editdlrm
feed-rdf.php26680666editdlrm
feed-rss.php11890666editdlrm
feed-rss2-comments.php41360666editdlrm
feed-rss2.php37990666editdlrm
feed.php251890666editdlrm
fonts.php97890666editdlrm
formatting.php3576520666editdlrm
functions.php2954810666editdlrm
functions.wp-scripts.php204920666editdlrm
functions.wp-styles.php86540666editdlrm
general-template.php1834720666editdlrm
global-styles-and-settings.php207800666editdlrm
http.php289610666editdlrm
https-detection.php58570666editdlrm
https-migration.php47410666editdlrm
icons.php63340666editdlrm
index.php10880444editdlrm
json-schema.php78020666editdlrm
kses.php884970666editdlrm
kwa.txt10644editdlrm
l10n.php714150666editdlrm
link-template.php1601430666editdlrm
load.php571480644editdlrm
locale.php1620666editdlrm
media-template.php657590666editdlrm
media.php2368040666editdlrm
meta.php667390666editdlrm
ms-blogs.php263240666editdlrm
ms-default-constants.php49210666editdlrm
ms-default-filters.php66360666editdlrm
ms-deprecated.php217870666editdlrm
ms-files.php28570666editdlrm
ms-functions.php932580644editdlrm
ms-load.php200550666editdlrm
ms-network.php37820666editdlrm
ms-settings.php41970666editdlrm
ms-site.php417290666editdlrm
nav-menu-template.php259830666editdlrm
nav-menu.php442690666editdlrm
option.php1052460666editdlrm
pluggable-deprecated.php63240666editdlrm
pluggable.php1279190666editdlrm
plugin.php391100644editdlrm
post-formats.php70700666editdlrm
post-template.php691290666editdlrm
post-thumbnail-template.php108790666editdlrm
post.php3052150666editdlrm
query.php375540666editdlrm
registration-functions.php2000666editdlrm
registration.php2000666editdlrm
rest-api.php1029510666editdlrm
revision.php312410666editdlrm
rewrite.php195670666editdlrm
robots-template.php51850666editdlrm
rss-functions.php2770666editdlrm
rss.php232030666editdlrm
script-loader.php1635500666editdlrm
script-modules.php123110666editdlrm
session.php2580666editdlrm
shortcodes.php240340666editdlrm
sitemaps.php32380666editdlrm
speculative-loading.php118800666editdlrm
spl-autoload-compat.php4410666editdlrm
style-engine.php80450666editdlrm
taxonomy.php1783070666editdlrm
template-canvas.php5440666editdlrm
template-loader.php42670666editdlrm
template.php368240666editdlrm
theme-i18n.json18920666editdlrm
theme-previews.php28870666editdlrm
theme-templates.php40600666editdlrm
theme.json94800666editdlrm
theme.php1346410666editdlrm
update.php382690666editdlrm
user.php1803010666editdlrm
utf8.php69770666editdlrm
vars.php66000666editdlrm
version.php18090644editdlrm
view-config.php190870666editdlrm
view-transitions.php6020666editdlrm
widgets.php708660666editdlrm
wp-db.php4450666editdlrm
wp-diff.php7920666editdlrm
Edit: /home/techb158/public_html/wp-includes/view-config.php (19087B)
array( 'type' => 'panel' ), 'fields' => array( array( 'id' => 'featured_media', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), array( 'id' => 'post-content-info', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), array( 'id' => 'excerpt', 'layout' => array( 'type' => 'panel', 'labelPosition' => 'top', ), ), array( 'id' => 'status', 'label' => __( 'Status' ), 'children' => array( array( 'id' => 'status', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), 'scheduled_date', 'password', 'sticky', ), ), 'date', 'slug', 'author', 'template', array( 'id' => 'discussion', 'label' => __( 'Discussion' ), 'children' => array( array( 'id' => 'comment_status', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), 'ping_status', ), ), 'parent', 'format', 'revisions', ), ); } /** * Returns the view configuration for the given entity. * * Builds the default configuration shared by all entities and then exposes it * through the dynamic `get_entity_view_config_{$kind}_{$name}` filter — with the * dynamic portions lowercased, see wp_get_entity_view_config_hook_name() * — so that core and third parties can provide the configuration for a * specific entity. * * @since 7.1.0 * * @param string $kind The entity kind (e.g. `postType`). * @param string $name The entity name (e.g. `page`). * @return array { * The view configuration for the entity. * * @type array $default_view Default view configuration. * @type array $default_layouts Default layouts configuration. * @type array $view_list List of available views. * @type array $form Form configuration. * } */ function wp_get_entity_view_config( $kind, $name ) { $default_view = array( 'type' => 'table', 'filters' => array(), 'sort' => array( 'field' => 'title', 'direction' => 'asc', ), 'perPage' => 20, 'fields' => array( 'author', 'status' ), 'titleField' => 'title', ); $default_layouts = array( 'table' => array(), 'grid' => array(), 'list' => array(), ); $all_items_title = __( 'All items' ); if ( 'postType' === $kind ) { $post_type_object = get_post_type_object( $name ); if ( $post_type_object && ! empty( $post_type_object->labels->all_items ) ) { $all_items_title = $post_type_object->labels->all_items; } } $view_list = array( array( 'title' => $all_items_title, 'slug' => 'all', ), ); $config = array( 'default_view' => $default_view, 'default_layouts' => $default_layouts, 'view_list' => $view_list, 'form' => 'postType' === $kind ? _wp_get_default_posttype_form() : array(), ); $data = new WP_View_Config_Data( $config ); return $data->apply_filters( $kind, $name ); } /** * Provides the view configuration for the `page` post type. * * @since 7.1.0 * * @param WP_View_Config_Data $data The view configuration container for the entity. * @return WP_View_Config_Data The updated view configuration container. */ function _wp_get_entity_view_config_posttype_page( $data ) { $default_layouts = array( 'table' => array( 'layout' => array( 'styles' => array( 'author' => array( 'align' => 'start', ), ), ), ), 'grid' => array(), 'list' => array(), ); $default_view = array( 'type' => 'list', 'filters' => array(), 'perPage' => 20, 'sort' => array( 'field' => 'title', 'direction' => 'asc', ), 'showLevels' => true, 'titleField' => 'title', 'mediaField' => 'featured_media', 'fields' => array( 'author', 'status' ), ); $view_list = array( array( 'title' => __( 'Published' ), 'slug' => 'published', 'view' => array( 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'publish', 'isLocked' => true, ), ), ), ), array( 'title' => __( 'Scheduled' ), 'slug' => 'future', 'view' => array( 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'future', 'isLocked' => true, ), ), ), ), array( 'title' => __( 'Drafts' ), 'slug' => 'drafts', 'view' => array( 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'draft', 'isLocked' => true, ), ), ), ), array( 'title' => __( 'Pending' ), 'slug' => 'pending', 'view' => array( 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'pending', 'isLocked' => true, ), ), ), ), array( 'title' => __( 'Private' ), 'slug' => 'private', 'view' => array( 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'private', 'isLocked' => true, ), ), ), ), array( 'title' => __( 'Trash' ), 'slug' => 'trash', 'view' => array( 'type' => 'table', 'layout' => $default_layouts['table']['layout'], 'filters' => array( array( 'field' => 'status', 'operator' => 'isAny', 'value' => 'trash', 'isLocked' => true, ), ), ), ), ); $data->set( array( 'default_view' => $default_view, 'default_layouts' => $default_layouts, ), 1 ); // Append the status views, thereby preserving the base "all items" view, // so its post-type-specific title is kept. $data->merge( array( 'view_list' => $view_list ), 1 ); return $data; } /** * Provides the view configuration for the `wp_block` post type. * * @since 7.1.0 * * @param WP_View_Config_Data $data The view configuration container for the entity. * @return WP_View_Config_Data The updated view configuration container. */ function _wp_get_entity_view_config_posttype_wp_block( $data ) { $default_layouts = array( 'table' => array( 'layout' => array( 'styles' => array( 'author' => array( 'width' => '1%', ), ), ), ), 'grid' => array( 'layout' => array( 'badgeFields' => array( 'sync-status' ), ), ), ); $default_view = array( 'type' => 'grid', 'perPage' => 20, 'titleField' => 'title', 'mediaField' => 'preview', 'fields' => array( 'sync-status' ), 'filters' => array(), 'layout' => $default_layouts['grid']['layout'], ); $view_list = array( array( 'title' => __( 'All patterns' ), 'slug' => 'all-patterns', ), array( 'title' => __( 'My patterns' ), 'slug' => 'my-patterns', ), ); // Gather categories from the block pattern categories registry. $registry = WP_Block_Pattern_Categories_Registry::get_instance(); $categories = array(); foreach ( $registry->get_all_registered() as $category ) { $categories[ $category['name'] ] = $category['label']; } // Ensure "Uncategorized" is always included for patterns // that have no category assigned. $categories['uncategorized'] ??= __( 'Uncategorized' ); // Also gather user-created pattern categories (wp_pattern_category taxonomy). $user_terms = get_terms( array( 'taxonomy' => 'wp_pattern_category', 'hide_empty' => false, ) ); if ( ! is_wp_error( $user_terms ) ) { foreach ( $user_terms as $term ) { $categories[ $term->slug ] = $term->name; } } // Sort categories alphabetically by label. asort( $categories, SORT_NATURAL | SORT_FLAG_CASE ); foreach ( $categories as $category_name => $label ) { $view_list[] = array( 'title' => $label, 'slug' => $category_name, ); } $form = array( 'layout' => array( 'type' => 'panel' ), 'fields' => array( array( 'id' => 'excerpt', 'layout' => array( 'type' => 'panel', 'labelPosition' => 'top', ), ), array( 'id' => 'post-content-info', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), 'sync-status', 'revisions', ), ); $data->set( array( 'default_view' => $default_view, 'default_layouts' => $default_layouts, 'view_list' => $view_list, 'form' => $form, ), 1 ); return $data; } /** * Provides the view configuration for the `wp_template_part` post type. * * @since 7.1.0 * * @param WP_View_Config_Data $data The view configuration container for the entity. * @return WP_View_Config_Data The updated view configuration container. */ function _wp_get_entity_view_config_posttype_wp_template_part( $data ) { $default_layouts = array( 'table' => array( 'layout' => array( 'styles' => array( 'author' => array( 'width' => '1%', ), ), ), ), 'grid' => array( 'layout' => array(), ), ); $default_view = array( 'type' => 'grid', 'perPage' => 20, 'titleField' => 'title', 'mediaField' => 'preview', 'fields' => array( 'author' ), 'filters' => array(), 'layout' => $default_layouts['grid']['layout'], ); $view_list = array( array( 'title' => __( 'All template parts' ), 'slug' => 'all-parts', ), ); $areas = get_allowed_block_template_part_areas(); // Ensure default areas appear in a consistent order. $preferred_order = array( 'header', 'footer', 'sidebar', 'navigation-overlay', 'uncategorized' ); $ordered_areas = array(); $remaining_areas = array(); foreach ( $areas as $area ) { $position = array_search( $area['area'], $preferred_order, true ); if ( false !== $position ) { $ordered_areas[ $position ] = $area; } else { $remaining_areas[] = $area; } } ksort( $ordered_areas ); $areas = array_merge( array_values( $ordered_areas ), $remaining_areas ); foreach ( $areas as $area ) { $view_list[] = array( 'title' => $area['label'], 'slug' => $area['area'], 'view' => array( 'filters' => array( array( 'field' => 'area', 'operator' => 'is', 'value' => $area['area'], 'isLocked' => true, ), ), ), ); } $form = array( 'layout' => array( 'type' => 'panel' ), 'fields' => array( array( 'id' => 'last_edited_date', 'layout' => array( 'type' => 'panel', 'labelPosition' => 'none', ), ), 'revisions', ), ); $data->set( array( 'default_view' => $default_view, 'default_layouts' => $default_layouts, 'view_list' => $view_list, 'form' => $form, ), 1 ); return $data; } /** * Provides the view configuration for the `wp_template` post type. * * @since 7.1.0 * * @param WP_View_Config_Data $data The view configuration container for the entity. * @return WP_View_Config_Data The updated view configuration container. */ function _wp_get_entity_view_config_posttype_wp_template( $data ) { $default_view = array( 'type' => 'grid', 'perPage' => 20, 'sort' => array( 'field' => 'title', 'direction' => 'asc', ), 'titleField' => 'title', 'descriptionField' => 'description', 'mediaField' => 'preview', 'fields' => array( 'author', 'active', 'slug', 'theme' ), 'filters' => array(), 'showMedia' => true, ); $default_layouts = array( 'table' => array( 'showMedia' => false ), 'grid' => array( 'showMedia' => true ), 'list' => array( 'showMedia' => false ), ); $view_list = array( array( 'title' => __( 'All templates' ), 'slug' => 'all', ), ); $templates = get_block_templates( array(), 'wp_template' ); // Collect unique authors, tracking whether they come from a registered // source (theme, plugin, site) so we can sort those before user ones. $seen_authors = array(); $registered_authors = array(); $user_authors = array(); foreach ( $templates as $template ) { /* * Determine the original source of the template ('theme', 'plugin', * 'site', or 'user'). */ $original_source = 'user'; if ( 'wp_template' === $template->type || 'wp_template_part' === $template->type ) { if ( $template->has_theme_file && ( 'theme' === $template->origin || ( empty( $template->origin ) && in_array( $template->source, array( 'theme', 'custom', ), true ) ) ) ) { /* * Added by theme. * Template originally provided by a theme, but customized by a user. * Templates originally didn't have the 'origin' field so identify * older customized templates by checking for no origin and a 'theme' * or 'custom' source. */ $original_source = 'theme'; } elseif ( 'plugin' === $template->origin ) { // Added by plugin. $original_source = 'plugin'; } elseif ( empty( $template->has_theme_file ) && 'custom' === $template->source && empty( $template->author ) ) { /* * Added by site. * Template was created from scratch, but has no author. Author support * was only added to templates in WordPress 5.9. Fallback to showing the * site logo and title. */ $original_source = 'site'; } } // Determine a human readable text for the author of the template. $author_text = ''; switch ( $original_source ) { case 'theme': $theme_name = wp_get_theme( $template->theme )->get( 'Name' ); $author_text = empty( $theme_name ) ? $template->theme : $theme_name; break; case 'plugin': if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_name = ''; if ( isset( $template->plugin ) ) { $plugins = wp_get_active_and_valid_plugins(); foreach ( $plugins as $plugin_file ) { $plugin_basename = plugin_basename( $plugin_file ); list( $plugin_slug, ) = explode( '/', $plugin_basename ); if ( $plugin_slug === $template->plugin ) { $plugin_data = get_plugin_data( $plugin_file ); if ( ! empty( $plugin_data['Name'] ) ) { $plugin_name = $plugin_data['Name']; } break; } } } /* * Fall back to the theme name if the plugin is not defined. That's needed to keep backwards * compatibility with templates that were registered before the plugin attribute was added. */ if ( '' === $plugin_name ) { $plugins = get_plugins(); $plugin_basename = plugin_basename( sanitize_text_field( $template->theme . '.php' ) ); if ( isset( $plugins[ $plugin_basename ] ) && isset( $plugins[ $plugin_basename ]['Name'] ) ) { $plugin_name = $plugins[ $plugin_basename ]['Name']; } else { $plugin_name = $template->plugin ?? $template->theme; } } $author_text = $plugin_name; break; case 'site': $author_text = get_bloginfo( 'name' ); break; case 'user': $author = get_user_by( 'id', $template->author ); if ( ! $author ) { $author_text = __( 'Unknown author' ); } else { $author_text = $author->get( 'display_name' ); } break; } if ( ! empty( $author_text ) && ! isset( $seen_authors[ $author_text ] ) ) { $seen_authors[ $author_text ] = true; $entry = array( 'title' => $author_text, 'slug' => $author_text, 'view' => array( 'filters' => array( array( 'field' => 'author', 'operator' => 'is', 'value' => $author_text, 'isLocked' => true, ), ), ), ); if ( 'user' === $original_source ) { $user_authors[] = $entry; } else { $registered_authors[] = $entry; } } } $form = array( 'layout' => array( 'type' => 'panel' ), 'fields' => array( array( 'id' => 'description', 'layout' => array( 'type' => 'panel', 'labelPosition' => 'top', ), ), array( 'id' => 'description_readonly', 'layout' => array( 'type' => 'regular', 'labelPosition' => 'none', ), ), array( 'id' => 'last_edited_date', 'layout' => array( 'type' => 'panel', 'labelPosition' => 'none', ), ), 'revisions', // The following fields are only meaningful in the `home`/`index` // template summary. They edit other entities (`root/site` and the // posts page); the editor merges those records into the form data // under a namespace and controls when the fields are shown. 'posts_page_title', 'posts_per_page', 'default_comment_status', ), ); $data->set( array( 'default_view' => $default_view, 'default_layouts' => $default_layouts, 'view_list' => array_merge( $view_list, $registered_authors, $user_authors ), 'form' => $form, ), 1 ); return $data; }