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.../plugins/accelera.../pagebuil...
File: functions.php
<?php
[0] Fix | Delete
// Exit if accessed directly
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
/* Admin Script */
[5] Fix | Delete
/**
[6] Fix | Delete
* Admin pagebuilder Scripts
[7] Fix | Delete
* @since 1.0.0Scripts
[8] Fix | Delete
*/
[9] Fix | Delete
add_action( 'admin_enqueue_scripts', 'amppbbase_admin_scripts' );
[10] Fix | Delete
function amppbbase_admin_scripts( $hook_suffix ){
[11] Fix | Delete
global $post_type;
[12] Fix | Delete
global $moduleTemplate;
[13] Fix | Delete
global $layoutTemplate, $redux_builder_amp;
[14] Fix | Delete
/* In Page Edit Screen */
[15] Fix | Delete
if( ($post_type=='post'
[16] Fix | Delete
|| $post_type=='page'
[17] Fix | Delete
|| (
[18] Fix | Delete
isset($redux_builder_amp['ampforwp-custom-type'])
[19] Fix | Delete
&& is_array($redux_builder_amp['ampforwp-custom-type'])
[20] Fix | Delete
&& in_array($post_type, $redux_builder_amp['ampforwp-custom-type'])
[21] Fix | Delete
)
[22] Fix | Delete
)
[23] Fix | Delete
&& in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ){
[24] Fix | Delete
//if($post_type=='post' || $post_type=='page'){
[25] Fix | Delete
/* Enqueue CSS & JS For Page Builder */
[26] Fix | Delete
wp_enqueue_style( 'amppb-admin', esc_url(AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.css'), array(), AMPFORWP_VERSION );
[27] Fix | Delete
wp_enqueue_style('ampforwp-dynamic-css', wp_nonce_url(esc_url(admin_url('admin-ajax.php?action=ampforwp_dynaminc_css')), 'verify_pb', 'verify_nonce' ), array(), AMPFORWP_VERSION, 'all' );
[28] Fix | Delete
wp_enqueue_media();
[29] Fix | Delete
//To add page
[30] Fix | Delete
if ( ! class_exists( '_WP_Editors', false ) ) {
[31] Fix | Delete
require( ABSPATH . WPINC . '/class-wp-editor.php' );
[32] Fix | Delete
}
[33] Fix | Delete
add_action( 'admin_print_footer_scripts', array( '_WP_Editors', 'print_default_editor_scripts' ) );
[34] Fix | Delete
$amp_current_post_id = $postId = get_the_ID();
[35] Fix | Delete
[36] Fix | Delete
[37] Fix | Delete
wp_enqueue_script( 'vuejs', esc_url(AMP_PAGE_BUILDER_URL. 'inc/assets/vue/vue.min.js'), array(),AMPFORWP_VERSION, true);
[38] Fix | Delete
wp_enqueue_script( 'vuejs-resource', esc_url(AMP_PAGE_BUILDER_URL. 'inc/assets/vuejs-resource/vue-resource.min.js'), array(), AMPFORWP_VERSION, true);//For Http Clients
[39] Fix | Delete
wp_enqueue_script( 'vueSortable', esc_url(AMP_PAGE_BUILDER_URL. 'inc/assets/vue.draggable/Sortable.min.js'), array(), AMPFORWP_VERSION, true);
[40] Fix | Delete
wp_enqueue_script( 'vuedraggable', esc_url(AMP_PAGE_BUILDER_URL. 'inc/assets/vue.draggable/vuedraggable.min.js') ,array(),AMPFORWP_VERSION, true);
[41] Fix | Delete
wp_enqueue_script( 'vuedropdrag', esc_url(AMP_PAGE_BUILDER_URL. 'inc/assets/vue-drag-drop/vue-drag-drop.browser.js'), array(), AMPFORWP_VERSION, true);
[42] Fix | Delete
[43] Fix | Delete
wp_register_script( 'amppb-admin', AMP_PAGE_BUILDER_URL. 'inc/admin-amp-page-builder.js', array(
[44] Fix | Delete
'jquery',
[45] Fix | Delete
'wp-color-picker',
[46] Fix | Delete
'vuejs',
[47] Fix | Delete
'vuejs-resource',
[48] Fix | Delete
'vueSortable',
[49] Fix | Delete
'vuedraggable',
[50] Fix | Delete
'vuedropdrag'
[51] Fix | Delete
),AMPFORWP_VERSION, true );
[52] Fix | Delete
[53] Fix | Delete
[54] Fix | Delete
$previousData = get_post_meta($postId,'amp-page-builder');
[55] Fix | Delete
$ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
[56] Fix | Delete
$previousData = isset($previousData[0])? $previousData[0]: null;
[57] Fix | Delete
$totalRows = 1;
[58] Fix | Delete
$totalmodules = 1;
[59] Fix | Delete
if(!empty($previousData)){
[60] Fix | Delete
$jsonData = json_decode($previousData,true);
[61] Fix | Delete
if((isset($jsonData['rows']) && count($jsonData['rows']))>0){
[62] Fix | Delete
$totalRows = $jsonData['totalrows'];
[63] Fix | Delete
$totalmodules = $jsonData['totalmodules'];
[64] Fix | Delete
$previousData = ($jsonData);
[65] Fix | Delete
}else{
[66] Fix | Delete
$jsonData['rows'] = array();
[67] Fix | Delete
$jsonData['totalrows']=1;
[68] Fix | Delete
$jsonData['totalmodules'] = 1;
[69] Fix | Delete
$previousData = ($jsonData);
[70] Fix | Delete
}
[71] Fix | Delete
}else{
[72] Fix | Delete
$jsonData['rows'] = array();
[73] Fix | Delete
$jsonData['totalrows']=1;
[74] Fix | Delete
$jsonData['totalmodules'] = 1;
[75] Fix | Delete
$previousData = ($jsonData);
[76] Fix | Delete
}
[77] Fix | Delete
wp_localize_script( 'amppb-admin', 'amppb_data',$previousData);
[78] Fix | Delete
[79] Fix | Delete
[80] Fix | Delete
$allPostLayout = array();
[81] Fix | Delete
$args = array(
[82] Fix | Delete
'posts_per_page' => 500,
[83] Fix | Delete
'orderby' => 'date',
[84] Fix | Delete
'order' => 'DESC',
[85] Fix | Delete
'post_type' => 'amppb_layout',
[86] Fix | Delete
'post_status' => 'publish'
[87] Fix | Delete
);
[88] Fix | Delete
$posts_array = get_posts( $args );
[89] Fix | Delete
if(count($posts_array)>0){
[90] Fix | Delete
foreach ($posts_array as $key => $layoutData) {
[91] Fix | Delete
$allPostLayout[] = array('post_title'=>$layoutData->post_title,
[92] Fix | Delete
'post_id'=>$layoutData->ID,
[93] Fix | Delete
'post_content'=>wp_unslash($layoutData->post_content),
[94] Fix | Delete
);
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
$components_options = array(
[98] Fix | Delete
"ajaxUrl"=>esc_url(admin_url( 'admin-ajax.php' )),
[99] Fix | Delete
"secure_nonce" => wp_create_nonce('verify_pb'),
[100] Fix | Delete
"savedLayouts"=>$allPostLayout,
[101] Fix | Delete
"startPagebuilder"=>(get_post_meta($postId,'use_ampforwp_page_builder',true)=='yes'? 1:0),
[102] Fix | Delete
"checkedPageBuilder"=>get_post_meta($postId,'ampforwp_page_builder_enable', true),
[103] Fix | Delete
);
[104] Fix | Delete
wp_localize_script( 'amppb-admin', 'amppb_panel_options',$components_options);
[105] Fix | Delete
wp_enqueue_script('amppb-admin');
[106] Fix | Delete
add_action( 'admin_footer', 'amppb_js_templates',9999);
[107] Fix | Delete
}
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
function amppb_js_templates() {
[111] Fix | Delete
global $containerCommonSettings;
[112] Fix | Delete
global $moduleTemplate;
[113] Fix | Delete
global $layoutTemplate;
[114] Fix | Delete
global $savedlayoutTemplate;
[115] Fix | Delete
include plugin_dir_path( __FILE__ ) . '/inc/js-templates.php';
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
require_once AMP_PAGE_BUILDER.'inc/amppb_save_data.php';
[119] Fix | Delete
require_once AMP_PAGE_BUILDER.'inc/viewShowFrontData.php';
[120] Fix | Delete
require_once AMP_PAGE_BUILDER.'inc/adminAjaxContents.php';
[121] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function