Created
January 28, 2017 05:57
-
-
Save sbrajesh/b47b84c3fdca9b76f04e696894a80d06 to your computer and use it in GitHub Desktop.
Add the gallery creator and media uploaders name to mediapress gallery/media.
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
<?php | |
/** | |
* Display the name of the creator of the gallery below gallery cover | |
* | |
*/ | |
function mpp_custom_display_gallery_owner_name() { | |
$gallery = mpp_get_gallery(); | |
if ( ! $gallery ) { | |
return ; | |
} | |
printf( 'by: %s', bp_core_get_userlink( $gallery->user_id ) ); | |
} | |
add_action( 'mpp_before_gallery_actions', 'mpp_custom_display_gallery_owner_name' ); | |
/** | |
* Display the name of the uploader of the media below media thumbnail | |
* | |
*/ | |
function mpp_custom_display_media_owner_name() { | |
$media = mpp_get_media(); | |
if ( ! $media ) { | |
return ; | |
} | |
printf( 'by: %s', bp_core_get_userlink( $media->user_id ) ); | |
} | |
add_action( 'mpp_media_meta', 'mpp_custom_display_media_owner_name' ); | |
//display in the lightbox too | |
add_action( 'mpp_lightbox_media_meta', 'mpp_custom_display_media_owner_name' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment