'; } $ampforwp_install_config = array( 'installer_dir' => 'install', 'plugin_title' => ucfirst( 'AMPforWP Installer' ), 'start_steps' => 1, 'total_steps' => 6, 'installerpage' => 'ampforwptourinstaller', 'dev_mode' => false, 'steps' => array( 1=>array( 'title'=>'Welcome', 'fields'=>'', 'description'=>'This wizard will set up AMP on your website, install plugin, and import content. It is optional & should take only a few minutes.', ), 2=>array( 'title'=>'Upload Logo', 'description'=>'Recommend logo size is: 190x36', 'fields'=>'
  • '.$ampLogo.'
  • ' ), 3=>array( 'title'=>'Select Pages', 'description'=>'Where you would like to enable AMP.', 'fields'=>'
  • ', ), 4=>array( 'title'=>'Setup Analytics', 'description'=>'Enter your Google Analytics Tracking code', 'fields'=>'
  • ', ), 5=>array( 'title'=>'Select Design', 'description'=>'', 'fields'=>'
  • ', ), 6=>array( 'title'=>'Enjoy', 'description'=>'Navigate to ', 'fields'=>'', ), ), 'current_step'=>array( 'title'=>'', 'step_id'=>1 ) ); add_action( 'admin_menu', 'ampforwp_add_admin_menu' ); add_action( 'admin_init', 'ampforwp_installer_init'); add_action( 'admin_footer', 'ampforwp_svg_sprite'); add_action( 'wp_ajax_ampforwp_save_installer', 'ampforwp_save_steps_data', 10, 0 ); function ampforwp_add_admin_menu(){ global $ampforwp_install_config; ampforwp_installer_init(); } function ampforwp_installer_init(){ // Exit if the user does not have proper permissions if(! current_user_can( 'manage_options' ) ) { return ; } global $ampforwp_install_config; ampforwp_instller_admin_init(); } function ampforwp_instller_admin_init(){ if(isset($_GET['ampforwp_install']) && $_GET['ampforwp_install']=='1' && is_admin()){ ampforwp_steps_call(); } } function ampforwp_steps_call(){ global $ampforwp_install_config; if ( empty( $_GET['page'] ) || $ampforwp_install_config['installerpage'] !== $_GET['page'] ) { return; } if ( ob_get_length() ) { ob_end_clean(); } $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : $ampforwp_install_config['start_steps'] ; $title = $ampforwp_install_config['steps'][$step]['title']; $ampforwp_install_config['current_step']['step_id'] = $step; // Use minified libraries if dev mode is turned on. $suffix = ''; // Enqueue styles. wp_enqueue_style( 'ampforwp_install', AMPFORWP_PLUGIN_DIR_URI. $ampforwp_install_config['installer_dir']. '/assets/css/merlin' . $suffix . '.css' , array( 'wp-admin' ), '0.1'); // Enqueue javascript. wp_enqueue_script( 'ampforwp_install', AMPFORWP_PLUGIN_DIR_URI. $ampforwp_install_config['installer_dir']. '/assets/js/merlin' . $suffix . '.js' , array( 'jquery-core' ), '0.1' ); wp_localize_script( 'ampforwp_install', 'ampforwp_install_params', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'wpnonce' => wp_create_nonce( 'ampforwp_install_nonce' ), 'pluginurl' => AMPFORWP_PLUGIN_DIR_URI, ) ); ob_start(); ampforwp_install_header(); ?>
    AMP Installation Wizard
    %s', esc_url( admin_url( 'admin.php?page=amp_options' ) ), esc_html( 'Return to dashboard' ) ); ?>

    $postValue){ if($postKey=='opt-media' && $postValue!=""){ $postValue = json_decode(stripcslashes($postValue),true); $redux_builder_amp[$postKey] = $postValue; }elseif(isset($redux_builder_amp[$postKey]) && $postValue!=""){ $redux_builder_amp[$postKey] = $postValue; } } } update_option('redux_builder_amp',$redux_builder_amp); wp_send_json( array( 'done' => 1, 'message' => "Stored Successfully", ) ); } function ampforwp_skip_button(){ ?> array( 'href' => array(), 'title' => array(), 'target' => array(), ), ); update_option( 'ampforwp_installer_completed', time() ); ?>

    > <?php echo ucwords($current_step); ?> '', 'title' => '', 'desc' => '', 'aria_hidden' => true, // Hide from screen readers. 'fallback' => false, ); // Parse args. $args = wp_parse_args( $args, $defaults ); // Set aria hidden. $aria_hidden = ''; if ( true === $args['aria_hidden'] ) { $aria_hidden = ' aria-hidden="true"'; } // Set ARIA. $aria_labelledby = ''; if ( $args['title'] && $args['desc'] ) { $aria_labelledby = ' aria-labelledby="title desc"'; } // Begin SVG markup. $svg = ''; // If there is a title, display it. if ( $args['title'] ) { $svg .= '' . esc_html( $args['title'] ) . ''; } // If there is a description, display it. if ( $args['desc'] ) { $svg .= '' . esc_html( $args['desc'] ) . ''; } $svg .= ''; // Add some markup to use as a fallback for browsers that do not support SVGs. if ( $args['fallback'] ) { $svg .= ''; } $svg .= ''; return $svg; } /** * Adds data attributes to the body, based on Customizer entries. */ function ampforwp_svg_allowed_html() { $array = array( 'svg' => array( 'class' => array(), 'aria-hidden' => array(), 'role' => array(), ), 'use' => array( 'xlink:href' => array(), ), ); return $array; } function step_output_bottom_dots(){ global $ampforwp_install_config; ?>
      $i) { $class_attr = 'done'; $show_link = true; } ?>