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
| add_filter( 'init', 'custom_registered_taxonomy_admin_labels' ); | |
| function custom_registered_taxonomy_admin_labels() { | |
| global $wp_taxonomies; | |
| $labels = &$wp_taxonomies['your_taxonomy']->labels;//change to your taxonomy slug | |
| $labels->name = 'NAME'; | |
| $labels->singular_name = 'SING_NAME'; | |
| $labels->add_new = 'Add NAME'; | |
| $labels->add_new_item = 'Add NAME'; | |
| $labels->edit_item = 'Edit NAME'; |
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
| add_filter('get_the_excerpt', 'allow_html_in_excerpt'); | |
| function allow_html_in_excerpt($text) { // Fakes an excerpt if needed | |
| global $post; | |
| if ( '' == $text ) { | |
| $text = get_the_content(''); | |
| $text = apply_filters('the_content', $text); | |
| $text = str_replace('\]\]\>', ']]>', $text); | |
| /*just add all the tags you want to appear in the excerpt -- | |
| be sure there are no white spaces in the string of allowed tags */ |
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
| remove_filter('get_the_excerpt', 'wp_trim_excerpt'); |
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
| add_filter( 'post_link', 'add_custom_base_to_post_links', 10, 3 ); | |
| function add_custom_base_to_post_links( $post_link, $post, $leavename ) { | |
| if ( 'post' != $post->post_type || 'publish' != $post->post_status ) { | |
| return $post_link; | |
| } | |
| $post_link = str_replace( '/' . $post->post_name . '/', '/your_custom_base/' . $post->post_name . '/', $post_link ); | |
| return $post_link; | |
| } |
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
| add_filter( 'register_post_type_args', 'rename_registered_post_types', 999, 2 ); | |
| function rename_registered_post_types( $args, $post_type ){ | |
| if( 'post' == $post_type ){//your post type to rename | |
| $args['rewrite']['slug'] = 'your_custom_slug'; | |
| } | |
| return $args; | |
| } |
NewerOlder