ACF checkbox return format based on page

You have to return the output with the value. you can check the following code. function hello_shortcode() { // Load field settings and values. $field = get_field_object(‘producent’); if( ! is_product_category() ) { $checkbox = $field[‘value’]; } else { $checkbox = $field[‘label’]; } $output=”‹p›”.$checkbox.’‹/p›’; return $output; } // register shortcode add_shortcode(‘hello’, ‘hello_shortcode’);

Shortcode for Custom Field of Media Attachment (to use with Featured Images)

The most basic option I can think of is this add_shortcode(‘bt_featured_image_acf_location’, ‘bt_featured_image_acf_location’); function bt_featured_image_acf_location ($atts) { return get_field(‘location’, get_post_thumbnail_id()); } Change ‘location’ to your acf field name and thats it. get_post_thumbnail_id() will get the current post featured image id. Once you have the ID of the post (images are posts, they are of the post … Read more

CPT email notification including only new value custom fields

From your explanation, it seems that we need wp_mail() function and post_updated hook. wp_mail() reference: https://developer.wordpress.org/reference/functions/wp_mail/ post_updated action hook: https://developer.wordpress.org/reference/hooks/post_updated/ <CPT_name> – replace this with your custom post type key. (Untested code – it should give you a good idea of what needs to be done) add_action(‘post_updated’, `send_custom_update`, 10, 3); function send_custom_update($post_ID, $post_after, $post_before) { … Read more

Form checkbox value going to dynamic URL

I am no expert but you are submitting multiple checkboxes with the same name attribute. Your current form GET action will return the url params like this for example… http://www.urltoshow.com/ville/paris?style=Classique&syle=Luxe So because there are 2 usages of param style in the url above, it means PHP $_GET[‘style’] will only return the last getted param value. … Read more