rwmb_{$id}_after_save_post not triggered by scheduled post and quick edit?

Support General rwmb_{$id}_after_save_post not triggered by scheduled post and quick edit?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #44722
    Paul de JongPaul de Jong
    Participant

    I have a rwmb_{$field_group_id}_after_save_post hook for my CPT and using the classic editor (no gutenberg).

    Am I correct that this hook is only triggered when I publish / update the post from within the post edit screen? I tried quick edit from post overview and tried a scheduled post, but the hook wasn't triggered.

    #44731
    PeterPeter
    Moderator

    Hello Paul,

    Actually, the action hook rwmb_{$field_group_id}_after_save_post is triggered after saving the field value, please check this code
    https://github.com/wpmetabox/meta-box/blob/master/inc/meta-box.php#L243-L247

    it is also noted in the documentation https://docs.metabox.io/actions/rwmb-after-save-post/
    This action runs after all fields in a field group are saved.

    and the Quick Edit feature of WordPress doesn't save the field value. If you want to do something when using the Quick Edit, please use the action hook save_post.

    #44732
    Paul de JongPaul de Jong
    Participant

    Ah I see, thanks for the clarification!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.