Making WordPress.org


Ignore:
Timestamp:
03/05/2021 12:05:23 AM (4 years ago)
Author:
coffee2code
Message:

Handbooks: Use WPorg_Handbook_Init::get_post_types() as the canonical source for obtaining all handbook post types.

File:
1 edited

Legend:

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

    r10764 r10768  
    9393    /**
    9494     * Constructor
     95     *
     96     * @param string $type   The post type for the handbook.
    9597     */
    9698    public function __construct( $type ) {
    97         if ( 'handbook' !== $type ) {
    98             $this->post_type = $type . '-handbook';
    99         } else {
    100             $this->post_type = $type;
    101         }
     99        $this->post_type = sanitize_title( $type );
    102100
    103101        $this->label = ucwords( str_replace( [ '-', '_' ], ' ', $this->post_type ) );
Note: See TracChangeset for help on using the changeset viewer.