Edited group field bool

Support MB Group Edited group field bool

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by PeterPeter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #45276
    YasmineYasmine
    Participant

    Do you perhaps have any helper hooks that can access if a group field was edited or not?

    I am trying to just run a function if a group field was edited to make it better optimised. But the $_POST no longer has data by the time I use my hook: add_action('save_post_research', 'manage_save_automations', 10, 3); And all I want to know if were changes made to the group field, or not. Hoping you have a helper function that I didn't spot!

    #45279
    PeterPeter
    Moderator

    Hello Yasmine,

    the $_POST no longer has data by the time I use my hook: add_action('save_post_research', 'manage_save_automations', 10, 3);

    How do you print out the $_POST variable to check if it has data? I use the sample code below and it prints out the value as well.

    add_action( 'save_post_research', function( $post_id, $post, $update ) {
    	echo "<pre>";
    	print_r( $_POST );
    	echo "</pre>";
    	die('12345');
    }, 10, 3 );
    #45307
    YasmineYasmine
    Participant

    I do see the $_POST array when do that. But when I try compare it:

    $old_values = rwmb_meta('academicreference_group', ['object_type' => 'post'], $post_ID);
    $new_values = $_POST['academicreference_group'] ?? [];

    Then the $_POST returns empty. And so I can't then compare the two

    #45314
    PeterPeter
    Moderator

    Hello,

    Please share your site credentials by submitting this contact form https://metabox.io/contact/
    I will take a look.

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