This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'sell_all_posts', 'mycred_pro_sell_all_posts' ); | |
function mycred_pro_sell_all_posts() { | |
if ( ! is_user_logged_in() || ! current_user_can( 'edit_users' ) ) | |
return 'This shortcode is only available for admins.'; | |
ob_start(); | |
// Run | |
if ( isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-sell-content-run' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'sell_posts_of_category', 'mycred_pro_sell_all_posts' ); | |
function mycred_pro_sell_all_posts() { | |
if ( ! is_user_logged_in() || ! current_user_can( 'edit_users' ) ) | |
return 'This shortcode is only available for admins.'; | |
ob_start(); | |
// Run | |
if ( isset( $_POST['token'] ) && wp_verify_nonce( $_POST['token'], 'mycred-sell-content-run' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Monthly payouts | |
* On the first page load on the first day of each month | |
* award 10 points to all users with the role "Subscriber". | |
* @version 1.0 | |
*/ | |
add_action( 'mycred_init', 'mycred_pro_monthly_payouts' ); | |
function mycred_pro_monthly_payouts() { | |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define( 'DYNAMIC_OUTPUT_BUFFER_TAG', '%mycredbalance%' ); // Change this to a secret placeholder tag | |
if ( DYNAMIC_OUTPUT_BUFFER_TAG != '' ) { | |
function dynamic_output_buffer_test( &$cachedata = 0 ) { | |
if ( defined( 'DYNAMIC_OB_TEXT' ) ) | |
return str_replace( DYNAMIC_OUTPUT_BUFFER_TAG, DYNAMIC_OB_TEXT, $cachedata ); | |
if ( is_user_logged_in() ) { | |
ob_start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Exclude Subscribers | |
* Excludes any user that does not have the "edit_posts" capability. | |
* On a default WordPress installation this will exclude all users with the | |
* "Subscriber" role. | |
* For more information on roles and capabilities please consult the | |
* WordPress codex: http://codex.wordpress.org/Roles_and_Capabilities | |
* @version 1.0 | |
*/ | |
add_filter( 'mycred_exclude_user', 'exclude_subscriber_from_mycred', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Minimum Transfer Requirement | |
* Force users to transfer a minimum amount of points | |
* when using the mycred_transfer shortcode. | |
* @version 1.0 | |
*/ | |
add_action( 'mycred_transfer_ready', 'mycred_min_transfer_req', 10, 2 ); | |
function mycred_min_transfer_req( $transaction_id, $post ) { | |
// Get amount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate QR Code Link | |
* Generates a QR code image using the "QR Code Generator" API | |
* for a given URL. Optional vendor ID can be appended under the "vendor" | |
* variable. The variable key can be changed via by passing the "ref_key" | |
* variable in $args. | |
* @see http://goqr.me/api/ | |
* @version 1.0 | |
*/ | |
function generate_QR_code_link( $base_url = '', $vendor_id = '', $args = array(), $alt = '' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Limit BP Group Creation | |
* Only users with x amount of points can create groups. | |
* @version 1.0 | |
*/ | |
add_filter( 'bp_user_can_create_groups', 'mycred_pro_limit_bp_group_creation' ); | |
function mycred_pro_limit_bp_group_creation( $can ) { | |
if ( ! function_exists( 'mycred' ) ) return $can; |