Created
November 30, 2015 23:35
-
-
Save gabrielmerovingi/190a9a693d35ffddb166 to your computer and use it in GitHub Desktop.
Final code for myCRED Tutorial - http://mycred.me/tutorial/buddypress-user-field-number-of-log-entries-to-show/
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_filter( 'mycred_bp_history_num_to_show', 'buddypress_number_of_rows_to_show' ); | |
function buddypress_number_of_rows_to_show( $num ) { | |
$user_id = bp_displayed_user_id(); | |
$number = xprofile_get_field_data( 'Your User Fields Title', $user_id ); | |
if ( ! empty( $number ) ) | |
return $number; | |
return $num; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment