Media Tags
[Suggestion] Paramter Handling in your Media Upload Tab (2 posts)

  1. ClubDesign
    Posted 2 years ago #


    just came across a problem within you plugin. If somebody ( like me ) opens the media uploader with a custom GET Paramter, then opening the Media Tag tab destroys the custom paramter and custom actions on the media uploader don`t work anymore, so i digged in your code and rewrote the tab form function to accept all get paramters and send them through:

    Function media_upload_mediatags_form:

    Before you start html output i have now:

    if ((isset($_REQUEST['type'])) && (strlen($_REQUEST['type'])))
     $get_requests = $_GET;
    		$get_requests['type'] = $_REQUEST['type'];
    		$get_requests['tab'] = 'library';
    		$get_requests['post_id'] = '0';
    		$build_action_url = 'media-upload.php?';
    		foreach( $get_requests as $nam => $val ): $build_action_url .= $nam . '=' . $val . '&';  endforeach;
    		$build_action_url = substr_replace($build_action_url ,"",-1);
    		$form_action_url = $build_action_url;

    instead of:

    if ((isset($_REQUEST['type'])) && (strlen($_REQUEST['type'])))
    		$type = "type=".$_REQUEST['type']."&";
    		//$form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?".$type."tab=library&post_id=".$post_id;
    		//$form_action_url = "media-upload.php?".$type."tab=library&post_id=".$post_id;
    		$form_action_url = "media-upload.php?".$type."tab=library&tab=library&post_id=".$post_id;

    Just a small change, but might make some developers happier because the can send their get requests through your plugin...;)


  2. Paul Menard
    Plugin Author

    Posted 2 years ago #

    clubdesign, Thanks for the suggestion. I just released Media-Tags 3.1 to take care of some issues with the new WordPress 3.5 but wanted to thank you for providing the details. I will review this for the next release hopefully next week.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Media Tags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.