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/frontend...
File: init.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Redirect admin post to FB builder if set.
[3] Fix | Delete
*
[4] Fix | Delete
* @since 3.0.0
[5] Fix | Delete
*
[6] Fix | Delete
* @param string $location Parameter passed by the 'redirect_post_location' filter.
[7] Fix | Delete
* @return string $_POST['et-fb-builder-redirect'] if set, $location otherwise.
[8] Fix | Delete
*/
[9] Fix | Delete
function et_fb_redirect_post_location( $location ) {
[10] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
[11] Fix | Delete
if ( is_admin() && isset( $_POST['et-fb-builder-redirect'] ) ) {
[12] Fix | Delete
return $_POST['et-fb-builder-redirect'];
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
return $location;
[16] Fix | Delete
// phpcs:enable
[17] Fix | Delete
}
[18] Fix | Delete
add_filter( 'redirect_post_location', 'et_fb_redirect_post_location' );
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* @internal NOTE: Don't use this from outside builder code! {@see et_core_is_fb_enabled()}.
[22] Fix | Delete
*
[23] Fix | Delete
* @deprecated Use et_core_is_fb_enabled() instead.
[24] Fix | Delete
*
[25] Fix | Delete
* @return bool
[26] Fix | Delete
*/
[27] Fix | Delete
function et_fb_enabled() {
[28] Fix | Delete
if ( defined( 'ET_FB_ENABLED' ) ) {
[29] Fix | Delete
return ET_FB_ENABLED;
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
// et_fb parameter supported by FB only, so check !is_admin() to avoid false loading of BFB
[33] Fix | Delete
if ( empty( $_GET['et_fb'] ) && ! is_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification
[34] Fix | Delete
return false;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
if ( is_customize_preview() ) {
[38] Fix | Delete
return false;
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
if ( ! is_admin() && ! is_single() && ! is_page() && ! et_builder_used_in_wc_shop() && ! isset( $_GET['is_new_page'] ) ) {
[42] Fix | Delete
return false;
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
if ( ! et_fb_is_user_can_edit() ) {
[46] Fix | Delete
return false;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
if ( ! et_pb_is_allowed( 'use_visual_builder' ) ) {
[50] Fix | Delete
return false;
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
// if we have made it here, determine if this is legit BFB page
[54] Fix | Delete
if ( is_admin() ) {
[55] Fix | Delete
if ( ! et_builder_should_load_framework() ) {
[56] Fix | Delete
return false;
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
if ( ! et_builder_bfb_enabled() ) {
[60] Fix | Delete
return false;
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
// no need to check posttypes here because it's checked in more appropriate place - et_pb_admin_scripts_styles()
[64] Fix | Delete
}
[65] Fix | Delete
[66] Fix | Delete
return true;
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
function et_fb_is_user_can_edit() {
[70] Fix | Delete
[71] Fix | Delete
$_ = ET_Core_Data_Utils::instance();
[72] Fix | Delete
[73] Fix | Delete
$post_id = et_core_page_resource_get_the_ID();
[74] Fix | Delete
[75] Fix | Delete
// If this function is called very early, global $post might not be defined yet.
[76] Fix | Delete
$post_id = $post_id ? $post_id : $_->array_get( $_GET, 'post', 0 );
[77] Fix | Delete
[78] Fix | Delete
if ( is_page() ) {
[79] Fix | Delete
if ( ! current_user_can( 'edit_pages' ) ) {
[80] Fix | Delete
return false;
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
if ( ! current_user_can( 'edit_others_pages' ) && ! current_user_can( 'edit_page', $post_id ) ) {
[84] Fix | Delete
return false;
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
if ( ( ! current_user_can( 'publish_pages' ) || ! current_user_can( 'edit_published_pages' ) ) && 'publish' === get_post_status( $post_id ) ) {
[88] Fix | Delete
return false;
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
if ( ( ! current_user_can( 'edit_private_pages' ) || ! current_user_can( 'read_private_pages' ) ) && 'private' === get_post_status( $post_id ) ) {
[92] Fix | Delete
return false;
[93] Fix | Delete
}
[94] Fix | Delete
} else {
[95] Fix | Delete
if ( ! current_user_can( 'edit_posts' ) ) {
[96] Fix | Delete
return false;
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
if ( ! current_user_can( 'edit_others_posts' ) && ! current_user_can( 'edit_post', $post_id ) ) {
[100] Fix | Delete
return false;
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
if ( ( ! current_user_can( 'publish_posts' ) || ! current_user_can( 'edit_published_posts' ) ) && 'publish' === get_post_status( $post_id ) ) {
[104] Fix | Delete
return false;
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
if ( ( ! current_user_can( 'edit_private_posts' ) || ! current_user_can( 'read_private_posts' ) ) && 'private' === get_post_status( $post_id ) ) {
[108] Fix | Delete
return false;
[109] Fix | Delete
}
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
return true;
[113] Fix | Delete
}
[114] Fix | Delete
[115] Fix | Delete
define( 'ET_FB_ENABLED', et_core_is_fb_enabled() );
[116] Fix | Delete
[117] Fix | Delete
// Set default value if the constant hasn't been defined
[118] Fix | Delete
if ( ! defined( 'ET_BUILDER_LOAD_ON_AJAX' ) ) {
[119] Fix | Delete
define( 'ET_BUILDER_LOAD_ON_AJAX', false );
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
// Stop here if the front end builder isn't enabled.
[123] Fix | Delete
if ( ! ET_FB_ENABLED && ! ET_BUILDER_LOAD_ON_AJAX ) {
[124] Fix | Delete
return;
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
define( 'ET_FB_URI', ET_BUILDER_URI . '/frontend-builder' );
[128] Fix | Delete
define( 'ET_FB_ASSETS_URI', ET_FB_URI . '/assets' );
[129] Fix | Delete
[130] Fix | Delete
require_once ET_BUILDER_DIR . 'frontend-builder/view.php';
[131] Fix | Delete
require_once ET_BUILDER_DIR . 'frontend-builder/assets.php';
[132] Fix | Delete
require_once ET_BUILDER_DIR . 'frontend-builder/helpers.php';
[133] Fix | Delete
require_once ET_BUILDER_DIR . 'frontend-builder/rtl.php';
[134] Fix | Delete
[135] Fix | Delete
do_action( 'et_fb_framework_loaded' );
[136] Fix | Delete
et_fb_fix_plugin_conflicts();
[137] Fix | Delete
[138] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function