3 thoughts on “How to intercept post publishing based on post meta

  1. I have some comments:

    1. You declare the $data as argument but did not use it. And actually on testing with my plugin, the $data is the array that holds values like ‘post_status’ or ‘post_type’
    2. $post argument is actually $post_ID

    The 2 things above I noticed by using var_dump()

    3. $post_status = isset( $data[‘post_status’] ) ? $data[‘post_status’] : get_post_status( $post_ID );
    This get_post_status( $post_ID ) can also be just $data[‘post_status’].

  2. Same question as Ống Bơ Gỉ: I don’t understand why $data is not being used. Also, I cannot find info about the form of data being delivered with $data. When I try to use it like $data->post_title, I get error.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.