@@ 77-94 (lines=18) @@ | ||
74 | ||
75 | $constants_checksums = (array) get_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, array() ); |
|
76 | ||
77 | foreach ( $constants as $name => $value ) { |
|
78 | $checksum = $this->get_check_sum( $value ); |
|
79 | // explicitly not using Identical comparison as get_option returns a string |
|
80 | if ( ! $this->still_valid_checksum( $constants_checksums, $name, $checksum ) && ! is_null( $value ) ) { |
|
81 | /** |
|
82 | * Tells the client to sync a constant to the server |
|
83 | * |
|
84 | * @since 4.2.0 |
|
85 | * |
|
86 | * @param string The name of the constant |
|
87 | * @param mixed The value of the constant |
|
88 | */ |
|
89 | do_action( 'jetpack_sync_constant', $name, $value ); |
|
90 | $constants_checksums[ $name ] = $checksum; |
|
91 | } else { |
|
92 | $constants_checksums[ $name ] = $checksum; |
|
93 | } |
|
94 | } |
|
95 | update_option( self::CONSTANTS_CHECKSUM_OPTION_NAME, $constants_checksums ); |
|
96 | } |
|
97 |
@@ 230-247 (lines=18) @@ | ||
227 | $callable_checksums = (array) Jetpack_Options::get_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, array() ); |
|
228 | ||
229 | // only send the callables that have changed |
|
230 | foreach ( $callables as $name => $value ) { |
|
231 | $checksum = $this->get_check_sum( $value ); |
|
232 | // explicitly not using Identical comparison as get_option returns a string |
|
233 | if ( ! is_null( $value ) && $this->should_send_callable( $callable_checksums, $name, $checksum ) ) { |
|
234 | /** |
|
235 | * Tells the client to sync a callable (aka function) to the server |
|
236 | * |
|
237 | * @since 4.2.0 |
|
238 | * |
|
239 | * @param string The name of the callable |
|
240 | * @param mixed The value of the callable |
|
241 | */ |
|
242 | do_action( 'jetpack_sync_callable', $name, $value ); |
|
243 | $callable_checksums[ $name ] = $checksum; |
|
244 | } else { |
|
245 | $callable_checksums[ $name ] = $checksum; |
|
246 | } |
|
247 | } |
|
248 | Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callable_checksums ); |
|
249 | } |
|
250 |