People tell me ... I post_type lot of time ... How to register a new post_type is clear through register_post_type($name,$args) ;

But how to change such post_type as post and page ... for example, rename it all through $labels = array( ); or add something there ... through 'supports' => array('title','editor','custom-fields')

    1 answer 1

     // ИзмСнСниС стандартных надписСй Π² АдминкС для записСй... function change_post_object_label() { global $wp_post_types; $labels = $wp_post_types['post']->labels; $labels->name = __('Акции', 'new' ); $labels->singular_name = __('Акции', 'new' ); $labels->add_new = __('Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ', 'new' ); $labels->add_new_item = __('Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ', 'new' ); $labels->edit_item = __('Π Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ Π°ΠΊΡ†ΠΈΠΈ', 'new' ); $labels->new_item = __('Новая акция', 'new' ); $labels->view_item = __('ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€ Π°ΠΊΡ†ΠΈΠΈ', 'new' ); $labels->search_items = __('Поиск Π°ΠΊΡ†ΠΈΠΈ', 'new' ); $labels->not_found = __('Акция Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π°', 'new' ); $labels->not_found_in_trash = __('Акция Π½Π΅ Π½Π°ΠΉΠ΄Π΅Π½Π°', 'new' ); $labels->menu_name = __('Акции', 'new' ); $labels->name_admin_bar = __('Акции', 'new' ); $labels->all_items = __('ВсС Π°ΠΊΡ†ΠΈΠΈ', 'new' ); } add_action( 'init', 'change_post_object_label' );