Created
March 3, 2017 13:09
-
-
Save raftaar1191/4469d8620fdddcedbc64a8adf37def4e to your computer and use it in GitHub Desktop.
Add sub menu inside rtMedia media tab in member profiles page
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 | |
// check if function does not exists | |
if ( ! function_exists( 'rtmedia_add_extra_sub_nav_for_upload' ) ) { | |
function rtmedia_add_extra_sub_nav_for_upload() { | |
// Check if user is logged in and RTMEDIA_MEDIA_SLUG is already defined | |
if ( is_user_logged_in() && defined( 'RTMEDIA_MEDIA_SLUG' ) ) { | |
// IMPORTANT Please change the page_slug | |
$page_slug = 'file-upload'; | |
?> | |
<li class="rtmedia-nav-item-<?php echo $page_slug; ?>-profile-1-li"> | |
<a id="rtmedia-nav-item-<?php echo $page_slug; ?>" href="<?php echo trailingslashit( get_rtmedia_user_link( get_current_user_id() ) ) . RTMEDIA_MEDIA_SLUG . '?' . $page_slug . '=1'; ?>">Upload</a> | |
</li> | |
<?php | |
} | |
} | |
} | |
add_action( 'add_extra_sub_nav' , 'rtmedia_add_extra_sub_nav_for_upload', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please the above snippet in functions.php of child themes.