PHP code example of martinsluters / wpregistrars

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

    

martinsluters / wpregistrars example snippets


use martinsluters\WPRegistrars\Factories\{ BulkRegistrarPostTypesFactory, BulkRegistrarTaxonomiesFactory };

( new  BulkRegistrarPostTypesFactory() )
    ->withArguments( [ 'report', 'guide', 'resource' ] )
    ->create()
    ->register();

( new  BulkRegistrarTaxonomiesFactory() )
    ->withArguments(
    	[
		'resource_type' => [ 'object_type' => [ 'resource' ] ]
		'guide_language' => [ 'object_type' => [ 'guide' ] ]
		'my-random-taxonomy'
    	]
    )
    ->create()
    ->register();

use martinsluters\WPRegistrars\Factories\BulkRegistrarPostTypesFactory;
use martinsluters\WPRegistrars\PluralizerDoctrineInflectorAdapter;
use Doctrine\Inflector\{ InflectorFactory, Inflector, Language };

$doctrine_inflector_spanish = ( new InflectorFactory( Language::SPANISH ) )
	->create()
	->build();
$pluralizer_spanish = new PluralizerDoctrineInflectorAdapter( $doctrine_inflector_spanish );

( new BulkRegistrarPostTypesFactory() )
	->withPluralizer( $pluralizer_spanish )
	->withDefaultRegistrationArguments( ['public' => true] )
	->withArguments( [ 'escuela' ] )
	->create()
	->register();