Skip to content

Instantly share code, notes, and snippets.

@raftaar1191
Created March 3, 2017 13:09
Show Gist options
  • Save raftaar1191/4469d8620fdddcedbc64a8adf37def4e to your computer and use it in GitHub Desktop.
Save raftaar1191/4469d8620fdddcedbc64a8adf37def4e to your computer and use it in GitHub Desktop.
Add sub menu inside rtMedia media tab in member profiles page
<?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 );
@raftaar1191
Copy link
Author

raftaar1191 commented Mar 3, 2017

Please the above snippet in functions.php of child themes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment