Making WordPress.org

Changeset 4338


Ignore:
Timestamp:
11/08/2016 06:41:53 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Slug pluralization should only be done explicitly for plugin and theme handbooks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/handbooks.php

    r3788 r4338  
    165165         *
    166166         * @param  array  $defaults  The default post type configuration.
    167          * @param  string $post_type The post type name.
     167         * @param  string $slug      The handbook post type slug.
    168168         * @return array
    169169         */
    170         public static function filter_handbook_post_type_defaults( $defaults, $post_type ) {
    171                 $defaults['rewrite'] = array(
    172                         'feeds'      => false,
    173                         'slug'       => $post_type . 's',
    174                         'with_front' => false,
    175                 );
     170        public static function filter_handbook_post_type_defaults( $defaults, $slug ) {
     171                // Pluralize slug for plugin and theme handbooks.
     172                if ( in_array( $slug, array( 'plugin', 'theme' ) ) ) {
     173                        $defaults['rewrite'] = array(
     174                                'feeds'      => false,
     175                                'slug'       => $slug . 's',
     176                                'with_front' => false,
     177                        );
     178                }
    176179
    177180                return $defaults;
Note: See TracChangeset for help on using the changeset viewer.