Esempio n. 1
0
    /**
     * Load the single template file
     *
     * @return void
     * @since  1.0
     * @author Antonino Scarfi' <*****@*****.**>
     */
    public function single_template() {
        global $post, $wpdb;

//        if ( defined('DOING_AJAX') && DOING_AJAX && isset( $_REQUEST['post_id'] ) ) {
//            $post = get_post( $_REQUEST['post_id'] );
//        }

        if ( ( ( ! defined('DOING_AJAX') || ! DOING_AJAX ) && ! is_single() ) || ! isset( $post->post_type ) || ! $this->_is_valid( $post->post_type ) ) {
            return;
        }

        // add the javascript assets
        if ( $this->_args['manage_layouts'] ) {
            foreach ( $this->layouts[ 'single' ]['js'] as $asset ) {
                yit_enqueue_script( $asset['handle'], $this->locate_url( 'single' ) . $asset['src'], $asset['deps'], $asset['ver'], $asset['in_footer'] );
            }
        }

        $post_name = $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->postmeta AS pm INNER JOIN $wpdb->posts AS p ON p.ID = pm.post_id WHERE pm.meta_key = %s AND pm.meta_value = %s AND p.post_type = %s", '_post_type', $post->post_type, $this->_name ) );
        extract( apply_filters( 'yit_cptu_frontend_vars', array( 'name' => $post_name ), $this->_name ) );

        include( $this->locate_file( 'single', 'markup' ) );
    }
Esempio n. 2
0
 /**
  * Add the multisite updater scripts
  *
  * @return void
  *
  * @since    1.0
  * @author   Andrea Grillo <*****@*****.**>
  */
 public function multisite_updater_script()
 {
     $update_url = array();
     $changelogs = array();
     $strings = array('new_version' => __('There is a new version of %plugin_name% available.', 'yith-plugin-fw'), 'latest' => __('View version %latest% details.', 'yith-plugin-fw'), 'unavailable' => __('Automatic update is unavailable for this plugin,', 'yith-plugin-fw'), 'activate' => __('please <a href="%activate_link%">activate</a> your copy of %plugin_name%.', 'yith-plugin-fw'), 'update_now' => __('Update now.', 'yith-plugin-fw'));
     foreach ($this->_plugins as $init => $info) {
         YIT_Plugin_Licence()->check($init);
         $update_url[$init] = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin-multisite&plugin=') . $init, 'upgrade-plugin-multisite_' . $init);
         $changelog_id = str_replace(array('/', '.php', '.'), array('-', '', '-'), $init);
         $details_url[$init] = '#TB_inline' . esc_url(add_query_arg(array('width' => 722, 'height' => 914, 'inlineId' => $changelog_id), ''));
         $plugin_changelog = isset($this->_plugins[$init]['info']['changelog']) ? $this->_plugins[$init]['info']['changelog'] : '';
         $changelogs[$init] = $this->in_theme_update_message($this->_plugins[$init], $plugin_changelog, $changelog_id, false);
     }
     $localize_script_args = array('registered' => $this->_plugins, 'activated' => YIT_Plugin_Licence()->get_activated_products(), 'licence_activation_url' => YIT_Plugin_Licence()->get_licence_activation_page_url(), 'update_url' => $update_url, 'details_url' => $details_url, 'strings' => $strings, 'changelogs' => $changelogs);
     yit_enqueue_script('yit-multisite-updater', YIT_CORE_PLUGIN_URL . '/assets/js/multisite-updater.min.js', array('jquery'), false, true);
     wp_localize_script('yit-multisite-updater', 'plugins', $localize_script_args);
 }
Esempio n. 3
0
    ?>
                </div>
            </li>
            <li>
                <input type="hidden" name="yit_mailpoet_newsletter_form_id" value="<?php 
    echo $post_id;
    ?>
"/>
                <input type="hidden" name="action" value="subscribe_mailpoet_user"/>
                <?php 
    wp_nonce_field('yit_mailpoet_newsletter_form_nonce', 'yit_mailpoet_newsletter_form_nonce');
    ?>
                <input class="button btn submit-field mailpoet-subscription-ajax-submit <?php 
    echo $button_class;
    ?>
" type="button" value="<?php 
    _e('Submit', 'yit');
    ?>
" />
            </li>
        </ul>
    </fieldset>
</form>

<?php 
    yit_enqueue_script('yit-mailpoet-ajax-send-form', YIT_Newsletter()->plugin_assets_url . '/js/mailpoet-ajax-subscribe.js', array('jquery'), '', true);
    wp_localize_script('yit-mailpoet-ajax-send-form', 'mailpoet_localization', array('url' => admin_url('admin-ajax.php'), 'error_message' => 'Ops! Something went wrong'));
}
?>

    echo '<label for="yit_mailchimp_newsletter_form_email">' . $email_label . '</label>';
}
?>
                <div class="newsletter_form_email">
                    <input type="text" <?php 
echo $placeholder_email;
?>
 name="yit_mailchimp_newsletter_form_email" id="yit_mailchimp_newsletter_form_email" class="email-field text-field autoclear" />
                </div>
            </li>
            <li class="ypop-submit">
                <input type="hidden" name="yit_mailchimp_newsletter_form_id" value="<?php 
echo $popup_id;
?>
"/>
                <input type="hidden" name="action" value="ypop_subscribe_mailchimp_user"/>
                <?php 
wp_nonce_field('yit_mailchimp_newsletter_form_nonce', 'yit_mailchimp_newsletter_form_nonce');
?>
                <button type="submit" class="btn submit-field mailchimp-subscription-ajax-submit"><?php 
echo $submit_icon . $submit_label;
?>
</button>
            </li>
        </ul>
    </fieldset>
</form>
</div>
<?php 
yit_enqueue_script('yit-mailchimp-ajax-send-form', YITH_YPOP_ASSETS_URL . '/js/mailchimp-ajax-subscribe.js', array('jquery'), '', true);
wp_localize_script('yit-mailchimp-ajax-send-form', 'mailchimp_localization', array('url' => admin_url('admin-ajax.php'), 'error_message' => 'Ops! Something went wrong'));
Esempio n. 5
0
<?php

/**
 * This file belongs to the YIT Plugin Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
yit_enqueue_script('yit-testimonial', YIT_Testimonial()->plugin_assets_url . '/js/yit-testimonial-frontend.min.js', array('jquery'), null, true);
yit_enqueue_script('owl-carousel', YIT_Testimonial()->plugin_assets_url . '/js/owl.carousel.min.js', array('jquery'));
wp_reset_query();
$args = array('post_type' => 'testimonial');
$args['posts_per_page'] = isset($items) && $items != '' ? $items : -1;
if (isset($cat) && !empty($cat)) {
    $cat = array_map('trim', explode(',', $cat));
    $args['tax_query'] = array(array('taxonomy' => 'category-testimonial', 'field' => 'id', 'terms' => $cat));
}
$options = get_option('yit_testimonial_options');
$text_type = YIT_Testimonial()->get_option('text-type-testimonials');
$limit_words = YIT_Testimonial()->get_option('limit-words-testimonials');
$limit = $limit_words != '' ? $limit_words : 50;
$thumbnail = YIT_Testimonial()->get_option('thumbnail-testimonials') == '' ? 'yes' : YIT_Testimonial()->get_option('thumbnail-testimonials');
$tests = new WP_Query($args);
if (!$tests->have_posts()) {
    return false;
Esempio n. 6
0
        echo '<a href="#" class="bwWrapper" >';
    }
    $image_id = get_post_thumbnail_id();
    $image_url = wp_get_attachment_image_src($image_id, 'full');
    $image_url = $image_url[0];
    echo '<img src="' . $image_url . '" style="max-height: ' . $height . 'px;" class="logo" />';
    echo '</a>';
    ?>
                    </li>
                <?php 
}
wp_reset_query();
?>
            </ul>
        </div>
        <div class="clear"></div>

        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</div>
<div class="clear"></div>

<?php 
yit_enqueue_script('jquery-imagesloaded', YIT_Logos()->plugin_assets_url . '/js/jquery.imagesloaded.min.js', array('jquery'), '', true);
yit_enqueue_script('owl-carousel', YIT_Logos()->plugin_assets_url . '/js/owl.carousel.min.js', array('jquery'), '', true);
if ($active_bw == 'yes') {
    yit_enqueue_script('black-and-white', YIT_Logos()->plugin_assets_url . '/js/jQuery.BlackAndWhite.js', array('jquery'), '', true);
}
echo $html;
add_action('wp_footer', array(YIT_Logos(), 'add_handler'), 30);
Esempio n. 7
0
 /**
  * Enqueue script and styles in frontend side
  *
  * Add style and scripts to frontend
  *
  * @return void
  * @since    1.0
  * @author   Emanuela Castorina <*****@*****.**>
  */
 public function enqueue_scripts() {
     yit_enqueue_script( 'yit-faq-frontend', $this->plugin_assets_url . '/js/yit-faq-frontend.min.js', array( 'jquery' ), $this->version, true );
     yit_enqueue_style( 'yit-faq', $this->plugin_assets_url . '/css/yit-faq.css', $this->version );
 }
Esempio n. 8
0
/**
 * This file belongs to the YIT Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
/**
 * @use \YIT_Feature_Tab_Object $features_tab
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
yit_enqueue_script('yit-feature-tab', $baseurl . '/assets/js/featurestab.min.js', array('jquery'), '', true);
$features_label = '';
$features_content = '';
$i = 0;
if ($features_tab->have_posts()) {
    while ($features_tab->have_posts()) {
        $features_tab->the_post();
        $current = $i == 0 ? ' current-feature' : '';
        $the_label = '<li class="features-tab-' . $i . $current . '"><h4><a href="javascript:void();">';
        if (has_post_thumbnail()) {
            $the_label .= $features_tab->get_image();
        }
        $the_label .= $features_tab->get('title');
        $the_label .= '</a></h4></li>';
        $the_content = '<div class="features-tab-content features-tab-' . $i . ' ' . $current . '">' . apply_filters('the_content', $features_tab->get('content')) . '</div>';
        $features_label .= $the_label;
 /**
  * Enqueue script and styles in frontend side
  *
  * Add style and scripts to frontend
  *
  * @return void
  * @since    1.0
  * @author   Emanuela Castorina <*****@*****.**>
  */
 public function enqueue_scripts()
 {
     yit_enqueue_style('yit-testimonial', $this->plugin_assets_url . '/css/yit-testimonial.css', $this->version);
     yit_enqueue_script('yit-testimonial', $this->plugin_assets_url . '/js/yit-testimonial-frontend.js', $this->version);
 }
Esempio n. 10
0
 /**
  * Enqueue scripts and stylesheets
  *
  * @param $hook
  *
  * @since  Version 2.0.0
  * @author Simone D'Amico <*****@*****.**>
  * @return void
  */
 public function enqueue($hook)
 {
     wp_enqueue_style('yit-panel', YIT_CORE_ASSETS_URL . '/css/panel.css');
     if (strpos(YIT_Request()->get('page'), 'yit_panel') !== false) {
         wp_enqueue_style('jquery-ui-overcast', YIT_CORE_ASSETS_URL . '/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
         wp_enqueue_style('yit-font-awesome', YIT_CORE_ASSETS_URL . '/css/font-awesome.min.css', false, '', 'all');
         wp_enqueue_style('wp-color-picker');
         wp_enqueue_media();
         wp_enqueue_script('jquery-ui');
         wp_enqueue_script('jquery-ui-core');
         wp_enqueue_script('jquery-ui-mouse');
         wp_enqueue_script('jquery-ui-button');
         wp_enqueue_script('jquery-ui-dialog');
         wp_enqueue_script('jquery-ui-slider');
         wp_enqueue_script('jquery-ui-widget');
         wp_enqueue_script('jquery-ui-sortable');
         yit_enqueue_script('yit-panel', YIT_CORE_ASSETS_URL . '/js/admin/panel.js', array('jquery'), YIT_CORE_VERSION, true);
         yit_enqueue_script('yit-spinner', YIT_CORE_ASSETS_URL . '/js/admin/panel.spinner.js', array('jquery'), '0.0.1', true);
         yit_enqueue_script('yit-typography', YIT_CORE_ASSETS_URL . '/js/admin/panel.typography.js', array('jquery'), '0.0.1', true);
         yit_enqueue_script('yit-types', YIT_CORE_ASSETS_URL . '/js/admin/panel.types.js', array('jquery', 'wp-color-picker'), YIT_CORE_VERSION, true);
         wp_localize_script('yit-panel', 'yit_panel_l10n', array('submit_loading' => __('Loading...', 'yit'), 'yit_panel_refresh_color_nonce' => YIT_Request()->create_nonce('refresh-color')));
     }
 }