• Anytime a Post is saved or published, WordPress is designed to trigger the save_post Hook only one (1) time. However, when the ConvertKit plugin is enabled, it causes the save_post Hook to trigger two (2) times.

    PLUGIN VERSION TESTED:
    Version 1.9.4

    STEPS TO REPRODUCE:
    Add the following to function.php:

    add_action( 'save_post', function($post_id, $post, $update) {
        // Avoid auto-saves
        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
    
        error_log("save_post hook triggered");
    }, 10, 3 );

    Compare the PHP error.log before & after the ConvertKit plugin is enabled.

    NOTES:
    Commenting out add_action( 'add_meta_boxes_post', array( __CLASS__, 'add_meta_boxes' ) );
    in file plugins/convertkit/includes/class-convertkit.php:71 fixes the issue.

  • The topic ‘BUG – save_post hook triggers twice’ is closed to new replies.