Get URL Param Plugin and Inserting Result in Widget Code

I think the underlying issue here is that shortcodes are not evaluated when placed inside HTML attributes. You could modify the template and output the necessary HTML using PHP and do_shortcode( ‘[urlparam param=”Book” /]’) as an alternative approach: <!– Calendly inline widget begin –> <div class=”calendly-inline-widget” data-url=”<?php echo do_shortcode( ‘[urlparam param=”Book” /]’ ); ?>” style=”min-width:320px;height:580px;”></div> … Read more

Changing WP_Query params with url Query Var

This code manually sets the order with the ‘order’ => ‘ASC’ declaration in the WP_Query arguments. $loop = new WP_Query( array( ‘post_type’ => ‘product’, ‘meta_key’ => ‘product_price’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘posts_per_page’ => 4, ‘paged’ => $paged) ); If we want to pass a url parameter to that we could use something like: … Read more

Add custom parameter to REST API request of a custom post type?

I solved following this answer and writing: public function query_wasb_messages_by_status( $args, $request ) { if ( ! is_null( $request->get_param( ‘message_status’ ) ) ) { $args[‘meta_query’] = array( ‘_wasb_message_status’ => array( ‘key’ => ‘_wasb_message_status’, ‘value’ => (int) $request->get_param( ‘message_status’ ), ‘compare’ => ‘=’, ‘type’ => ‘numeric’ ) ); } return $args; } add_filter( ‘rest_wasb_message_query’, array( $this, … Read more

wp_parse_args & category parameter

Update 3/5: When I originally answered this question I didn’t realize that your code was almost an exact copy of the wp_get_archives function. There is nothing in your code or the original wp_get_archives code that supports categories. The function was written to get date archives and your defaults are missing the type, limit, before and … Read more

How do I pass arguments for multiple functions hooked to a single action?

The value for the default output should be passed to do_action() as the second parameter. E.g.: do_action( ‘my_action’, ‘<p>Default output</p>’ ); Note that the above code will not actually output anything. It’s just going to fire the callbacks attached to the my_action hook and it will pass ‘<p>Default output</p>’ to those functions. You can modify … Read more

Create URL with parameter for JQuery toggle status

You need to process 2 scenarios: When page is loaded with #espanol hash When button is clicked //check for #espanol hash and toggle on page load spanishByHash(); //process toggle on click event $(‘.js-spanish-toggle’).on(‘click’, function() { hashToggle(); spanishToggle(); }); function spanishToggle() { $(‘.js-spanish-toggle’) .find(‘button’) .toggleClass(‘active’); $(‘.js-spanish-toggle’) .parents(‘.spanish-container’) .toggleClass(‘is-spanish’); } function hashToggle(){ if($(location).prop(‘hash’) === ‘#espanol’){ $(location).prop(‘hash’,”); }else{ … Read more