ive, (array) $module ) ); return $this->update_active( $new ); } /** * Generate a module's path from its slug. * * @param string $slug Module slug. */ public function get_path( $slug ) { if ( ! Constants::is_defined( 'JETPACK__PLUGIN_DIR' ) ) { return ''; } /** * Filters the path of a modules. * * @since 7.4.0 * * @param array $return The absolute path to a module's root php file * @param string $slug The module slug */ return apply_filters( 'jetpack_get_module_path', JETPACK__PLUGIN_DIR . "modules/$slug.php", $slug ); } /** * Saves all the currently active modules to options. * Also fires Action hooks for each newly activated and deactivated module. * * @param array $modules Array of active modules to be saved in options. * * @return $success bool true for success, false for failure. */ public function update_active( $modules ) { $current_modules = \Jetpack_Options::get_option( 'active_modules', array() ); $active_modules = $this->get_active(); $new_active_modules = array_diff( $modules, $current_modules ); $new_inactive_modules = array_diff( $active_modules, $modules ); $new_current_modules = array_diff( array_merge( $current_modules, $new_active_modules ), $new_inactive_modules ); $reindexed_modules = array_values( $new_current_modules ); $success = \Jetpack_Options::update_option( 'active_modules', array_unique( $reindexed_modules ) ); // Let's take `pre_update_option_jetpack_active_modules` filter into account // and actually decide for which modules we need to fire hooks by comparing // the 'active_modules' option before and after the update. $current_modules_post_update = \Jetpack_Options::get_option( 'active_modules', array() ); $new_inactive_modules = array_diff( $current_modules, $current_modules_post_update ); $new_inactive_modules = array_unique( $new_inactive_modules ); $new_inactive_modules = array_values( $new_inactive_modules ); $new_active_modules = array_diff( $current_modules_post_update, $current_modules ); $new_active_modules = array_unique( $new_active_modules ); $new_active_modules = array_values( $new_active_modules ); foreach ( $new_active_modules as $module ) { /** * Fires when a specific module is activated. * * @since 1.9.0 * * @param string $module Module slug. * @param boolean $success whether the module was activated. @since 4.2 */ do_action( 'jetpack_activate_module', $module, $success ); /** * Fires when a module is activated. * The dynamic part of the filter, $module, is the module slug. * * @since 1.9.0 * * @param string $module Module slug. */ do_action( "jetpack_activate_module_$module", $module ); } foreach ( $new_inactive_modules as $module ) { /** * Fired after a module has been deactivated. * * @since 4.2.0 * * @param string $module Module slug. * @param boolean $success whether the module was deactivated. */ do_action( 'jetpack_deactivate_module', $module, $success ); /** * Fires when a module is deactivated. * The dynamic part of the filter, $module, is the module slug. * * @since 1.9.0 * * @param string $module Module slug. */ do_action( "jetpack_deactivate_module_$module", $module ); } return $success; } }
Fatal error: Uncaught Error: Class 'Automattic\Jetpack\Modules' not found in /home/healths/public_html/wp-content/plugins/jetpack-social/vendor/automattic/jetpack-plans/src/class-current-plan.php:262 Stack trace: #0 /home/healths/public_html/wp-content/plugins/jetpack-social/vendor/automattic/jetpack-plans/src/class-current-plan.php(370): Automattic\Jetpack\Current_Plan::get() #1 /home/healths/public_html/wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php(1784): Automattic\Jetpack\Current_Plan::supports() #2 /home/healths/public_html/wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-settings.php(78): Automattic\Jetpack\Publicize\Publicize_Base->has_social_image_generator_feature() #3 /home/healths/public_html/wp-content/plugins/jetpack-social/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-setup.php(18): Automattic\Jetpack\Publicize\Social_Image_Generator\Settings->is_available( in /home/healths/public_html/wp-content/plugins/jetpack-social/vendor/automattic/jetpack-plans/src/class-current-plan.php on line 262