array(), 'AMP_YouTube_Embed_Handler' => array(), 'AMP_DailyMotion_Embed_Handler' => array(), 'AMP_Vimeo_Embed_Handler' => array(), 'AMP_SoundCloud_Embed_Handler' => array(), 'AMP_Instagram_Embed_Handler' => array(), 'AMP_Vine_Embed_Handler' => array(), 'AMP_Facebook_Embed_Handler' => array(), 'AMP_Pinterest_Embed_Handler' => array(), 'AMP_Gallery_Embed_Handler' => array(), 'AMP_Playlist_Embed_Handler' => array(), ) ), apply_filters( 'amp_content_sanitizers', array( 'AMP_Style_Sanitizer' => array(), 'AMP_Blacklist_Sanitizer' => array(), 'AMP_Img_Sanitizer' => array(), 'AMP_Video_Sanitizer' => array(), 'AMP_Audio_Sanitizer' => array(), 'AMP_Playbuzz_Sanitizer' => array(), 'AMP_Iframe_Sanitizer' => array( 'add_placeholder' => true, ), ) ) ); if ( $amp_custom_content ) { $data['ampforwp_amp_content'] = $amp_custom_content->get_amp_content(); $data['amp_component_scripts'] = $amp_custom_content->get_amp_scripts(); $data['post_amp_styles'] = $amp_custom_content->get_amp_styles(); } } return $data; } function ampforwp_custom_content_meta_register() { global $redux_builder_amp; $user_level = ''; $user_level = current_user_can( 'manage_options' ); if ( isset( $redux_builder_amp['amp-meta-permissions'] ) && 'all' === $redux_builder_amp['amp-meta-permissions'] ) { $user_level = true; } if ( $user_level ) { if ( $redux_builder_amp['amp-on-off-for-all-posts'] ) { add_meta_box( 'custom_content_editor', esc_html__( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'post','normal', 'default' ); } if ( $redux_builder_amp['amp-on-off-for-all-pages'] ) { add_meta_box( 'custom_content_editor', esc_html__( 'Custom AMP Editor','accelerated-mobile-pages' ), 'amp_content_editor_title_callback', 'page','normal', 'default' ); } // Custom AMP Editor for Custom Post Types $post_types = ampforwp_get_all_post_types(); if ( $post_types ) { foreach ( $post_types as $post_type ) { if ( 'post' !== $post_type && 'page' !== $post_type ) { add_meta_box( 'custom_content_editor', esc_html__( 'Custom AMP Editor', 'accelerated-mobile-pages' ), 'amp_content_editor_title_callback', $post_type ,'normal', 'default' ); } } } // Assign Pagebuilder Meta Box // Legecy pagebuilder if ( $redux_builder_amp['ampforwp-content-builder'] ) { add_meta_box( 'custom_content_sidebar', esc_html__( 'AMP Page Builder', 'accelerated-mobile-pages' ), 'amp_content_sidebar_callback', 'page','side', 'default' ); } } } add_action('add_meta_boxes','ampforwp_custom_content_meta_register'); function amp_content_sidebar_callback( $post ) { global $post; global $redux_builder_amp; $current_post_id = $post->ID; wp_nonce_field( basename( __FILE__) , 'custom_content_sidebar_nonce' ); $amp_content_sidebar = get_post_meta($current_post_id, 'ampforwp_custom_sidebar_select', true); $amp_content_sidebar = esc_attr($amp_content_sidebar); ?>
Assign an AMP Page Builder Widget Area which will be used AMP page.
(Need Help?)