Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom field's value is not being pulled #461

Open
kshojib opened this issue Sep 19, 2023 · 1 comment
Open

Custom field's value is not being pulled #461

kshojib opened this issue Sep 19, 2023 · 1 comment
Labels

Comments

@kshojib
Copy link

kshojib commented Sep 19, 2023

Bug description

Original issue was created here #460

I have added your suggested code but it did not work. Could you check?

add_filter( 'notification/should_send', 'skip_notification', 5000, 3 );
function skip_notification( $should_send, $notification, $trigger ) {
  $post_id = $trigger->{ $trigger->get_post_type() }->ID;
  $skip_notification = get_field('skip_notification', $post_id);
  if($skip_notification) {
  return false;
  }
  return $should_send;
}

$post_id = get_the_ID(); did pull the correct post id. $trigger->{ $trigger->get_post_type() }->ID; also returning the correct post ID. But it's not returning the ACF value.

@kshojib kshojib added the bug label Sep 19, 2023
@kshojib
Copy link
Author

kshojib commented Apr 3, 2024

I found the problem. It was due to the Gutenberg editor. I have installed classic editor which solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant