null, 'color' => isset( $border['color'] ) && ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'color' ) ? $border['color'] : null, 'style' => isset( $border['style'] ) && ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'style' ) ? $border['style'] : null, ); $border_block_styles[ $side ] = $border_side_values; } } // Collect classes and styles. $attributes = array(); $styles = wp_style_engine_get_styles( array( 'border' => $border_block_styles ) ); if ( ! empty( $styles['classnames'] ) ) { $attributes['class'] = $styles['classnames']; } if ( ! empty( $styles['css'] ) ) { $attributes['style'] = $styles['css']; } return $attributes; } /** * Checks whether the current block type supports the border feature requested. * * If the `__experimentalBorder` support flag is a boolean `true` all border * support features are available. Otherwise, the specific feature's support * flag nested under `experimentalBorder` must be enabled for the feature * to be opted into. * * @since 5.8.0 * @access private * * @param WP_Block_Type $block_type Block type to check for support. * @param string $feature Name of the feature to check support for. * @param mixed $default_value Fallback value for feature support, defaults to false. * @return bool Whether the feature is supported. */ function wp_has_border_feature_support( $block_type, $feature, $default_value = false ) { // Check if all border support features have been opted into via `"__experimentalBorder": true`. if ( $block_type instanceof WP_Block_Type ) { $block_type_supports_border = isset( $block_type->supports['__experimentalBorder'] ) ? $block_type->supports['__experimentalBorder'] : $default_value; if ( true === $block_type_supports_border ) { return true; } } // Check if the specific feature has been opted into individually // via nested flag under `__experimentalBorder`. return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default_value ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'border', array( 'register_attribute' => 'wp_register_border_support', 'apply' => 'wp_apply_border_support', ) ); $max_items_to_enqueue, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable /** * Tells the client to sync all options to the server * * @since 1.6.3 * @since-jetpack 4.2.0 * * @param boolean Whether to expand options (should always be true) */ do_action( 'jetpack_full_sync_options', true ); // The number of actions enqueued, and next module state (true == done). return array( 1, true ); } /** * Send the options actions for full sync. * * @access public * * @param array $config Full sync configuration for this sync module. * @param int $send_until The timestamp until the current request can send. * @param array $state This module Full Sync status. * * @return array This module Full Sync status. */ public function send_full_sync_actions( $config, $send_until, $state ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable // we call this instead of do_action when sending immediately. $this->send_action( 'jetpack_full_sync_options', array( true ) ); // The number of actions enqueued, and next module state (true == done). return array( 'finished' => true ); } /** * Retrieve an estimated number of actions that will be enqueued. * * @access public * * @param array $config Full sync configuration for this sync module. * @return int Number of items yet to be enqueued. */ public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable return 1; } /** * Retrieve the actions that will be sent for this module during a full sync. * * @access public * * @return array Full sync actions of this module. */ public function get_full_sync_actions() { return array( 'jetpack_full_sync_options' ); } /** * Retrieve all options as per the current options whitelist. * Public so that we don't have to store so much data all the options twice. * * @access public * * @return array All options. */ public function get_all_options() { $options = array(); $random_string = wp_generate_password(); foreach ( $this->options_whitelist as $option ) { if ( str_starts_with( $option, Settings::SETTINGS_OPTION_PREFIX ) ) { $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $option ) ); $options[ $option ] = $option_value; } else { $option_value = get_option( $option, $random_string ); if ( $option_value !== $random_string ) { $options[ $option ] = $option_value; } } } // Add theme mods. $theme_mods_option = 'theme_mods_' . get_option( 'stylesheet' ); $theme_mods_value = get_option( $theme_mods_option, $random_string ); if ( $theme_mods_value === $random_string ) { return $options; } $this->filter_theme_mods( $theme_mods_value ); $options[ $theme_mods_option ] = $theme_mods_value; return $options; } /** * Update the options whitelist to the default one. * * @access public */ public function update_options_whitelist() { $this->options_whitelist = Defaults::get_options_whitelist(); } /** * Set the options whitelist. * * @access public * * @param array $options The new options whitelist. */ public function set_options_whitelist( $options ) { $this->options_whitelist = $options; } /** * Get the options whitelist. * * @access public * * @return array The options whitelist. */ public function get_options_whitelist() { return $this->options_whitelist; } /** * Update the contentless options to the defaults. * * @access public */ public function update_options_contentless() { $this->options_contentless = Defaults::get_options_contentless(); } /** * Get the contentless options. * * @access public * * @return array Array of the contentless options. */ public function get_options_contentless() { return $this->options_contentless; } /** * Reject any options that aren't whitelisted or contentless. * * @access public * * @param array $args The hook parameters. * @return array $args The hook parameters. */ public function whitelist_options( $args ) { // Reject non-whitelisted options. if ( ! $this->is_whitelisted_option( $args[0] ) ) { return false; } // Filter our weird array( false ) value for theme_mods_*. if ( str_starts_with( $args[0], 'theme_mods_' ) ) { $this->filter_theme_mods( $args[1] ); if ( isset( $args[2] ) ) { $this->filter_theme_mods( $args[2] ); } } // Set value(s) of contentless option to empty string(s). if ( $this->is_contentless_option( $args[0] ) ) { // Create a new array matching length of $args, containing empty strings. $empty = array_fill( 0, count( $args ), '' ); $empty[0] = $args[0]; return $empty; } return $args; } /** * Whether a certain option is whitelisted for sync. * * @access public * * @param string $option Option name. * @return boolean Whether the option is whitelisted. */ public function is_whitelisted_option( $option ) { return in_array( $option, $this->options_whitelist, true ) || str_starts_with( $option, 'theme_mods_' ); } /** * Whether a certain option is a contentless one. * * @access private * * @param string $option Option name. * @return boolean Whether the option is contentless. */ private function is_contentless_option( $option ) { return in_array( $option, $this->options_contentless, true ); } /** * Filters out falsy values from theme mod options. * * @access private * * @param array $value Option value. */ private function filter_theme_mods( &$value ) { if ( is_array( $value ) && isset( $value[0] ) ) { unset( $value[0] ); } } /** * Handle changes in the core site icon and sync them. * * @access public */ public function jetpack_sync_core_icon() { $url = get_site_icon_url(); $jetpack_url = \Jetpack_Options::get_option( 'site_icon_url' ); if ( defined( 'JETPACK__PLUGIN_DIR' ) ) { if ( ! function_exists( 'jetpack_site_icon_url' ) ) { require_once JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php'; } $jetpack_url = jetpack_site_icon_url(); } // If there's a core icon, maybe update the option. If not, fall back to Jetpack's. if ( ! empty( $url ) && $jetpack_url !== $url ) { // This is the option that is synced with dotcom. \Jetpack_Options::update_option( 'site_icon_url', $url ); } elseif ( empty( $url ) ) { \Jetpack_Options::delete_option( 'site_icon_url' ); } } /** * Expand all options 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_options( $args ) { if ( $args[0] ) { return $this->get_all_options(); } 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( Defaults::get_options_whitelist() ); } /** * Retrieve a set of options by their IDs. * * @access public * * @param string $object_type Object type. * @param array $ids Object IDs. * @return array Array of objects. */ public function get_objects_by_id( $object_type, $ids ) { if ( empty( $ids ) || empty( $object_type ) || 'option' !== $object_type ) { return array(); } $objects = array(); foreach ( (array) $ids as $id ) { $object = $this->get_object_by_id( $object_type, $id ); // Only add object if we have the object. if ( 'OPTION-DOES-NOT-EXIST' !== $object ) { if ( 'all' === $id ) { // If all was requested it contains all options and can simply be returned. return $object; } $objects[ $id ] = $object; } } return $objects; } /** * Retrieve an option by its name. * * @access public * * @param string $object_type Type of the sync object. * @param string $id ID of the sync object. * @return mixed Value of Option or 'OPTION-DOES-NOT-EXIST' if not found. */ public function get_object_by_id( $object_type, $id ) { if ( 'option' === $object_type ) { // Utilize Random string as default value to distinguish between false and not exist. $random_string = wp_generate_password(); // Only whitelisted options can be returned. if ( in_array( $id, $this->options_whitelist, true ) ) { if ( str_starts_with( $id, Settings::SETTINGS_OPTION_PREFIX ) ) { $option_value = Settings::get_setting( str_replace( Settings::SETTINGS_OPTION_PREFIX, '', $id ) ); return $option_value; } else { $option_value = get_option( $id, $random_string ); if ( $option_value !== $random_string ) { return $option_value; } } } elseif ( 'all' === $id ) { return $this->get_all_options(); } } return 'OPTION-DOES-NOT-EXIST'; } }
Fatal error: Uncaught Error: Class "Automattic\Jetpack\Sync\Modules\Options" not found in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php:144 Stack trace: #0 [internal function]: Automattic\Jetpack\Sync\Modules::load_module('Automattic\\Jetp...') #1 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php(129): array_map(Array, Array) #2 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php(67): Automattic\Jetpack\Sync\Modules::initialize_modules() #3 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(86): Automattic\Jetpack\Sync\Modules::get_modules() #4 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(76): Automattic\Jetpack\Sync\Listener->init() #5 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-listener.php(63): Automattic\Jetpack\Sync\Listener->__construct() #6 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(760): Automattic\Jetpack\Sync\Listener::get_instance() #7 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-actions.php(146): Automattic\Jetpack\Sync\Actions::initialize_listener() #8 /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-main.php(111): Automattic\Jetpack\Sync\Actions::init() #9 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\Jetpack\Sync\Main::on_plugins_loaded_late('') #10 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #11 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #12 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #13 /htdocs/wp-config.php(90): require_once('/htdocs/wp-sett...') #14 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #15 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #16 /htdocs/index.php(17): require('/htdocs/wp-blog...') #17 {main} thrown in /htdocs/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/class-modules.php on line 144