Tip: Make WPSubtitle work with post types
-
I needed this to work with some of my post types, this is not recommended but more an ide.
Go to plugins/wp-subtitle and open wp-subtitle.php with your favorit text editor.
Add this function inside the WPSubtitle class
/** * Get Post Types * By Nexxoz.com */ public static function _get_tax_types(){ $taxonomies = get_post_types( '', 'names' ); unset($taxonomies['attachment']); unset($taxonomies['revision']); unset($taxonomies['nav_menu_item']); unset($taxonomies['wpcf7_contact_form']); unset($taxonomies['guide']); return $taxonomies; }
Now find _add_default_post_type_support function and replace it with this
public static function _add_default_post_type_support() { // add_post_type_support( 'page', 'wps_subtitle' ); // add_post_type_support( 'post', 'wps_subtitle' ); foreach (self::_get_tax_types() as $taxonomy ) { add_post_type_support($taxonomy, 'wps_subtitle' ); } }
Now find get_supported_post_types function and replace this line
$post_types = array_merge( $post_types, array( 'post' , 'page' ) );
with this
$post_types = array_merge( $post_types, self::_get_tax_types() );
Save the file and upload it, Happy coding ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Tip: Make WPSubtitle work with post types’ is closed to new replies.