ID; $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true ); //previous data stored compatible if(get_post_meta($amp_current_post_id ,'use_ampforwp_page_builder',true)==null && get_post_meta( $amp_current_post_id, 'amp-page-builder', true ) != ''){ update_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes'); } //Disable page builder if(isset($_GET['ramppb']) && sanitize_text_field( wp_unslash($_GET['ramppb']))=='1'){ delete_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes'); delete_post_meta($amp_current_post_id, 'ampforwp_page_builder_enable','yes'); } //Enable page builder if(isset($_GET['use_amp_pagebuilder']) && sanitize_text_field( wp_unslash($_GET['use_amp_pagebuilder']))=='1'){ update_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes'); } if(empty($content)){ echo " "; } ampforwp_call_page_builder(); } /* Add page builder form after editor */ function ampforwp_call_page_builder(){ global $post, $moduleTemplate, $layoutTemplate, $containerCommonSettings; if($post!=null){ $postId = $post->ID; } if(isset($_GET['post_id'])){ $postId = sanitize_text_field( wp_unslash($_GET['post_id'])); } add_thickbox(); $previousData = get_post_meta($postId,'amp-page-builder'); $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true); $previousData = isset($previousData[0])? $previousData[0]: null; $previousData = (str_replace("'", "'", $previousData)); $totalRows = 1; $totalmodules = 1; if(!empty($previousData)){ $jsonData = json_decode($previousData,true); if(count($jsonData['rows'])>0){ $totalRows = $jsonData['totalrows']; $totalmodules = $jsonData['totalmodules']; $previousData = json_encode($jsonData); }else{ $jsonData['rows'] = array(); $jsonData['totalrows']=1; $jsonData['totalmodules'] = 1; $previousData = json_encode($jsonData); } } $pageBuilderData = array( 'title'=>'Pagebuilder Settings', 'default_tab'=> 'customizer', 'tabs' => array( 'customizer'=>'Customizer', 'container_css'=>'Container css' ), 'fields' => array( array( 'type' =>'text', 'name' =>"content_title", 'label' => esc_html__('Category Block Title','accelerated-mobile-pages'), 'tab' =>'customizer', 'default' =>'Category', ), array( 'type' =>'text', 'name' =>"content_title", 'label' => esc_html__('Category Block Title','accelerated-mobile-pages'), 'tab' =>'container_css', 'default' =>'Category', ), ) ); $backendRowSetting = $containerCommonSettings; unset($backendRowSetting['front_template_start']); unset($backendRowSetting['front_template_end']); unset($backendRowSetting['front_css']); unset($backendRowSetting['front_common_css']); wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' ); if(class_exists('WPSEO_Frontend') && true == ampforwp_get_setting('ampforwp-yoast-seo-analysis') && true == ampforwp_get_setting('ampforwp-amp-takeover') ) { ?>

.

1
2
1 Column 2 Columns
$module) { if(in_array($key, $oldModules)){ continue; } unset($module['front_template']); unset($module['front_css']); if(isset($module['front_loop_content'])){ unset($module['front_loop_content']); } if(isset($module['front_common_css'])){ unset($module['front_common_css']); } if(isset($module['repeater'])){ unset($module['repeater']['front_template']); } $moduleJson = array('type'=> 'module','moduleDraggable'=>true ,'modulename'=>strtolower($module['name']),'moduleJson'=>$module); echo ' '.$module['label'].' '; } ?>

array( 'name' => esc_html__( 'AMP Layouts','accelerated-mobile-pages' ), 'singular_name' => esc_html__( 'AMP Layout','accelerated-mobile-pages' ) ), 'public' => false, // it's not public, it shouldn't have it's own permalink, and so on 'publicly_queriable' => false, // you should be able to query it 'show_ui' => false, // you should be able to edit it in wp-admin 'exclude_from_search' => true, // you should exclude it from search results 'show_in_nav_menus' => false, // you shouldn't be able to add it to menus 'has_archive' => false, // it shouldn't have archive page 'rewrite' => false, // it shouldn't have rewrite rules 'rewrite' => array('slug' => 'amppb-layout'), ) ); } add_action( 'init', 'ampforwp_create_posttype_amppb_layout' ); require_once AMP_PAGE_BUILDER.'functions.php';