-
Notifications
You must be signed in to change notification settings - Fork 0
/
rename-documents.php
38 lines (33 loc) · 1.46 KB
/
rename-documents.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
Plugin Name: WP Document Revisions - Rename Documents Label
Plugin URI:
Description: Example code to change the "Documents" labels used throughout the plugin to something else such as "articles" or "reports"
Version: 0.1
Author: Benjamin J. Balter
Author URI: http://ben.balter.com
License: GPL2
*/
/**
* Changes all references to "Documents" in the interface to "Articles"
* @params array $args the default args for the custom post type
* @returns array $args the CPT args with our modified labels
*/
function bb_filter_document_cpt( $args ) {
$args['labels'] = array(
'name' => _x( 'Articles', 'post type general name', 'wp_document_revisions' ),
'singular_name' => _x( 'Article', 'post type singular name', 'wp_document_revisions' ),
'add_new' => _x( 'Add Article', 'article', 'wp_document_revisions' ),
'add_new_item' => __( 'Add New Article', 'wp_document_revisions' ),
'edit_item' => __( 'Edit Article', 'wp_document_revisions' ),
'new_item' => __( 'New Article', 'wp_document_revisions' ),
'view_item' => __( 'View Article', 'wp_document_revisions' ),
'search_items' => __( 'Search Articles', 'wp_document_revisions' ),
'not_found' =>__( 'No articles found', 'wp_document_revisions' ),
'not_found_in_trash' => __( 'No articles found in Trash', 'wp_document_revisions' ),
'parent_item_colon' => '',
'menu_name' => __( 'Articles', 'wp_document_revisions' ),
);
return $args;
}
add_filter( 'document_revisions_cpt', 'bb_filter_document_cpt' );