$callables = $this->get_all_callables(); $cron_callables = array(); foreach ( self::ALWAYS_SEND_UPDATES_TO_THESE_OPTIONS as $option_name ) { if ( array_key_exists( $option_name, $callables ) ) { $cron_callables[ $option_name ] = $callables[ $option_name ]; continue; } // Check for the Callable name/key for the option, if different from option name. if ( array_key_exists( $option_name, self::OPTION_NAMES_TO_CALLABLE_NAMES ) ) { $callable_name = self::OPTION_NAMES_TO_CALLABLE_NAMES[ $option_name ]; if ( array_key_exists( $callable_name, $callables ) ) { $cron_callables[ $callable_name ] = $callables[ $callable_name ]; } } } return $cron_callables; } /** * Expand the callables within a hook before they are serialized and sent to the server. * * @access public * * @param array $args The hook parameters. * @return array $args The hook parameters. */ public function expand_callables( $args ) { if ( $args[0] ) { $callables = $this->get_all_callables(); $callables_checksums = array(); foreach ( $callables as $name => $value ) { $callables_checksums[ $name ] = $this->get_check_sum( $value ); } \Jetpack_Options::update_raw_option( self::CALLABLES_CHECKSUM_OPTION_NAME, $callables_checksums ); return $callables; } return $args; } /** * Return Total number of objects. * * @param array $config Full Sync config. * * @return int total */ public function total( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable return count( $this->get_callable_whitelist() ); } }