ID; $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true ); $editor_id = 'ampforwp_custom_content_editor'; //wp_editor( $content, $editor_id ); //echo ""; /*echo "
"; echo html_entity_decode($content); echo "
";*/ //previous data stored compatible //echo get_post_meta( $amp_current_post_id, 'amp-page-builder', true ); 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']) && $_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']) && $_GET['use_amp_pagebuilder']=='1'){ update_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes'); } if(get_post_meta($amp_current_post_id ,'use_ampforwp_page_builder',true)=='yes'){ $url = remove_query_arg('use_amp_pagebuilder'); if(empty($content)){ echo "
Beta Feature Video Tutorial Rate
"; } wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... wp_enqueue_style( 'wp-jquery-ui-dialog' ); // echo "
// Remove //
"; call_page_builder(); }else{ $url = remove_query_arg('ramppb'); echo '
Start the AMP Page Builder
'; } } add_action("wp_ajax_call_page_builder", "call_page_builder"); /* Add page builder form after editor */ function call_page_builder(){ global $post; global $moduleTemplate; if($post!=null){ $postId = $post->ID; } if(isset($_GET['post_id'])){ $postId = $_GET['post_id']; } add_thickbox(); if(isset($postId) && get_post_meta($postId,'use_ampforwp_page_builder')!='yes'){ update_post_meta($postId, 'use_ampforwp_page_builder','yes'); } $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)){ //echo ' sdcds '.json_encode($previousData);die; $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); } } wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' ); ?>

Welcome to AMP Page Builder.

1 Column 2 Columns
$module) { echo ''.$module['label'].''; } ?>
0){ foreach($get_ids as $id){ $image = wp_get_attachment_image( $id, 'medium', false, array( 'id' => 'ampforwp-preview-image' ) ); $image_src = wp_get_attachment_image_src($id, 'medium', false); $data[] = array( 'image' => $image, 'detail' => $image_src ); } } }else{ $image = wp_get_attachment_image( filter_input( INPUT_GET, 'id', FILTER_VALIDATE_INT ), 'medium', false, array( 'id' => 'ampforwp-preview-image' ) ); $data = array( 'image' => $image, ); } wp_send_json_success( $data ); } else { wp_send_json_error(); } } require_once AMP_PAGE_BUILDER.'functions.php';