Content types

Post types

Register editor-ready content types using familiar WordPress arguments.

#Complete example

PHP
<?php

defined('ABSPATH') || exit;

use Voxyframe\Core\Registry;

add_action('voxycure/register', function (Registry $registry): void {
    $registry->register_post_type('project', [
        'name'          => 'Projects',
        'singular_name' => 'Project',
        'show_in_rest' => true,
        'supports'     => ['title', 'editor', 'thumbnail'],
    ]);
});

#Definition arguments

KeyTypeDefault / purpose
namestringPlural label derived from the slug.
singular_namestringFalls back to name.
publicbooleantrue
show_uibooleantrue
show_in_restbooleantrue; required for the block editor.
supportsstring[]title and editor.
has_archiveboolean|stringtrue
rewrite_slugstringThe post type slug.
argsarrayOverrides or adds native WordPress arguments.

#Pass current WordPress arguments

This is a complete inc/voxycure.php file. Put advanced native arguments inside args.

PHP
<?php

defined('ABSPATH') || exit;

use Voxyframe\Core\Registry;

add_action('voxycure/register', function (Registry $registry): void {
    $registry->register_post_type('event', [
        'name' => 'Events',
        'args' => [
            'rest_namespace' => 'wp/v2',
            'template' => [['core/heading'], ['core/paragraph']],
            'template_lock' => 'insert',
        ],
    ]);
});
Framework version2.0.0
PHP requirement8.0+
Documentation updatedAugust 2026