• Resolved awpu

    (@awpu)


    How can I set the default value for the Article Extension? It’s an unnecessary extra step to have to change it manually each time we make a new post.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi there!

    I’m working on it 🙂

    1. Filter wise: https://github.com/sybrew/the-seo-framework/issues/298.
    2. Option wise, I still need to create an abstract and dynamic options page for all extensions to hook into; this requires a lot of planning.

    The idea is that the options page will allow you to select the enabled post types, and thereafter the default Articles type for each post type.

    Thread Starter awpu

    (@awpu)

    I tried this filter, but it’s not re-ordering?

    
    add_filter( 'the_seo_framework_articles_post_type_support', function( array $types = [] ) {
    
    	// Reorders "post" default selection. The first is auto-selected.
    	$types['post'] = [ 'BlogPosting', 'Article', 'NewsArticle' ];
    
    	return $types;
    } );
    • This reply was modified 7 years, 5 months ago by awpu.
    Plugin Author Sybre Waaijer

    (@cybr)

    Hello again 🙂

    My apologies for the confusion. The filter was a proposal, and it’s not implemented.

    I forgot I implemented another filter.

    You’d want to use that filter, instead. This is assuming you want BlogPosting by default:

    add_filter( 'the_seo_framework_articles_default_meta', function( $defaults ) {
    	$defaults['type'] = 'BlogPosting';
    	return $defaults;
    } );

    The filter above will work for all new posts. It’ll also affect all old posts where you haven’t saved the metadata since activating the extensions.

    I hope this helps! Cheers 🙂

    Thread Starter awpu

    (@awpu)

    Great, thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Article Extension Default Value’ is closed to new replies.