All Functions

myCRED Functions

Chapters

Category: Functions

All available point related or myCRED feature related functions.

buycred_complete_pending_payment

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

Continue Reading

buycred_gateway

This function will construct a given buyCRED Payment Gateway.

Continue Reading

buycred_get_pending_payment

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

Continue Reading

buycred_get_pending_payment_id

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

Continue Reading

buycred_get_users_pending_payments

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

Continue Reading

buycred_trash_pending_payment

This function will trash a pending buyCRED point purchase payment.

Continue Reading

mycred

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

Continue Reading

mycred_add

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.

Continue Reading

mycred_add_new_notice

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

Continue Reading

mycred_add_user_meta

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

Continue Reading

mycred_assign_badge

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

Continue Reading

mycred_assign_badge_to_user

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.

Continue Reading

mycred_assign_ranks

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

Continue Reading

mycred_badge_level_reached

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

Continue Reading

mycred_centralize_log

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

Continue Reading

mycred_content_purchase_has_expired

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

Continue Reading

mycred_count_all_ref_instances

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

Continue Reading

mycred_count_ref_id_instances

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.

Continue Reading

mycred_count_ref_instances

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

Continue Reading

mycred_count_users_with_badge

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

Continue Reading

mycred_count_users_without_badge

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

Continue Reading

mycred_coupon_was_successfully_used

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

Continue Reading

mycred_create_chart

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

Continue Reading

mycred_create_new_coupon

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

Continue Reading

mycred_date_to_gmt_timestamp

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

Continue Reading

mycred_delete_recurring_payout

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

Continue Reading

mycred_delete_user_meta

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

Continue Reading

mycred_display_badge_requirements

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

Continue Reading

mycred_display_users_badges

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

Continue Reading

mycred_display_users_balance

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

Continue Reading

mycred_display_users_total_balance

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

Continue Reading

mycred_exclude_user

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

Continue Reading

mycred_find_users_rank

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.

Continue Reading

mycred_flush_widget_cache

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

Continue Reading

mycred_force_singular_session

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

Continue Reading

mycred_get_account

Retrieves a given users myCRED_Account object.

Continue Reading

mycred_get_badge

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

Continue Reading

mycred_get_badge_ids

This function returns an array of published badge IDs.

Continue Reading

mycred_get_badge_references

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

Continue Reading

mycred_get_content_buyers_count

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

Continue Reading

mycred_get_content_price

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

Continue Reading

mycred_get_content_sales_count

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

Continue Reading

mycred_get_coupon

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

Continue Reading

mycred_get_email_notice

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

Continue Reading

mycred_get_global_coupon_count

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

Continue Reading

mycred_get_module

This function will return a specific myCRED Module object.

Continue Reading

mycred_get_my_rank

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

Continue Reading

mycred_get_point_type_name

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

Continue Reading

mycred_get_rank

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

Continue Reading

mycred_get_rank_logo

This function will return a given ranks logo image.

Continue Reading

mycred_get_rank_object_id

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

Continue Reading

mycred_get_ranks

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

Continue Reading

mycred_get_recurring_payout

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

Continue Reading

mycred_get_recurring_payout_schedules

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

Continue Reading

mycred_get_remote

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

Continue Reading

mycred_get_settings_network

This function returns the network settings on a Multisite installation.

Continue Reading

mycred_get_total_by_time

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.

Continue Reading

mycred_get_transfer

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

Continue Reading

mycred_get_unique_coupon_code

This function will generate a unique random code for coupons.

Continue Reading

mycred_get_user_id

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.

Continue Reading

mycred_get_users_badges

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

Continue Reading

mycred_get_users_balance

This function will return a given users current points balance.

Continue Reading

mycred_get_users_coupon_count

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

Continue Reading

mycred_get_users_of_rank

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

Continue Reading

mycred_get_users_profile_url

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

Continue Reading

mycred_get_users_rank

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

Continue Reading

mycred_get_users_rank_id

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

Continue Reading

mycred_get_users_reference_sum

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

Continue Reading

mycred_get_users_total_balance

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

Continue Reading

mycred_get_woo_product_reward

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

Continue Reading

mycred_have_ranks

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

Continue Reading

mycred_is_admin

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

Continue Reading

mycred_label

This function returns the myCRED label.

Continue Reading

mycred_new_transfer

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.

Continue Reading

mycred_override_settings

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

Continue Reading

mycred_post_is_for_sale

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

Continue Reading

mycred_post_type_for_sale

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

Continue Reading

mycred_query_users_total

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

Continue Reading

mycred_rank_has_logo

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

Continue Reading

mycred_refund_transfer

This function attempts to refund a completed transfer.

Continue Reading

mycred_sell_content_new_purchase

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.

Continue Reading

mycred_sell_content_payment_buttons

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

Continue Reading

mycred_sell_content_post_id

This function attempts to get the current posts ID.

Continue Reading

mycred_subtract

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

Continue Reading

mycred_transfer

This shortcode will generate the transfer form allowing users to send points to each other.

Continue Reading

mycred_use_coupon

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

Continue Reading

mycred_user_can_transfer

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

Continue Reading

mycred_user_paid_for_content

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

Continue Reading