/** * Show Template Settings Metabox */ public static function show_template_settings($post, $metabox_args) { global $CTA_Variations; $CTAExtensions = CTA_Load_Extensions(); $extension_data = $CTAExtensions->definitions; $template_id = $metabox_args['args']['template_id']; $wp_cta_custom_fields = $extension_data[$template_id]['settings']; $template_id = $template_id ? $template_id : 'blank-template'; $template_input_name = apply_filters('wp_cta_prepare_input_id', 'wp-cta-selected-template'); // Use nonce for verification echo "<input type='hidden' name='wp_cta_wp-cta_custom_fields_nonce' value='" . wp_create_nonce('wp-cta-nonce') . "' />"; /* Display customizer launch button */ if (!isset($_GET['frontend']) || $_GET['frontend'] == 'false') { $post_link = CTA_Variations::get_variation_permalink($post->ID, $vid = null); echo "<a rel='" . $post_link . "' id='cta-launch-front' class='button-primary ' href='{$post_link}&cta-template-customize=on'>" . __('Launch Visual Editor', 'cta') . "</a>"; echo " "; } echo '<a class="button-primary" id="wp-cta-change-template-button">' . __('Choose Another Template', 'cta') . '</a>'; echo '<input type="hidden" id="" name="' . $template_input_name . '" class="selected-template" value="' . $template_id . '">'; self::render_settings($template_id, $wp_cta_custom_fields, $post); }