Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi Phil Singleton,

    I have added a filter, so I can flexibly adjust the post-types without the plugin integrating automatically into all post-types.

    Maybe you can take the filter to the next release.

    function kcSeoPostTypes() {
    	$post_types = get_post_types(
    		array(
    			'_builtin' => true
    		)
    	);
    	$exclude    = array( 'attachment', 'revision', 'nav_menu_item' );
    	foreach ( $exclude as $ex ) {
    		unset( $post_types[ $ex ] );
    	}
    
    	return apply_filters('kc_post_types', $post_types);
    }
    

    and in the functions.php of the child-theme:

    function ae_changed_kc_post_types ($post_types) {
    	$post_types['portfolio']="portfolio";
    	return $post_types;
    }
    add_filter ('kc_post_types', 'ae_changed_kc_post_types');
    
Viewing 1 replies (of 1 total)