Chapters

Category: mycred/core

A compilation of core plugin functions.

mycred

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

Continue Reading

myCRED_Account

The account object is an “umbrella” object of a given users myCRED related data. This includes their balance, history and data related to any add-ons that are enabled in your installation.

Continue Reading

mycred_add_menu

This action indicates the instance where myCRED has finished registering all the wp-admin screens.

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_admin_enqueue

This action indicates the instance where myCRED has enqueued all scripts and styling in the admin area.

Continue Reading

mycred_admin_init

This action indicates the instance where myCRED has finished running tasks when the wp-admin area is initiated.

Continue Reading

mycred_affiliate_cookie

This filter allows you to change the lifespan of the cookies your users receive from the "Points for referrals" hook.

Continue Reading

mycred_affiliate_id

Used by the Point for referrals hook, this shortcode will return the current logged in users referral ID.

Continue Reading

mycred_affiliate_key

This filter allows you to adjust the referral key that the myCRED hook uses.

Continue Reading

mycred_affiliate_link

Used by the Point for referrals hook, this shortcode will append the current users referral link to a given URL. If no URL is given, the current page's URL is used.

Continue Reading

mycred_after_deletion

This action indicates the instance when the myCRED plugin has been deleted.

Continue Reading

mycred_apply_exchange_rate

This filter allows you to change the results of the apply_exchange() class method in the myCRED_Settings object.

Continue Reading

mycred_before_deletion

This action indicates the instance when the myCRED plugin is about to be deleted.

Continue Reading

mycred_centralize_log

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

Continue Reading

mycred_date_to_gmt_timestamp

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

Continue Reading

mycred_deactivation

This action indicates the instance when the myCRED plugin has been disabled.

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_exchange

This shortcode allows your users to exchange one particular point type for another based on an exchange rate that you set for the shortcode. You can use the shortcode multiple times to allow exchanges between multiple types but exchanges can only be done in one direction per shortcode.

Continue Reading

mycred_exclude_user

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

Continue Reading

mycred_exclude_user

This filter allows you to exclude users from using myCRED via script.

Continue Reading

mycred_export_headers

This filter allows you to adjust what columns should be included when myCRED log entries are exported.

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_front_enqueue

This action indicates the instance when scripts and styles needs to be enqueued for the front end of your website.

Continue Reading

mycred_get_account

Retrieves a given users myCRED_Account object.

Continue Reading

mycred_get_module

This function will return a specific myCRED Module object.

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_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_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_profile_url

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

Continue Reading

mycred_give

This shortcode allows you to give your users points when this shortcode is rendered. These points are created “out of thin air and not from a specific account / user. You can insert this in page/post content or in a template file.

Continue Reading

mycred_give_run

This filter controls if the mycred_give shortcode should run or not. It can be used to either disable this shortcode or to limit when or by whom it can be used.

Continue Reading

mycred_hide_if

This shortcode allows you to hide parts of your content for those who fulfil the requirements you set. This shortcode is the opposite of the mycred_show_if shortcode. You can set a balance requirement, rank requirement (if the Ranks add-on is enabled) or a reference count.

Continue Reading

myCRED_Hook

myCRED_Hook is an abstract class used by all myCRED Hooks. It contains commonly used methods to help you build hooks without to much programming.

Continue Reading

mycred_hook_table

This shortcode will generate a table where all enabled hooks for a particular point type is listed. You can use this to show how your users can earn points based on how you setup your hooks.

Continue Reading

mycred_init

This action indicates the instance where myCRED is ready to run it’s initial actions.

Continue Reading

mycred_is_admin

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

Continue Reading

mycred_label

This filter allows you to change the value of the MYCRED_DEFAULT_LABEL constant, re-naming the myCRED plugin.

Continue Reading

mycred_label

This function returns the myCRED label.

Continue Reading

mycred_link

This shortcode allows you to award or deduct points from the current user when their click on a link. This shortcode will always generate a link, even if the user viewing it has already clicked on it / reached their limit or if the shortcode is viewed by a user that is logged out. However no points will be paid out unless the user is logged in, are not excluded and have not yet reached the limit you might have set for the “Points for clicking on links” hook.

Continue Reading

mycred_link

This filter allows you to adjust the anchor element the mycred_link shortcode renders.

Continue Reading

myCRED_Module

The myCRED_Module is an abstract class used by all myCRED add-ons and core modules. It contains commonly used methods to help you build modules without to much programming.

Continue Reading

mycred_my_ranking

This shortcode allows you to show a given users or the current users position in a particular leaderboard. Nothing will be returned if the user viewing the shortcode is not logged in

Continue Reading

mycred_override_settings

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

Continue Reading

mycred_pre_init

This action fires once myCRED is ready after that modules have been loaded but before the init action.

Continue Reading

mycred_referral_stats

The mycred_referral_stats shortcode is associated with the referral hook which displays the total count of referred visitors/sign ups users.

Continue Reading

mycred_send

This shortcode allows the user viewing the shortcode to send a pre-set amount of points under a specific reference to a pre-selected user. Basically this is a very very basic transfer shortcode where the amount, recipient and log template is already set.

Continue Reading

mycred_send_language

This filter lets you change the language used for the button in the mycred_send shortcode.

Continue Reading

mycred_set_user_balance

This action allows you to execute custom actions when a users balance is changed to a specific amount.

Continue Reading

myCRED_Settings

This class is the most commonly used and essential class in myCRED. Besides retrieving our settings, this class contain a set of methods which presents, manages, processes actions based on these settings.

Continue Reading

mycred_setup_addons

This filter allows you to register your own add-ons or remove/disable existing add-ons.

Continue Reading

mycred_setup_hooks

This filter allows you to add custom hooks or remove built-in ones.

Continue Reading

mycred_show_if

This shortcode allows you to show parts of your content for those who fulfil the requirements you set. This shortcode is the opposite of the mycred_hide_if shortcode. You can set a balance requirement, rank requirement (if the Ranks add-on is enabled) or a reference count.

Continue Reading

mycred_tool_bar

This action fires directly after myCRED has setup the WordPress Toolbar items.

Continue Reading

mycred_user_row_actions

This filter allows you to remove or add custom action links when viewing your users point balance on the Users page.

Continue Reading

mycred_users_profile_url

This filter allows you to adjust what URL the %user_profile_url% and the %user_profile_link% template tags point to.

Continue Reading

mycred_video

This shortcode is used to embed YouTube videos via IFRAME in order to allow us to award points for users who view the video. Videos that are embedded without using this shortcode can not award points for viewing.

Continue Reading

mycred_video_output

This filter allows you to adjust the video embed that is generated by the mycred_video add-on.

Continue Reading

mycred_video_query_youtube

This filter allows you to make changes to the youtube video query.

Continue Reading

mycred_widgets_init

This action fires once myCRED has loaded and registered all widgets.

Continue Reading