Making WordPress.org

Changeset 10781

Timestamp:
03/05/2021 12:50:03 AM (3 years ago)
Author:
coffee2code
Message:

Handbooks, Explicitly remove '-handbook' from post types rather than assuming it's the last nine characters.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/handbook.php

    r10780 r10781  
    135135            // If no name defined yet, try handbook post type if not standard.
    136136            if ( ! $name && ( 'handbook' !== $post_type ) ) {
    137                 $name = ucfirst( substr( $post_type, 0, -9 ) );
     137                $name = ucfirst( s ) );
    138138            }
    139139
     
    285285        $label = ( 'handbook' === $this->post_type ) ?
    286286            __( 'Handbook name', 'wporg' ) :
    287             sprintf( __( 'Handbook name (%s)', 'wporg' ), substr( $this->post_type, 0, -9 ) );
     287            sprintf( __( 'Handbook name (%s)', 'wporg' ), s ) );
    288288
    289289        add_settings_field(
     
    525525            $page = get_page_by_path( $this->post_type, OBJECT, $this->post_type );
    526526            if ( ! $page ) {
    527                 $slug = substr( $this->post_type, 0, -9 );
     527                $slug = s );
    528528                $page = get_page_by_path( $slug, OBJECT, $this->post_type );
    529529            }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php

    r10768 r10781  
    9595        $page = get_page_by_path( $post_type, OBJECT, $post_type );
    9696        if ( ! $page ) {
    97             $slug = substr( $post_type, 0, -9 );
     97            $slug = s );
    9898            $page = get_page_by_path( $slug, OBJECT, $post_type );
    9999        }
Note: See TracChangeset for help on using the changeset viewer.