Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Create checktype.js #736

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions js/checktype.js
@@ -0,0 +1,25 @@
/**
* Display post format meta boxes as needed
* Change meta boxes id to metabox-post-FORMAT
**/

jQuery(document).ready(function($){

$('#post-formats-select input').change(checkFormat);
$('.wp-post-format-ui .post-format-options > a').click(checkFormat);

function checkFormat(){
var format = $('#post-formats-select input:checked').attr('value');
if( typeof format != 'undefined'){
$('#post-body div[id^=metabox-post-]').hide();
$('#post-body #metabox-post-'+format+'').stop(true,true).fadeIn(500);
}
}

$(window).load( function(){
checkFormat();
})

});