: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$amp_cpt_option = array();
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$ampforwp_cpt_plugin_check = is_plugin_active( 'amp-custom-post-type/amp-custom-post-type.php' );
if ( false == $ampforwp_cpt_plugin_check ) {
'id' => 'ampforwp-custom-type',
'title' => esc_html__('Custom Post Types', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Custom Post Types', 'accelerated-mobile-pages'),
'options' => ampforwp_get_cpt_generated_post_types(),
function ampforwp_get_categories($id){
$data = get_transient($id);
$selected_categories = ampforwp_get_setting($id);
if(is_numeric($selected_categories)){
$temp_array[0] = $selected_categories;
$selected_categories = $temp_array;
if(isset($selected_categories) && $selected_categories) {
$get_required_data = array_filter( $selected_categories );
if ( count( $get_required_data ) != 0 ) {
$categories = get_terms( 'category', array( 'include' => $get_required_data ) );
foreach ( $categories as $category ) {
$result[ esc_attr( $category->term_id ) ] = esc_html( $category->name );
set_transient( $id, $result);
function ampforwp_get_all_tags($id){
$data = get_transient($id);
$selected_tags = ampforwp_get_setting($id);
if(is_numeric($selected_tags)){
$temp_array[0] = $selected_tags;
$selected_tags = $temp_array;
$get_required_data = array_filter( $selected_tags );
if ( count( $get_required_data ) != 0 ) {
$tags = get_terms( 'post_tag', array( 'include' => $get_required_data ) );
foreach($tags as $tag ) {
$result[esc_attr($tag->term_id)] = esc_html($tag->name);
set_transient( $id, $result);
function ampforwp_get_user_roles(){
foreach ( $wp_roles->roles as $key=>$value ){
$allroles[esc_attr($key)] = esc_html($value['name']);
function ampforwp_default_user_roles(){
$metabox_access = ampforwp_get_setting('amp-meta-permissions');
if($metabox_access == 'admin'){
$rba = ampforwp_get_setting('ampforwp-role-based-access');
$roles = array('administrator');
$roles = ampforwp_get_setting('ampforwp-role-based-access');
$rba = ampforwp_get_setting('ampforwp-role-based-access');
$roles = array('administrator','editor');
$roles = ampforwp_get_setting('ampforwp-role-based-access');
function ampforwp_get_generated_custom_taxonomies(){
$taxonomies = get_transient('ampforwp_get_taxonomies');
$amp_custom_tax_option = array();
$taxonomies = ampforwp_get_generated_custom_taxonomies();
if( !empty($taxonomies) && $taxonomies != false){
$amp_custom_tax_option = array(
'id' => 'ampforwp-custom-taxonomies',
'title' => esc_html__('Custom Taxonomies', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Archives for Custom Taxonomies.', 'accelerated-mobile-pages'),
'options' => ampforwp_get_generated_custom_taxonomies(),
'required' => array('ampforwp-archive-support', '=' , '1')
$design_types = ampforwp_get_setting('amp-design-selector');
$secondary_text = 'Content';
if($design_types == 1 || $design_types == 2 || $design_types == 3){
$secondary_text = 'Secondary';
if(!current_user_can('administrator') ){
$show_for_admin = 'hide';
// AMP to WP Default value
function ampforwp_amp2wp_default(){
if (true == ampforwp_get_setting('ampforwp-amp-takeover')){
$theme = wp_get_theme(); // gets the current theme
if ( 'AMP WordPress Theme' == $theme->name || 'AMP WordPress Theme' == $theme->parent_theme ) {
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'General', 'accelerated-mobile-pages' ),
'id' => 'opt-text-subsection',
'title' => esc_html__('Branding', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'title' => esc_html__('Logo', 'accelerated-mobile-pages'),
'tooltip-subtitle'=>esc_html__('Upload a logo for the AMP version. (Recommended logo size: 190x36)', 'accelerated-mobile-pages'),
'default' => array('url' => ampforwp_default_logo_settings() ),
'id' => 'ampforwp-custom-logo-dimensions',
'title' => esc_html__('Resize', 'accelerated-mobile-pages'),
'required'=>array('opt-media','!=',''),
'id' => 'ampforwp-custom-logo-dimensions-options',
'title' => esc_html__('Resize Method', 'accelerated-mobile-pages'),
'class' => 'child_opt child_opt_arrow',
'flexible' => 'Flexible Width',
'prescribed' => 'Fixed Width'
'default' => ampforwp_custom_logo_dimensions_options(),
'required'=>array('ampforwp-custom-logo-dimensions','=','1'),
'id' => 'ampforwp-custom-logo-dimensions-slider',
'title' => esc_html__('Resize Your Logo', 'accelerated-mobile-pages'),
'required'=>array('ampforwp-custom-logo-dimensions-options','=','flexible'),
'id' => 'opt-media-width',
'title' => esc_html__('Logo Width', 'accelerated-mobile-pages'),
'tooltip-subtitle' => __('Default width is 190 pixels', 'accelerated-mobile-pages'),
'required'=>array('ampforwp-custom-logo-dimensions-options','=','prescribed'),
'id' => 'opt-media-height',
'title' => esc_html__('Logo Height', 'accelerated-mobile-pages'),
'tooltip-subtitle' => __('Default height is 36 pixels', 'accelerated-mobile-pages'),
'required'=>array('ampforwp-custom-logo-dimensions-options','=','prescribed'),
'title' => esc_html__('AMP Support', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'id' =>'amp-on-off-for-all-posts',
'title' => esc_html__('Posts', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Posts', 'accelerated-mobile-pages'),
'id' =>'amp-on-off-for-all-pages',
'title' => esc_html__('Pages', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Pages.', 'accelerated-mobile-pages'),
'id' => 'ampforwp-homepage-on-off-support',
'title' => esc_html__('Homepage', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Homepage.', 'accelerated-mobile-pages'),
'id' =>'amp-frontpage-select-option',
'title' => esc_html__('Custom Front Page', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Set Custom Front Page as Homepage', 'accelerated-mobile-pages'),
'required' => array('ampforwp-homepage-on-off-support','=','1'),
'id' => 'amp-frontpage-select-option-pages',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Select Page as Front Page', 'accelerated-mobile-pages'),
'required' => array('amp-frontpage-select-option', '=' , '1'),
// Must provide key => value pairs for select options
'id' => 'ampforwp-title-on-front-page',
'title' => esc_html__('Title on Static Front Page', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable/Disable display of title on the Static Front Page.', 'accelerated-mobile-pages'),
'required' => array('amp-frontpage-select-option', '=' , '1'),
'id' => 'ampforwp-archive-support',
'title' => esc_html__('Archives [Category & Tags]', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Archives.', 'accelerated-mobile-pages'),
'id' => 'ampforwp-archive-support-cat',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Category', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Categories.', 'accelerated-mobile-pages'),
'required' => array('ampforwp-archive-support', '=' , '1')
'id' => 'ampforwp-archive-support-tag',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Tags', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable AMP Support on Tags.', 'accelerated-mobile-pages'),
'required' => array('ampforwp-archive-support', '=' , '1')
'id' => 'ampforwp-amp-takeover',
'title' => esc_html__('AMP Takeover (Beta)', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Make your non-amp to load the AMP (AMP & NON-AMP both will be AMP with same design)', 'accelerated-mobile-pages'),
/* $pb_title = 'Page Builder';
$theme = wp_get_theme(); // gets the current theme
if( class_exists('Vc_Manager') || ( class_exists('ET_Builder_Plugin') || 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ) || did_action( 'elementor/loaded' ) ){
if(class_exists('Vc_Manager') ){
$pb_title = 'WPBakery Page Builder Support';
if( class_exists('ET_Builder_Plugin') || 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ){
$pb_title = 'Divi Builder Support';
if(did_action( 'elementor/loaded' ) ){
$pb_title = 'Elementor Support';
// AMP Content Page Builder SECTION
Redux::setSection( $opt_name, array(
'title' => esc_html__( $pb_title, 'accelerated-mobile-pages' ),
'id' => 'amp-content-builder',
'class' => 'ampforwp_new_features ',
if ( ! function_exists('amp_activate') ) {
ampforwp_admin_advertisement_options($opt_name);
if ( ! function_exists('ampforwp_seo_default') ) {
function ampforwp_seo_default() {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active('wordpress-seo/wp-seo.php') ) {
elseif ( is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') ) {
elseif ( defined( 'RANK_MATH_FILE' ) ) {
elseif ( function_exists('genesis_theme_support') ) {
elseif ( is_plugin_active('wp-seopress/seopress.php') ) {
elseif ( function_exists( 'the_seo_framework' ) ) {
$default = 'seo_framework';
elseif ( class_exists('SQ_Classes_ObjController') ) {
'aioseo' => 'All in One SEO',
'rank_math' => 'Rank Math SEO',
'seopress' => 'SEOPress',
'bridge' => 'Bridge Qode SEO',
'seo_framework' => 'The SEO Framework',
'squirrly' => 'Squirrly SEO',
'smartcrawl' => 'SmartCrawl'
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'SEO', 'accelerated-mobile-pages' ),
'id' => 'ampforwp-seo-general-section',
'title' => esc_html__('General', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'id' => 'ampforwp-seo-meta-desc',
'title' => esc_html__('Meta Description', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('The meta tag that displays in head', 'accelerated-mobile-pages'),
'id' => 'ampforwp-seo-og-meta-tags',
'title' => esc_html__('OpenGraph Meta Tags', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable/Disable Default OpenGraph Meta Tags', 'accelerated-mobile-pages'),
'id' => 'ampforwp-seo-custom-additional-meta',
'title' => esc_html__('Head Section', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Adds additional Meta to the head section', 'accelerated-mobile-pages', 'accelerated-mobile-pages'),
'placeholder' => esc_html__('<!-- Paste your Additional HTML , that goes between <head> </head> tags -->','accelerated-mobile-pages')
'id' => 'ampforwp-seo-plugins-section',
'title' => esc_html__('SEO Plugin Integration', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'id' => 'ampforwp-seo-selection',
'title' => esc_html__('Select SEO Plugin', 'accelerated-mobile-pages'),
'options' => $seo_options,
'default' => ampforwp_seo_default(),
'class' => 'child_opt child_opt_arrow',
'id' => 'ampforwp-seo-rank_math-meta',
'tooltip-subtitle' => esc_html__('Adds Social and Open Graph Meta Tags from Rank Math', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Meta Tags from Rank Math', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
'id' => 'ampforwp-seo-rank_math-schema',
'tooltip-subtitle' => esc_html__('Adds Rank Math ld+json for AMP page', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Rank Math ld+json data', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
'id' => 'ampforwp-seo-rank_math-canonical',
'tooltip-subtitle' => esc_html__('Pull Canonical from Rank Math for AMP pages', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Canonical from Rank Math', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'rank_math'),
'class' => 'child_opt child_opt_arrow',
'id' => 'ampforwp-seo-yoast-meta',
'tooltip-subtitle' => esc_html__('Adds Social and Open Graph Meta Tags from Yoast', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Meta Tags from Yoast', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
'id' => 'ampforwp-seo-yoast-description',
'tooltip-subtitle' => esc_html__('Adds Yoast Custom description to ld+json for AMP page', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Yoast Description in ld+json', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
'id' => 'ampforwp-seo-yoast-canonical',
'tooltip-subtitle' => esc_html__('Pull Canonical from Yoast for AMP pages', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Canonical from Yoast', 'accelerated-mobile-pages' ),
'required' => array('ampforwp-seo-selection', '=' , 'yoast'),
'id' => 'ampforwp-yoast-bread-crumb',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Breadcrumbs From Yoast', 'accelerated-mobile-pages'),
array('ampforwp-bread-crumb', '=' , '1'),
array('ampforwp-seo-selection', '=' , 'yoast')
'id' => 'ampforwp-seo-yoast-schema',
'tooltip-subtitle' => esc_html__('Fetch Schema from the Yoast Seo for AMP Pages', 'accelerated-mobile-pages'),
'title' => esc_html__( 'Schema from Yoast', 'accelerated-mobile-pages' ),