WordPress.org

Plugin Directory

Changeset 542130


Ignore:
Timestamp:
05/09/12 23:45:55 (2 years ago)
Author:
jamescollins
Message:

Custom Post Editor v1.0.2 files.

Location:
cpt-editor/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • cpt-editor/trunk/cpt-editor.php

    r541709 r542130  
    33Plugin Name: Custom Post Type Editor 
    44Plugin URI: http://om4.com.au/wordpress-plugins/custom-post-type-editor/ 
    5 Description: Customise the text labels/names for any registered custom post type. 
    6 Version: 1.0.1 
     5Description: Customize the text labels or menu names for any registered custom post type using a simple Dashboard user interface. 
     6Version: 1.0.2 
    77Author: OM4 
    88Author URI: http://om4.com.au/ 
     
    3131 
    3232class OM4_CPT_Editor { 
    33  
    34     var $version = '1.0'; 
    3533 
    3634    var $db_version = 1; 
     
    124122     * Executed whenever a Post Type is registered (by core, a plugin or a theme). 
    125123     * 
    126      * Override any labels that have been customised, and if we're in the backend save a backup of the original CPT so that we can detect that its been modified. 
     124     * Override any labels that have been customized, and if we're in the backend save a backup of the original CPT so that we can detect that its been modified. 
    127125     * 
    128126     * @param string $post_type 
     
    142140 
    143141                if ( $label_text != $wp_post_types[$post_type]->labels->$label_name ) { 
    144                     // This label text is customised, so override the default 
     142                    // This label text is customized, so override the default 
    145143                    $wp_post_types[$post_type]->labels->$label_name = $label_text; 
    146144                } 
     
    197195 
    198196                if ( !is_array($this->settings['types'][$post_type]['labels']) ) { 
    199                     // The user hasn't customised the labels for this built-in CPT 
     197                    // The user hasn't customized the labels for this built-in CPT 
    200198                    continue; 
    201199                } 
     
    210208 
    211209                    if ( isset($this->settings['types'][$post_type]['labels'][$label_name_to_override]) ) { 
    212                         // The user has customised this label 
     210                        // The user has customized this label 
    213211 
    214212                        $id = null; 
     
    390388 
    391389                            if ( $_POST[$label_name] != $this->cpt_originals[$custom_post_type_name]->labels->{$label_name} ) { 
    392                                 // Label text is customised from the default 
     390                                // Label text is customized from the default 
    393391                                $this->settings['types'][$custom_post_type_name]['labels'][$label_name] =  $_POST[$label_name]; 
    394392                                $needs_save = true; 
     
    421419        <form action="" method="post" id="edit_custom_post_type"> 
    422420            <h3><?php esc_html_e( 'Labels', 'om4-cpt-editor' );?></h3> 
    423             <p><?php esc_html_e( 'Here you can customise (override) one or more labels for this Custom Post Type.', 'om4-cpt-editor' ); ?></p> 
    424             <p><?php esc_html_e( 'Customised Labels are shown in blue.', 'om4-cpt-editor' ); ?></p> 
     421            <p><?php esc_html_e( 'This screen lets you customize one or more text or menu labels for this Custom Post Type.', 'om4-cpt-editor' ); ?></p> 
     422            <p><?php esc_html_e( 'Customized Labels are shown in blue.', 'om4-cpt-editor' ); ?></p> 
    425423            <p><?php esc_html_e( 'To reset a label to its default, empty its text field. To reset all labels to their defaults, use the checkbox below:', 'om4-cpt-editor' ); ?></p> 
    426424            <table class="form-table"> 
     
    442440                        <td> 
    443441                            <?php 
    444                             $class = esc_attr( isset($this->settings['types'][$custom_post_type_name]['labels'][$label_name]) ? 'customised' : 'default' ); 
     442                            $class = esc_attr( isset($this->settings['types'][$custom_post_type_name]['labels'][$label_name]) ? 'customized' : 'default' ); 
    445443                            ?> 
    446444                            <input name="<?php echo esc_attr($label_name); ?>" type="text" id="<?php esc_attr_e($label_name); ?>" value="<?php esc_attr_e($custom_post_type->labels->$label_name); ?>" class="<?php echo $class; ?>" /> 
     
    477475                    width: auto; 
    478476                } 
    479                 form#edit_custom_post_type .customised { 
     477                form#edit_custom_post_type .customized { 
    480478                    color: blue; 
    481479                } 
     
    489487                    ); 
    490488 
    491                     // When a label text is modified, display it a customised 
     489                    // When a label text is modified, display it a customized 
    492490                    $('form#edit_custom_post_type input[type=text]').keyup( function() { 
    493                                 $(this).removeClass('default').addClass('customised'); 
     491                                $(this).removeClass('default').addClass('customized'); 
    494492                            } 
    495493                    ); 
     
    518516 
    519517    /** 
    520      * Whether or not the specified Custom Post Type has been customised using this plugin. 
     518     * Whether or not the specified Custom Post Type has been customized using this plugin. 
    521519     * 
    522520     * @param string $post_type The Custom Post Type name/identifier 
    523521     * @return bool 
    524522     */ 
    525     public function IsCustomised( $post_type ) { 
     523    public function IsCustomized( $post_type ) { 
    526524        return ( isset($this->settings['types'][$post_type]['labels']) && is_array($this->settings['types'][$post_type]['labels']) && count($this->settings['types'][$post_type]['labels']) ); 
    527525    } 
    528526 
    529527    /** 
    530      * The number of customised labels for the specified Custom Post Type 
     528     * The number of customized labels for the specified Custom Post Type 
    531529     * @param string $post_type The Custom Post Type name/identifier 
    532530     * @return int 
    533531     */ 
    534     public function NumberOfCustomisedLabels( $post_type ) { 
     532    public function NumberOfCustomizedLabels( $post_type ) { 
    535533        return ( isset($this->settings['types'][$post_type]['labels']) && is_array($this->settings['types'][$post_type]['labels']) ) ? count($this->settings['types'][$post_type]['labels']) : 0; 
    536534    } 
  • cpt-editor/trunk/inc/OM4_CPT_List_Table.php

    r541683 r542130  
    5252                'title' => $post_type_object->label, 
    5353                'name' => $post_type, 
    54                 'status' => $this->instance->NumberOfCustomisedLabels($post_type) 
     54                'status' => $this->instance->NumberOfCustomizedLabels($post_type) 
    5555            ); 
    5656        } 
     
    9999    function column_status( $item ) { 
    100100        if ( $item['status'] > 0 ) { 
    101             return __( 'Customised', 'om4-cpt-editor' ); 
     101            return __( 'Customized', 'om4-cpt-editor' ); 
    102102        } else { 
    103103            return __( 'Default', 'om4-cpt-editor' ); 
  • cpt-editor/trunk/languages/om4-cpt-editor.pot

    r541709 r542130  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: Custom Post Type Editor 1.0\n" 
     5"Project-Id-Version: Custom Post Type Editor 1.0.1\n" 
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/cpt-editor\n" 
    7 "POT-Creation-Date: 2012-05-09 00:32:19+00:00\n" 
     7"POT-Creation-Date: 2012-05-09 03:59:47+00:00\n" 
    88"MIME-Version: 1.0\n" 
    99"Content-Type: text/plain; charset=UTF-8\n" 
     
    1717msgstr "" 
    1818 
    19 #: cpt-editor.php:204 
     19#: cpt-editor.php:281 
    2020msgid "Registered Custom Post Types" 
    2121msgstr "" 
    2222 
    23 #: cpt-editor.php:205 
     23#: cpt-editor.php:282 
    2424msgid "" 
    2525"Below is a list of registered custom post types. These post types are " 
     
    2828msgstr "" 
    2929 
    30 #: cpt-editor.php:206 
     30#: cpt-editor.php:283 
    3131msgid "Click on a post type to view its details." 
    3232msgstr "" 
    3333 
    34 #: cpt-editor.php:229 
     34#: cpt-editor.php:306 
    3535msgid "Invalid Custom Post Type" 
    3636msgstr "" 
    3737 
    38 #: cpt-editor.php:238 
     38#: cpt-editor.php:315 
    3939msgid "Edit '%s' Custom Post Type" 
    4040msgstr "" 
    4141 
    42 #: cpt-editor.php:243 
     42#: cpt-editor.php:320 
    4343msgid "Name:" 
    4444msgstr "" 
    4545 
    46 #: cpt-editor.php:244 
     46#: cpt-editor.php:321 
    4747msgid "General name for the post type, usually plural." 
    4848msgstr "" 
    4949 
    50 #: cpt-editor.php:246 
     50#: cpt-editor.php:323 
    5151msgid "Singular Name:" 
    5252msgstr "" 
    5353 
    54 #: cpt-editor.php:247 
     54#: cpt-editor.php:324 
    5555msgid "Name for one object of this post type." 
    5656msgstr "" 
    5757 
    58 #: cpt-editor.php:249 
     58#: cpt-editor.php:326 
     59msgid "Add New Item:" 
     60msgstr "" 
     61 
     62#: cpt-editor.php:327 
     63msgid "The add new item text." 
     64msgstr "" 
     65 
     66#: cpt-editor.php:329 
     67msgid "Edit Item:" 
     68msgstr "" 
     69 
     70#: cpt-editor.php:330 
     71msgid "The edit item text." 
     72msgstr "" 
     73 
     74#: cpt-editor.php:332 
     75msgid "New Item:" 
     76msgstr "" 
     77 
     78#: cpt-editor.php:333 
     79msgid "The new item text." 
     80msgstr "" 
     81 
     82#: cpt-editor.php:335 
     83msgid "View Item:" 
     84msgstr "" 
     85 
     86#: cpt-editor.php:336 
     87msgid "The view item text." 
     88msgstr "" 
     89 
     90#: cpt-editor.php:338 
     91msgid "Search Items:" 
     92msgstr "" 
     93 
     94#: cpt-editor.php:339 
     95msgid "The search items text." 
     96msgstr "" 
     97 
     98#: cpt-editor.php:341 
     99msgid "Not Found:" 
     100msgstr "" 
     101 
     102#: cpt-editor.php:342 
     103msgid "The not found text." 
     104msgstr "" 
     105 
     106#: cpt-editor.php:344 
     107msgid "Not Found in Trash:" 
     108msgstr "" 
     109 
     110#: cpt-editor.php:345 
     111msgid "The not found in trash text." 
     112msgstr "" 
     113 
     114#: cpt-editor.php:347 
     115msgid "Parent Item Colon:" 
     116msgstr "" 
     117 
     118#: cpt-editor.php:348 
     119msgid "The parent item text. Only used for hierarchical post types." 
     120msgstr "" 
     121 
     122#: cpt-editor.php:351 
     123msgid "Menu Name:" 
     124msgstr "" 
     125 
     126#: cpt-editor.php:352 
     127msgid "The text used in the Dashboard's top level menu." 
     128msgstr "" 
     129 
     130#: cpt-editor.php:354 
     131msgid "All Items:" 
     132msgstr "" 
     133 
     134#: cpt-editor.php:355 
     135msgid "The text used in the Dashboard menu's 'all items' submenu item." 
     136msgstr "" 
     137 
     138#: cpt-editor.php:357 
    59139msgid "Add New:" 
    60140msgstr "" 
    61141 
    62 #: cpt-editor.php:250 
    63 msgid "The add new text." 
    64 msgstr "" 
    65  
    66 #: cpt-editor.php:252 
    67 msgid "Add New Item:" 
    68 msgstr "" 
    69  
    70 #: cpt-editor.php:253 
    71 msgid "The add new item text." 
    72 msgstr "" 
    73  
    74 #: cpt-editor.php:255 
    75 msgid "Edit Item:" 
    76 msgstr "" 
    77  
    78 #: cpt-editor.php:256 
    79 msgid "The edit item text." 
    80 msgstr "" 
    81  
    82 #: cpt-editor.php:258 
    83 msgid "New Item:" 
    84 msgstr "" 
    85  
    86 #: cpt-editor.php:259 
    87 msgid "The new item text." 
    88 msgstr "" 
    89  
    90 #: cpt-editor.php:261 
    91 msgid "View Item:" 
    92 msgstr "" 
    93  
    94 #: cpt-editor.php:262 
    95 msgid "The view item text." 
    96 msgstr "" 
    97  
    98 #: cpt-editor.php:264 
    99 msgid "Search Items:" 
    100 msgstr "" 
    101  
    102 #: cpt-editor.php:265 
    103 msgid "The search items text." 
    104 msgstr "" 
    105  
    106 #: cpt-editor.php:267 
    107 msgid "Not Found:" 
    108 msgstr "" 
    109  
    110 #: cpt-editor.php:268 
    111 msgid "The not found text." 
    112 msgstr "" 
    113  
    114 #: cpt-editor.php:270 
    115 msgid "Not Found in Trash:" 
    116 msgstr "" 
    117  
    118 #: cpt-editor.php:271 
    119 msgid "The not found in trash text." 
    120 msgstr "" 
    121  
    122 #: cpt-editor.php:273 
    123 msgid "Parent Item Colon:" 
    124 msgstr "" 
    125  
    126 #: cpt-editor.php:274 
    127 msgid "The parent item text. Only used for hierarchical post types." 
    128 msgstr "" 
    129  
    130 #: cpt-editor.php:277 
    131 msgid "Menu Name:" 
    132 msgstr "" 
    133  
    134 #: cpt-editor.php:278 
    135 msgid "The text used in the Dashboard's top level menu." 
    136 msgstr "" 
    137  
    138 #: cpt-editor.php:280 
    139 msgid "All Items:" 
    140 msgstr "" 
    141  
    142 #: cpt-editor.php:281 
    143 msgid "The text used in the Dashboard menu's 'all items' menu item." 
    144 msgstr "" 
    145  
    146 #: cpt-editor.php:283 
     142#: cpt-editor.php:358 
     143msgid "The text used in the Dashboard menu's 'add new' submenu item." 
     144msgstr "" 
     145 
     146#: cpt-editor.php:360 
    147147msgid "Admin Bar Name:" 
    148148msgstr "" 
    149149 
    150 #: cpt-editor.php:284 
     150#: cpt-editor.php:361 
    151151msgid "The text used in the Admin Bar's 'New' menu." 
    152152msgstr "" 
    153153 
    154 #: cpt-editor.php:290 
     154#: cpt-editor.php:367 
    155155msgid "Insufficient privileges!" 
    156156msgstr "" 
    157157 
    158 #: cpt-editor.php:336 
     158#: cpt-editor.php:413 
    159159msgid "" 
    160160"Custom Post Type updated. Your changes will be visible on your next page " 
     
    162162msgstr "" 
    163163 
    164 #: cpt-editor.php:345 
     164#: cpt-editor.php:422 
    165165msgid "Labels" 
    166166msgstr "" 
    167167 
    168 #: cpt-editor.php:346 
     168#: cpt-editor.php:423 
    169169msgid "" 
    170170"Here you can customise (override) one or more labels for this Custom Post " 
     
    172172msgstr "" 
    173173 
    174 #: cpt-editor.php:347 
     174#: cpt-editor.php:424 
    175175msgid "Customised Labels are shown in blue." 
    176176msgstr "" 
    177177 
    178 #: cpt-editor.php:348 
     178#: cpt-editor.php:425 
    179179msgid "" 
    180180"To reset a label to its default, empty its text field. To reset all labels " 
     
    182182msgstr "" 
    183183 
    184 #: cpt-editor.php:352 
     184#: cpt-editor.php:429 
    185185msgid "Reset all labels to their defaults" 
    186186msgstr "" 
    187187 
    188 #: cpt-editor.php:364 
     188#: cpt-editor.php:441 
    189189msgid "%1s<br />(%2s)" 
    190190msgstr "" 
    191191 
    192 #: cpt-editor.php:371 
     192#: cpt-editor.php:448 
    193193msgid "[Empty]" 
    194194msgstr "" 
    195195 
    196 #: cpt-editor.php:373 
     196#: cpt-editor.php:450 
    197197msgid "%1s Default: %2s" 
    198198msgstr "" 
    199199 
    200 #: cpt-editor.php:382 
     200#: cpt-editor.php:459 
    201201msgid "Save Changes" 
    202202msgstr "" 
    203203 
    204 #: cpt-editor.php:429 
     204#: cpt-editor.php:506 
    205205msgid "&lArr; Back" 
    206206msgstr "" 
  • cpt-editor/trunk/readme.txt

    r541709 r542130  
    55Requires at least: 3.2 
    66Tested up to: 3.4 
    7 Stable tag: trunk 
     7Stable tag: 1.0.2 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    1010 
    11 Customise (override) the text labels for any registered custom post type using a simple Dashboard user interface. 
     11Customize the text labels or menu names for any registered custom post type using a simple Dashboard user interface. 
    1212 
    1313== Description == 
    1414 
    15 This plugin provides a simple to use Dashboard interface. No PHP file editing is necessary! 
     15Customize the text labels or menu names for any registered custom post type using a simple Dashboard user interface. No PHP file editing is necessary! 
    1616 
    17 For example, you could customise the following Custom Post Types: 
     17For example, you could customize the following Custom Post Types: 
    1818 
    1919* The `Posts` Custom Post Type (created by WordPress Core) 
     
    2525This means that you no longer have to modify PHP files in order to rename a Custom Post Type! Using this plugin, you can now make those changes using a simple interface in your WordPress dashboard. See the [screenshots](http://wordpress.org/extend/plugins/cpt-editor/screenshots/) for details. 
    2626 
    27 * Want to rename `Posts` to `Blog Posts`? 
    28 * Want to rename `Media` to `Uploads`? 
     27* Want to rename `Posts` to `News`? 
     28* Want to rename `Media` to `Files`? 
    2929* Want to rename the WooThemes’ `Features` post type to `Tours`? 
    3030 
     
    5252 
    5353= I found a bug. How can I contribute a patch or bug fix? = 
    54 Fork our [Github Repository](https://github.com/OM4/cpt-editor) and send us a pull request. 
     54 
     55We'd love you to fork our [Github Repository](https://github.com/OM4/cpt-editor) and send us a pull request. 
     56 
     57Alternatively, you can report a bug on our [Issue Tracker](https://github.com/OM4/cpt-editor/issues). 
    5558 
    5659== Screenshots == 
     
    5962 
    6063== Changelog == 
     64 
     65= 1.0.2 = 
     66* Documentation updates 
     67* US spelling 
     68* Screenshot updates 
    6169 
    6270= 1.0.1 = 
     
    6876== Upgrade Notice == 
    6977 
     78= 1.0.2 = 
     79* Documentation, spelling and screenshot updates. 
     80 
    7081= 1.0.1 = 
    7182* Adds support for customising WordPress' built-in Posts, Pages and Media dashboard menu labels. 
Note: See TracChangeset for help on using the changeset viewer.