-
-
Save BiancaNL/8f643b49b4a9c0c35da1533bb169291c to your computer and use it in GitHub Desktop.
Rename the Genesis Portfolio Slug
This file contains 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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
/** | |
* Rename slug in Genesis Portfolio Plugin. | |
* | |
* @author Anita Carter | |
* @link https://cre8tivediva.com/rename-genesis-portfolio-slug | |
*/ | |
function rename_portfolio_custom_post_type_slug() { | |
$args = get_post_type_object( 'gpb_portfolio' ); | |
if (!isset($args->name)) return; | |
$args->rewrite['slug'] = 'your-new-slug'; | |
register_post_type( $args->name, $args ); | |
} | |
add_action( 'init', 'rename_portfolio_custom_post_type_slug', 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fork of https://gist.github.com/cre8tivediva/ebad9d4d34120368d9e89a09821b0596 adjusted to work with the Portfolio Post Type in Genesis Pro