autosave - Why wp_is_post_autosave doesn't return anything?

admin2025-06-05  2

After saving a post I check the console and $is_autosave is simply not set

function save_func($post_id){
  $is_autosave = wp_is_post_autosave( $post_id );
  file_put_contents('php://stderr', print_r("Autosave: ".$is_autosave, TRUE));
}
add_action('save_post','save_func');

Output:

Autosave:

Technically since it's not an autosave the result should be:

Output:

Autosave: 0

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749091301a316287.html

最新回复(0)