Created
December 24, 2014 04:59
-
-
Save mayeenulislam/3fd880e99fae78a76edc to your computer and use it in GitHub Desktop.
jQuery - show/hide WP meta boxes on post type selection. To make things work, you have to assure the jQuery is turned on, and you have to enqueue the scripts using `admin_enqueue_scripts()`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('body.post-new-php #formatdiv input[id="post-format-gallery"], body.post-new-php #formatdiv input[id="post-format-video"]').change(function(){ | |
$('.news-head-div').slideUp(); | |
$('.news-highlight-div').slideUp(); | |
$('#news-position').slideUp(); | |
$('#categorydiv').slideUp(); | |
}); | |
$('body.post-new-php #formatdiv input[id="post-format-0"]').change(function(){ | |
$('.news-head-div').slideDown(); | |
$('.news-highlight-div').slideDown(); | |
$('#news-position').slideDown(); | |
$('#categorydiv').slideDown(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment