← All changes
|
modules/theme-tools/content-options/featured-images.php
+13
-1
13.8.3
→
16.3-a.5
View file →
| @@ -4,18 +4,24 @@ | ||
| 4 | 4 | * |
| 5 | 5 | * @package automattic/jetpack |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | + exit( 0 ); | |
| 10 | +} | |
| 11 | + | |
| 8 | 12 | if ( ! function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) { |
| 9 | 13 | |
| 10 | 14 | /** |
| 11 | 15 | * The function to prevent for Featured Images to be displayed in a theme. |
| 12 | 16 | * |
| 17 | + * @deprecated 13.9 Moved to Classic Theme Helper package. | |
| 13 | 18 | * @param array $metadata Post metadata. |
| 14 | 19 | * @param int $object_id Post ID. |
| 15 | 20 | * @param string $meta_key Metadata key. |
| 16 | 21 | */ |
| 17 | 22 | function jetpack_featured_images_remove_post_thumbnail( $metadata, $object_id, $meta_key ) { |
| 23 | + _deprecated_function( __FUNCTION__, 'jetpack-13.9' ); | |
| 18 | 24 | $opts = jetpack_featured_images_get_settings(); |
| 19 | 25 | |
| 20 | 26 | /** |
| 21 | 27 | * Allow featured images to be displayed at all times for specific CPTs. |
| @@ -92,10 +98,13 @@ | ||
| 92 | 98 | if ( ! function_exists( 'jetpack_is_product' ) ) { |
| 93 | 99 | |
| 94 | 100 | /** |
| 95 | 101 | * Check if we are in a WooCommerce Product in order to exclude it from the is_single check. |
| 102 | + * | |
| 103 | + * @deprecated 13.9 Moved to Classic Theme Helper package. | |
| 96 | 104 | */ |
| 97 | 105 | function jetpack_is_product() { |
| 106 | + _deprecated_function( __FUNCTION__, 'jetpack-13.9' ); | |
| 98 | 107 | return ( function_exists( 'is_product' ) ) ? is_product() : false; |
| 99 | 108 | } |
| 100 | 109 | |
| 101 | 110 | } |
| @@ -103,10 +112,13 @@ | ||
| 103 | 112 | if ( ! function_exists( 'jetpack_is_shop_page' ) ) { |
| 104 | 113 | |
| 105 | 114 | /** |
| 106 | 115 | * Check if we are in a WooCommerce Shop in order to exclude it from the is_archive check. |
| 116 | + * | |
| 117 | + * @deprecated 13.9 Moved to Classic Theme Helper package. | |
| 107 | 118 | */ |
| 108 | 119 | function jetpack_is_shop_page() { |
| 120 | + _deprecated_function( __FUNCTION__, 'jetpack-13.9' ); | |
| 109 | 121 | // Check if WooCommerce is active first. |
| 110 | 122 | if ( ! class_exists( 'WooCommerce' ) ) { |
| 111 | 123 | return false; |
| 112 | 124 | } |
| @@ -117,9 +129,9 @@ | ||
| 117 | 129 | $current_page_id = $wp_query->get( 'page_id' ); |
| 118 | 130 | $is_static_front_page = 'page' === get_option( 'show_on_front' ); |
| 119 | 131 | |
| 120 | 132 | if ( $is_static_front_page && $front_page_id === $current_page_id ) { |
| 121 | - $is_shop_page = ( wc_get_page_id( 'shop' ) === $current_page_id ) ? true : false; | |
| 133 | + $is_shop_page = wc_get_page_id( 'shop' ) === $current_page_id; | |
| 122 | 134 | } else { |
| 123 | 135 | $is_shop_page = is_shop(); |
| 124 | 136 | } |
| 125 | 137 | |