Plugin Directory

Changeset 1836611


Ignore:
Timestamp:
03/08/2018 08:45:58 PM (8 years ago)
Author:
graffino
Message:

Add ability to show custom taxonomy column in post listing.

Location:
custom-post-type-maker
Files:
4 edited
6 copied

Legend:

Unmodified
Added
Removed
  • custom-post-type-maker/tags/1.1.4/CHANGELOG.md

    r1706370 r1836611  
    11## Changelog
     2
     3### 1.1.4
     4- Add ability to show custom taxonomy column in post listing.
    25
    36### 1.1.3
     
    3134- [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2`
    3235- [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/
    33 
  • custom-post-type-maker/tags/1.1.4/README.md

    r1706370 r1836611  
    2323
    2424## Changelog
     25
     26### 1.1.4
     27- Add ability to show custom taxonomy column in post listing.
    2528
    2629### 1.1.3
     
    5558- [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2`
    5659- [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/
    57 
    58 
  • custom-post-type-maker/tags/1.1.4/custom-post-type-maker.php

    r1706370 r1836611  
    44Plugin URI: https://github.com/Graffino/custom-post-type-maker-ui
    55Description: Custom Post Type Maker lets you create Custom Post Types and custom Taxonomies in a user friendly way.
    6 Version: 1.1.3
     6Version: 1.1.4
    77Author: Graffino
    88Author URI: http://www.graffino.com/
     
    2525 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPLv2
    2626 * @package     Custom_Post_Types_Maker
    27  * @version     1.1.3
     27 * @version     1.1.4
    2828 */
    2929
     
    4040 * @since   1.0.0
    4141 */
    42 class Cptm 
     42class Cptm
    4343{
    44    
     44
    4545
    4646    /** @var string $dir Plugin dir */
     
    5454     * Constructor
    5555     */
    56     function __construct() 
     56    function __construct()
    5757    {
    5858        // vars
    5959        $this->dir = plugins_url( '', __FILE__ );
    6060        $this->path = plugin_dir_path( __FILE__ );
    61         $this->version = '1.1.3';
     61        $this->version = '1.1.4';
    6262
    6363        // actions
     
    9292     * Initialize plugin
    9393     */
    94     public function init() 
     94    public function init()
    9595    {
    9696        // Create cptm post type
     
    161161     * Add admin menu items
    162162     */
    163     public function cptm_admin_menu() 
     163    public function cptm_admin_menu()
    164164    {
    165165        // add cptm page to options menu
     
    167167        add_submenu_page( 'edit.php?post_type=cptm', __('Taxonomies', 'custom-post-type-maker' ), __('Taxonomies', 'custom-post-type-maker' ), 'manage_options', 'edit.php?post_type=cptm_tax' );
    168168    }
    169    
     169
    170170    /**
    171171     * Register admin styles
     
    173173     * @param string $hook Wordpress hook
    174174     */
    175     public function cptm_styles( $hook ) 
     175    public function cptm_styles( $hook )
    176176    {
    177177        // register overview style
     
    198198        }
    199199    }
    200    
     200
    201201    /**
    202202     * Create custom post types
     
    229229
    230230                // Custom post icon (uploaded)
    231                 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false );               
    232                
     231                $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false );
     232
    233233                // Custom post icon (dashicons)
    234234                $cptm_icon_slug = ( array_key_exists( 'cptm_icon_slug', $cptm_meta ) && $cptm_meta['cptm_icon_slug'][0] ? $cptm_meta['cptm_icon_slug'][0] : false );
    235                
     235
    236236                // If DashIcon is set ignore uploaded
    237237                if ( !empty($cptm_icon_slug) ) {
     
    240240                    $cptm_icon_name = $cptm_icon_url;
    241241                }
    242                
     242
    243243                $cptm_custom_rewrite_slug = ( array_key_exists( 'cptm_custom_rewrite_slug', $cptm_meta ) && $cptm_meta['cptm_custom_rewrite_slug'][0] ? esc_html( $cptm_meta['cptm_custom_rewrite_slug'][0] ) : $cptm_name );
    244244                $cptm_menu_position       = ( array_key_exists( 'cptm_menu_position', $cptm_meta ) && $cptm_meta['cptm_menu_position'][0] ? (int) $cptm_meta['cptm_menu_position'][0] : null );
     
    256256                $cptm_pages               = ( array_key_exists( 'cptm_pages', $cptm_meta ) && $cptm_meta['cptm_pages'][0] == '1' ? true : false );
    257257                $cptm_query_var           = ( array_key_exists( 'cptm_query_var', $cptm_meta ) && $cptm_meta['cptm_query_var'][0] == '1' ? true : false );
    258                
     258
    259259                // If it doesn't exist, it must be set to true ( fix for existing installs )
    260260                if ( ! array_key_exists( 'cptm_publicly_queryable', $cptm_meta ) ) {
     
    274274                $cptm_rewrite_options     = array();
    275275                if ( $cptm_rewrite )      { $cptm_rewrite_options['slug'] = _x( $cptm_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ); }
    276                
     276
    277277                $cptm_rewrite_options['with_front'] = $cptm_withfront;
    278278
     
    302302                    'cptm_builtin_taxonomies'  => unserialize( $cptm_builtin_taxonomies ),
    303303                );
    304                
     304
    305305                // register custom post types
    306306                if ( is_array( $cptms ) ) {
     
    371371                $cptm_tax_rewrite             = ( array_key_exists( 'cptm_tax_rewrite', $cptm_meta ) && $cptm_meta['cptm_tax_rewrite'][0] == '1' ? array( 'slug' => _x( $cptm_tax_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ) ) : false );
    372372                $cptm_tax_query_var           = ( array_key_exists( 'cptm_tax_query_var', $cptm_meta ) && $cptm_meta['cptm_tax_query_var'][0] == '1' ? true : false );
     373                $cptm_tax_show_admin_column           = ( array_key_exists( 'cptm_tax_show_admin_column', $cptm_meta ) && $cptm_meta['cptm_tax_show_admin_column'][0] == '1' ? true : false );
     374
    373375
    374376                // checkbox
     
    385387                    'cptm_tax_rewrite'             => $cptm_tax_rewrite,
    386388                    'cptm_tax_query_var'           => (bool) $cptm_tax_query_var,
     389                    'cptm_tax_show_admin_column'   => (bool) $cptm_tax_show_admin_column,
    387390                    'cptm_tax_builtin_taxonomies'  => unserialize( $cptm_tax_post_types ),
    388391                );
     
    417420                            'hierarchical'        => $cptm_taxonomy['cptm_tax_hierarchical'],
    418421                            'query_var'           => $cptm_taxonomy['cptm_tax_query_var'],
     422                            'show_admin_column'   => $cptm_taxonomy['cptm_tax_show_admin_column'],
    419423                        );
    420424
     
    450454        );
    451455    }
    452    
     456
    453457    /**
    454458     * Create custom post meta box
     
    469473        // Custom post icon (uploaded)
    470474        $cptm_icon_url                      = isset( $values['cptm_icon_url'] ) ? esc_attr( $values['cptm_icon_url'][0] ) : '';
    471        
     475
    472476        // Custom post icon (dashicons)
    473         $cptm_icon_slug                     = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 
    474        
     477        $cptm_icon_slug                     = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : '';
     478
    475479        // If DashIcon is set ignore uploaded
    476480        if ( !empty($cptm_icon_slug) ) {
     
    479483            $cptm_icon_name = $cptm_icon_url;
    480484        }
    481        
    482        
     485
     486
    483487        $cptm_custom_rewrite_slug           = isset( $values['cptm_custom_rewrite_slug'] ) ? esc_attr( $values['cptm_custom_rewrite_slug'][0] ) : '';
    484488        $cptm_menu_position                 = isset( $values['cptm_menu_position'] ) ? esc_attr( $values['cptm_menu_position'][0] ) : '';
     
    829833     * @param  object $post Wordpress $post object
    830834     */
    831     public function cptm_tax_meta_box( $post ) 
     835    public function cptm_tax_meta_box( $post )
    832836    {
    833837        // get post meta values
     
    845849        $cptm_tax_rewrite                       = isset( $values['cptm_tax_rewrite'] ) ? esc_attr( $values['cptm_tax_rewrite'][0] ) : '';
    846850        $cptm_tax_query_var                     = isset( $values['cptm_tax_query_var'] ) ? esc_attr( $values['cptm_tax_query_var'][0] ) : '';
     851        $cptm_tax_show_admin_column             = isset( $values['cptm_tax_show_admin_column'] ) ? esc_attr( $values['cptm_tax_show_admin_column'][0] ) : '';
    847852
    848853        // checkbox fields
     
    957962            </tr>
    958963            <tr>
     964                <td class="label">
     965                    <label for="cptm_tax_show_admin_column"><?php _e( 'Admin Column', 'custom-post-type-maker' ); ?></label>
     966                    <p><?php _e( 'Show this taxonomy as a column in the custom post listing.', 'custom-post-type-maker' ); ?></p>
     967                </td>
     968                <td>
     969                    <select name="cptm_tax_show_admin_column" id="cptm_tax_show_admin_column" tabindex="8">
     970                        <option value="1" <?php selected( $cptm_tax_show_admin_column, '1' ); ?>><?php _e( 'True', 'custom-post-type-maker' ); ?> (<?php _e( 'default', 'custom-post-type-maker' ); ?>)</option>
     971                        <option value="0" <?php selected( $cptm_tax_show_admin_column, '0' ); ?>><?php _e( 'False', 'custom-post-type-maker' ); ?></option>
     972                    </select>
     973                </td>
     974            </tr>
     975            <tr>
    959976                <td class="label top">
    960977                    <label for="cptm_tax_post_types"><?php _e( 'Post Types', 'custom-post-type-maker' ); ?></label>
     
    980997        <?php
    981998    }
    982    
     999
    9831000    /**
    9841001     * Save custom post
     
    9861003     * @param  int $post_id Wordpress Post ID
    9871004     */
    988     public function cptm_save_post( $post_id ) 
     1005    public function cptm_save_post( $post_id )
    9891006    {
    9901007        // verify if this is an auto save routine.
     
    10111028        if ( isset($_POST['cptm_icon_slug']) )
    10121029            update_post_meta( $post_id, 'cptm_icon_slug', esc_textarea( $_POST['cptm_icon_slug'] ) );
    1013        
     1030
    10141031        if ( isset($_POST['cptm_icon_url']) )
    10151032            update_post_meta( $post_id, 'cptm_icon_url', esc_textarea( $_POST['cptm_icon_url'] ) );
     
    10501067        if ( isset( $_POST['cptm_query_var'] ) )
    10511068            update_post_meta( $post_id, 'cptm_query_var', esc_attr( $_POST['cptm_query_var'] ) );
    1052        
     1069
    10531070        if ( isset( $_POST['cptm_publicly_queryable'] ) )
    10541071            update_post_meta( $post_id, 'cptm_publicly_queryable', esc_attr( $_POST['cptm_publicly_queryable'] ) );
     
    10911108            update_post_meta( $post_id, 'cptm_tax_query_var', esc_attr( $_POST['cptm_tax_query_var'] ) );
    10921109
     1110        if ( isset( $_POST['cptm_tax_show_admin_column'] ) )
     1111            update_post_meta( $post_id, 'cptm_tax_show_admin_column', esc_attr( $_POST['cptm_tax_show_admin_column'] ) );
     1112
    10931113        $cptm_tax_post_types = isset( $_POST['cptm_tax_post_types'] ) ? $_POST['cptm_tax_post_types'] : array();
    10941114            update_post_meta( $post_id, 'cptm_tax_post_types', $cptm_tax_post_types );
     
    10971117            update_option( 'cptm_plugin_settings_changed', true );
    10981118    }
    1099    
     1119
    11001120    /**
    11011121     * Flush rewrite rules
    11021122     */
    1103     function cptm_plugin_settings_flush_rewrite() 
     1123    function cptm_plugin_settings_flush_rewrite()
    11041124    {
    11051125    if ( get_option( 'cptm_plugin_settings_changed' ) == true ) {
     
    11121132     * Flush rewrite rules on plugin activation
    11131133     */
    1114     function cptm_plugin_activate_flush_rewrite() 
     1134    function cptm_plugin_activate_flush_rewrite()
    11151135    {
    11161136        $this->cptm_create_custom_post_types();
    11171137        flush_rewrite_rules();
    11181138    }
    1119    
     1139
    11201140    /**
    11211141     * Modify existing columns
     
    11241144     * @return object       Modified columns
    11251145     */
    1126     function cptm_change_columns( $cols ) 
     1146    function cptm_change_columns( $cols )
    11271147    {
    11281148        $cols = array(
     
    11351155        return $cols;
    11361156    }
    1137    
     1157
    11381158    /**
    11391159     * Make columns sortable
     
    11411161     * @return array Sortable array
    11421162     */
    1143     function cptm_sortable_columns() 
     1163    function cptm_sortable_columns()
    11441164    {
    11451165        return array(
     
    11541174     * @param  int    $post_id Wordpress Post ID
    11551175     */
    1156     function cptm_custom_columns( $column, $post_id ) 
     1176    function cptm_custom_columns( $column, $post_id )
    11571177    {
    11581178        switch ( $column ) {
     
    11681188        }
    11691189    }
    1170    
     1190
    11711191    /**
    11721192     * Modify existing taxonomy columns
     
    11751195     * @return array       Modified taxonomy columns
    11761196     */
    1177     function cptm_tax_change_columns( $cols ) 
     1197    function cptm_tax_change_columns( $cols )
    11781198    {
    11791199        $cols = array(
     
    11851205        return $cols;
    11861206    }
    1187    
     1207
    11881208    /**
    11891209     * Make taxonomy columns sortable
     
    11911211     * @return array Sortable array
    11921212     */
    1193     function cptm_tax_sortable_columns() 
     1213    function cptm_tax_sortable_columns()
    11941214    {
    11951215        return array(
     
    11971217        );
    11981218    }
    1199    
     1219
    12001220    /**
    12011221     * Insert custom taxonomy columns
     
    12041224     * @param  int    $post_id Wordpress Post ID
    12051225     */
    1206     function cptm_tax_custom_columns( $column, $post_id ) 
     1226    function cptm_tax_custom_columns( $column, $post_id )
    12071227    {
    12081228        switch ( $column ) {
     
    12151235        }
    12161236    }
    1217    
     1237
    12181238    /**
    12191239     * Insert admin footer
    12201240     */
    1221     function cptm_admin_footer() 
     1241    function cptm_admin_footer()
    12221242    {
    12231243        global $post_type;
     
    14421462        }
    14431463    }
    1444    
     1464
    14451465    /**
    14461466     * Update messages
     
    14491469     * @return array           Update messages
    14501470     */
    1451     function cptm_post_updated_messages( $messages ) 
     1471    function cptm_post_updated_messages( $messages )
    14521472    {
    14531473        global $post, $post_ID;
     
    14701490        return $messages;
    14711491    }
    1472    
     1492
    14731493    /**
    14741494     * Prepare attachment for Ajax Upload Request
  • custom-post-type-maker/tags/1.1.4/readme.txt

    r1706375 r1836611  
    6767== Changelog ==
    6868
     69= 1.1.4
     70- Add ability to show custom taxonomy column in post listing.
     71
    6972= 1.1.3
    7073- Removed forgotten development dump. Sorry about that.
  • custom-post-type-maker/trunk/CHANGELOG.md

    r1706370 r1836611  
    11## Changelog
     2
     3### 1.1.4
     4- Add ability to show custom taxonomy column in post listing.
    25
    36### 1.1.3
     
    3134- [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2`
    3235- [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/
    33 
  • custom-post-type-maker/trunk/README.md

    r1706370 r1836611  
    2323
    2424## Changelog
     25
     26### 1.1.4
     27- Add ability to show custom taxonomy column in post listing.
    2528
    2629### 1.1.3
     
    5558- [Bugfix] Fixed `add_utility_page provokes "deprecated" notice in 4.5.2`
    5659- [Forked] Forked https://wordpress.org/plugins/custom-post-type-maker/
    57 
    58 
  • custom-post-type-maker/trunk/custom-post-type-maker.php

    r1706370 r1836611  
    44Plugin URI: https://github.com/Graffino/custom-post-type-maker-ui
    55Description: Custom Post Type Maker lets you create Custom Post Types and custom Taxonomies in a user friendly way.
    6 Version: 1.1.3
     6Version: 1.1.4
    77Author: Graffino
    88Author URI: http://www.graffino.com/
     
    2525 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPLv2
    2626 * @package     Custom_Post_Types_Maker
    27  * @version     1.1.3
     27 * @version     1.1.4
    2828 */
    2929
     
    4040 * @since   1.0.0
    4141 */
    42 class Cptm 
     42class Cptm
    4343{
    44    
     44
    4545
    4646    /** @var string $dir Plugin dir */
     
    5454     * Constructor
    5555     */
    56     function __construct() 
     56    function __construct()
    5757    {
    5858        // vars
    5959        $this->dir = plugins_url( '', __FILE__ );
    6060        $this->path = plugin_dir_path( __FILE__ );
    61         $this->version = '1.1.3';
     61        $this->version = '1.1.4';
    6262
    6363        // actions
     
    9292     * Initialize plugin
    9393     */
    94     public function init() 
     94    public function init()
    9595    {
    9696        // Create cptm post type
     
    161161     * Add admin menu items
    162162     */
    163     public function cptm_admin_menu() 
     163    public function cptm_admin_menu()
    164164    {
    165165        // add cptm page to options menu
     
    167167        add_submenu_page( 'edit.php?post_type=cptm', __('Taxonomies', 'custom-post-type-maker' ), __('Taxonomies', 'custom-post-type-maker' ), 'manage_options', 'edit.php?post_type=cptm_tax' );
    168168    }
    169    
     169
    170170    /**
    171171     * Register admin styles
     
    173173     * @param string $hook Wordpress hook
    174174     */
    175     public function cptm_styles( $hook ) 
     175    public function cptm_styles( $hook )
    176176    {
    177177        // register overview style
     
    198198        }
    199199    }
    200    
     200
    201201    /**
    202202     * Create custom post types
     
    229229
    230230                // Custom post icon (uploaded)
    231                 $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false );               
    232                
     231                $cptm_icon_url = ( array_key_exists( 'cptm_icon_url', $cptm_meta ) && $cptm_meta['cptm_icon_url'][0] ? $cptm_meta['cptm_icon_url'][0] : false );
     232
    233233                // Custom post icon (dashicons)
    234234                $cptm_icon_slug = ( array_key_exists( 'cptm_icon_slug', $cptm_meta ) && $cptm_meta['cptm_icon_slug'][0] ? $cptm_meta['cptm_icon_slug'][0] : false );
    235                
     235
    236236                // If DashIcon is set ignore uploaded
    237237                if ( !empty($cptm_icon_slug) ) {
     
    240240                    $cptm_icon_name = $cptm_icon_url;
    241241                }
    242                
     242
    243243                $cptm_custom_rewrite_slug = ( array_key_exists( 'cptm_custom_rewrite_slug', $cptm_meta ) && $cptm_meta['cptm_custom_rewrite_slug'][0] ? esc_html( $cptm_meta['cptm_custom_rewrite_slug'][0] ) : $cptm_name );
    244244                $cptm_menu_position       = ( array_key_exists( 'cptm_menu_position', $cptm_meta ) && $cptm_meta['cptm_menu_position'][0] ? (int) $cptm_meta['cptm_menu_position'][0] : null );
     
    256256                $cptm_pages               = ( array_key_exists( 'cptm_pages', $cptm_meta ) && $cptm_meta['cptm_pages'][0] == '1' ? true : false );
    257257                $cptm_query_var           = ( array_key_exists( 'cptm_query_var', $cptm_meta ) && $cptm_meta['cptm_query_var'][0] == '1' ? true : false );
    258                
     258
    259259                // If it doesn't exist, it must be set to true ( fix for existing installs )
    260260                if ( ! array_key_exists( 'cptm_publicly_queryable', $cptm_meta ) ) {
     
    274274                $cptm_rewrite_options     = array();
    275275                if ( $cptm_rewrite )      { $cptm_rewrite_options['slug'] = _x( $cptm_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ); }
    276                
     276
    277277                $cptm_rewrite_options['with_front'] = $cptm_withfront;
    278278
     
    302302                    'cptm_builtin_taxonomies'  => unserialize( $cptm_builtin_taxonomies ),
    303303                );
    304                
     304
    305305                // register custom post types
    306306                if ( is_array( $cptms ) ) {
     
    371371                $cptm_tax_rewrite             = ( array_key_exists( 'cptm_tax_rewrite', $cptm_meta ) && $cptm_meta['cptm_tax_rewrite'][0] == '1' ? array( 'slug' => _x( $cptm_tax_custom_rewrite_slug, 'URL Slug', 'custom-post-type-maker' ) ) : false );
    372372                $cptm_tax_query_var           = ( array_key_exists( 'cptm_tax_query_var', $cptm_meta ) && $cptm_meta['cptm_tax_query_var'][0] == '1' ? true : false );
     373                $cptm_tax_show_admin_column           = ( array_key_exists( 'cptm_tax_show_admin_column', $cptm_meta ) && $cptm_meta['cptm_tax_show_admin_column'][0] == '1' ? true : false );
     374
    373375
    374376                // checkbox
     
    385387                    'cptm_tax_rewrite'             => $cptm_tax_rewrite,
    386388                    'cptm_tax_query_var'           => (bool) $cptm_tax_query_var,
     389                    'cptm_tax_show_admin_column'   => (bool) $cptm_tax_show_admin_column,
    387390                    'cptm_tax_builtin_taxonomies'  => unserialize( $cptm_tax_post_types ),
    388391                );
     
    417420                            'hierarchical'        => $cptm_taxonomy['cptm_tax_hierarchical'],
    418421                            'query_var'           => $cptm_taxonomy['cptm_tax_query_var'],
     422                            'show_admin_column'   => $cptm_taxonomy['cptm_tax_show_admin_column'],
    419423                        );
    420424
     
    450454        );
    451455    }
    452    
     456
    453457    /**
    454458     * Create custom post meta box
     
    469473        // Custom post icon (uploaded)
    470474        $cptm_icon_url                      = isset( $values['cptm_icon_url'] ) ? esc_attr( $values['cptm_icon_url'][0] ) : '';
    471        
     475
    472476        // Custom post icon (dashicons)
    473         $cptm_icon_slug                     = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : ''; 
    474        
     477        $cptm_icon_slug                     = isset( $values['cptm_icon_slug'] ) ? esc_attr( $values['cptm_icon_slug'][0] ) : '';
     478
    475479        // If DashIcon is set ignore uploaded
    476480        if ( !empty($cptm_icon_slug) ) {
     
    479483            $cptm_icon_name = $cptm_icon_url;
    480484        }
    481        
    482        
     485
     486
    483487        $cptm_custom_rewrite_slug           = isset( $values['cptm_custom_rewrite_slug'] ) ? esc_attr( $values['cptm_custom_rewrite_slug'][0] ) : '';
    484488        $cptm_menu_position                 = isset( $values['cptm_menu_position'] ) ? esc_attr( $values['cptm_menu_position'][0] ) : '';
     
    829833     * @param  object $post Wordpress $post object
    830834     */
    831     public function cptm_tax_meta_box( $post ) 
     835    public function cptm_tax_meta_box( $post )
    832836    {
    833837        // get post meta values
     
    845849        $cptm_tax_rewrite                       = isset( $values['cptm_tax_rewrite'] ) ? esc_attr( $values['cptm_tax_rewrite'][0] ) : '';
    846850        $cptm_tax_query_var                     = isset( $values['cptm_tax_query_var'] ) ? esc_attr( $values['cptm_tax_query_var'][0] ) : '';
     851        $cptm_tax_show_admin_column             = isset( $values['cptm_tax_show_admin_column'] ) ? esc_attr( $values['cptm_tax_show_admin_column'][0] ) : '';
    847852
    848853        // checkbox fields
     
    957962            </tr>
    958963            <tr>
     964                <td class="label">
     965                    <label for="cptm_tax_show_admin_column"><?php _e( 'Admin Column', 'custom-post-type-maker' ); ?></label>
     966                    <p><?php _e( 'Show this taxonomy as a column in the custom post listing.', 'custom-post-type-maker' ); ?></p>
     967                </td>
     968                <td>
     969                    <select name="cptm_tax_show_admin_column" id="cptm_tax_show_admin_column" tabindex="8">
     970                        <option value="1" <?php selected( $cptm_tax_show_admin_column, '1' ); ?>><?php _e( 'True', 'custom-post-type-maker' ); ?> (<?php _e( 'default', 'custom-post-type-maker' ); ?>)</option>
     971                        <option value="0" <?php selected( $cptm_tax_show_admin_column, '0' ); ?>><?php _e( 'False', 'custom-post-type-maker' ); ?></option>
     972                    </select>
     973                </td>
     974            </tr>
     975            <tr>
    959976                <td class="label top">
    960977                    <label for="cptm_tax_post_types"><?php _e( 'Post Types', 'custom-post-type-maker' ); ?></label>
     
    980997        <?php
    981998    }
    982    
     999
    9831000    /**
    9841001     * Save custom post
     
    9861003     * @param  int $post_id Wordpress Post ID
    9871004     */
    988     public function cptm_save_post( $post_id ) 
     1005    public function cptm_save_post( $post_id )
    9891006    {
    9901007        // verify if this is an auto save routine.
     
    10111028        if ( isset($_POST['cptm_icon_slug']) )
    10121029            update_post_meta( $post_id, 'cptm_icon_slug', esc_textarea( $_POST['cptm_icon_slug'] ) );
    1013        
     1030
    10141031        if ( isset($_POST['cptm_icon_url']) )
    10151032            update_post_meta( $post_id, 'cptm_icon_url', esc_textarea( $_POST['cptm_icon_url'] ) );
     
    10501067        if ( isset( $_POST['cptm_query_var'] ) )
    10511068            update_post_meta( $post_id, 'cptm_query_var', esc_attr( $_POST['cptm_query_var'] ) );
    1052        
     1069
    10531070        if ( isset( $_POST['cptm_publicly_queryable'] ) )
    10541071            update_post_meta( $post_id, 'cptm_publicly_queryable', esc_attr( $_POST['cptm_publicly_queryable'] ) );
     
    10911108            update_post_meta( $post_id, 'cptm_tax_query_var', esc_attr( $_POST['cptm_tax_query_var'] ) );
    10921109
     1110        if ( isset( $_POST['cptm_tax_show_admin_column'] ) )
     1111            update_post_meta( $post_id, 'cptm_tax_show_admin_column', esc_attr( $_POST['cptm_tax_show_admin_column'] ) );
     1112
    10931113        $cptm_tax_post_types = isset( $_POST['cptm_tax_post_types'] ) ? $_POST['cptm_tax_post_types'] : array();
    10941114            update_post_meta( $post_id, 'cptm_tax_post_types', $cptm_tax_post_types );
     
    10971117            update_option( 'cptm_plugin_settings_changed', true );
    10981118    }
    1099    
     1119
    11001120    /**
    11011121     * Flush rewrite rules
    11021122     */
    1103     function cptm_plugin_settings_flush_rewrite() 
     1123    function cptm_plugin_settings_flush_rewrite()
    11041124    {
    11051125    if ( get_option( 'cptm_plugin_settings_changed' ) == true ) {
     
    11121132     * Flush rewrite rules on plugin activation
    11131133     */
    1114     function cptm_plugin_activate_flush_rewrite() 
     1134    function cptm_plugin_activate_flush_rewrite()
    11151135    {
    11161136        $this->cptm_create_custom_post_types();
    11171137        flush_rewrite_rules();
    11181138    }
    1119    
     1139
    11201140    /**
    11211141     * Modify existing columns
     
    11241144     * @return object       Modified columns
    11251145     */
    1126     function cptm_change_columns( $cols ) 
     1146    function cptm_change_columns( $cols )
    11271147    {
    11281148        $cols = array(
     
    11351155        return $cols;
    11361156    }
    1137    
     1157
    11381158    /**
    11391159     * Make columns sortable
     
    11411161     * @return array Sortable array
    11421162     */
    1143     function cptm_sortable_columns() 
     1163    function cptm_sortable_columns()
    11441164    {
    11451165        return array(
     
    11541174     * @param  int    $post_id Wordpress Post ID
    11551175     */
    1156     function cptm_custom_columns( $column, $post_id ) 
     1176    function cptm_custom_columns( $column, $post_id )
    11571177    {
    11581178        switch ( $column ) {
     
    11681188        }
    11691189    }
    1170    
     1190
    11711191    /**
    11721192     * Modify existing taxonomy columns
     
    11751195     * @return array       Modified taxonomy columns
    11761196     */
    1177     function cptm_tax_change_columns( $cols ) 
     1197    function cptm_tax_change_columns( $cols )
    11781198    {
    11791199        $cols = array(
     
    11851205        return $cols;
    11861206    }
    1187    
     1207
    11881208    /**
    11891209     * Make taxonomy columns sortable
     
    11911211     * @return array Sortable array
    11921212     */
    1193     function cptm_tax_sortable_columns() 
     1213    function cptm_tax_sortable_columns()
    11941214    {
    11951215        return array(
     
    11971217        );
    11981218    }
    1199    
     1219
    12001220    /**
    12011221     * Insert custom taxonomy columns
     
    12041224     * @param  int    $post_id Wordpress Post ID
    12051225     */
    1206     function cptm_tax_custom_columns( $column, $post_id ) 
     1226    function cptm_tax_custom_columns( $column, $post_id )
    12071227    {
    12081228        switch ( $column ) {
     
    12151235        }
    12161236    }
    1217    
     1237
    12181238    /**
    12191239     * Insert admin footer
    12201240     */
    1221     function cptm_admin_footer() 
     1241    function cptm_admin_footer()
    12221242    {
    12231243        global $post_type;
     
    14421462        }
    14431463    }
    1444    
     1464
    14451465    /**
    14461466     * Update messages
     
    14491469     * @return array           Update messages
    14501470     */
    1451     function cptm_post_updated_messages( $messages ) 
     1471    function cptm_post_updated_messages( $messages )
    14521472    {
    14531473        global $post, $post_ID;
     
    14701490        return $messages;
    14711491    }
    1472    
     1492
    14731493    /**
    14741494     * Prepare attachment for Ajax Upload Request
  • custom-post-type-maker/trunk/readme.txt

    r1706375 r1836611  
    6767== Changelog ==
    6868
     69= 1.1.4
     70- Add ability to show custom taxonomy column in post listing.
     71
    6972= 1.1.3
    7073- Removed forgotten development dump. Sorry about that.
Note: See TracChangeset for help on using the changeset viewer.