Last active
September 1, 2017 02:43
-
-
Save stevengliebe/2b26a1862854c28b3d07 to your computer and use it in GitHub Desktop.
Example of how to change Church Content plugin post type URL slug (e.g. "sermons" to "messages")
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 | |
/** | |
* Change sermon slug in URL | |
* | |
* Example of how to change sermon slug in Church Content plugin. | |
* This is ideally placed in your own functionality plugin so that it works after switching themes. | |
* | |
* REQUIRED: Go to Settings > Permalinks and save after applying this, or it will not take effect | |
* | |
* More info: https://churchthemes.com/guides/developer/church-content/#modifying-post-types | |
* | |
* @param array $args Post type registration arguments yourprefix_change_sermon_slug | |
* @return array Filtered arguments with new slug | |
*/ | |
function yourprefix_change_sermon_slug( $args ) { | |
$args['rewrite']['slug'] = 'newslug'; | |
return $args; | |
} | |
add_filter( 'ctc_post_type_sermon_args', 'yourprefix_change_sermon_slug' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment