Skip to content

Post Type

Gene Alyson Fortunado Torcende edited this page Apr 11, 2020 · 3 revisions

Registration

accepts 1 parameter - the array of custom post type configuration

ThemePlate()->post_type( $config );

Config

Each custom post type is configured using these following keys:

Required

  • name
  • singular
  • plural

Optional - (defaults)

  • args
array(
    'labels' => array() // with `singular` and `plural`
    'public' => true,
    'show_in_rest' => true,
    'rewrite' => array(
        'with_front' => false,
    ),
)