@@ 464-480 (lines=17) @@ | ||
461 | return crc32( serialize( $values ) ); |
|
462 | } |
|
463 | ||
464 | function jetpack_sync_core_icon() { |
|
465 | error_log("syncing core icon"); |
|
466 | if ( function_exists( 'get_site_icon_url' ) ) { |
|
467 | $url = get_site_icon_url(); |
|
468 | } else { |
|
469 | return; |
|
470 | } |
|
471 | ||
472 | require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' ); |
|
473 | // If there's a core icon, maybe update the option. If not, fall back to Jetpack's. |
|
474 | if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) { |
|
475 | // This is the option that is synced with dotcom |
|
476 | Jetpack_Options::update_option( 'site_icon_url', $url ); |
|
477 | } else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) { |
|
478 | Jetpack_Options::delete_option( 'site_icon_url' ); |
|
479 | } |
|
480 | } |
|
481 | ||
482 | function get_sync_queue() { |
|
483 | return $this->sync_queue; |
@@ 159-174 (lines=16) @@ | ||
156 | * Make sure any site icon added to core can get |
|
157 | * synced back to dotcom, so we can display it there. |
|
158 | */ |
|
159 | static function jetpack_sync_core_icon() { |
|
160 | if ( function_exists( 'get_site_icon_url' ) ) { |
|
161 | $url = get_site_icon_url(); |
|
162 | } else { |
|
163 | return; |
|
164 | } |
|
165 | ||
166 | require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' ); |
|
167 | // If there's a core icon, maybe update the option. If not, fall back to Jetpack's. |
|
168 | if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) { |
|
169 | // This is the option that is synced with dotcom |
|
170 | Jetpack_Options::update_option( 'site_icon_url', $url ); |
|
171 | } else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) { |
|
172 | Jetpack_Options::delete_option( 'site_icon_url' ); |
|
173 | } |
|
174 | } |
|
175 | ||
176 | } |
|
177 |