Created
October 25, 2019 08:53
-
-
Save maheshwaghmare/e2ae238e474dcf6e0c2bb1b37adcfef0 to your computer and use it in GitHub Desktop.
Astra Portfolio - Change the text `Portfolio` with `Retreats` from post type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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