$formats = $_POST[\'tax_input[formats][]\'];
???????
A.var_dump( $_POST );
可能会有帮助
\'tax_input\' =>
array (size=1)
\'post_tag\' => string \'tag_a,tag_b,tag_c\' (length=...)
尝试以下操作:
add_action( \'save_post\', \'find_post_tax\' );
function find_post_tax(){
$tax_to_fetch = \'supersonicscrewdriver\';
$found = false;
if( isset( $_POST[\'tax_input\'][\'formats\'] ) && ! empty( $_POST[\'tax_input\'][\'formats\'] ) ){
$taxs = explode( \',\', $_POST[\'tax_input\'][\'formats\'] );
$found = in_array( $tax_to_fetch, $taxs );
}
return $found;
}