Make WordPress Core

Changeset 54254


Ignore:
Timestamp:
09/20/2022 02:15:25 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rename WordPress Dependencies API class files.

The current coding standards note that the name of the class files should be based on the class name with class- prepended, and the underscores replaced by hyphens (see the Naming Conventions section in the handbook), except for the three legacy files: class.wp-dependencies.php, class.wp-scripts.php, class.wp-styles.php.

To bring more consistency to the codebase and make it easier to implement autoloading in the future, this commit renames those three legacy files to conform to the coding standards:

  • wp-includes/class.wp-dependencies.phpwp-includes/class-wp-dependencies.php
  • wp-includes/class.wp-scripts.phpwp-includes/class-wp-scripts.php
  • wp-includes/class.wp-styles.phpwp-includes/class-wp-styles.php

Includes:

  • Loading the new files from the old ones, for anyone that may have been including the files directly.
  • Replacing references to the old filenames with the new filenames.

Follow-up to [7970], [45654], [45662], [45663], [45678], [47197], [52026], [53749].

Props afragen, schlessera, swissspidy, dingo_d, hellofromTonya, SergeyBiryukov.
Fixes #37861. See #55647.

Location:
trunk/src/wp-includes
Files:
3 added
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-scripts.php

    r54253 r54254  
    384384        }
    385385
    386         /** This filter is documented in wp-includes/class.wp-scripts.php */
     386        /** This filter is documented in wp-includes/class-wp-scripts.php */
    387387        $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
    388388
  • trunk/src/wp-includes/class-wp-styles.php

    r54253 r54254  
    269269            );
    270270
    271             /** This filter is documented in wp-includes/class.wp-styles.php */
     271            /** This filter is documented in wp-includes/class-wp-styles.php */
    272272            $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );
    273273
  • trunk/src/wp-includes/formatting.php

    r54229 r54254  
    57965796    if ( SCRIPT_DEBUG ) {
    57975797        $settings['source'] = array(
    5798             /** This filter is documented in wp-includes/class.wp-scripts.php */
     5798            /** This filter is documented in wp-includes/class-wp-scripts.php */
    57995799            'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ),
    5800             /** This filter is documented in wp-includes/class.wp-scripts.php */
     5800            /** This filter is documented in wp-includes/class-wp-scripts.php */
    58015801            'twemoji' => apply_filters( 'script_loader_src', includes_url( "js/twemoji.js?$version" ), 'twemoji' ),
    58025802        );
    58035803    } else {
    58045804        $settings['source'] = array(
    5805             /** This filter is documented in wp-includes/class.wp-scripts.php */
     5805            /** This filter is documented in wp-includes/class-wp-scripts.php */
    58065806            'concatemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji-release.min.js?$version" ), 'concatemoji' ),
    58075807        );
  • trunk/src/wp-includes/script-loader.php

    r54238 r54254  
    2121
    2222/** WordPress Dependencies Class */
    23 require ABSPATH . WPINC . '/class.wp-dependencies.php';
     23require ABSPATH . WPINC . '/class-wp-dependencies.php';
    2424
    2525/** WordPress Scripts Class */
    26 require ABSPATH . WPINC . '/class.wp-scripts.php';
     26require ABSPATH . WPINC . '/class-wp-scripts.php';
    2727
    2828/** WordPress Scripts Functions */
     
    3030
    3131/** WordPress Styles Class */
    32 require ABSPATH . WPINC . '/class.wp-styles.php';
     32require ABSPATH . WPINC . '/class-wp-styles.php';
    3333
    3434/** WordPress Styles Functions */
     
    191191        }
    192192
    193         /** This filter is documented in wp-includes/class.wp-scripts.php */
     193        /** This filter is documented in wp-includes/class-wp-scripts.php */
    194194        $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
    195195
Note: See TracChangeset for help on using the changeset viewer.