Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Change label of a post type in WordPress using filter.
<?php // don't copy this line in your code
function your_prefix_change_post_type_slug( $args, $post_type ) {
if ( 'sfwd-topic' == $post_type ) {
$args['labels']['name'] = 'LD Topics';
return $args;
add_filter( 'register_post_type_args', 'your_prefix_change_post_type_slug', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.