Skip to content

Conversation

@seemly
Copy link

@seemly seemly commented Jul 3, 2023

I have added a new bv_run_acf_rule_tests_value filter hook.

This means you can pass a shortcode into the Value field in the UI and run do_shortcode using the new filter before comparison.

This is useful when bulk importing posts using something like WP All Import, and you want to compare the value against a dynamically generated value defined in an ACF field on the current post.

add_filter('bv_run_acf_rule_tests_value', function($value) {
	if(str_contains($value, '[acf field=')) {
		return do_shortcode($value);
	}
	
	return $value;
});
Screenshot 2023-07-03 at 20 07 24

seemly added 2 commits July 3, 2023 20:05
I have added a new `bv_run_acf_rule_tests_value` filter hook.

This means you can then pass a shortcode into the `Value` field in the UI, and run `do_shortcode` using the new filter prior to comparison.

This is useful when bulk importing posts using something like WP All Import, and you want to compare the value against a dynamically generated value defined in an ACF field on the current post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant