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 do I query posts by a sub value with the API?

To access posts via meta key you need to hook into the [rest_query_vary filter].1 The example I was thinking of when I read your question is the same one found on the post @WebElaine commented. I’ve merely added it below: function my_allow_meta_query( $valid_vars ) { $valid_vars = array_merge( $valid_vars, array( ‘meta_key’, ‘meta_value’ ) ); return … Read more