Skip to content

Commit 712a6af

Browse files
Coding Standards: Simplify plugin name fallback in entity view-config.php.
Simplifies the plugin name resolution in by replacing the nested `isset()` checks with a null coalescing chain. No functional change — the fallback order is preserved: plugin's registered `Name`, then the template's `plugin` attribute, then the `theme` attribute. Follow-up to [62547]. Props Soean. See #64897. git-svn-id: https://develop.svn.wordpress.org/trunk@62631 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4d6a707 commit 712a6af

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/wp-includes/view-config.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,11 +660,7 @@ function _wp_get_entity_view_config_post_type_wp_template( $config ) {
660660
if ( '' === $plugin_name ) {
661661
$plugins = get_plugins();
662662
$plugin_basename = plugin_basename( sanitize_text_field( $template->theme . '.php' ) );
663-
if ( isset( $plugins[ $plugin_basename ] ) && isset( $plugins[ $plugin_basename ]['Name'] ) ) {
664-
$plugin_name = $plugins[ $plugin_basename ]['Name'];
665-
} else {
666-
$plugin_name = $template->plugin ?? $template->theme;
667-
}
663+
$plugin_name = $plugins[ $plugin_basename ]['Name'] ?? $template->plugin ?? $template->theme;
668664
}
669665
$author_text = $plugin_name;
670666
break;

0 commit comments

Comments
 (0)