当前位置: 首页>>代码示例>>PHP>>正文


PHP porto_get_woo_version_number函数代码示例

本文整理汇总了PHP中porto_get_woo_version_number函数的典型用法代码示例。如果您正苦于以下问题:PHP porto_get_woo_version_number函数的具体用法?PHP porto_get_woo_version_number怎么用?PHP porto_get_woo_version_number使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了porto_get_woo_version_number函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: porto_mobile_menu

function porto_mobile_menu()
{
    global $porto_settings;
    $html = '';
    if (isset($porto_settings['menu-login-pos']) && $porto_settings['menu-login-pos'] == 'main_menu') {
        if (is_user_logged_in()) {
            $logout_link = '';
            if (class_exists('WooCommerce')) {
                $logout_link = version_compare(porto_get_woo_version_number(), '2.3', '<') ? wp_logout_url(wc_get_page_permalink('myaccount')) : wc_get_endpoint_url('customer-logout', '', wc_get_page_permalink('myaccount'));
            } else {
                $logout_link = wp_logout_url(get_home_url());
            }
            $html .= '<li class="menu-item"><a href="' . $logout_link . '"><i class="avatar">' . get_avatar(get_current_user_id(), $size = '24') . '</i>' . __('Logout', 'porto') . '</a></li>';
        } else {
            $login_link = $register_link = '';
            if (class_exists('WooCommerce')) {
                $login_link = wc_get_page_permalink('myaccount');
                if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
                    $register_link = wc_get_page_permalink('myaccount');
                }
            } else {
                $login_link = wp_login_url(get_home_url());
                $active_signup = get_site_option('registration', 'none');
                $active_signup = apply_filters('wpmu_active_signup', $active_signup);
                if ($active_signup != 'none') {
                    $register_link = wp_registration_url(get_home_url());
                }
            }
            $html .= '<li class="menu-item"><a href="' . $login_link . '"><i class="fa fa-user"></i>' . __('Login', 'porto') . '</a></li>';
            if ($register_link && isset($porto_settings['menu-enable-register']) && $porto_settings['menu-enable-register']) {
                $html .= '<li class="menu-item"><a href="' . $register_link . '"><i class="fa fa-user-plus"></i>' . __('Register', 'porto') . '</a></li>';
            }
        }
    }
    ob_start();
    $main_menu = porto_get_meta_value('main_menu');
    if (has_nav_menu('main_menu') || $main_menu) {
        $args = array('container' => '', 'menu_class' => 'mobile-menu accordion-menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'fallback_cb' => false, 'walker' => new porto_accordion_navwalker());
        if ($main_menu) {
            $args['menu'] = $main_menu;
        } else {
            $args['theme_location'] = 'main_menu';
        }
        wp_nav_menu($args);
    }
    $output = str_replace('&nbsp;', '', ob_get_clean());
    // sidebar menu
    ob_start();
    $sidebar_menu = porto_get_meta_value('sidebar_menu');
    if (has_nav_menu('sidebar_menu') || $sidebar_menu) {
        $args = array('container' => '', 'menu_class' => 'mobile-menu accordion-menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'fallback_cb' => false, 'walker' => new porto_accordion_navwalker());
        if ($sidebar_menu) {
            $args['menu'] = $sidebar_menu;
        } else {
            $args['theme_location'] = 'sidebar_menu';
        }
        wp_nav_menu($args);
    }
    $output .= str_replace('&nbsp;', '', ob_get_clean());
    if ($output && $html) {
        $output = preg_replace('/<\\/ul>$/', $html . '</ul>', $output, 1);
    } else {
        if (!$output && $html) {
            $output = '<ul class="' . 'mobile-menu accordion-menu' . '" id="menu-main-menu">' . $html . '</ul>';
        }
    }
    return apply_filters('porto_mobile_menu', $output);
}
开发者ID:booklein,项目名称:wpbookle,代码行数:68,代码来源:layout.php

示例2: class_exists

 * will need to copy the new files to your theme to maintain compatibility. We try to do this.
 * as little as possible, but it does happen. When this occurs the version of the template file will.
 * be bumped and the readme will list any important changes.
 *
 * @see 	    http://docs.woothemes.com/document/template-structure/
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.5.0
 */
if (!defined('ABSPATH')) {
    exit;
}
global $porto_settings, $product;
$wishlist = class_exists('YITH_WCWL') && $porto_settings['product-wishlist'];
$quickview = $porto_settings['product-quickview'];
$porto_woo_version = porto_get_woo_version_number();
?>
<div class="add-links-wrap">
    <div class="add-links <?php 
if (!$wishlist && !$quickview) {
    echo 'no-effect';
}
?>
 clearfix">
        <?php 
global $porto_settings;
$catalog_mode = false;
if ($porto_settings['catalog-enable']) {
    if ($porto_settings['catalog-admin'] || !$porto_settings['catalog-admin'] && !(current_user_can('administrator') && is_user_logged_in())) {
        if (!$porto_settings['catalog-cart']) {
            $catalog_mode = true;
开发者ID:booklein,项目名称:wpbookle,代码行数:31,代码来源:add-to-cart.php

示例3: force_balance_tags

 ?>
                 </div>
                 <?php 
 if ($porto_settings['menu-block']) {
     ?>
                 <div class="col-md-9">
                     <div class="menu-custom-block">
                         <?php 
     echo force_balance_tags($porto_settings['menu-block']);
     ?>
                         <?php 
     if (isset($porto_settings['menu-login-pos']) && $porto_settings['menu-login-pos'] == 'main_menu') {
         if (is_user_logged_in()) {
             $logout_link = '';
             if (class_exists('WooCommerce')) {
                 $logout_link = version_compare(porto_get_woo_version_number(), '2.3', '<') ? wp_logout_url(wc_get_page_permalink('myaccount')) : wc_get_endpoint_url('customer-logout', '', wc_get_page_permalink('myaccount'));
             } else {
                 $logout_link = wp_logout_url(get_home_url());
             }
             echo '<a class="' . (is_rtl() ? 'pull-left p-l-none' : 'pull-right p-r-none') . '" href="' . $logout_link . '"><i class="avatar">' . get_avatar(get_current_user_id(), $size = '24') . '</i>' . __('Logout', 'porto') . '</a>';
         } else {
             $login_link = $register_link = '';
             if (class_exists('WooCommerce')) {
                 $login_link = wc_get_page_permalink('myaccount');
                 if (get_option('woocommerce_enable_myaccount_registration') === 'yes') {
                     $register_link = wc_get_page_permalink('myaccount');
                 }
             } else {
                 $login_link = wp_login_url(get_home_url());
                 $active_signup = get_site_option('registration', 'none');
                 $active_signup = apply_filters('wpmu_active_signup', $active_signup);
开发者ID:booklein,项目名称:wpbookle,代码行数:31,代码来源:header_9.php


注:本文中的porto_get_woo_version_number函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。