Registers the form post type.
Description
See also
Source
File: src/db-objects/post-type-manager.php
protected function register_form_post_type() { $options = $this->options()->get( 'general_settings', array() ); $rewrite_slug = ! empty( $options['slug'] ) ? $options['slug'] : _x( 'forms', 'default form rewrite slug', 'torro-forms' ); $menu_icon = '<svg viewBox="0 0 1500 1500" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M0 750 l0 -750 750 0 750 0 0 750 0 750 -750 0 -750 0 0 -750z m680 161 l0 -158 -74 -6 c-83 -6 -132 -27 -148 -63 -11 -24 -5 -94 19 -238 l6 -39 -79 54 c-109 75 -201 164 -231 222 -51 102 -38 214 32 276 46 40 175 80 335 105 14 2 51 4 83 5 l57 1 0 -159z m395 130 c175 -42 237 -81 265 -167 17 -50 7 -131 -23 -191 -30 -58 -122 -147 -231 -222 l-79 -54 6 39 c24 144 30 214 19 238 -16 36 -65 57 -148 63 l-74 6 0 160 0 160 93 -7 c50 -3 128 -15 172 -25z"/></svg>'; $args = array( 'labels' => array( 'name' => __( 'Forms', 'torro-forms' ), 'singular_name' => __( 'Form', 'torro-forms' ), 'add_new' => _x( 'Add New', 'form label', 'torro-forms' ), 'add_new_item' => __( 'Add New Form', 'torro-forms' ), 'edit_item' => __( 'Edit Form', 'torro-forms' ), 'new_item' => __( 'New Form', 'torro-forms' ), 'view_item' => __( 'View Form', 'torro-forms' ), 'view_items' => __( 'View Forms', 'torro-forms' ), 'search_items' => __( 'Search Forms', 'torro-forms' ), 'not_found' => __( 'No forms found.', 'torro-forms' ), 'not_found_in_trash' => __( 'No forms found in Trash.', 'torro-forms' ), 'parent_item_colon' => __( 'Parent Form:', 'torro-forms' ), 'all_items' => __( 'All Forms', 'torro-forms' ), 'archives' => __( 'Form Archives', 'torro-forms' ), 'attributes' => __( 'Form Attributes', 'torro-forms' ), 'insert_into_item' => __( 'Insert into form', 'torro-forms' ), 'uploaded_to_this_item' => __( 'Uploaded to this form', 'torro-forms' ), 'filter_items_list' => __( 'Filter forms list', 'torro-forms' ), 'items_list_navigation' => __( 'Forms list navigation', 'torro-forms' ), 'items_list' => __( 'Forms list', 'torro-forms' ), 'menu_name' => __( 'Forms', 'torro-forms' ), ), 'public' => true, 'hierarchical' => false, 'exclude_from_search' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => false, 'menu_position' => 50, 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode( $menu_icon ), 'capability_type' => array( $this->get_prefix() . 'form', $this->get_prefix() . 'forms' ), 'map_meta_cap' => true, 'supports' => array( 'title' ), 'has_archive' => false, 'rewrite' => array( 'slug' => $rewrite_slug, 'with_front' => false, 'ep_mask' => EP_PERMALINK, ), ); $this->register( $this->get_prefix() . 'form', $args ); $this->unregister_map_meta_caps(); }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |