| @@ -5,48 +5,13 @@ | ||
| 5 | 5 | * |
| 6 | 6 | * @package automattic/jetpack |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -/** | |
| 10 | - * A last try to show posts, in case the Featured Content plugin returns no IDs. | |
| 11 | - * | |
| 12 | - * @param array $featured_ids Array of 'featured' post IDs. | |
| 13 | - * @return array | |
| 14 | - */ | |
| 15 | -function twentyfourteen_featured_content_post_ids( $featured_ids ) { | |
| 16 | - if ( empty( $featured_ids ) ) { | |
| 17 | - $featured_ids = array_slice( get_option( 'sticky_posts', array() ), 0, 6 ); | |
| 18 | - } | |
| 19 | - | |
| 20 | - return $featured_ids; | |
| 9 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit( 0 ); | |
| 21 | 11 | } |
| 22 | -add_action( 'featured_content_post_ids', 'twentyfourteen_featured_content_post_ids' ); | |
| 23 | 12 | |
| 24 | 13 | /** |
| 25 | - * Set the default tag name for Featured Content. | |
| 26 | - * | |
| 27 | - * @param WP_Customize_Manager $wp_customize Theme Customizer object. | |
| 28 | - * @return void | |
| 29 | - */ | |
| 30 | -function twentyfourteen_customizer_default( $wp_customize ) { | |
| 31 | - $wp_customize->get_setting( 'featured-content[tag-name]' )->default = 'featured'; | |
| 32 | -} | |
| 33 | -add_action( 'customize_register', 'twentyfourteen_customizer_default' ); | |
| 34 | - | |
| 35 | -/** | |
| 36 | - * Sets a default tag of 'featured' for Featured Content. | |
| 37 | - * | |
| 38 | - * @param array $settings Featured content settings. | |
| 39 | - * @return array | |
| 40 | - */ | |
| 41 | -function twentyfourteen_featured_content_default_settings( $settings ) { | |
| 42 | - $settings['tag-name'] = 'featured'; | |
| 43 | - | |
| 44 | - return $settings; | |
| 45 | -} | |
| 46 | -add_action( 'featured_content_default_settings', 'twentyfourteen_featured_content_default_settings' ); | |
| 47 | - | |
| 48 | -/** | |
| 49 | 14 | * Removes sharing markup from post content if we're not in the loop and it's a |
| 50 | 15 | * formatted post. |
| 51 | 16 | * |
| 52 | 17 | * @param bool $show Whether to show sharing options. |
| @@ -54,9 +19,9 @@ | ||
| 54 | 19 | * @return bool |
| 55 | 20 | */ |
| 56 | 21 | function twentyfourteen_mute_content_filters( $show, $post ) { |
| 57 | 22 | $formats = get_theme_support( 'post-formats' ); |
| 58 | - if ( ! in_the_loop() && has_post_format( $formats[0], $post ) ) { | |
| 23 | + if ( ! in_the_loop() && is_array( $formats ) && has_post_format( $formats[0], $post ) ) { | |
| 59 | 24 | $show = false; |
| 60 | 25 | } |
| 61 | 26 | return $show; |
| 62 | 27 | } |