static::$classic_url_override; } static::$classic_url_override = isset( $_GET[ static::$classic_override ] ) || isset( $_POST[ static::$classic_override ] ); return static::$classic_url_override; } /** * Filters tribe_editor_should_load_blocks based on internal logic. * * @since 4.14.13 * * @param boolean $should_load_blocks Whether we should force blocks over classic. * * @return boolean Whether we should force blocks or classic. */ public function filter_tribe_editor_should_load_blocks( bool $should_load_blocks ) { if ( ! static::is_classic_plugin_active() ) { return $should_load_blocks; } if ( static::is_classic_option_active() ) { $should_load_blocks = false; } if ( ! static::get_user_choice_allowed() ) { return $should_load_blocks; } if ( static::get_classic_param() ) { $should_load_blocks = false; } // The override param inverts whatever else is set via parameter/preference. if ( static::get_classic_override() ) { $should_load_blocks = ! $should_load_blocks; } global $pagenow; // The profile and remember settings only apply to new posts/etc so bail out now if we're not in the admin and creating a new event. if ( ! empty( $pagenow ) && ! in_array( $pagenow, [ 'post-new.php' ] ) ) { $remember = static::classic_editor_remembers(); if ( false !== $remember ) { $should_load_blocks = static::$block_term === $remember; } return $should_load_blocks; } $profile_choice = static::user_profile_choice(); // Only override via $profile_choice if it is actually set. if ( empty( $profile_choice ) ) { return $should_load_blocks; } // Only override via $profile_choice if it contains an expected value. if ( static::$block_term === $profile_choice ) { $should_load_blocks = true; } else if ( static::$classic_term === $profile_choice ) { $should_load_blocks = false; } // The override param inverts whatever else is set via parameter/preference. if ( static::get_classic_override() ) { $should_load_blocks = ! $should_load_blocks; } return $should_load_blocks; } /** * classic_editor_replace is function that is created by the plugin: * used in ECP recurrence and TEC Meta * * @see https://wordpress.org/plugins/classic-editor/ * * prior 1.3 version the Classic Editor plugin was bundle inside of a unique function: * `classic_editor_replace` now all is bundled inside of a class `Classic_Editor` * * @since 4.14.13 * * @return bool */ public static function is_classic_plugin_active() { $is_plugin_active = class_exists( 'Classic_Editor', false ); /** * Filter to change the output of calling: `is_classic_plugin_active` * * @since 4.9.12 * @since 4.14.13 moved to separate class. * * @param $is_plugin_active bool Value that indicates if the plugin is active or not. */ return (boolean) apply_filters( 'tribe_is_classic_editor_plugin_active', $is_plugin_active ); } /** * Check if the setting `classic-editor-replace` is set to `replace` that option means to * replace the gutenberg editor with the Classic Editor. * * Prior to 1.3 on Classic Editor plugin the value to identify if is on classic the value * was `replace`, now the value is `classic` * * @since 4.8 * @since 4.14.13 moved to separate class. * * @return bool */ public static function is_classic_option_active() { if ( ! static::is_classic_plugin_active() ) { return false; } $valid_values = [ 'replace', 'classic' ]; $replace = in_array( (string) get_option( static::$classic_option_key ), $valid_values, true ); return (boolean) $replace; } /** * Get and store wether user choice is allowed - lets us bypass some checks. * * @since 4.14.13 * * @return boolean */ public static function get_user_choice_allowed() { if ( null !== static::$user_choice_allowed ) { return static::$user_choice_allowed; } static::$user_choice_allowed = 'allow' === get_option( static::$user_choice_key, 'disallow' ); return static::$user_choice_allowed; } /** * Get the and store user's editor of choice - set in the user profile. * * @since 4.14.13 * * @return string */ public static function user_profile_choice() { if ( null !== static::$user_profile_choice ) { return static::$user_profile_choice; } global $wpdb; $user = get_current_user_id(); static::$user_profile_choice = get_user_option( $wpdb->prefix . static::$user_meta_choice_key, $user ); return static::$user_profile_choice; } /** * Get whether CE has "remembered" the last editor for a given post. * If so, this is what the default edit link will send us to. * * @since 4.14.13 * * @return bool|string The string of the editor choice or false on fails. */ public static function classic_editor_remembers( $id = null ) { if ( empty( $id ) ) { $id = isset( $_GET[ 'post' ] ) ? (int) $_GET[ 'post' ] : null; } $remember = get_post_meta( $id, static::$post_remember_meta_key, true ); if ( empty( $remember ) ) { return static::$block_term; } // Why WP, why did you use a different term here? return str_replace( '-editor', '', $remember ); } }
Fatal error: Uncaught Error: Class "Tribe\Editor\Compatibility\Classic_Editor" not found in /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Editor/Compatibility.php:21 Stack trace: #0 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(463): Tribe\Editor\Compatibility->register() #1 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe\\Editor\\Co...') #2 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(305): TEC\Common\Contracts\Container->register('Tribe\\Editor\\Co...') #3 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Editor/Provider.php(19): tribe_register_provider('Tribe\\Editor\\Co...') #4 /htdocs/wp-content/plugins/the-events-calendar/common/vendor/vendor-prefixed/lucatume/di52/src/Container.php(463): Tribe__Editor__Provider->register() #5 /htdocs/wp-content/plugins/the-events-calendar/common/src/Common/Contracts/Container.php(46): TEC\Common\lucatume\DI52\Container->register('Tribe__Editor__...') #6 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Container.php(305): TEC\Common\Contracts\Container->register('Tribe__Editor__...') #7 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(748): tribe_register_provider('Tribe__Editor__...') #8 /htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Main.php(119): Tribe__Main->bind_implementations() #9 /htdocs/wp-includes/class-wp-hook.php(324): Tribe__Main->plugins_loaded('') #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(555): do_action('plugins_loaded') #13 /htdocs/wp-config.php(92): 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/the-events-calendar/common/src/Tribe/Editor/Compatibility.php on line 21