本文整理汇总了PHP中is_account_page函数的典型用法代码示例。如果您正苦于以下问题:PHP is_account_page函数的具体用法?PHP is_account_page怎么用?PHP is_account_page使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_account_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
}
}
示例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§ion=display'));
}
}
}
示例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'));
}
}
示例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;
}
示例6: woodrobe_body_class
function woodrobe_body_class($classes)
{
if (is_woocommerce() || is_cart() || is_checkout() || is_account_page()) {
$classes[] = 'woodrobe';
}
return $classes;
}
示例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;
}
}
示例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;
}
示例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);
}
示例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>';
}
}
}
示例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');
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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