Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Created October 25, 2019 08:53
Show Gist options
  • Save maheshwaghmare/e2ae238e474dcf6e0c2bb1b37adcfef0 to your computer and use it in GitHub Desktop.
Save maheshwaghmare/e2ae238e474dcf6e0c2bb1b37adcfef0 to your computer and use it in GitHub Desktop.
Astra Portfolio - Change the text `Portfolio` with `Retreats` from post type.
<?php
/**
* Change name `Portfolio` with `Retreats`
*
* @param array $args Post type arguments.
* @param string $post_type Post type slug.
* @return array Filtered arguments.
*/
if( ! function_exists( 'astra_portfolio_change_portfolio_arguments' ) ) :
function astra_portfolio_change_portfolio_arguments( $args = array(), $post_type = '' ) {
if( 'astra-portfolio' !== $post_type ) {
return $args;
}
// Change the post type title.
$args['labels']['name'] = 'Retreats';
return $args;
}
add_filter( 'register_post_type_args', 'astra_portfolio_change_portfolio_arguments', 10, 2 );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment