Making WordPress.org

Changeset 12715


Ignore:
Timestamp:
07/06/2023 06:23:02 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: Import: When importing plugins from SVN, if the readme title is the plugin slug, ignore that and use the Plugin headers.

This affects a minority of plugins, but this improves a small set of plugins who have === plugin-slug-here === in their readme.txt.

See #6106.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r12588 r12715  
    191191                }
    192192
    193                 // Fallback to the plugin title if the readme didn't contain it.
    194                 $plugin->post_title   = trim( $readme->name ) ?: strip_tags( $headers->Name ) ?: $plugin->post_title;
     193                // Use the Readme name, as long as it's not the plugin slug.
     194                if (
     195                        $readme->name &&
     196                        $readme->name !== $plugin->post_name
     197                ) {
     198                        $plugin->post_title = $readme->name;
     199                } elseif ( $headers->Name ) {
     200                        $plugin->post_title = strip_tags( $headers->Name );
     201                }
     202
    195203                $plugin->post_content = trim( $content ) ?: $plugin->post_content;
    196204                $plugin->post_excerpt = trim( $readme->short_description ) ?: $headers->Description ?: $plugin->post_excerpt;
Note: See TracChangeset for help on using the changeset viewer.