#6: wp_terms_checklist_args
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
<?php | |
/** | |
* Disable 'checked_ontop' for Media Categories taxonomy | |
* | |
* @see wp_terms_checklist() | |
* | |
* @param array $args An array of arguments. | |
* @param int $post_id The post id. | |
* | |
* @return array The arguments array. | |
*/ | |
function wpdocs_no_top_float( $args, $post_id ) { | |
// If the taxonomy is set and equals 'media_cats' | |
if ( isset( $args['taxonomy'] ) && 'media_cats' == $args['taxonomy'] ) | |
$args['checked_ontop'] = false; | |
return $args; | |
} | |
add_filter( 'wp_terms_checklist_args', 'wpdocs_no_top_float', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://fotd.werdswords.com/wp_terms_checklist_args/