[wp-trac] [WordPress Trac] #36685: Cannot edit the default args of default post types

WordPress Trac noreply at wordpress.org
Fri Mar 24 17:14:40 UTC 2017


#36685: Cannot edit the default args of default post types
-------------------------------+-----------------------------
 Reporter:  sidati             |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  4.4
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  fixed
 Keywords:  has-patch          |     Focuses:  administration
-------------------------------+-----------------------------
Changes (by johnbillion):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:  Awaiting Review => 4.4


Comment:

 The `register_post_type_args` (and `register_taxonomy_args`) filter has
 been available since WordPress 4.4 (see #17447). As mentioned above, the
 default post types ''are'' re-registered on the `init` hook, so these
 filters also apply to default post types and taxonomies.

 Example usage:

 {{{
 add_filter( 'register_post_type_args', function( array $args, $name ) {
         if ( 'post' === $name ) {
                 $args['labels']['menu_name'] = 'News';
         }
         return $args;
 }, 10, 2 );
 }}}

 Please feel free to re-open if something about these filters is not
 working as expected.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36685#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list