• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_account_page函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mango_current_page_id

function mango_current_page_id()
{
    global $post, $wp_query;
    $current_page_id = '';
    // Get The Page ID You Need
    //wp_reset_postdata();
    if (class_exists("woocommerce")) {
        if (is_shop()) {
            ///|| is_product_category() || is_product_tag()) {
            $current_page_id = get_option('woocommerce_shop_page_id');
        } elseif (is_cart()) {
            $current_page_id = get_option('woocommerce_cart_page_id');
        } elseif (is_checkout()) {
            $current_page_id = get_option('woocommerce_checkout_page_id');
        } elseif (is_account_page()) {
            $current_page_id = get_option('woocommerce_myaccount_page_id');
        } elseif (is_view_order_page()) {
            $current_page_id = get_option('woocommerce_view_order_page_id');
        }
    }
    if ($current_page_id == '') {
        if (is_home() && is_front_page()) {
            $current_page_id = '';
        } elseif (is_home()) {
            $current_page_id = get_option('page_for_posts');
        } elseif (is_search() || is_category() || is_tag() || is_tax()) {
            $current_page_id = '';
            //}elseif(class_exists("woocommerce") && (is_shop() || is_product_category() || is_cart() || is_checkout() || is_account_page() || is_view_order_page() )){
            // $current_page_id = '';
        } elseif (!is_404()) {
            $current_page_id = $post->ID;
        }
    }
    return $current_page_id;
}
开发者ID:nickkoskowski,项目名称:Work-Depot,代码行数:35,代码来源:general.php


示例2: geolocation_ajax_redirect

 /**
  * When using geolocation via ajax, to bust cache, redirect if the location hash does not equal the querystring.
  *
  * This prevents caching of the wrong data for this request.
  */
 public static function geolocation_ajax_redirect()
 {
     if ('geolocation_ajax' === get_option('woocommerce_default_customer_address') && !is_checkout() && !is_cart() && !is_account_page() && !is_ajax() && empty($_POST)) {
         $location_hash = self::geolocation_ajax_get_location_hash();
         $current_hash = isset($_GET['v']) ? wc_clean($_GET['v']) : '';
         if (empty($current_hash) || $current_hash !== $location_hash) {
             global $wp;
             $redirect_url = trailingslashit(home_url($wp->request));
             if (!get_option('permalink_structure')) {
                 $redirect_url = add_query_arg($wp->query_string, '', $redirect_url);
             }
             $redirect_url = add_query_arg('v', $location_hash, remove_query_arg('v', $redirect_url));
             wp_safe_redirect(esc_url_raw($redirect_url), 307);
             exit;
         }
     }
 }
开发者ID:Karanadmin,项目名称:woocommerce,代码行数:22,代码来源:class-wc-cache-helper.php


示例3: flatsome_admin_bar_helper

function flatsome_admin_bar_helper()
{
    global $wp_admin_bar;
    $optionUrl = get_admin_url() . 'themes.php?page=optionsframework';
    $adminUrl = get_admin_url();
    if (is_category() || is_home()) {
        $wp_admin_bar->add_menu(array('parent' => false, 'id' => 'admin_bar_helper', 'title' => 'Blog Layout', 'href' => $optionUrl . '&tab=of-option-blog'));
    }
    if (ux_is_woocommerce_active()) {
        if (is_checkout() || is_cart()) {
            $wp_admin_bar->add_menu(array('parent' => false, 'id' => 'admin_bar_helper', 'title' => 'Checkout Settings', 'href' => $adminUrl . 'admin.php?page=wc-settings&tab=checkout'));
        }
        if (is_product()) {
            $wp_admin_bar->add_menu(array('parent' => false, 'id' => 'admin_bar_helper', 'title' => 'Product Page Layout', 'href' => $optionUrl . '&tab=of-option-productpage'));
        }
        if (is_account_page()) {
            $wp_admin_bar->add_menu(array('parent' => false, 'id' => 'admin_bar_helper', 'title' => 'My Account Page', 'href' => $adminUrl . 'admin.php?page=wc-settings&tab=account'));
        }
        if (is_shop() || is_product_category()) {
            $wp_admin_bar->add_menu(array('parent' => false, 'id' => 'admin_bar_helper', 'title' => 'Shop Settings'));
            $wp_admin_bar->add_menu(array('parent' => 'admin_bar_helper', 'id' => 'admin_bar_helper_flatsome', 'title' => 'Category Page Layout', 'href' => $optionUrl . '&tab=of-option-categorypage'));
            $wp_admin_bar->add_menu(array('parent' => 'admin_bar_helper', 'id' => 'admin_bar_helper_woocommerce', 'title' => 'Shop Page Display', 'href' => $adminUrl . 'admin.php?page=wc-settings&tab=products&section=display'));
        }
    }
}
开发者ID:B1aZer,项目名称:yaltatoys_wp,代码行数:25,代码来源:helpers.php


示例4: add_scripts

 /**
  * Add the scripts
  */
 public function add_scripts()
 {
     if (is_account_page() || is_order_received_page() || $this->is_woocommerce_tracking_page()) {
         wp_enqueue_script('woocommerce-delivery-notes-print-link', WooCommerce_Delivery_Notes::$plugin_url . 'js/jquery.print-link.js', array('jquery'));
         wp_enqueue_script('woocommerce-delivery-notes-theme', WooCommerce_Delivery_Notes::$plugin_url . 'js/theme.js', array('jquery', 'woocommerce-delivery-notes-print-link'));
     }
 }
开发者ID:flasomm,项目名称:Montkailash,代码行数:10,代码来源:class-wcdn-theme.php


示例5: xt_get_page_ID

function xt_get_page_ID()
{
    global $wp_query, $post;
    $page_id = false;
    if (is_home() && get_option('page_for_posts')) {
        $page_id = get_option('page_for_posts');
    } elseif (is_front_page() && get_option('page_on_front')) {
        $page_id = get_option('page_on_front');
    } else {
        if (function_exists('is_shop') && is_shop() && get_option('woocommerce_shop_page_id') != '') {
            $page_id = get_option('woocommerce_shop_page_id');
        } else {
            if (function_exists('is_cart') && is_cart() && get_option('woocommerce_cart_page_id') != '') {
                $page_id = get_option('woocommerce_cart_page_id');
            } else {
                if (function_exists('is_checkout') && is_checkout() && get_option('woocommerce_checkout_page_id') != '') {
                    $page_id = get_option('woocommerce_checkout_page_id');
                } else {
                    if (function_exists('is_account_page') && is_account_page() && get_option('woocommerce_myaccount_page_id') != '') {
                        $page_id = get_option('woocommerce_myaccount_page_id');
                    } else {
                        if ($wp_query && !empty($wp_query->queried_object) && !empty($wp_query->queried_object->ID)) {
                            $page_id = $wp_query->queried_object->ID;
                        } else {
                            if (!empty($post->ID)) {
                                $page_id = $post->ID;
                            }
                        }
                    }
                }
            }
        }
    }
    return $page_id;
}
开发者ID:venturepact,项目名称:blog,代码行数:35,代码来源:functions.php


示例6: woodrobe_body_class

function woodrobe_body_class($classes)
{
    if (is_woocommerce() || is_cart() || is_checkout() || is_account_page()) {
        $classes[] = 'woodrobe';
    }
    return $classes;
}
开发者ID:peterjohnhunt,项目名称:woodrobe,代码行数:7,代码来源:woodrobe.php


示例7: redirect_reset_password_link

 /**
  * Remove key and login from querystring, set cookie, and redirect to account page to show the form.
  */
 public static function redirect_reset_password_link()
 {
     if (is_account_page() && !empty($_GET['key']) && !empty($_GET['login'])) {
         $value = sprintf('%s:%s', wp_unslash($_GET['login']), wp_unslash($_GET['key']));
         WC_Shortcode_My_Account::set_reset_password_cookie($value);
         wp_safe_redirect(add_query_arg('show-reset-form', 'true', wc_lostpassword_url()));
         exit;
     }
 }
开发者ID:johnulist,项目名称:woocommerce,代码行数:12,代码来源:class-wc-form-handler.php


示例8: ci_theme_woo_pages_fullwidth_option

 function ci_theme_woo_pages_fullwidth_option($value, $object_id, $meta_key, $single)
 {
     if ('page_layout' == $meta_key) {
         if (woocommerce_enabled() && (is_cart() || is_checkout() || is_account_page())) {
             return 'full';
         }
     }
     return $value;
 }
开发者ID:sbhambad,项目名称:TimousDemo,代码行数:9,代码来源:template_hooks.php


示例9: kadence_sidebar_id

function kadence_sidebar_id()
{
    if (is_front_page()) {
        global $virtue;
        if (!empty($virtue['home_sidebar'])) {
            $sidebar = $virtue['home_sidebar'];
        } else {
            $sidebar = 'sidebar-primary';
        }
    } else {
        if (class_exists('woocommerce') and is_shop() || is_product_category() || is_product_tag()) {
            global $virtue;
            if (!empty($virtue['shop_sidebar'])) {
                $sidebar = $virtue['shop_sidebar'];
            } else {
                $sidebar = 'sidebar-primary';
            }
        } elseif (class_exists('woocommerce') and is_account_page()) {
            get_template_part('templates/account', 'sidebar');
            $sidebar = "";
        } elseif (is_page_template('page-blog.php') || is_page_template('page-sidebar.php') || is_page_template('page-feature-sidebar.php') || get_post_type() == 'post') {
            global $post;
            $sidebar_name = get_post_meta($post->ID, '_kad_sidebar_choice', true);
            if (!empty($sidebar_name)) {
                $sidebar = $sidebar_name;
            } else {
                $sidebar = 'sidebar-primary';
            }
        } else {
            if (is_archive()) {
                $sidebar = 'sidebar-primary';
            } else {
                if (is_category()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_tag()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_post_type_archive()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_day()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_month()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_year()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_author()) {
                    $sidebar = 'sidebar-primary';
                } elseif (is_search()) {
                    $sidebar = 'sidebar-primary';
                } else {
                    $sidebar = 'sidebar-primary';
                }
            }
        }
    }
    return apply_filters('kadence_sidebar_id', $sidebar);
}
开发者ID:neruub,项目名称:shop_sda,代码行数:56,代码来源:sidebar.php


示例10: kt_wc_print_notices

function kt_wc_print_notices()
{
    if (class_exists('woocommerce')) {
        if (!is_shop() and !is_woocommerce() and !is_cart() and !is_checkout() and !is_account_page()) {
            echo '<div class="container">';
            echo do_shortcode('[woocommerce_messages]');
            echo '</div>';
        }
    }
}
开发者ID:MikeBu,项目名称:wp-fm.com,代码行数:10,代码来源:custom-woocommerce.php


示例11: frontend_scripts

 /**
  * Front end styles and scripts.
  *
  * @since  1.0.0
  * @access public
  * @return void
  */
 public static function frontend_scripts()
 {
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     // My Account Page
     if (is_account_page()) {
         //wp_register_style( 'wcso-css', WCSO_PLUGIN_URL . '/assets/css/wcso-style' . $suffix . '.css', false, WCSO_VERSION, 'all' );
         wp_register_style('wcso-css', WCSO_PLUGIN_URL . '/assets/css/wcso-style.css', false, WCSO_VERSION, 'all');
         wp_enqueue_style('wcso-css');
     }
 }
开发者ID:AnimalsCode,项目名称:WooCommerce-Skip-One,代码行数:17,代码来源:class-wcso-display.php


示例12: change_endpoint_title

 /**
  * Changes page title on view subscription page
  *
  * @param  string $title original title
  * @return string        changed title
  */
 public function change_endpoint_title($title)
 {
     if (in_the_loop() && is_account_page()) {
         foreach ($this->query_vars as $key => $query_var) {
             if ($this->is_query($query_var)) {
                 $title = $this->get_endpoint_title($key);
             }
         }
     }
     return $title;
 }
开发者ID:DustinHartzler,项目名称:TheCLEFT,代码行数:17,代码来源:class-wcs-query.php


示例13: change_my_products_endpoint_title

 function change_my_products_endpoint_title($title)
 {
     global $wp_query;
     $is_endpoint = isset($wp_query->query_vars['wcj-my-products']);
     if ($is_endpoint && !is_admin() && is_main_query() && in_the_loop() && is_account_page()) {
         // New page title.
         $title = __('Products', 'woocommerce-jetpack');
         remove_filter('the_title', array($this, 'change_my_products_endpoint_title'));
     }
     return $title;
 }
开发者ID:algoritmika,项目名称:woocommerce-jetpack,代码行数:11,代码来源:class-wcj-product-by-user.php


示例14: cuttz_woo_pages_customization

function cuttz_woo_pages_customization()
{
    if (is_product() || is_checkout() || is_account_page()) {
        add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
    }
    // Disable the custom widget areas on certain pages
    if (is_woocommerce() || is_cart() || is_checkout() || is_account_page()) {
        remove_action('genesis_before_header', 'cuttz_sidebar_before_header');
        remove_action('genesis_after_header', 'cuttz_sidebar_after_header');
        remove_action('genesis_before_footer', 'cuttz_sidebar_above_footer', 5);
    }
}
开发者ID:garywp,项目名称:cuttz-framework,代码行数:12,代码来源:cuttz-woocommerce.php


示例15: enqueue_scripts

 /**
  * Register and enqueues public-facing style sheet and JavaScript files.
  */
 public function enqueue_scripts()
 {
     // Load scripts only in checkout.
     if (is_checkout() || is_account_page()) {
         // Get plugin settings.
         $settings = get_option('wcbcf_settings');
         // Call jQuery.
         wp_enqueue_script('jquery');
         // Fix checkout fields.
         wp_enqueue_script('woocommerce-extra-checkout-fields-for-brazil-front', plugins_url('assets/js/frontend/frontend.min.js', plugin_dir_path(__FILE__)), array('jquery'), Extra_Checkout_Fields_For_Brazil::VERSION, true);
         wp_localize_script('woocommerce-extra-checkout-fields-for-brazil-front', 'wcbcf_public_params', array('state' => __('State', 'woocommerce-extra-checkout-fields-for-brazil'), 'required' => __('required', 'woocommerce-extra-checkout-fields-for-brazil'), 'mailcheck' => isset($settings['mailcheck']) ? 'yes' : 'no', 'maskedinput' => isset($settings['maskedinput']) ? 'yes' : 'no', 'addresscomplete' => isset($settings['addresscomplete']) ? 'yes' : 'no', 'person_type' => $settings['person_type'], 'only_brazil' => isset($settings['only_brazil']) ? 'yes' : 'no'));
     }
 }
开发者ID:pensesmart,项目名称:woocommerce-extra-checkout-fields-for-brazil,代码行数:16,代码来源:class-wc-ecfb-front-end.php


示例16: sidebar_options

 /**
  * Get sidebar settings based on the page type
  *
  * @return array
  */
 public function sidebar_options()
 {
     if (is_home()) {
         $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
     } elseif (function_exists('is_bbpress') && is_bbpress()) {
         $sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
         if (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search()) {
             $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
         }
     } elseif (function_exists('is_buddypress') && is_buddypress()) {
         $sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
     } elseif (class_exists('WooCommerce') && (is_product() || is_shop())) {
         $sidebars = array('global' => Avada()->settings->get('woo_global_sidebar'), 'sidebar_1' => Avada()->settings->get('woo_sidebar'), 'sidebar_2' => Avada()->settings->get('woo_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
     } elseif (class_exists('WooCommerce') && (is_product_category() || is_product_tag())) {
         $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('woocommerce_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('woocommerce_archive_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
     } elseif (is_page()) {
         $sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
     } elseif (is_single()) {
         $sidebars = array('global' => Avada()->settings->get('posts_global_sidebar'), 'sidebar_1' => Avada()->settings->get('posts_sidebar'), 'sidebar_2' => Avada()->settings->get('posts_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
         if (is_singular('avada_portfolio')) {
             $sidebars = array('global' => Avada()->settings->get('portfolio_global_sidebar'), 'sidebar_1' => Avada()->settings->get('portfolio_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
         } else {
             if (is_singular('tribe_events') || is_singular('tribe_organizer') || is_singular('tribe_venue')) {
                 $sidebars = array('global' => Avada()->settings->get('ec_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
             }
         }
         if (is_singular('tribe_organizer') || is_singular('tribe_venue')) {
             $sidebars['global'] = 1;
         }
     } elseif (is_archive()) {
         $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
         if (is_post_type_archive('avada_portfolio') || is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags')) {
             $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('portfolio_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_archive_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
         }
     } elseif (is_search()) {
         $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('search_sidebar'), 'sidebar_2' => Avada()->settings->get('search_sidebar_2'), 'position' => Avada()->settings->get('search_sidebar_position'));
     } else {
         $sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
     }
     if (class_exists('Tribe__Events__Main') && is_events_archive()) {
         $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
     }
     // Remove sidebars from the certain woocommerce pages
     if (class_exists('WooCommerce')) {
         if (is_cart() || is_checkout() || is_account_page() || get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))) {
             $sidebars = array();
         }
     }
     return $sidebars;
 }
开发者ID:Aldebaran10,项目名称:avada,代码行数:55,代码来源:class-avada-layout.php


示例17: render_social_login_buttons

 /**
  * Render social login buttons on frontend
  *
  * @since 1.0
  */
 public function render_social_login_buttons()
 {
     if (!is_checkout() && !is_account_page()) {
         return;
     }
     if (is_checkout() && !$this->is_displayed_on('checkout')) {
         return;
     }
     if (is_account_page() && !$this->is_displayed_on('my_account')) {
         return;
     }
     $return_url = is_checkout() ? WC()->cart->get_checkout_url() : wc_get_page_permalink('myaccount');
     woocommerce_social_login_buttons($return_url);
 }
开发者ID:pcuervo,项目名称:dabba,代码行数:19,代码来源:class-wc-social-login-frontend.php


示例18: woocommerce_template_redirect

/**
 * Handle redirects before content is output - hooked into template_redirect so is_page works.
 *
 * @access public
 * @return void
 */
function woocommerce_template_redirect()
{
    global $woocommerce, $wp_query;
    // When default permalinks are enabled, redirect shop page to post type archive url
    if (!empty($_GET['page_id']) && get_option('permalink_structure') == "" && $_GET['page_id'] == woocommerce_get_page_id('shop')) {
        wp_safe_redirect(get_post_type_archive_link('product'));
        exit;
    } elseif (is_page(woocommerce_get_page_id('checkout')) && sizeof($woocommerce->cart->get_cart()) == 0) {
        wp_redirect(get_permalink(woocommerce_get_page_id('cart')));
        exit;
    } elseif (is_page(woocommerce_get_page_id('pay')) && !isset($_GET['order'])) {
        wp_redirect(get_permalink(woocommerce_get_page_id('checkout')));
        exit;
    } elseif (!is_user_logged_in() && (is_page(woocommerce_get_page_id('edit_address')) || is_page(woocommerce_get_page_id('view_order')) || is_page(woocommerce_get_page_id('change_password')))) {
        wp_redirect(get_permalink(woocommerce_get_page_id('myaccount')));
        exit;
    } elseif (is_page(woocommerce_get_page_id('logout'))) {
        wp_redirect(str_replace('&amp;', '&', wp_logout_url(get_permalink(woocommerce_get_page_id('myaccount')))));
        exit;
    } elseif (is_search() && is_post_type_archive('product')) {
        if ($wp_query->post_count == 1) {
            $product = get_product($wp_query->post);
            if ($product->is_visible()) {
                wp_safe_redirect(get_permalink($product->id), 302);
            }
            exit;
        }
    } elseif (get_option('woocommerce_force_ssl_checkout') == 'yes' && !is_ssl()) {
        if (is_checkout() || is_account_page() || apply_filters('woocommerce_force_ssl_checkout', false)) {
            if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
                wp_safe_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI']));
                exit;
            } else {
                wp_safe_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
                exit;
            }
        }
    } elseif (get_option('woocommerce_force_ssl_checkout') == 'yes' && get_option('woocommerce_unforce_ssl_checkout') == 'yes' && is_ssl() && $_SERVER['REQUEST_URI'] && !is_checkout() && !is_page(woocommerce_get_page_id('thanks')) && !is_ajax() && !is_account_page() && apply_filters('woocommerce_unforce_ssl_checkout', true)) {
        if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) {
            wp_safe_redirect(preg_replace('|^https://|', 'http://', $_SERVER['REQUEST_URI']));
            exit;
        } else {
            wp_safe_redirect('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
            exit;
        }
    } elseif (is_checkout()) {
        ob_start();
    }
}
开发者ID:googlecode-mirror,项目名称:wpmu-demo,代码行数:55,代码来源:woocommerce-functions.php


示例19: woocommerce_stripe_handle_delete_card

 /**
  * Delete card
  * @return [type]
  */
 function woocommerce_stripe_handle_delete_card()
 {
     global $woocommerce;
     if (!isset($_POST['stripe_delete_card']) || !is_account_page()) {
         return;
     }
     if (!is_user_logged_in() || !wp_verify_nonce($_POST['_wpnonce'], "stripe_del_card")) {
         wp_die(__('Unable to verify deletion, please try again', 'wc_stripe'));
     }
     $credit_card = $credit_cards[(int) $_POST['stripe_delete_card']];
     delete_user_meta(get_current_user_id(), '_stripe_customer_id', $credit_card);
     $woocommerce->add_message(__('Card deleted.', 'wc_stripe'));
     wp_safe_redirect(get_permalink(woocommerce_get_page_id('myaccount')));
     exit;
 }
开发者ID:bulats,项目名称:chef,代码行数:19,代码来源:gateway-stripe.php


示例20: shop_navigation

    function shop_navigation()
    {
        if (is_woocommerce() || is_cart() || is_checkout() || is_account_page()) {
            ?>
		<div id="shop-nav">
			<div class="left-sec">
				<ul>
					<li><a href="#">FAQ's</a></li>
					<li><a href="/my-account">My Account</a></li>
				</ul>
			</div>
			<div class="right-sec">
				<div class="cart">
					<?php 
            if (is_cart()) {
                ?>
						<a href="/shop">
							<span class="glyphicon glyphicon-shopping-cart"></span>
							<small>Back to Shop</small>
						</a>
					<?php 
            } else {
                ?>
						<a class="cart-contents" href="<?php 
                echo !empty(WC()->cart->cart_contents) ? '/cart' : '/shop';
                ?>
">
							<span class="glyphicon glyphicon-shopping-cart"></span>
							<?php 
                if (!empty(WC()->cart->cart_contents)) {
                    ?>
							<?php 
                    echo WC()->cart->get_cart_contents_count();
                    ?>
							<?php 
                }
                ?>
						</a>
					<?php 
            }
            ?>
				</div>
			</div>
		</div>
		<?php 
        }
    }
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:47,代码来源:woocommerce.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_active函数代码示例发布时间:2022-05-15
下一篇:
PHP is_absolute函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap