| @@ -19,8 +19,12 @@ | ||
| 19 | 19 | * |
| 20 | 20 | * @package automattic/jetpack |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 24 | + exit( 0 ); | |
| 25 | +} | |
| 26 | + | |
| 23 | 27 | /** |
| 24 | 28 | * Activate the Site Logo plugin. |
| 25 | 29 | * |
| 26 | 30 | * @uses current_theme_supports() |
| @@ -29,8 +33,9 @@ | ||
| 29 | 33 | */ |
| 30 | 34 | function site_logo_init() { |
| 31 | 35 | // Only load our code if our theme declares support, and the standalone plugin is not activated. |
| 32 | 36 | if ( current_theme_supports( 'site-logo' ) && ! class_exists( 'Site_Logo', false ) ) { |
| 37 | + _deprecated_hook( 'site-logo', '13.4', 'custom-logo', 'Jetpack no longer supports site-logo feature. Add custom-logo support to your theme instead: https://developer.wordpress.org/themes/functionality/custom-logo/' ); | |
| 33 | 38 | // Load our class for namespacing. |
| 34 | 39 | if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { |
| 35 | 40 | // wpcom handles the image sizes differently. |
| 36 | 41 | require_once WPMU_PLUGIN_DIR . '/site-logo/inc/class-site-logo.php'; |
| @@ -69,13 +74,13 @@ | ||
| 69 | 74 | * and the updated Jetpack site-logo feature. |
| 70 | 75 | * |
| 71 | 76 | * @since 9.9.0 |
| 72 | 77 | * |
| 73 | - * @param int|array $site_logo Option. | |
| 74 | - * @return int | |
| 78 | + * @param int|array|WP_Error $site_logo Option. | |
| 79 | + * @return int|WP_Error | |
| 75 | 80 | */ |
| 76 | 81 | function jetpack_site_logo_block_compat( $site_logo ) { |
| 77 | - if ( isset( $site_logo['id'] ) ) { | |
| 82 | + if ( is_array( $site_logo ) && isset( $site_logo['id'] ) ) { | |
| 78 | 83 | remove_filter( 'option_site_logo', 'jetpack_site_logo_block_compat', 1 ); |
| 79 | 84 | update_option( 'site_logo', $site_logo['id'] ); |
| 80 | 85 | return $site_logo['id']; |
| 81 | 86 | } |