Make WordPress Core

Ticket #24876: 24876.diff

File 24876.diff, 1.2 KB (added by jeherve, 13 years ago)

Featured Content: add a new parameter to Featured Content to allow users to include Featured Posts in the main blog query

  • modules/featured-content/featured-content.php

     
    1414 *     'featured_content_filter' => 'mytheme_get_featured_content',
    1515 *     'description' => 'Describe the featured content area.',
    1616 *     'max_posts' => 20,
     17 *     'include_featured' => false,
    1718 * ) );
    1819 *
    1920 * For maximum compatibility with different methods of posting
    … …  
    8182                add_action( 'admin_init',            array( __CLASS__, 'register_setting' ) );
    8283                add_action( 'save_post',             array( __CLASS__, 'delete_transient' ) );
    8384                add_action( 'delete_post_tag',       array( __CLASS__, 'delete_post_tag' ) );
    84                 add_action( 'pre_get_posts',         array( __CLASS__, 'pre_get_posts' ) );
     85               
     86                // Exclude featured posts from the blog query when the blog is the front-page.
     87                if ( ! isset( $theme_support[0]['include_featured'] ) || false == $theme_support[0]['include_featured'] )
     88                        add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) );
    8589
    8690                // Hide "featured" tag from the front-end.
    8791                if ( self::get_setting( 'hide-tag' ) ) {