PHP code example of builtnorth / wp-post-types

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

    

builtnorth / wp-post-types example snippets


use BuiltNorth\PostTypesConstructor\PostTypeManager;

add_action('init', function() {
    $post_type_manager = new PostTypeManager();
    $post_type_manager->init();
}, 0);

use BuiltNorth\PostTypesConstructor\PostTypeManager;

add_action('init', function() {
    $config_file = plugin_dir_path(__FILE__) . 'post-type.config.json';
    $post_type_manager = new PostTypeManager($config_file);
    $post_type_manager->init();
}, 0);

$config_file = '/path/to/your/custom-config.json';
$post_type_manager = new PostTypeManager($config_file);
$post_type_manager->init();

$config = [
    'post_types' => [
        // Your post type configurations
    ],
    // Other configurations
];

$post_type_manager = new PostTypeManager($config);
$post_type_manager->init();