PHP code example of innocode-digital / wp-prerender-aws-lambda

1. Go to this page and download the library: Download innocode-digital/wp-prerender-aws-lambda library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

innocode-digital / wp-prerender-aws-lambda example snippets

`
add_filter( 'innocode_prerender_should_update_post_author', function (
    (bool) $should_update,
    int $object_id,
    $id
) : bool {
    // Do not update achive page of author with user id 5.
    if ( $id == 5 ) {
        return false;
    }

    return $should_update;
}, 10, 3 );
`
add_filter( 'innocode_prerender_template', function ( string $template ) : string {
    if ( $template == 'date_archive' ) {
        return '';
    }

    return $template;
} );
`
add_filter( 'innocode_prerender_selector', function () : string {
    return '#main';
} )
`
if ( function_exists( 'innocode_prerender' ) ) {
    innocode_prerender()
        ->get_db()
        ->get_html_version()
        ->bump();
}