本文整理汇总了PHP中wc_processing_order_count函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_processing_order_count函数的具体用法?PHP wc_processing_order_count怎么用?PHP wc_processing_order_count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wc_processing_order_count函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: menu_order_count
/**
* Adds the order processing count to the menu.
*/
public function menu_order_count()
{
global $submenu;
if (isset($submenu['youpzt_store'])) {
// Remove 'WooCommerce' sub menu item
unset($submenu['youpzt_store'][0]);
// Add count if user has access
if (apply_filters('woocommerce_include_processing_order_count_in_menu', true) && current_user_can('manage_youpztstore') && ($order_count = wc_processing_order_count())) {
foreach ($submenu['youpzt_store'] as $key => $menu_item) {
if (0 === strpos($menu_item[0], _x('Orders', 'Admin menu name', 'woocommerce'))) {
$submenu['youpzt_store'][$key][0] .= ' <span class="awaiting-mod update-plugins count-' . $order_count . '"><span class="processing-count">' . number_format_i18n($order_count) . '</span></span>';
break;
}
}
}
}
}
开发者ID:fengdou902,项目名称:youpzt-store,代码行数:20,代码来源:class-youpzt-admin-menus.php
示例2: register_post_types
/**
* Register core post types
*/
public static function register_post_types()
{
if (post_type_exists('product')) {
return;
}
do_action('woocommerce_register_post_type');
$permalinks = get_option('woocommerce_permalinks');
$product_permalink = empty($permalinks['product_base']) ? _x('product', 'slug', 'woocommerce') : $permalinks['product_base'];
register_post_type("product", apply_filters('woocommerce_register_post_type_product', array('labels' => array('name' => __('Products', 'woocommerce'), 'singular_name' => __('Product', 'woocommerce'), 'menu_name' => _x('Products', 'Admin menu name', 'woocommerce'), 'add_new' => __('Add Product', 'woocommerce'), 'add_new_item' => __('Add New Product', 'woocommerce'), 'edit' => __('Edit', 'woocommerce'), 'edit_item' => __('Edit Product', 'woocommerce'), 'new_item' => __('New Product', 'woocommerce'), 'view' => __('View Product', 'woocommerce'), 'view_item' => __('View Product', 'woocommerce'), 'search_items' => __('Search Products', 'woocommerce'), 'not_found' => __('No Products found', 'woocommerce'), 'not_found_in_trash' => __('No Products found in trash', 'woocommerce'), 'parent' => __('Parent Product', 'woocommerce')), 'description' => __('This is where you can add new products to your store.', 'woocommerce'), 'public' => true, 'show_ui' => true, 'capability_type' => 'product', 'map_meta_cap' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => $product_permalink ? array('slug' => untrailingslashit($product_permalink), 'with_front' => false, 'feeds' => true) : false, 'query_var' => true, 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'page-attributes'), 'has_archive' => ($shop_page_id = wc_get_page_id('shop')) && get_page($shop_page_id) ? get_page_uri($shop_page_id) : 'shop', 'show_in_nav_menus' => true)));
register_post_type("product_variation", apply_filters('woocommerce_register_post_type_product_variation', array('label' => __('Variations', 'woocommerce'), 'public' => false, 'hierarchical' => false, 'supports' => false)));
$menu_name = _x('Orders', 'Admin menu name', 'woocommerce');
if ($order_count = wc_processing_order_count()) {
$menu_name .= " <span class='awaiting-mod update-plugins count-{$order_count}'><span class='processing-count'>" . number_format_i18n($order_count) . "</span></span>";
}
register_post_type("shop_order", apply_filters('woocommerce_register_post_type_shop_order', array('labels' => array('name' => __('Orders', 'woocommerce'), 'singular_name' => __('Order', 'woocommerce'), 'add_new' => __('Add Order', 'woocommerce'), 'add_new_item' => __('Add New Order', 'woocommerce'), 'edit' => __('Edit', 'woocommerce'), 'edit_item' => __('Edit Order', 'woocommerce'), 'new_item' => __('New Order', 'woocommerce'), 'view' => __('View Order', 'woocommerce'), 'view_item' => __('View Order', 'woocommerce'), 'search_items' => __('Search Orders', 'woocommerce'), 'not_found' => __('No Orders found', 'woocommerce'), 'not_found_in_trash' => __('No Orders found in trash', 'woocommerce'), 'parent' => __('Parent Orders', 'woocommerce'), 'menu_name' => $menu_name), 'description' => __('This is where store orders are stored.', 'woocommerce'), 'public' => false, 'show_ui' => true, 'capability_type' => 'shop_order', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => current_user_can('manage_woocommerce') ? 'woocommerce' : true, 'hierarchical' => false, 'show_in_nav_menus' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'comments', 'custom-fields'), 'has_archive' => false)));
if (get_option('woocommerce_enable_coupons') == 'yes') {
register_post_type("shop_coupon", apply_filters('woocommerce_register_post_type_shop_coupon', array('labels' => array('name' => __('Coupons', 'woocommerce'), 'singular_name' => __('Coupon', 'woocommerce'), 'menu_name' => _x('Coupons', 'Admin menu name', 'woocommerce'), 'add_new' => __('Add Coupon', 'woocommerce'), 'add_new_item' => __('Add New Coupon', 'woocommerce'), 'edit' => __('Edit', 'woocommerce'), 'edit_item' => __('Edit Coupon', 'woocommerce'), 'new_item' => __('New Coupon', 'woocommerce'), 'view' => __('View Coupons', 'woocommerce'), 'view_item' => __('View Coupon', 'woocommerce'), 'search_items' => __('Search Coupons', 'woocommerce'), 'not_found' => __('No Coupons found', 'woocommerce'), 'not_found_in_trash' => __('No Coupons found in trash', 'woocommerce'), 'parent' => __('Parent Coupon', 'woocommerce')), 'description' => __('This is where you can add new coupons that customers can use in your store.', 'woocommerce'), 'public' => false, 'show_ui' => true, 'capability_type' => 'shop_coupon', 'map_meta_cap' => true, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_in_menu' => current_user_can('manage_woocommerce') ? 'woocommerce' : true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title'), 'show_in_nav_menus' => false, 'show_in_admin_bar' => true)));
}
}
开发者ID:chhavinav,项目名称:fr.ilovejuice,代码行数:22,代码来源:class-wc-post-types.php
示例3: woocommerce_processing_order_count
/**
* @deprecated
*/
function woocommerce_processing_order_count()
{
return wc_processing_order_count();
}
开发者ID:nayemDevs,项目名称:woocommerce,代码行数:7,代码来源:wc-deprecated-functions.php
示例4: menu_highlight
/**
* Highlights the correct top level admin menu item for post type add screens.
*
* @access public
* @return void
*/
public function menu_highlight()
{
global $menu, $submenu, $parent_file, $submenu_file, $self, $post_type, $taxonomy;
$to_highlight_types = array('shop_order', 'shop_coupon');
if (isset($post_type)) {
if (in_array($post_type, $to_highlight_types)) {
$submenu_file = 'edit.php?post_type=' . esc_attr($post_type);
$parent_file = 'woocommerce';
}
if ('product' == $post_type) {
$screen = get_current_screen();
if ($screen->base == 'edit-tags' && taxonomy_is_product_attribute($taxonomy)) {
$submenu_file = 'product_attributes';
$parent_file = 'edit.php?post_type=' . esc_attr($post_type);
}
}
}
if (isset($submenu['woocommerce']) && isset($submenu['woocommerce'][1])) {
$submenu['woocommerce'][0] = $submenu['woocommerce'][1];
unset($submenu['woocommerce'][1]);
}
// Sort out Orders menu when on the top level
if (!current_user_can('manage_woocommerce')) {
foreach ($menu as $key => $menu_item) {
if (strpos($menu_item[0], _x('Orders', 'Admin menu name', 'woocommerce')) === 0) {
$menu_name = _x('Orders', 'Admin menu name', 'woocommerce');
$menu_name_count = '';
if ($order_count = wc_processing_order_count()) {
$menu_name_count = " <span class='awaiting-mod update-plugins count-{$order_count}'><span class='processing-count'>" . number_format_i18n($order_count) . "</span></span>";
}
$menu[$key][0] = $menu_name . $menu_name_count;
$submenu['edit.php?post_type=shop_order'][5][0] = $menu_name;
break;
}
}
}
}
开发者ID:chhavinav,项目名称:fr.ilovejuice,代码行数:43,代码来源:class-wc-admin-menus.php
示例5: menu_highlight
/**
* Highlights the correct top level admin menu item for post type add screens.
*
* @return void
*/
public function menu_highlight()
{
global $menu, $submenu, $parent_file, $submenu_file, $self, $post_type, $taxonomy;
$to_highlight_types = array('shop_order', 'shop_coupon');
if (isset($post_type)) {
if (in_array($post_type, $to_highlight_types)) {
$submenu_file = 'edit.php?post_type=' . esc_attr($post_type);
$parent_file = 'woocommerce';
}
if ('product' == $post_type) {
$screen = get_current_screen();
if ($screen->base == 'edit-tags' && taxonomy_is_product_attribute($taxonomy)) {
$submenu_file = 'product_attributes';
$parent_file = 'edit.php?post_type=' . esc_attr($post_type);
}
}
}
if (isset($submenu['woocommerce']) && isset($submenu['woocommerce'][1])) {
$submenu['woocommerce'][0] = $submenu['woocommerce'][1];
unset($submenu['woocommerce'][1]);
}
if (isset($submenu['woocommerce']) && current_user_can('manage_woocommerce')) {
foreach ($submenu['woocommerce'] as $key => $menu_item) {
if (0 === strpos($menu_item[0], _x('Orders', 'Admin menu name', 'woocommerce'))) {
$menu_name = _x('Orders', 'Admin menu name', 'woocommerce');
if ($order_count = wc_processing_order_count()) {
$menu_name .= ' <span class="awaiting-mod update-plugins count-' . $order_count . '"><span class="processing-count">' . number_format_i18n($order_count) . '</span></span>';
}
$submenu['woocommerce'][$key][0] = $menu_name;
break;
}
}
}
}
开发者ID:donpapa26,项目名称:bakancslistad,代码行数:39,代码来源:class-wc-admin-menus.php
示例6: val_replace
//.........这里部分代码省略.........
if (strstr($str, '[stylesheet_directory_uri]')) {
$str = str_replace('[stylesheet_directory_uri]', get_stylesheet_directory_uri(), $str);
}
if (strstr($str, '[blog_name]')) {
$str = str_replace('[blog_name]', get_bloginfo('name'), $str);
}
if (strstr($str, '[update_total]')) {
$str = str_replace('[update_total]', $update_data["counts"]["total"], $str);
}
if (strstr($str, '[update_total_format]')) {
$str = str_replace('[update_total_format]', number_format_i18n($update_data["counts"]["total"]), $str);
}
if (strstr($str, '[update_plugins]')) {
$str = str_replace('[update_plugins]', $update_data["counts"]["plugins"], $str);
}
if (strstr($str, '[update_plugins_format]')) {
$str = str_replace('[update_plugins_format]', number_format_i18n($update_data["counts"]["plugins"]), $str);
}
if (strstr($str, '[update_themes]')) {
$str = str_replace('[update_themes]', $update_data["counts"]["themes"], $str);
}
if (strstr($str, '[update_themes_format]')) {
$str = str_replace('[update_themes_format]', number_format_i18n($update_data["counts"]["themes"]), $str);
}
if (strstr($str, '[comment_count]')) {
$str = str_replace('[comment_count]', $awaiting_mod, $str);
}
if (strstr($str, '[comment_count_format]')) {
$str = str_replace('[comment_count_format]', number_format_i18n($awaiting_mod), $str);
}
if (strstr($str, '[user_name]')) {
$str = str_replace('[user_name]', $current_user->display_name, $str);
}
if (strstr($str, '[user_login_name]')) {
$str = str_replace('[user_login_name]', $current_user->user_login, $str);
}
if (strstr($str, '[user_avatar]')) {
$str = str_replace('[user_avatar]', get_avatar($current_user->ID, 16), $str);
}
if (strstr($str, '[user_avatar_64]')) {
$str = str_replace('[user_avatar_64]', get_avatar($current_user->ID, 64), $str);
}
if (strstr($str, '[post_type]')) {
$post_name = '';
if (is_admin()) {
global $current_screen;
global $typenow;
global $tax;
if ($current_screen->base == 'edit' or $current_screen->base == 'post' && !empty($typenow)) {
$post_type_object = get_post_type_object($typenow);
if (!empty($post_type_object->public)) {
$post_name = $post_type_object->labels->singular_name;
}
} elseif ($current_screen->base == 'edit-tags' && !empty($tax)) {
if (!empty($tax->public)) {
$post_name = $tax->labels->singular_name;
}
}
} else {
$queried_object = get_queried_object();
if (!empty($queried_object->post_type)) {
$post_type_object = get_post_type_object($queried_object->post_type);
if (!empty($post_type_object->public)) {
$post_name = $post_type_object->labels->singular_name;
}
} elseif (!empty($queried_object->taxonomy)) {
$tax = get_taxonomy($queried_object->taxonomy);
if (!empty($tax->public)) {
$post_name = $tax->labels->singular_name;
}
}
}
$str = str_replace('[post_type]', $post_name, $str);
}
if (is_multisite()) {
if (strstr($str, '[site_name]')) {
$str = str_replace('[site_name]', esc_attr($current_site->site_name), $str);
}
if (strstr($str, '[site_url]')) {
$str = str_replace('[site_url]', $this->Schema . esc_attr($current_site->domain . $current_site->path), $str);
}
}
if (!empty($this->ActivatedPlugin)) {
$activated_plugins = $this->ActivatedPlugin;
if (!empty($activated_plugins['woocommerce'])) {
if (strstr($str, '[woocommerce_order_process_count]')) {
$woocommerce_order_process_count = '';
if (function_exists('wc_processing_order_count')) {
$order_count = intval(wc_processing_order_count());
if (!empty($order_count)) {
$woocommerce_order_process_count = ' <span class="awaiting-mod update-plugins count-' . $order_count . '"><span class="processing-count">' . number_format_i18n($order_count) . '</span></span>';
}
}
$str = str_replace('[woocommerce_order_process_count]', $woocommerce_order_process_count, $str);
}
}
}
}
return $str;
}
开发者ID:Optimize-Worldwide,项目名称:Admin-UI-Customization,代码行数:101,代码来源:wp-admin-ui-customize.php
示例7: test_wc_processing_order_count
/**
* Test wc_processing_order_count().
* @since 2.4
*/
public function test_wc_processing_order_count()
{
$this->assertEquals(0, wc_processing_order_count());
}
开发者ID:woocommerce,项目名称:woocommerce,代码行数:8,代码来源:functions.php
示例8: intval
if (!empty($this->ActivatedPlugin)) {
?>
<?php
$activated_plugins = $this->ActivatedPlugin;
?>
<?php
if (!empty($activated_plugins['woocommerce'])) {
?>
<?php
if (function_exists('wc_processing_order_count')) {
?>
<?php
$order_count = intval(wc_processing_order_count());
?>
<?php
if (!empty($order_count)) {
?>
<tr>
<th><strong>[woocommerce_order_process_count]</strong></th>
<td>
<code><span class="awaiting-mod update-plugins count-<?php
echo $order_count;
?>
"><span class="processing-count"><?php
echo number_format_i18n($order_count);
?>
</span></span></code>
</td>
开发者ID:Kilbourne,项目名称:restart,代码行数:31,代码来源:list_variables.php
示例9: get_processing_order_count
/**
* Get the count of all processing orders
*
* @since 1.1.1
* @return type
*/
public static function get_processing_order_count()
{
if (self::is_wc_2_2()) {
return wc_processing_order_count();
} else {
return get_term_by('slug', 'processing', 'shop_order_status')->count;
}
}
开发者ID:raisonon,项目名称:woocommerce-grow,代码行数:14,代码来源:class-woocommerce-grow-compat.php
注:本文中的wc_processing_order_count函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论