Forums Forums Search & Filter Pro Passing WP_Query to another plugin

Viewing 10 posts - 1 through 10 (of 17 total)
  • Anonymous
    #195272
    This reply has been marked as private.
    Anonymous
    #195274
    This reply has been marked as private.
    Anonymous
    #195276
    This reply has been marked as private.
    Trevor
    #195299

    It looks like the data is being passed INSIDE the while loop. The basic archive structure is this:

    if ( $query->have_posts() )
    {
    	
    // Pass the query here	
    
        while ($query->have_posts())
    	{
    		$query->the_post();
    		
    // Looks like the query is being passed here
    
        }
    
    }
    Anonymous
    #195315

    That eliminates the looping but the query results are empty. There may be something I’m missing in the documentation. I’m doing this:

    if ( $query->have_posts() )
    {
       echo GeoMashup::map([
       'map_content' => $query,
       'show_future' => True,
       ]);
       while ($query->have_posts())
    	{
             // and so on

    Does that look correct?

    Anonymous
    #195321
    This reply has been marked as private.
    Trevor
    #195392

    Where you use $query are you sure that is the name of the query array? What does the map_content variable need by way of data? $query will give it the whole array. It might be useful to use print_r inside `

    
    

    HTML tags on that $query variable to see if it is empty or not.

    Anonymous
    #195400

    Per the other plugin’s docs, the map_content variable takes a WP Query object.

    When I print_r($query), it shows WP_Query Object ( [query] => Array ( [paged] => 1 [search_filter_id] => 174371529654519 [search_filter_override] => [posts_per_page] => 10 [post_status] => Array ( [0] => publish ) [ignore_sticky_posts] => 1 [meta_query] => Array ( ) [post_type] => simcal-concerts [orderby] => Array ( [date] => ASC ) [date_query] => Array ( [after] => Array ( [day] => 05 [month] => 12 [year] => 2018 ) [before] => Array ( [day] => 01 [month] => 06 [year] => 2019 ) [inclusive] => 1 ) [post__in] => Array ( [0] => 174371529431586 [1] => 174371529431587 [2] => 174371529431588 [3] => 174371529431589 [4] => 174371529431590 [5] => 174371529431591 [6] => 174371529431592 [7] => 174371529431593 [8] => 174371529431595 [9] => 174371529431596 [10] => (…) and so on, through a fairly large number of results.

    When reloaded via AJAX, it shows something that looks more like a JSON response, with HTML characters escaped.

    Trevor
    #195405
    This reply has been marked as private.
    Anonymous
    #195407
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 17 total)