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

Shortcode Bug #85

Open
YanMetelitsa opened this issue Mar 20, 2025 · 0 comments
Open

Shortcode Bug #85

YanMetelitsa opened this issue Mar 20, 2025 · 0 comments

Comments

@YanMetelitsa
Copy link
Contributor

Greetings!

I noticed, that on some sites the [acf] shortcode does not work, while on some sites it works (with the same versions of WordPress and SCF).

When trying to output shortcode [acf field=”..."], an empty string is displayed. Everywhere – in page/post content, plugins etc..

I checked if the shortcode is registered using $GLOBALS[ 'shortcode_tags' ] – shortcode [acf] is registered.

At the same time, if you recreate the shortcode, it starts working correctly:

add_shortcode( 'acf', function ( $atts ) {
	$value = apply_filters(
		'acf/format_value', 
		get_field( $atts[ 'field' ], $atts[ 'post_id' ] )
	);

	return $value;
});
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

No branches or pull requests

1 participant