PHP code example of johnbillion / extended-template-parts

1. Go to this page and download the library: Download johnbillion/extended-template-parts 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/ */

    

johnbillion / extended-template-parts example snippets




get_extended_template_part( 'foo', 'bar' );

get_extended_template_part( 'foo', 'bar', [
	'my_variable' => 'Hello, world!',
] );

echo esc_html( $this->vars['my_variable'] );

get_extended_template_part( 'foo', 'bar', [
	'my_variable' => 'Hello, world!',
], [
	'dir'   => 'my-directory',
	'cache' => 1 * HOUR_IN_SECONDS,
] );