Ecommerce Shopify WordPress Discussion

Display content when changing a user profile custom field using ACF

I have created a ACF field group which displays inside a Wordpress user profile. Within that field group is a simple dropdown field with 4 options. I am trying to create a shortcode where by an admin can select one of these options inside a users profile. Once they do this, a button/link/text would appear on a specific page that only the user would see once logged in. Eg. If an admin selects the 'Approved' option, then the user would see some text on the front end saying 'You're approved'. Here is what I have but it doesn't seem to be working. add_shortcode('pdf-capa-button', 'capa_btn'); function capa_btn() { $user_id = get_current_user_id(); $variable = get_field('capa_statut', "user_{$id}"); $content = ''; if($variable == "CAPA Approved") { $content .= '<p>You are approved!</p>'; } return $content; } Is there anything I'm doing wrong? The code doesn't seem to be throwing any errors but nonetheless, the shortcode isn't generating any content on the front end. Any help would be appreciated
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.