61 lines
3 KiB
PHP
61 lines
3 KiB
PHP
<?php
|
|
/**
|
|
* Custom Post Type registration.
|
|
*
|
|
* @package WPFMJ
|
|
* @subpackage WPFMJ/includes
|
|
*/
|
|
|
|
class WPFMJ_CPT {
|
|
|
|
/**
|
|
* Register the custom post type for automations.
|
|
*/
|
|
public function register_post_type() {
|
|
$labels = array(
|
|
'name' => _x('Automations', 'Post Type General Name', 'wpforms-mailjet-automation'),
|
|
'singular_name' => _x('Automation', 'Post Type Singular Name', 'wpforms-mailjet-automation'),
|
|
'menu_name' => __('Mailjet Automations', 'wpforms-mailjet-automation'),
|
|
'name_admin_bar' => __('Automation', 'wpforms-mailjet-automation'),
|
|
'archives' => __('Automation Archives', 'wpforms-mailjet-automation'),
|
|
'attributes' => __('Automation Attributes', 'wpforms-mailjet-automation'),
|
|
'parent_item_colon' => __('Parent Automation:', 'wpforms-mailjet-automation'),
|
|
'all_items' => __('All Automations', 'wpforms-mailjet-automation'),
|
|
'add_new_item' => __('Add New Automation', 'wpforms-mailjet-automation'),
|
|
'add_new' => __('Add New', 'wpforms-mailjet-automation'),
|
|
'new_item' => __('New Automation', 'wpforms-mailjet-automation'),
|
|
'edit_item' => __('Edit Automation', 'wpforms-mailjet-automation'),
|
|
'update_item' => __('Update Automation', 'wpforms-mailjet-automation'),
|
|
'view_item' => __('View Automation', 'wpforms-mailjet-automation'),
|
|
'view_items' => __('View Automations', 'wpforms-mailjet-automation'),
|
|
'search_items' => __('Search Automation', 'wpforms-mailjet-automation'),
|
|
'not_found' => __('Not found', 'wpforms-mailjet-automation'),
|
|
'not_found_in_trash' => __('Not found in Trash', 'wpforms-mailjet-automation'),
|
|
);
|
|
|
|
$args = array(
|
|
'label' => __('Automation', 'wpforms-mailjet-automation'),
|
|
'description' => __('WPForms to Mailjet Automations', 'wpforms-mailjet-automation'),
|
|
'labels' => $labels,
|
|
'supports' => array('title'),
|
|
'hierarchical' => false,
|
|
'public' => false,
|
|
'show_ui' => false,
|
|
'show_in_menu' => false,
|
|
'menu_position' => 5,
|
|
'show_in_admin_bar' => false,
|
|
'show_in_nav_menus' => false,
|
|
'can_export' => false,
|
|
'has_archive' => false,
|
|
'exclude_from_search' => true,
|
|
'publicly_queryable' => false,
|
|
'capability_type' => 'post',
|
|
'capabilities' => array(
|
|
'create_posts' => 'manage_options',
|
|
),
|
|
'map_meta_cap' => true,
|
|
);
|
|
|
|
register_post_type('wpfmj_automation', $args);
|
|
}
|
|
}
|