PHP code example of victorhugobatista / wp-eruptor

1. Go to this page and download the library: Download victorhugobatista/wp-eruptor 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/ */

    

victorhugobatista / wp-eruptor example snippets


use victorhugobatista\WpEruptor\Eruptor;
Eruptor::initialize();

use victorhugobatista\WpEruptor\Eruptor;

$themePath = get_template_directory();
$templateToInclude = "{$themePath}/my-custom-template-dir";

Eruptor::initialize($templateToInclude);

 echo $pageData['post-id'] 

add_filter('eruptor/data*', function($data) {
  return array_merge($data, [
    'new-data' => 'new data added to template',
  ]);
});

 echo $pageData['new-data']