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
    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
Category: Functions
All available point related or myCRED feature related functions.

Codex / Functions

buycred_complete_pending_paymentFunction

This function will process a pending point purchase and “complete” it by paying the buyer the point they purchased.

buycred_gatewayFunction

This function will construct a given buyCRED Payment Gateway.

buycred_get_pending_paymentFunction

This function retrieves the buyCRED pending payment object based on a given pending payment ID.

buycred_get_pending_payment_idFunction

This function attempts to get the WordPress post object ID for a given buyCRED pending payment ID.

buycred_get_users_pending_paymentsFunction

This function will return all a given users currently pending buyCRED point purchases.

buycred_trash_pending_paymentFunction

This function will trash a pending buyCRED point purchase payment.

mycredFunction

Constructs and returns the myCRED_Settings object based on a given point type.

mycred_addFunction

Adds a given amount of creds to a specific user. Once the users balance has been updated, a new log entry is made under the given reference.

mycred_add_new_noticeFunction

This function allows you to add a new notification for a specific user.

mycred_add_user_metaFunction

A wrapper function for add_user_meta, it assures that point related data is saved under the correct meta key structure.

mycred_assign_badgeFunction

This function assigns a given badge to all users that meet the set requirements.

mycred_assign_badge_to_userFunction

This function assigns a given badge and badge level to a specific user. It is used by other badge assignment functions to connect a badge with a user.

mycred_assign_ranksFunction

This function will assign ranks to users based on their balance.

mycred_badge_level_reachedFunction

This function checks if a user has earned a particular badge and if they have, the level they have reached.

mycred_centralize_logFunction

This function checks if the central log feature is enabled on a Multisite installation.

mycred_content_purchase_has_expiredFunction

This function will check if a content payment has expired or not.

mycred_count_all_ref_instancesFunction

This function returns an associative array of references and the number of times each occur in your log.

mycred_count_ref_id_instancesFunction

Returns the number of times a specific reference, in combination with a reference ID occurs in the log, with the option to filter by user ID or by point type.

mycred_count_ref_instancesFunction

Returns the number of times a specific reference occurs in the log, with the option to filter by user ID or by point type.

mycred_count_users_with_badgeFunction

This function counts the number of users that has a given badge with the option to count badge level.

mycred_count_users_without_badgeFunction

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

mycred_coupon_was_successfully_usedFunction

This function checks if a coupon was successfully applied or not. Should be used in combination with the mycred_use_coupon function.

mycred_create_chartFunction

Returns an instance of the myCRED_Chart object for building charts using the Statistics add-on.

mycred_create_new_couponFunction

This function creates a new myCRED Coupon post object. Uses wp_insert_post.

mycred_date_to_gmt_timestampFunction

This function will convert a well formatted date to a GMT unix timestamp.

mycred_delete_recurring_payoutFunction

Deletes a given recurring payout in the Banking add-on.

mycred_delete_user_metaFunction

A wrapper function for delete_user_meta, it assures that point related data is deleted under the correct meta key structure.

mycred_display_badge_requirementsFunction

This function will return the requirements you set for a particular badge in readable format.

mycred_display_users_badgesFunction

This function renders a list of all the badges a give user has earned.

mycred_display_users_balanceFunction

Returns a given users current balance for a specific point type formatted.

mycred_display_users_total_balanceFunction

Returns a given users total balance for a specific point type formatted.

mycred_exclude_userFunction

Checks if a given user is excluded from using a particular point type.

mycred_find_users_rankFunction

This function will attempt to find a given users rank of a specific point type. This function can be used to just query which rank a user should have or also save this rank.

mycred_flush_widget_cacheFunction

Wrapper function for wp_cache_delete for deleting widget caches. Used when myCRED widget settings are saved.

mycred_force_singular_sessionFunction

This function is used throughout myCRED to prevent users from attempting to submit AJAX forms multiple times.

mycred_get_accountFunction

Retrieves a given users myCRED_Account object.

mycred_get_badgeFunction

This function returns the myCRED Badge Object for a given badge ID.

mycred_get_badge_idsFunction

This function returns an array of published badge IDs.

mycred_get_badge_referencesFunction

This function will return an associative array of references and badge IDs that exists on your website.

mycred_get_content_buyers_countFunction

This function returns the total number of unique users that have purchased a given post.

mycred_get_content_priceFunction

This function returns the set price for a post that has been set for sale using the Sell Content add-on.

mycred_get_content_sales_countFunction

This function returns the total number of times a particular posts content has been purchased.

mycred_get_couponFunction

This function returns a coupon object based on a coupon post ID.

mycred_get_email_noticeFunction

Returns an instance of the myCRED_Email object based on a given email notice post ID.

mycred_get_global_coupon_countFunction

This function returns the total number of times a given coupon has been redeemed on your website.

mycred_get_moduleFunction

This function will return a specific myCRED Module object.

mycred_get_my_rankFunction

This function returns the current users myCRED rank object. Uses the mycred_get_users_rank function.

mycred_get_point_type_nameFunction

This function returns a specific point type’s given name in singular or plural form.

mycred_get_rankFunction

This function will return the myCRED Rank Object for a given rank ID.

mycred_get_rank_logoFunction

This function will return a given ranks logo image.

mycred_get_rank_object_idFunction

This function attempts to convert a given rank name into it’s post object ID.

mycred_get_ranksFunction

This function allows you to query existing ranks for a specific point type.

mycred_get_recurring_payoutFunction

This function returns the settings and status of a given scheduled recurring payout in the Banking add-on.

mycred_get_recurring_payout_schedulesFunction

This function will return all currently existing recurring payout schedules in the Banking add-on.

mycred_get_remoteFunction

This function returns the Remove API (version 1.0) settings.

mycred_get_settings_networkFunction

This function returns the network settings on a Multisite installation.

mycred_get_total_by_timeFunction

This function will return the total number of points logged in the log table between two dates, either in total, for a specific reference or for a specific user.

mycred_get_transferFunction

This function retrieves the myCRED_Transfer object, populated based on the given transfer ID.

mycred_get_unique_coupon_codeFunction

This function will generate a unique random code for coupons.

mycred_get_user_idFunction

This function will attempt to return a user ID based on either an identifying piece of information (email, login or slug) or based on keywords.

mycred_get_users_badgesFunction

This function returns an array badge IDs that a given user has earned.

mycred_get_users_balanceFunction

This function will return a given users current points balance.

mycred_get_users_coupon_countFunction

This function returns the total number of times a user has redeemed a specific coupon.

mycred_get_users_of_rankFunction

This function allows you to query users of a specific rank.

mycred_get_users_profile_urlFunction

This function will return a given users profile URL based on your websites setup.

mycred_get_users_rankFunction

This function will retrieve a given users current rank object for a specific point type.

mycred_get_users_rank_idFunction

This function returns a given users current rank post object ID of a specific point type.

mycred_get_users_reference_sumFunction

This function will return an array of all point instances a user has based on the log.

mycred_get_users_total_balanceFunction

This function returns a given user’s total point balance for a specific point type.

mycred_get_woo_product_rewardFunction

This function will help you retrieve the point amount a user is rewarded when they buy a WooCommerce product.

mycred_have_ranksFunction

This function checks if there are published rank post objects for a particular point type.

mycred_is_adminFunction

This function checks if a specific user is to be considered an “administrator”.

mycred_labelFunction

This function returns the myCRED label.

mycred_new_transferFunction
Description This function attempts to process a transfer request that has been submitted by a transfer form. If no transfer form is used and you need to process a new transfer artificially, make sure you simulate a form submission by providing an array of form names and values. This function is only available if the [...]
mycred_override_settingsFunction

This function checks if the master template feature is enabled on a Multisite installation.

mycred_post_is_for_saleFunction

This function checks if a specific post is set for sale in the Sell Content add-on.

mycred_post_type_for_saleFunction

This function checks if a given post type is set for sale in the Sell Content settings.

mycred_query_users_totalFunction

This function will query the myCRED log in order to get a given users total balance for a particular point type.

mycred_rank_has_logoFunction

This function checks if a given rank has a logo using the has_post_thumbnail function.

mycred_refund_transferFunction

This function attempts to refund a completed transfer.

mycred_sell_content_new_purchaseFunction

This function will attempt to charge a given user for a piece of content that has been set for sale using the Sell Content add-on.

mycred_sell_content_payment_buttonsFunction

This function will return all available payment buttons that a user can use, in order to pay for a posts content.

mycred_sell_content_post_idFunction

This function attempts to get the current posts ID.

mycred_subtractFunction

This function allows you to decrease a users balance by deducting a specific amount from it.

mycred_transferFunction

This function will returns the myCRED_Transfer object. Note that this function will not populate the object.

mycred_use_couponFunction

This function will validate and a given coupon code and if the coupon can be used, redeems the coupon.

mycred_user_can_transferFunction

This function checks if a user can afford or allowed to make a transfer of a specified amount of points.

mycred_user_paid_for_contentFunction

This function checks if a given user has a valid and active payment for a specific post that is set for sale.

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 byWPExperts; 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