PHP code example of elcontraption / wp-post-type

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

    

elcontraption / wp-post-type example snippets


use \ElContraption\WpPostType\PostType;

$events = new PostType('event');

$events = new PostType(array(

    // These are alleries',

    // Optional
    'name' => 'gallery'
));

$labels = array(

    // Override the 'add_new' label
    'add_new' => 'My Custom Label'
);

$events = new PostType('event', $labels);

$args = array(

    // Make this post type public
    'public' => true
);

$events = new PostType('event', $labels, $args);