/** * Modify post preview link with our own implementation. * When user hits preview theme from slider settings, this is the URL he will be taken to. * * @param string $url */ public function slider_preview_link($url) { global $post; if (!$post || parent::get_type_slider() != $post->post_type) { return $url; } $preview_args = array('post_id' => $post->ID, 'theme' => $_POST['theme']['active'], 'vars' => array('color' => isset($_POST['theme']['color']) ? $_POST['theme']['color'] : ''), 'echo' => false); $url = fa_slider_preview_homepage($preview_args); return htmlspecialchars_decode($url); }
<h3 class="theme-name"> <?php echo $theme_details['theme_config']['name']; ?> </h3><!-- .theme-name --> <div class="theme-actions"> <?php $args = array('name' => 'theme_color', 'id' => 'theme-color', 'label' => __('Color', 'fapro'), 'selected' => $options['theme']['color']); fa_theme_colors_dropdown($theme_details, $args); ?> <?php $preview_args = array('post_id' => $post->ID, 'theme' => $theme); ?> <a class="button-primary fa-customize" target="fa-slider-preview" href="<?php fa_slider_preview_homepage($preview_args); ?> " <?php fa_hide($active != $theme); ?> ><?php _e('Preview', 'fapro'); ?> </a> <a class="button-secondary fa-select" data-theme="<?php echo esc_attr($theme); ?> " <?php fa_hide($active == $theme); ?> ><?php