admin管理员组

文章数量:1289877

Post saving took much time. I have action to save custom metas using update_post_meta

add_action( 'save_post_property', 'propertys_save' );
function propertys_save($id) {
    foreach($_POST['meta'] as $k => $v) {
        $time_start = microtime(true);
        update_post_meta($id,$k,$v);
        echo microtime(true) - $time_start
    }
}

and i get this average timing:

0.16451787948608

And if i call update_post_meta anywhere in another place (for example admin-ajax.php?action=123) it will take:

0.00014281272888184s

It's 1000 times faster... Is there any way to speed it up?

本文标签: Update post meta is slow while saving post