• Can someone please share how the “callback” parameter works? Is it a PHP function callback, Javascript callback? I can’t seem to find a working example, and every test I’ve attempted doesn’t seem to fire. Here’s what my code looks like:

    PHP including PHP callback

    add_filter( 'infinite_scroll_options', 'mytheme_infinite_scroll_options' );
    
    function mytheme_infinite_scroll_options( $options ){
    	$options['callback'] = 'mytheme_infinite_scroll_callback';
    	return $options;
    }
    
    function mytheme_infinite_scroll_callback( $vars = array() ){
    	echo '<script type="text/javascript">alert(\'php callback\');</script>';
    	return $vars;
    }

    JS Version

    function mytheme_infinite_scroll_callback(){
    	alert('js callback');
    }

    I don’t get either alert.

    https://www.ads-software.com/plugins/infinite-scroll/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Callback Example?’ is closed to new replies.