A free points management plugin for WordPress.
myCRED Logo
myCRED Logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download
    Navigation
    • Loading navigation ...
    All Functions
    myCRED functions
    1. buycred_complete_pending_payment
    2. buycred_gateway
    3. buycred_get_pending_payment
    4. buycred_get_pending_payment_id
    5. buycred_get_users_pending_payments
    6. buycred_trash_pending_payment
    7. mycred
    8. mycred_add
    9. mycred_add_new_notice
    10. mycred_add_user_meta
    11. mycred_assign_badge
    12. mycred_assign_badge_to_user
    13. mycred_assign_ranks
    14. mycred_badge_level_reached
    15. mycred_centralize_log
    16. mycred_content_purchase_has_expired
    17. mycred_count_all_ref_instances
    18. mycred_count_ref_id_instances
    19. mycred_count_ref_instances
    20. mycred_count_users_with_badge
    21. mycred_count_users_without_badge
    22. mycred_coupon_was_successfully_used
    23. mycred_create_chart
    24. mycred_create_new_coupon
    25. mycred_date_to_gmt_timestamp
    26. mycred_delete_recurring_payout
    27. mycred_delete_user_meta
    28. mycred_display_badge_requirements
    29. mycred_display_users_badges
    30. mycred_display_users_balance
    31. mycred_display_users_total_balance
    32. mycred_exclude_user
    33. mycred_find_users_rank
    34. mycred_flush_widget_cache
    35. mycred_force_singular_session
    36. mycred_get_account
    37. mycred_get_badge
    38. mycred_get_badge_ids
    39. mycred_get_badge_references
    40. mycred_get_content_buyers_count
    41. mycred_get_content_price
    42. mycred_get_content_sales_count
    43. mycred_get_coupon
    44. mycred_get_email_notice
    45. mycred_get_global_coupon_count
    46. mycred_get_module
    47. mycred_get_my_rank
    48. mycred_get_point_type_name
    49. mycred_get_rank
    50. mycred_get_rank_logo
    51. mycred_get_rank_object_id
    52. mycred_get_ranks
    53. mycred_get_recurring_payout
    54. mycred_get_recurring_payout_schedul ...
    55. mycred_get_remote
    56. mycred_get_settings_network
    57. mycred_get_total_by_time
    58. mycred_get_transfer
    59. mycred_get_unique_coupon_code
    60. mycred_get_user_id
    61. mycred_get_users_badges
    62. mycred_get_users_balance
    63. mycred_get_users_coupon_count
    64. mycred_get_users_of_rank
    65. mycred_get_users_profile_url
    66. mycred_get_users_rank
    67. mycred_get_users_rank_id
    68. mycred_get_users_reference_sum
    69. mycred_get_users_total_balance
    70. mycred_get_woo_product_reward
    71. mycred_have_ranks
    72. mycred_is_admin
    73. mycred_label
    74. mycred_new_transfer
    75. mycred_override_settings
    76. mycred_post_is_for_sale
    77. mycred_post_type_for_sale
    78. mycred_query_users_total
    79. mycred_rank_has_logo
    80. mycred_refund_transfer
    81. mycred_sell_content_new_purchase
    82. mycred_sell_content_payment_buttons
    83. mycred_sell_content_post_id
    84. mycred_subtract
    85. mycred_transfer
    86. mycred_use_coupon
    87. mycred_user_can_transfer
    88. mycred_user_paid_for_content
    Categories
    Filter by category
    1. Actions
    2. Classes
    3. Filters
    4. Functions
    5. Hooks
    6. Objects
    7. Shortcodes
    8. Template Tags
    Chapters
    Documentation
    1. Chapter I - Introduction
    2. Chapter II - Getting Started
    3. Chapter III - Add-ons
    4. Chapter IV - Premium Add-ons
    5. Chapter V - For Developers
    6. Chapter VI - Reference Guides
mycred_count_users_without_badge

Codex / mycred/badge / Functions / mycred_count_users_without_badge

Description

This function counts the number of users that has not earned a given badge.

This function is only available if the Badges add-on is enabled.

Available since version 1.5

Returns

(int) The number of users that has not earned the badge.

Parameters
Param Type Required Description
function mycred_count_users_without_badge(
$badge_id int Yes

The badge post object ID.

) { ... }
Example

Example 1: Count the number of users that have not earned the badge 2 yet.

$badge_id = 2;
$count    = mycred_count_users_without_badge( $badge_id );

printf( '%d users has not yet earned this badge', $count );
0

About myCred

myCred is a free, open-source and developer friendly points management tool for WordPress powered websites.

Download Rate Plugin

Documentation

  • Add-ons
  • Core Shortcodes
  • F.A.Q.
  • Tutorials
  • Third Party Plugins
  • Code Snippets

Support

  • Product Licenses
  • Customization
  • Support Forums
  • Plugin Changelog
  • Contact

Copyright 2013 - 2021 by WPExperts; All rights reserved. myCred is licensed under GPL 2.0

Terms & Conditions • Use of Cookies • Store Policy • Community Rules

Suggest Codex Example

You can submit suggestions for codex examples that you have available as a public gist. If you are a member on the mycred.me website, you can earn Tokens for each submission. To claim these Tokens, make sure you provide your mycred.me username.

Please make sure the example you submit is relevant and if you include documentation, it's provided in English.

logo
  • Membership New
  • Chapters
    • Chapter I – Introduction
    • Chapter II – Getting Started
    • Chapter III – Add-ons
    • Chapter IV – Premium Add-ons
    • Chapter V – For Developers
    • Chapter VI – Reference Guides
  • Categories
    • Actions
    • Classes
    • Constants
    • Filters
    • Functions
    • Objects
    • Shortcodes
    • Hooks
    • Template Tags
  • Packages
    • mycred/api
    • mycred/badge
    • mycred/balance
    • mycred/banking
    • mycred/content
    • mycred/core
    • mycred/coupon
    • mycred/email
    • mycred/game
    • mycred/log
    • mycred/notice
    • mycred/payment
    • mycred/purchase
    • mycred/rank
    • mycred/transfer
  • Store
  • Download