este es el codigo
Código PHP:
<?php
function force_tag()
{
wp_enqueue_script('jquery');
}
function force_tag_post()
{
echo "<script type='text/javascript'>\n";
echo "
jQuery('#publish').click(function(){
var testervar = jQuery('[id^=\"tagsdiv-post_tag\"]')
.find('.tagchecklist span');
if (testervar.val().length < 1)
{
jQuery('[id^=\"tagsdiv-post_tag\"]').css('background', '#F96');
setTimeout(\"jQuery('#ajax-loading').css('visibility', 'hidden');\", 100);
alert('Tag is required');
setTimeout(\"jQuery('#publish').removeClass('button-primary-disabled');\", 100);
return false;
}
});
";
echo "</script>\n";
}
add_action('admin_init', 'force_tag');
add_action('edit_form_advanced', 'force_tag_post');
?>