AJAX and Shortcode with Parameters
AJAX and Shortcode with Parameters
AJAX and Shortcode with Parameters
Test WordPress api with postman
How can I use cached images in an AJAX response?
How to get original custom taxonomy slug after the slug has been rewritten?
Ajax date_query not working past the first iteration
Load MediaPlayerElement after Infinity Scroll loads more posts
The answer is wp_get_referer(). This function is working inside ajax_query_attachments_args. I can then use get_post_type with the post id from url parameters $referer = parse_url(wp_get_referer()); parse_str($referer[‘query’], $params); if (isset($params[‘post’])){ $post_type = get_post_type($params[‘post’]); } else if (strpos($referer[‘path’], ‘post-new.php’) !== false && !isset($params[‘post_type’])){ $post_type=”post”; } else { $post_type=””; } if ( $post_type == ‘post’ ) { $query[‘tax_query’] … Read more
JS innerhtml changing style when using AJAX
My solution ended up being: <script> var mb_user_location_current = … … </script> And then used those variables from the head to the function. But then ventured down other paths for different solutions.
You can use default wordpress function to search categories. get_terms() is the function you need to use where you need to pass your search string in a search parameter. For details please check get_terms function in wordpress codex