How to exclude tags and categories from a function?

I don’t know how the structure of $cat_not_in looks like but make sure that that variable is not an array. If $cat_not_in is an array then you could try if ($cat_not_in) { $args[‘category__not_in’] = $cat_not_in; } if ($tag_not_in) { $args[‘tag__not_in’] = $tag_not_in; } Also see WP Codex – WP_Query it allows for category exclusion by … Read more

What esc_ to use to validate this?

esc_url is the correct function to escape links -> https://codex.wordpress.org/Function_Reference/esc_url – if it’s not working correctly then double check the actual output of your variables to make sure they are in fact links. But selling links in your themes via “sponsored” links is not something I would ever recommend anyone doing which from the code … Read more

wp_enqueue_script seperately for each shortcode

You’re pretty close! What you can do is to register all of the scripts via the wp_enqueue_scripts hook normally and then just enqueue them in the shortcode callback. This is telling WordPress about the scripts and then allowing you to only enqueue them as needed: add_action( ‘wp_enqueue_scripts’ ‘register_all_my_scripts’ ); function register_all_my_scripts() { wp_register_script( ‘per-pas-belanja-online’, plugins_url(‘js/per-pas-belanja-online.js’, … Read more

how to retrieve a value if a checkbox is checked

You need to first get the post meta value that Fieldmanager writes to your database for the checkbox. This answer can help you. Then you can properly set $in_update and do this test: elseif ( /* VALUE WHEN YOUR CHECKBOX IS CHECKED */ == $in_update ) { echo ‘<span class=”…’; }