Skip to content

Adding Post Types

Paul Ryley edited this page May 16, 2017 · 1 revision

Example configuration for the "Post Types" field

You may copy and paste the following into the Post Types field in the Pollux settings.

gallery:

  # [required] This is the Singular name of the Post Type, used to generate correct labels
  single: Gallery

  # [required] This is the Plural name of the Post Type, used to generate correct labels
  plural: Galleries

  # [optional] By default, the menu name label is the same as the "plural" value.
  menu_name: My Galleries

  # [optional] These are the columns you want to show in the Post Type admin page table,
  # you must also add their corresponding labels in the "Post Type Columns".
  columns:
    - title
    - slug
    - media
    - thumbnail
    - date

  # [optional] Default value is false
  # https://codex.wordpress.org/Function_Reference/register_post_type#has_archive
  has_archive: false

  # [optional] Default value is true
  # https://codex.wordpress.org/Function_Reference/register_post_type#map_meta_cap
  map_meta_cap: true

  # [optional] Defaults to the posts icon.
  # See all available Built-in icons here: https://developer.wordpress.org/resource/dashicons/
  # https://codex.wordpress.org/Function_Reference/register_post_type#menu_icon
  menu_icon: dashicons-images-alt2

  # [optional] Default value is 20 (below the Pages menu item)
  # https://codex.wordpress.org/Function_Reference/register_post_type#menu_position
  menu_position: 20

  # [optional] Default value is true
  # https://codex.wordpress.org/Function_Reference/register_post_type#public
  public: false

  # [optional] Default value is true
  # https://codex.wordpress.org/Function_Reference/register_post_type#show_in_menu
  show_in_menu: true

  # [optional] Default value is true
  # https://codex.wordpress.org/Function_Reference/register_post_type#show_ui
  show_ui: true

  # [optional] Default values are title and editor
  # https://codex.wordpress.org/Function_Reference/register_post_type#supports
  supports:
    - title
    - editor
    - thumbnail

For all other fields and their defaults, please see the available parameters at the official WordPress Codex.