Support » Plugin: Media Tags » [Suggestion] Paramter Handling in your Media Upload Tab

  • Hey,

    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…;)

Viewing 1 replies (of 1 total)
  • Plugin Author Paul Menard


    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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Suggestion] Paramter Handling in your Media Upload Tab’ is closed to new replies.