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

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

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

The filter receives an array with the default labels, and expects an array of labels to be returned.

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

By default, the following labels are included:

$labels = array(
    'name'               => __( 'Contacts', 'wp-crm-system' ),
    'singular_name'      => __( 'Contact', 'wp-crm-system' ),
    'menu_name'          => __( 'Contacts', 'wp-crm-system' ),
    'name_admin_bar'     => __( 'Contact', 'wp-crm-system' ),
    'add_new'            => __( 'Add New', 'wp-crm-system' ),
    'add_new_item'       => __( 'Add New Contact', 'wp-crm-system' ),
    'new_item'           => __( 'New Contact', 'wp-crm-system' ),
    'edit_item'          => __( 'Edit Contact', 'wp-crm-system' ),
    'view_item'          => __( 'View Contact', 'wp-crm-system' ),
    'all_items'          => __( 'Contacts', 'wp-crm-system' ),
    'search_items'       => __( 'Search Contacts', 'wp-crm-system' ),
    'parent_item_colon'  => __( 'Parent Contact:', 'wp-crm-system' ),
    'not_found'          => __( 'No contacts found.', 'wp-crm-system' ),
    'not_found_in_trash' => __( 'No contacts found in Trash.', 'wp-crm-system' )
);

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).

An example of changing the word "Contact" to something more specific like "Customer".

add_filter( 'wpcrm_system_post_type_labels_wpcrm-contact', 'change_contact_to_customer' );
function change_contact_to_customer( $labels ){
    $labels = array(
        'name'               => __( 'Customers', 'wp-crm-system' ),
        'singular_name'      => __( 'Customer', 'wp-crm-system' ),
        'menu_name'          => __( 'Customers', 'wp-crm-system' ),
        'name_admin_bar'     => __( 'Customer', 'wp-crm-system' ),
        'add_new'            => __( 'Add New', 'wp-crm-system' ),
        'add_new_item'       => __( 'Add New Customer', 'wp-crm-system' ),
        'new_item'           => __( 'New Customer', 'wp-crm-system' ),
        'edit_item'          => __( 'Edit Customer', 'wp-crm-system' ),
        'view_item'          => __( 'View Customer', 'wp-crm-system' ),
        'all_items'          => __( 'Customers', 'wp-crm-system' ),
        'search_items'       => __( 'Search Customers', 'wp-crm-system' ),
        'parent_item_colon'  => __( 'Parent Customer:', 'wp-crm-system' ),
        'not_found'          => __( 'No customers found.', 'wp-crm-system' ),
        'not_found_in_trash' => __( 'No customers found in Trash.', 'wp-crm-system' )
    );
    return $labels;
}