Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

This code worksThis code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

On pages using my custom post type I am passing through the parameter of type=image to the media uploader. For 2 of the tabs my code within the if statement is not being executed:

2 tabs still showing all information

The other 2 tabs on the media uploader popup do what I want:

Code running correctly

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

This code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

On pages using my custom post type I am passing through the parameter of type=image to the media uploader. For 2 of the tabs my code within the if statement is not being executed:

2 tabs still showing all information

The other 2 tabs on the media uploader popup do what I want:

Code running correctly

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

This code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

On pages using my custom post type I am passing through the parameter of type=image to the media uploader. For 2 of the tabs my code within the if statement is not being executed:

2 tabs still showing all information

The other 2 tabs on the media uploader popup do what I want:

Code running correctly

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

edited title
Link
KevinUK
  • 341
  • 2
  • 13

Remove fields on media uploader on specificfor custom page onlytype - not working for "From Computer" or "From Url" tabs?

added 413 characters in body
Source Link
KevinUK
  • 341
  • 2
  • 13

This code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

On pages using my custom post type I am passing through the parameter of type=image to the media uploader. For 2 of the tabs my code within the if statement is not being executed:

2 tabs still showing all information

The other 2 tabs on the media uploader popup do what I want:

Code running correctly

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

This code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

This code works for me if I go to upload a file and choose the Gallery or Media Library tabs then it correctly hides elements on the page.

If I go to the From Computer or From URL tabs, nothing is hidden!

If I take out the if statement then it works. I can't see why it shouldn't be working on these 2 tabs as the URLs are the same apart from the tab parameter and the if statement is only checking the post_id:

Gallery tab works: /wp-admin/media-upload.php?post_id=4&type=image&tab=gallery

From Computer tab doesn't work: /wp-admin/media-upload.php?post_id=4&type=image&tab=type

Edit

On pages using my custom post type I am passing through the parameter of type=image to the media uploader. For 2 of the tabs my code within the if statement is not being executed:

2 tabs still showing all information

The other 2 tabs on the media uploader popup do what I want:

Code running correctly

If I have the if statement as:

if ($_GET['type'] == 'image')

Then it still doesnt trigger the code on From Computer or Gallery Tab so I can't rely on the querystring?

Any ideas?

added 179 characters in body
Source Link
KevinUK
  • 341
  • 2
  • 13
Loading
Source Link
KevinUK
  • 341
  • 2
  • 13
Loading