Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/feature
File: ClassicEditor.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit; // Exit if accessed directly
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Load classic editor and disable Gutenberg/Block Editor
[6] Fix | Delete
*
[7] Fix | Delete
* Adapted from Classic Editor plugin by WordPress Contributors.
[8] Fix | Delete
*
[9] Fix | Delete
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
[10] Fix | Delete
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
[11] Fix | Delete
* that you can use any other version of the GPL.
[12] Fix | Delete
*
[13] Fix | Delete
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
[14] Fix | Delete
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[15] Fix | Delete
*
[16] Fix | Delete
* Classic Editor
[17] Fix | Delete
*
[18] Fix | Delete
* Copyright 2018 by WordPress Contributors
[19] Fix | Delete
*
[20] Fix | Delete
* Classic Editor is released under the GPL-2.0+
[21] Fix | Delete
*
[22] Fix | Delete
*/
[23] Fix | Delete
if ( ! class_exists( 'ET_Builder_Classic_Editor' ) ) :
[24] Fix | Delete
[25] Fix | Delete
class ET_Builder_Classic_Editor {
[26] Fix | Delete
/**
[27] Fix | Delete
* @var ET_Builder_Classic_Editor
[28] Fix | Delete
*/
[29] Fix | Delete
private static $_instance;
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* ET_Builder_Classic_Editor constructor.
[33] Fix | Delete
*/
[34] Fix | Delete
public function __construct() {
[35] Fix | Delete
add_action( 'init', array( $this, 'register_actions' ), 20 );
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Get the class instance.
[40] Fix | Delete
*
[41] Fix | Delete
* @since 3.18
[42] Fix | Delete
*
[43] Fix | Delete
* @return ET_Builder_Classic_Editor
[44] Fix | Delete
*/
[45] Fix | Delete
public static function instance() {
[46] Fix | Delete
if ( ! self::$_instance ) {
[47] Fix | Delete
self::$_instance = new self;
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
return self::$_instance;
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
/**
[54] Fix | Delete
* Add & remove necessary actions and filters needed to load Classic Editor back
[55] Fix | Delete
* These filters are based on Classic Editor plugin to ensure required filters & actions needed
[56] Fix | Delete
* to load Classic Editor on Gutenberg / Block Editor (WordPress 5.0). All conditiononal Block Editor
[57] Fix | Delete
* loader based on query string has been removed.
[58] Fix | Delete
*
[59] Fix | Delete
* @since 3.18
[60] Fix | Delete
*/
[61] Fix | Delete
public function register_actions() {
[62] Fix | Delete
$gutenberg = has_filter( 'replace_editor', 'gutenberg_init' );
[63] Fix | Delete
$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
[64] Fix | Delete
[65] Fix | Delete
if ( ! $gutenberg && ! $block_editor ) {
[66] Fix | Delete
return;
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
// Load classic editor
[70] Fix | Delete
$enable_classic_editor = apply_filters( 'et_builder_enable_classic_editor', isset( $_GET['et_classic_editor'] ) );
[71] Fix | Delete
[72] Fix | Delete
if ( $block_editor && $enable_classic_editor ) {
[73] Fix | Delete
add_filter( 'use_block_editor_for_post_type', '__return_false', 100 );
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
if ( $gutenberg && $enable_classic_editor ) {
[77] Fix | Delete
// gutenberg.php
[78] Fix | Delete
remove_action( 'admin_menu', 'gutenberg_menu' );
[79] Fix | Delete
remove_action( 'admin_notices', 'gutenberg_build_files_notice' );
[80] Fix | Delete
remove_action( 'admin_notices', 'gutenberg_wordpress_version_notice' );
[81] Fix | Delete
remove_action( 'admin_init', 'gutenberg_redirect_demo' );
[82] Fix | Delete
[83] Fix | Delete
remove_filter( 'replace_editor', 'gutenberg_init' );
[84] Fix | Delete
[85] Fix | Delete
// lib/client-assets.php
[86] Fix | Delete
remove_action( 'wp_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5 );
[87] Fix | Delete
remove_action( 'admin_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5 );
[88] Fix | Delete
remove_action( 'wp_enqueue_scripts', 'gutenberg_common_scripts_and_styles' );
[89] Fix | Delete
remove_action( 'admin_enqueue_scripts', 'gutenberg_common_scripts_and_styles' );
[90] Fix | Delete
[91] Fix | Delete
// lib/compat.php
[92] Fix | Delete
remove_filter( 'wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers' );
[93] Fix | Delete
[94] Fix | Delete
// lib/rest-api.php
[95] Fix | Delete
remove_action( 'rest_api_init', 'gutenberg_register_rest_routes' );
[96] Fix | Delete
remove_action( 'rest_api_init', 'gutenberg_add_taxonomy_visibility_field' );
[97] Fix | Delete
[98] Fix | Delete
remove_filter( 'rest_request_after_callbacks', 'gutenberg_filter_oembed_result' );
[99] Fix | Delete
remove_filter( 'registered_post_type', 'gutenberg_register_post_prepare_functions' );
[100] Fix | Delete
remove_filter( 'register_post_type_args', 'gutenberg_filter_post_type_labels' );
[101] Fix | Delete
[102] Fix | Delete
// lib/meta-box-partial-page.php
[103] Fix | Delete
remove_action( 'do_meta_boxes', 'gutenberg_meta_box_save', 1000 );
[104] Fix | Delete
remove_action( 'submitpost_box', 'gutenberg_intercept_meta_box_render' );
[105] Fix | Delete
remove_action( 'submitpage_box', 'gutenberg_intercept_meta_box_render' );
[106] Fix | Delete
remove_action( 'edit_page_form', 'gutenberg_intercept_meta_box_render' );
[107] Fix | Delete
remove_action( 'edit_form_advanced', 'gutenberg_intercept_meta_box_render' );
[108] Fix | Delete
[109] Fix | Delete
remove_filter( 'redirect_post_location', 'gutenberg_meta_box_save_redirect' );
[110] Fix | Delete
remove_filter( 'filter_gutenberg_meta_boxes', 'gutenberg_filter_meta_boxes' );
[111] Fix | Delete
}
[112] Fix | Delete
[113] Fix | Delete
if ( $gutenberg && $enable_classic_editor ) {
[114] Fix | Delete
// gutenberg.php
[115] Fix | Delete
remove_action( 'admin_init', 'gutenberg_add_edit_link_filters' );
[116] Fix | Delete
remove_action( 'admin_print_scripts-edit.php', 'gutenberg_replace_default_add_new_button' );
[117] Fix | Delete
[118] Fix | Delete
remove_filter( 'body_class', 'gutenberg_add_responsive_body_class' );
[119] Fix | Delete
remove_filter( 'admin_url', 'gutenberg_modify_add_new_button_url' );
[120] Fix | Delete
[121] Fix | Delete
// lib/compat.php
[122] Fix | Delete
remove_action( 'admin_enqueue_scripts', 'gutenberg_check_if_classic_needs_warning_about_blocks' );
[123] Fix | Delete
[124] Fix | Delete
// lib/register.php
[125] Fix | Delete
remove_action( 'edit_form_top', 'gutenberg_remember_classic_editor_when_saving_posts' );
[126] Fix | Delete
[127] Fix | Delete
remove_filter( 'redirect_post_location', 'gutenberg_redirect_to_classic_editor_when_saving_posts' );
[128] Fix | Delete
remove_filter( 'get_edit_post_link', 'gutenberg_revisions_link_to_editor' );
[129] Fix | Delete
remove_filter( 'wp_prepare_revision_for_js', 'gutenberg_revisions_restore' );
[130] Fix | Delete
remove_filter( 'display_post_states', 'gutenberg_add_gutenberg_post_state' );
[131] Fix | Delete
[132] Fix | Delete
// lib/plugin-compat.php
[133] Fix | Delete
remove_filter( 'rest_pre_insert_post', 'gutenberg_remove_wpcom_markdown_support' );
[134] Fix | Delete
}
[135] Fix | Delete
}
[136] Fix | Delete
}
[137] Fix | Delete
[138] Fix | Delete
endif;
[139] Fix | Delete
[140] Fix | Delete
ET_Builder_Classic_Editor::instance();
[141] Fix | Delete
[142] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function