Making WordPress.org

Changeset 950


Ignore:
Timestamp:
10/29/2014 05:19:58 PM (10 years ago)
Author:
coffee2code
Message:

Handbook plugin: add 'handbook_post_type_defaults' filter to permit customization of the post type configuration

File:
1 edited

Legend:

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

    r879 r950  
    163163        }
    164164
    165         register_post_type( $this->post_type, array(
     165        $default_config = array(
    166166            'labels' => array(
    167167                'name'          => $this->label,
     
    184184            'delete_with_user'  => false,
    185185            'supports'          => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
    186         ) );
     186        );
     187        // Allow customization of the default post type configuration via filter.
     188        $config = apply_filters( 'handbook_post_type_defaults', $default_config, $slug );
     189
     190        register_post_type( $this->post_type, $config );
    187191    }
    188192
Note: See TracChangeset for help on using the changeset viewer.