0){ $totalRows = $jsonData['totalrows']; $totalmodules = $jsonData['totalmodules']; $previousData = ($jsonData); }else{ $jsonData['rows'] = array(); $jsonData['totalrows']=1; $jsonData['totalmodules'] = 1; $previousData = ($jsonData); } }else{ $jsonData['rows'] = array(); $jsonData['totalrows']=1; $jsonData['totalmodules'] = 1; $previousData = ($jsonData); } wp_localize_script( 'amppb-admin', 'amppb_data',$previousData); $allPostLayout = array(); $args = array( 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'amppb_layout', 'post_status' => 'publish' ); $posts_array = get_posts( $args ); if(count($posts_array)>0){ foreach ($posts_array as $key => $layoutData) { $allPostLayout[] = array('post_title'=>$layoutData->post_title, 'post_content'=>$layoutData->post_content, ); } } $components_options = array( "ajaxUrl"=>esc_url(admin_url( 'admin-ajax.php' )), "secure_nonce" => wp_create_nonce('verify_pb'), "savedLayouts"=>$allPostLayout, "startPagebuilder"=>(get_post_meta($postId,'use_ampforwp_page_builder',true)=='yes'? 1:0), "checkedPageBuilder"=>get_post_meta($postId,'ampforwp_page_builder_enable', true), ); wp_localize_script( 'amppb-admin', 'amppb_panel_options',$components_options); wp_enqueue_script('amppb-admin'); add_action( 'admin_footer', 'js_templates',9999); } } function js_templates() { global $containerCommonSettings; global $moduleTemplate; global $layoutTemplate; global $savedlayoutTemplate; include plugin_dir_path( __FILE__ ) . '/inc/js-templates.php'; } function checkAMPforPageBuilderStatus($postId){ global $post, $redux_builder_amp; $postId = (is_object($post)? $post->ID: ''); if( ampforwp_is_front_page() ){ $postId = ampforwp_get_frontpage_id(); } if ( empty( $postId ) ) { return false; } $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true); if( $ampforwp_pagebuilder_enable=='yes'){ return true; }else{ return false; } } require_once AMP_PAGE_BUILDER.'inc/amppb_save_data.php'; require_once AMP_PAGE_BUILDER.'inc/viewShowFrontData.php'; require_once AMP_PAGE_BUILDER.'inc/adminAjaxContents.php';