This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Post Loop using Ajax

10 years ago · Last reply by Ivan 9 years ago

Hello,
I’m using PageBuilder and i want to load the pages using Ajax. It’s working but i had a problem using the Post Loop widget, because i get a blank page.

I searched a bit and i found this :
https://github.com/wp-plugins/siteorigin-panels/blob/master/widgets/basic.php#L170

function widget( $args, $instance ) {
		...
		if( is_admin() ) return;
		...

All the Ajax calls must be routed in : /wp-admin/admin-ajax.php. But the

is_admin()
function will always return
true
due to this routing.

I would like to know :
1 – Is there a simpler solution than duplicate the widget and remove this line
2 – Why is this condition checked ?

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

3
  1. Andy 10 years, 9 months ago

    Hello, i’m always facing this problem, can someone can help me ? Thanks :)

  2. Greg Priday Staff 10 years, 9 months ago

    Hi Andy

    Sorry we missed your thread last time.

    The main reason we’re adding in that check in is to prevent the possibility of infinite loops coming up, which was happening in the admin. I’ll look at making that check filterable for use cases like yours. Basically something along the lines of:

    if( apply_filters( 'siteorigin_panels_postloop_skip_render', is_admin() ) ) return;
  3. Ivan 9 years, 6 months ago

    Hello Andy,

    I was wondering if you have documented in some place about how to use ajax with Siteorigin. I’m needing to make an ajax pagination of a widget, so if you can share what you have, it should be good in order to get an idea.

    Thanks!!

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread