wpcrm_system_post_type_args_{post-type}

The wpcrm_system_post_type_args_{post-type} filter lets you edit the arguments that are used in WP-CRM System for the various post types.

Each type of record has its own post type, so the filters used will be specific for each post type:

  • wpcrm_system_post_type_args_wpcrm-contact
  • wpcrm_system_post_type_args_wpcrm-organization
  • wpcrm_system_post_type_args_wpcrm-project
  • wpcrm_system_post_type_args_wpcrm-task
  • wpcrm_system_post_type_args_wpcrm-opportunity
  • wpcrm_system_post_type_args_wpcrm-campaign

The filter receives an array with the default arguments and expects an array to be returned.

For more information on possible arguments that can be added, please see the WordPress documentation on Custom Post Type arguments.

By default, the following arguments are included:

// Note $post_type = wpcrm-contact; in this example
$args = array(
    'labels'             => $labels, // See note below about labels
    'description'        => __( 'Contacts', 'wp-crm-system' ),
    'public'             => false,
    'exclude_from_search'=> true,
    'publicly_queryable' => false,
    'show_ui'            => true,
    'show_in_menu'       => 'wpcrm',
    'query_var'          => true,
    'rewrite'            => array( 'slug' => $post_type ),
    'capabilities' => array(
        'edit_post' => 'edit_'.$post_type,
        'read_post' => 'read_'.$post_type,
        'delete_post' => 'delete_'.$post_type,
        'edit_posts' => 'edit_'.$post_type.'s',
        'edit_others_posts' => 'edit_others_'.$post_type.'s',
        'publish_posts' => 'publish_'.$post_type.'s',
        'read_private_posts' => 'read_private_'.$post_type.'s',
        'read' => 'read_'.$post_type,
        'delete_posts' => 'delete_'.$post_type.'s',
        'delete_private_posts' => 'delete_private_'.$post_type.'s',
        'delete_published_posts' => 'delete_published_'.$post_type.'s',
        'delete_others_posts' => 'delete_others_'.$post_type.'s',
        'edit_private_posts' => 'edit_private_'.$post_type.'s',
        'edit_published_posts' => 'edit_published_'.$post_type.'s',
        'create_posts' => 'create_'.$post_type.'s',
    ),
    'has_archive'        => false,
    'hierarchical'       => false,
    'menu_position'      => null,
    'taxonomies'        => array( 'contact-type' ),
    'supports'           => array( 'author', 'thumbnail', 'custom-fields', 'comments' )
);

Each post type is passed the same array with the exception of the values shown will be specific to that post type (Contact/Contacts will be changed to the appropriate record type).

Please note that the $labels variable is the same as the labels that can be modified in the wpcrm_system_post_type_labels_{post-type} filter. If you only need to edit those labels, it is safer to use that filter so you do not accidentally override any of the default behavior of the WP-CRM System post types.