Skip to Content
Menu

infinite_load()

Actually loads the infinite query.

PHP April 26, 2017

Usage

This function runs automatically, so it is not called manually. Is this incorrect?

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /libs/Functions.php on line 1811.

    No Hooks

    This function does not have any filters or actions available. Request one?
    PHP
            public function infinite_load(){
                if ( !wp_verify_nonce($this->super->post['nonce'], 'nebula_ajax_nonce') ){ die('Permission Denied.'); }
    
                $page_number = sanitize_text_field($this->super->post['page']);
                $args = json_decode(stripslashes($this->super->post['args']), true); //Remove escaped slashes and decode to an array
                $args['paged'] = $page_number; //Add the page number to the array
                $loop = sanitize_text_field($this->super->post['loop']);
                $args = array_map('esc_attr', $args); //Sanitize the args array
    
                query_posts($args);
    
                if ( $loop == 'false' ){
                    get_template_part('loop');
                } else {
                    call_user_func($loop); //Custom loop callback function must be defined in a functions file (not a template file) for this to work.
                }
    
                wp_die();
            }
    

    Override

    This function can not be short-circuited with an override filter. Request one?