View mycred-query-log-args-filter-example1
/**
* Adjust myCRED Query Args
* @version 1.0
*/
function mycred_pro_my_adjustments( $args ) {
if ( $args['ref'] == 'manual' && current_user_can( 'moderate_comments' ) )
$args['ref_id'] = get_current_user_id();
return $args;
View mycred-run-this-filter-example2
/**
* Duplicate Points
* @since 1.0
* @version 1.0
*/
function mycred_pro_duplicate_points( $request ) {
// If a user is to gain points, double the value
if ( $request['amount'] > 0 ) {
$request['amount'] = $request['amount'] * 2;
View mycred-bp-leaderboard-member-column-example1
/**
* Insert Avatar in Leaderboard Column
* @since 1.0
* @version 1.0
*/
function mycred_pro_bp_leaderboard_avatar_column( $content, $row, $group_id, $point_type ) {
return get_avatar( $row->user_id, 64 ) . $content;
}
View mycred-bp-leaderboard-column_id-column-filter-example1
/**
* Avatar Leaderboard Column
* @since 1.0
* @version 1.0
*/
function mycred_pro_bp_leaderboard_avatar_column( $content, $row, $group_id, $point_type ) {
return get_avatar( $row->user_id, 64 );
}
View mycred-bp-leaderboard-columns-filter-example3
/**
* Add Custom Leaderboard Column
* @since 1.0
* @version 1.0
*/
function mycred_pro_bp_leaderboard_columns( $columns ) {
$columns['avatar'] = 'Avatar';
return $columns;
View mycred-bp-leaderboard-columns-filter-example2
/**
* Reorder Leaderboard Columns
* @since 1.0
* @version 1.0
*/
function mycred_pro_bp_leaderboard_columns( $columns ) {
$new = array();
$new['balance'] = $columns['balance'];
$new['position'] = $columns['position'];
View mycred-bp-leaderboard-columns-filter-example1
/**
* Rename Leaderboard Columns
* @since 1.0
* @version 1.0
*/
function mycred_pro_bp_leaderboard_columns( $columns ) {
$columns['position'] = 'Rank';
return $columns;
View mycred-bp-leaderboard-find-position-filter-example1
/**
* Query Custom BP Leaderboard Position
* @since 1.0
* @version 1.0
*/
function mycred_pro_query_custom_position( $position, $group_id, $user_id, $point_type ) {
// Get setup
$setup = mycred_get_bp_group_setup( $group_id );
View mycred-bp-leaderboard-get-filter-example1
/**
* Query Custom BP Leaderboard
* @since 1.0
* @version 1.0
*/
function mycred_pro_query_custom_leaderboard( $leaderboard, $group_id, $point_type, $append_user, $fresh ) {
// Get setup
$setup = mycred_get_bp_group_setup( $group_id );
View mycred-bp-leaderboard-types-filter-example1
/**
* Register Custom BP Leaderboard
* @since 1.0
* @version 1.0
*/
function mycred_pro_register_annual_leaderboard( $leaderboards ) {
$leaderboards['year'] = 'Annual Leaderboard';
return $leaderboards;