Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Add filter that inserts our new tab
- function nsm_menu($tabs) {
- $newtab = array('shared_media' => __('Network Shared Media', 'networksharedmedia'));
- return array_merge($tabs, $newtab);
- }
- add_filter('media_upload_tabs', 'nsm_menu');
- // Load media_nsm_process() into the existing iframe
- function nsm_menu_handle() {
- return wp_iframe('media_nsm_process');
- }
- add_action('media_upload_shared_media', 'nsm_menu_handle');
- /*
- * media_nsm_process() contains the code for what you want to display. This function MUST start with the word 'media' in order
- * for the proper CSS to load.
- *
- * First, we switch to the blog containing all of the media. This is called up by the blog # found in the database.
- *
- * Then we call media_upload_library() which contains all of the code needed to show the library, select media sizes, and
- * insert into the post.
- */
- function media_nsm_process() {
- switch_to_blog(3);
- media_upload_library();
- }
- ?>
Add Comment
Please, Sign In to add comment