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: amp-page-builder.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
// Identifies the current plugin version.
[5] Fix | Delete
define( 'AMP_PAGE_BUILDER', plugin_dir_path(__FILE__) );
[6] Fix | Delete
define( 'AMP_PAGE_BUILDER_URL', plugin_dir_url(__FILE__) );
[7] Fix | Delete
[8] Fix | Delete
require_once(AMP_PAGE_BUILDER."config/moduleTemplate.php");
[9] Fix | Delete
[10] Fix | Delete
//Set Metabox
[11] Fix | Delete
add_action('add_meta_boxes','ampforwp_pagebuilder_content_meta_register', 10 ,1);
[12] Fix | Delete
function ampforwp_pagebuilder_content_meta_register($post_type){
[13] Fix | Delete
global $redux_builder_amp;
[14] Fix | Delete
global $post_id;
[15] Fix | Delete
[16] Fix | Delete
if ( ampforwp_role_based_access_options() == true && ( current_user_can('edit_posts') || current_user_can('edit_pages') ) ) {
[17] Fix | Delete
// Page builder for posts
[18] Fix | Delete
if( ampforwp_get_setting('amp-on-off-for-all-posts') && $post_type == 'post' ) {
[19] Fix | Delete
add_meta_box( 'pagebilder_content', esc_html__( 'AMP Page Builder', 'accelerated-mobile-pages' ), 'amp_content_pagebuilder_title_callback', 'post' , 'normal', 'default' );
[20] Fix | Delete
}
[21] Fix | Delete
$frontpage_id = ampforwp_get_the_ID();
[22] Fix | Delete
// Page builder for pages
[23] Fix | Delete
if ( ( true == ampforwp_get_setting('amp-on-off-for-all-pages') && $post_type == 'page' ) || ( true == ampforwp_get_setting('amp-frontpage-select-option') && $post_id == $frontpage_id )) {
[24] Fix | Delete
add_meta_box( 'pagebilder_content', esc_html__( 'AMP Page Builder', 'accelerated-mobile-pages' ), 'amp_content_pagebuilder_title_callback', 'page' , 'normal', 'default' );
[25] Fix | Delete
}
[26] Fix | Delete
if( is_array(ampforwp_get_setting('ampforwp-custom-type') ) && in_array($post_type, ampforwp_get_setting('ampforwp-custom-type')) ){
[27] Fix | Delete
add_meta_box( 'pagebilder_content', esc_html__( 'AMP Page Builder', 'accelerated-mobile-pages' ), 'amp_content_pagebuilder_title_callback', $post_type , 'normal', 'default' );
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
}
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
function amp_content_pagebuilder_title_callback( $post ){
[34] Fix | Delete
if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) {
[35] Fix | Delete
return ;
[36] Fix | Delete
}
[37] Fix | Delete
global $post;
[38] Fix | Delete
$amp_current_post_id = $post->ID;
[39] Fix | Delete
$content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
[40] Fix | Delete
$content = html_entity_decode($content);
[41] Fix | Delete
[42] Fix | Delete
//previous data stored compatible
[43] Fix | Delete
if(get_post_meta($amp_current_post_id ,'use_ampforwp_page_builder',true)==null &&
[44] Fix | Delete
get_post_meta( $amp_current_post_id, 'amp-page-builder', true ) != ''){
[45] Fix | Delete
update_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes');
[46] Fix | Delete
}
[47] Fix | Delete
//Disable page builder
[48] Fix | Delete
if(isset($_GET['ramppb']) && sanitize_text_field( wp_unslash($_GET['ramppb']))=='1'){
[49] Fix | Delete
delete_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes');
[50] Fix | Delete
delete_post_meta($amp_current_post_id, 'ampforwp_page_builder_enable','yes');
[51] Fix | Delete
}
[52] Fix | Delete
//Enable page builder
[53] Fix | Delete
if(isset($_GET['use_amp_pagebuilder']) && sanitize_text_field( wp_unslash($_GET['use_amp_pagebuilder']))=='1'){
[54] Fix | Delete
update_post_meta($amp_current_post_id, 'use_ampforwp_page_builder','yes');
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
if(empty($content)){
[58] Fix | Delete
echo " ";
[59] Fix | Delete
}
[60] Fix | Delete
ampforwp_call_page_builder();
[61] Fix | Delete
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
/* Add page builder form after editor */
[65] Fix | Delete
function ampforwp_call_page_builder(){
[66] Fix | Delete
global $post, $moduleTemplate, $layoutTemplate, $containerCommonSettings;
[67] Fix | Delete
if($post!=null){
[68] Fix | Delete
$postId = $post->ID;
[69] Fix | Delete
}
[70] Fix | Delete
if(isset($_GET['post_id'])){
[71] Fix | Delete
$id = intval($_GET['post_id']);
[72] Fix | Delete
$postId = sanitize_text_field( wp_unslash($id));
[73] Fix | Delete
}
[74] Fix | Delete
add_thickbox();
[75] Fix | Delete
[76] Fix | Delete
$previousData = get_post_meta($postId,'amp-page-builder');
[77] Fix | Delete
$ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
[78] Fix | Delete
$previousData = isset($previousData[0])? $previousData[0]: null;
[79] Fix | Delete
[80] Fix | Delete
$previousData = (str_replace("'", "&apos;", $previousData));
[81] Fix | Delete
[82] Fix | Delete
$totalRows = 1;
[83] Fix | Delete
$totalmodules = 1;
[84] Fix | Delete
if(!empty($previousData)){
[85] Fix | Delete
$jsonData = json_decode($previousData,true);
[86] Fix | Delete
if(is_array($jsonData) && isset($jsonData['rows']) && count($jsonData['rows'])>0){
[87] Fix | Delete
$totalRows = $jsonData['totalrows'];
[88] Fix | Delete
$totalmodules = $jsonData['totalmodules'];
[89] Fix | Delete
$previousData = wp_json_encode($jsonData);
[90] Fix | Delete
}else{
[91] Fix | Delete
$jsonData['rows'] = array();
[92] Fix | Delete
$jsonData['totalrows']=1;
[93] Fix | Delete
$jsonData['totalmodules'] = 1;
[94] Fix | Delete
$previousData = wp_json_encode($jsonData);
[95] Fix | Delete
}
[96] Fix | Delete
}
[97] Fix | Delete
$pageBuilderData = array(
[98] Fix | Delete
'title'=>'Pagebuilder Settings',
[99] Fix | Delete
'default_tab'=> 'customizer',
[100] Fix | Delete
'tabs' => array(
[101] Fix | Delete
'customizer'=>'Customizer',
[102] Fix | Delete
'container_css'=>'Container css'
[103] Fix | Delete
),
[104] Fix | Delete
'fields' => array(
[105] Fix | Delete
array(
[106] Fix | Delete
'type' =>'text',
[107] Fix | Delete
'name' =>"content_title",
[108] Fix | Delete
'label' => esc_html__('Category Block Title','accelerated-mobile-pages'),
[109] Fix | Delete
'tab' =>'customizer',
[110] Fix | Delete
'default' =>'Category',
[111] Fix | Delete
),
[112] Fix | Delete
array(
[113] Fix | Delete
'type' =>'text',
[114] Fix | Delete
'name' =>"content_title",
[115] Fix | Delete
'label' => esc_html__('Category Block Title','accelerated-mobile-pages'),
[116] Fix | Delete
'tab' =>'container_css',
[117] Fix | Delete
'default' =>'Category',
[118] Fix | Delete
),
[119] Fix | Delete
)
[120] Fix | Delete
);
[121] Fix | Delete
[122] Fix | Delete
$backendRowSetting = $containerCommonSettings;
[123] Fix | Delete
unset($backendRowSetting['front_template_start']);
[124] Fix | Delete
unset($backendRowSetting['front_template_end']);
[125] Fix | Delete
unset($backendRowSetting['front_css']);
[126] Fix | Delete
unset($backendRowSetting['front_common_css']);
[127] Fix | Delete
wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
[128] Fix | Delete
[129] Fix | Delete
$mob_pres_link = false;
[130] Fix | Delete
if(function_exists('ampforwp_mobile_redirect_preseve_link')){
[131] Fix | Delete
$mob_pres_link = ampforwp_mobile_redirect_preseve_link();
[132] Fix | Delete
}
[133] Fix | Delete
if(class_exists('WPSEO_Frontend') && true == ampforwp_get_setting('ampforwp-yoast-seo-analysis') && (true == ampforwp_get_setting('ampforwp-amp-takeover') || $mob_pres_link == true) ) {
[134] Fix | Delete
$pb_content = get_post_field('amp-page-builder',$post->ID);
[135] Fix | Delete
?>
[136] Fix | Delete
<script type="text/template" class="hide" id="amp-page-builder-ready"><?php echo stripcslashes( $pb_content ); ?></script>
[137] Fix | Delete
<?php } ?>
[138] Fix | Delete
<div id="ampForWpPageBuilder_container">
[139] Fix | Delete
<div id="start_amp_pb_post" class="start_amp_pb" data-postId="<?php echo esc_attr(get_the_ID()) ?>" v-if="startPagebuilder==0" @click="amppb_startFunction($event)"><?php echo esc_html__('Start the AMP Page Builder','accelerated-mobile-pages'); ?></div>
[140] Fix | Delete
<div class="enable_ampforwp_page_builder" v-if="startPagebuilder==1">
[141] Fix | Delete
<label><input type="checkbox" name="ampforwp_page_builder_enable" value="yes" v-model="checkedPageBuilder"><?php echo esc_html__('Use Builder','accelerated-mobile-pages'); ?></label>
[142] Fix | Delete
<label @click="showModal = true;"><?php echo esc_html__('Pre-built AMP Layouts','accelerated-mobile-pages'); ?></label>
[143] Fix | Delete
</div>
[144] Fix | Delete
<div id="amp-page-builder" v-if="startPagebuilder==1">
[145] Fix | Delete
<?php wp_nonce_field( "amppb_nonce_action", "amppb_nonce" ) ?>
[146] Fix | Delete
<input type="hidden" name="amp-page-builder" id="amp-page-builder-data" class="amp-data" v-model="JSON.stringify(mainContent)" value='<?php echo $previousData; // nothing to escaped ?>'>
[147] Fix | Delete
<?php /* This is where we gonna add & manage rows */ ?>
[148] Fix | Delete
<div id="sorted_rows" class="amppb-rows drop" >
[149] Fix | Delete
<drop class="drop" :class="{'row-dropping':rowOverDrop}" @drop="handleDrop" @dragover="rowOverDrop = true"
[150] Fix | Delete
@dragleave="rowOverDrop = false">
[151] Fix | Delete
<p class="amppb-rows-message" v-if="mainContent.rows && mainContent.rows.length==0"><?php echo esc_html__('Start by dragging a Column and then a Module','accelerated-mobile-pages'); ?>.</p>
[152] Fix | Delete
<draggable :element="'div'" class="dragrow"
[153] Fix | Delete
v-model="mainContent.rows"
[154] Fix | Delete
:options="{
[155] Fix | Delete
animation:200,
[156] Fix | Delete
draggable:'.amppb-row',
[157] Fix | Delete
handle: '.amppb-handle',
[158] Fix | Delete
ghostClass: 'ghost',
[159] Fix | Delete
group:{name:'.amppb-row'}
[160] Fix | Delete
}"
[161] Fix | Delete
@start="rowdrag=true"
[162] Fix | Delete
@end="rowdrag=false;rows_moved($event)"
[163] Fix | Delete
>
[164] Fix | Delete
<div v-for="(row, key, index) in mainContent.rows" :key="row.id" class="amppb-row" :id="'conatiner-'+row.id">
[165] Fix | Delete
<div v-if="row.cells==1" :id="'conatiner-'+row.id">
[166] Fix | Delete
<input type="hidden" name="column-data" value="">
[167] Fix | Delete
<div class="amppb-row-title">
[168] Fix | Delete
<span class="amppb-handle dashicons dashicons-move"></span>
[169] Fix | Delete
<span class="amppb-row-title-text">1 <?php echo esc_html__('Column','accelerated-mobile-pages'); ?></span>
[170] Fix | Delete
<span @click="reomve_row(key)" data-confirm="Delete Row?" class="amppb-remove dashicons dashicons-trash"></span>
[171] Fix | Delete
<span @click="showRowSettingPopUp($event)" class="rowBoxContainer" title="Row settings column 1" :data-popupContent='JSON.stringify(<?php echo wp_json_encode($backendRowSetting); ?>)'
[172] Fix | Delete
:data-container_id="row.id"
[173] Fix | Delete
>
[174] Fix | Delete
<i class="tools-icon dashicons dashicons-menu"></i>
[175] Fix | Delete
</span>
[176] Fix | Delete
<span @click="duplicateRow($event)" class="amppb-duplicate dashicons dashicons-admin-page" :data-rowid="row.id"></span>
[177] Fix | Delete
[178] Fix | Delete
</div><!-- .amppb-row-title -->
[179] Fix | Delete
[180] Fix | Delete
<div class="amppb-row-fields col" data-cell="1">
[181] Fix | Delete
<drop class="drop" @drop="handleModuleDrop" :data-rowid="row.id" :data-cellid="1" :class="{'module-dropping':modulesOverDrop}" @drop="handleDrop" @dragover="modulesOverDrop = true"
[182] Fix | Delete
@dragleave="modulesOverDrop = false">
[183] Fix | Delete
<draggable
[184] Fix | Delete
:element="'div'"
[185] Fix | Delete
class="modules-drop"
[186] Fix | Delete
:class="{'ui-droppable': row.cell_data.length==0 }"
[187] Fix | Delete
v-model="row.cell_data"
[188] Fix | Delete
:options="{
[189] Fix | Delete
animation:100,
[190] Fix | Delete
draggable:'.amppb-module',
[191] Fix | Delete
handle: '.amppb-module',
[192] Fix | Delete
group:{name:'.amppb-module'},
[193] Fix | Delete
ghostClass: 'ghost',
[194] Fix | Delete
}"
[195] Fix | Delete
@start="moduledrag=true"
[196] Fix | Delete
@end="moduledrag=false;modulesort($event)"
[197] Fix | Delete
:data-rowid="row.id" :data-cellid="1"
[198] Fix | Delete
>
[199] Fix | Delete
<module-data v-for="(cell, key, index) in row.cell_data" :key="cell.cell_id" :modulekey="key" :cell="cell" :cellcontainer="1"></module-data>
[200] Fix | Delete
</draggable>
[201] Fix | Delete
</drop>
[202] Fix | Delete
</div><!-- .amppb-row-fields -->
[203] Fix | Delete
</div><!-- .amppb-row.amppb-col-1 -->
[204] Fix | Delete
[205] Fix | Delete
<div v-if="row.cells==2" class="amppb-col-2" :id="'conatiner-'+row.id">
[206] Fix | Delete
<input type="hidden" name="column-data" value="">
[207] Fix | Delete
<div class="amppb-row-title">
[208] Fix | Delete
<span class="amppb-handle dashicons dashicons-move"></span>
[209] Fix | Delete
<span class="amppb-row-title-text">2 <?php echo esc_html__('Columns','accelerated-mobile-pages'); ?></span>
[210] Fix | Delete
<span @click="reomve_row(key)" data-confirm="Delete Row?" class="amppb-remove amppb-item-remove dashicons dashicons-trash"></span>
[211] Fix | Delete
<span href="#" class="rowBoxContainer" title="Row settings column 2" @click="showRowSettingPopUp($event)" :data-popupContent='JSON.stringify(<?php echo wp_json_encode($backendRowSetting); ?>)'
[212] Fix | Delete
:data-container_id="row.id"
[213] Fix | Delete
>
[214] Fix | Delete
<span class="tools-icon dashicons dashicons-menu"></span>
[215] Fix | Delete
</span>
[216] Fix | Delete
<span @click="duplicateRow($event)" class="amppb-duplicate dashicons dashicons-admin-page" :data-rowid="row.id"></span>
[217] Fix | Delete
</div><!-- .amppb-row-title -->
[218] Fix | Delete
[219] Fix | Delete
<div class="amppb-row-fields ">
[220] Fix | Delete
<div class="amppb-column-2-left col" data-cell="1">
[221] Fix | Delete
<drop class="drop" @drop="handleModuleDrop" :data-rowid="row.id" :data-cellid="1" :class="{'module-dropping':modulesOverDrop}" @drop="handleDrop" @dragover="modulesOverDrop = true"
[222] Fix | Delete
@dragleave="modulesOverDrop = false">
[223] Fix | Delete
<div class="modules-drop">
[224] Fix | Delete
[225] Fix | Delete
<draggable :element="'div'"class="module-drop-zone"
[226] Fix | Delete
:class="{'ui-droppable': row.cell_left.length==0 }" v-model="row.cell_left"
[227] Fix | Delete
:options="{
[228] Fix | Delete
animation:200,
[229] Fix | Delete
draggable:'.amppb-module',
[230] Fix | Delete
handle: '.amppb-module',
[231] Fix | Delete
group:{name:'.amppb-module'},
[232] Fix | Delete
ghostClass: 'ghost'
[233] Fix | Delete
}"
[234] Fix | Delete
@start="moduledrag=true"
[235] Fix | Delete
@end="moduledrag=false;modulesort($event)"
[236] Fix | Delete
:data-rowid="row.id" :data-cellid="1"
[237] Fix | Delete
>
[238] Fix | Delete
<module-data v-for="(cell, key, index) in row.cell_left" :key="cell.cell_id" :modulekey="key" :cell="cell" :cellcontainer="1"></module-data>
[239] Fix | Delete
</draggable>
[240] Fix | Delete
[241] Fix | Delete
</div>
[242] Fix | Delete
</drop>
[243] Fix | Delete
</div><!-- .amppb-col-2-left -->
[244] Fix | Delete
<div class="amppb-column-2-right col" data-cell="2">
[245] Fix | Delete
<div class="resize-handle"></div>
[246] Fix | Delete
<drop class="drop" @drop="handleModuleDrop" :data-rowid="row.id" :data-cellid="2" :class="{'module-dropping':modulesOverDrop}" @drop="handleDrop" @dragover="modulesOverDrop = true"
[247] Fix | Delete
@dragleave="modulesOverDrop = false">
[248] Fix | Delete
<div class="modules-drop" >
[249] Fix | Delete
[250] Fix | Delete
<draggable :element="'div'"class="module-drop-zone"
[251] Fix | Delete
:class="{'ui-droppable': row.cell_right.length==0 }"
[252] Fix | Delete
v-model="row.cell_right"
[253] Fix | Delete
:options="{
[254] Fix | Delete
animation:200,
[255] Fix | Delete
draggable:'.amppb-module',
[256] Fix | Delete
handle: '.amppb-module',
[257] Fix | Delete
group:{name:'.amppb-module'},
[258] Fix | Delete
ghostClass: 'ghost',
[259] Fix | Delete
}"
[260] Fix | Delete
@start="moduledrag=true"
[261] Fix | Delete
@end="moduledrag=false;modulesort($event)"
[262] Fix | Delete
:data-rowid="row.id" :data-cellid="2"
[263] Fix | Delete
>
[264] Fix | Delete
<module-data v-for="(cell, key, index) in row.cell_right" :key="cell.cell_id" :modulekey="key" :cell="cell" :cellcontainer="2"></module-data>
[265] Fix | Delete
</draggable>
[266] Fix | Delete
[267] Fix | Delete
</div>
[268] Fix | Delete
</drop>
[269] Fix | Delete
</div><!-- .amppb-col-2-right -->
[270] Fix | Delete
</div><!-- .amppb-row-fields -->
[271] Fix | Delete
</div><!-- .amppb-row.amppb-col-2 -->
[272] Fix | Delete
</div>
[273] Fix | Delete
</draggable>
[274] Fix | Delete
</drop>
[275] Fix | Delete
[276] Fix | Delete
[277] Fix | Delete
</div><!-- .amppb-rows -->
[278] Fix | Delete
[279] Fix | Delete
<div class="modules-options">
[280] Fix | Delete
<div class="amppb-actions" id="amppb-actions-container" data-containerid="<?php echo $totalRows; // nothing to escaped ?>">
[281] Fix | Delete
<drag class="drag" :transfer-data='{type: "column",value: "col-1",rowSettingJson:<?php echo wp_json_encode($backendRowSetting); ?>}' :draggable="true" :effect-allowed="'copy'">
[282] Fix | Delete
<span id="action-col-1" class="amppb-add-row button-primary button-large module-col-1" data-template="col-1"
[283] Fix | Delete
>1 Column</span>
[284] Fix | Delete
</drag>
[285] Fix | Delete
<drag class="drag" :transfer-data='{type: "column",value: "col-2", rowSettingJson:<?php echo wp_json_encode($backendRowSetting); ?>}' :draggable="true" :effect-allowed="'copy'">
[286] Fix | Delete
<span id="action-col-2" class="amppb-add-row button-primary button-large draggable module-col-2" data-template="col-2"
[287] Fix | Delete
>2 Columns</span>
[288] Fix | Delete
</drag>
[289] Fix | Delete
<div class="clearfix"></div>
[290] Fix | Delete
</div><!-- .amppb-actions -->
[291] Fix | Delete
<div class="amppb-module-actions" id="amppb-module-actions-container" data-recentid="<?php echo esc_attr($totalmodules); ?>">
[292] Fix | Delete
<?php
[293] Fix | Delete
//fallback support Hide old modules
[294] Fix | Delete
$oldModules = array(
[295] Fix | Delete
'blurb',
[296] Fix | Delete
'button',
[297] Fix | Delete
'image',
[298] Fix | Delete
'text'
[299] Fix | Delete
);
[300] Fix | Delete
ksort($moduleTemplate);
[301] Fix | Delete
foreach ($moduleTemplate as $key => $module) {
[302] Fix | Delete
if(in_array($key, $oldModules)){
[303] Fix | Delete
continue;
[304] Fix | Delete
}
[305] Fix | Delete
unset($module['front_template']);
[306] Fix | Delete
unset($module['front_css']);
[307] Fix | Delete
if(isset($module['front_loop_content'])){
[308] Fix | Delete
unset($module['front_loop_content']);
[309] Fix | Delete
}
[310] Fix | Delete
if(isset($module['front_common_css'])){
[311] Fix | Delete
unset($module['front_common_css']);
[312] Fix | Delete
}
[313] Fix | Delete
if(isset($module['repeater'])){
[314] Fix | Delete
unset($module['repeater']['front_template']);
[315] Fix | Delete
}
[316] Fix | Delete
$moduleJson = array('type'=> 'module','moduleDraggable'=>true ,'modulename'=>strtolower($module['name']),'moduleJson'=>$module);
[317] Fix | Delete
echo '
[318] Fix | Delete
<drag class="drag" :transfer-data=\''.wp_json_encode($moduleJson).'\' :draggable="true" :effect-allowed="\'copy\'">
[319] Fix | Delete
<span class="amppb-add-row button-primary button-large draggable module-'.esc_attr(strtolower($module['name'])).'"
[320] Fix | Delete
>
[321] Fix | Delete
'.$module['label'].'
[322] Fix | Delete
</span>
[323] Fix | Delete
</drag>
[324] Fix | Delete
';
[325] Fix | Delete
}
[326] Fix | Delete
?>
[327] Fix | Delete
<div class="clearfix"></div>
[328] Fix | Delete
</div><!-- .amppb-module-actions -->
[329] Fix | Delete
</div>
[330] Fix | Delete
[331] Fix | Delete
<?php /* This is where our action buttons to add rows
[332] Fix | Delete
Modules
[333] Fix | Delete
*/ ?>
[334] Fix | Delete
[335] Fix | Delete
<!-- use the modal component, pass in the prop -->
[336] Fix | Delete
<amp-pagebuilder-modal v-if="showModal" @close="showModal = false">
[337] Fix | Delete
<!--
[338] Fix | Delete
you can use custom content here to overwrite
[339] Fix | Delete
default content
[340] Fix | Delete
-->
[341] Fix | Delete
<h3 slot="header"><?php echo esc_html__('custom header','accelerated-mobile-pages'); ?></h3>
[342] Fix | Delete
</amp-pagebuilder-modal>
[343] Fix | Delete
<amp-pagebuilder-module-modal v-if="showmoduleModal" @close="showmoduleModal = false">
[344] Fix | Delete
<!--
[345] Fix | Delete
you can use custom content here to overwrite
[346] Fix | Delete
default content
[347] Fix | Delete
-->
[348] Fix | Delete
[349] Fix | Delete
</amp-pagebuilder-module-modal>
[350] Fix | Delete
</div>
[351] Fix | Delete
</div>
[352] Fix | Delete
<?php
[353] Fix | Delete
}
[354] Fix | Delete
[355] Fix | Delete
function ampforwp_create_posttype_amppb_layout(){
[356] Fix | Delete
register_post_type( 'amppb_layout',
[357] Fix | Delete
array(
[358] Fix | Delete
'labels' => array(
[359] Fix | Delete
'name' => esc_html__( 'AMP Layouts','accelerated-mobile-pages' ),
[360] Fix | Delete
'singular_name' => esc_html__( 'AMP Layout','accelerated-mobile-pages' )
[361] Fix | Delete
),
[362] Fix | Delete
'public' => false, // it's not public, it shouldn't have it's own permalink, and so on
[363] Fix | Delete
'publicly_queriable' => false, // you should be able to query it
[364] Fix | Delete
'show_ui' => false, // you should be able to edit it in wp-admin
[365] Fix | Delete
'exclude_from_search' => true, // you should exclude it from search results
[366] Fix | Delete
'show_in_nav_menus' => false, // you shouldn't be able to add it to menus
[367] Fix | Delete
'has_archive' => false, // it shouldn't have archive page
[368] Fix | Delete
'rewrite' => false, // it shouldn't have rewrite rules
[369] Fix | Delete
'rewrite' => array('slug' => 'amppb-layout'),
[370] Fix | Delete
)
[371] Fix | Delete
);
[372] Fix | Delete
}
[373] Fix | Delete
add_action( 'init', 'ampforwp_create_posttype_amppb_layout' );
[374] Fix | Delete
require_once AMP_PAGE_BUILDER.'functions.php';
[375] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function