Changeset 1340949
- Timestamp:
- 02/01/2016 09:31:16 PM (10 years ago)
- Location:
- lsw-organize-drafts/trunk
- Files:
-
- 2 edited
-
lsw_organize_drafts.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lsw-organize-drafts/trunk/lsw_organize_drafts.php
r1339338 r1340949 8 8 * Author: Linnea Wilhelm 9 9 * Author URI: http://www.linsoftware.com 10 * Version: 1.0. 010 * Version: 1.0.1 11 11 * License: GPL2 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 26 26 * @var string 27 27 */ 28 public $version = '1.0. 0';28 public $version = '1.0.1'; 29 29 30 30 /** … … 74 74 add_filter('manage_posts_columns' , array('LSW_Organize_Drafts', 'control_columns')); 75 75 add_filter('manage_pages_columns' , array('LSW_Organize_Drafts', 'control_columns')); 76 add_action('ad min_menu', array('LSW_Organize_Drafts', 'update_meta_boxes'));76 add_action('add_meta_boxes', array('LSW_Organize_Drafts','update_meta_boxes'), 20, 2 ); 77 77 add_action('save_post', array('LSW_Organize_Drafts', 'save_taxonomy_data'), 10, 2); 78 78 $post_types = apply_filters('lsw_default_post_types', LSW_Organize_Drafts::$post_types); … … 115 115 116 116 117 118 public static function update_meta_boxes() { 117 public static function update_meta_boxes($post_type, $post) { 118 119 119 $post_types = apply_filters('lsw_default_post_types', LSW_Organize_Drafts::$post_types); 120 120 remove_meta_box( 'tagsdiv-lswdrafttype', $post_types, 'side' ); 121 add_meta_box('lswdrafttype_custom', __('Draft Type', 'lsw_organize_drafts'), array('LSW_Organize_Drafts', 122 'render_meta_box'), $post_types, 'side', 'core'); 121 if (isset($post->post_status) && ($post->post_status == 'draft' || $post->post_status == 'auto-draft')) { 122 add_meta_box('lswdrafttype_custom', __('Draft Type', 'lsw_organize_drafts'), array('LSW_Organize_Drafts','render_meta_box'), $post_types, 'side', 'core'); 123 } 123 124 } 124 125 125 126 public static function render_meta_box($post) { 126 127 127 if($post->post_status!=='draft') {128 printf( esc_html__( 'Not a draft' ));129 return;130 }131 128 echo '<input type="hidden" name="taxonomy_noncename" id="taxonomy_noncename" value="' . 132 129 wp_create_nonce( 'taxonomy_lswdrafttype' ) . '" />'; -
lsw-organize-drafts/trunk/readme.txt
r1339374 r1340949 7 7 Requires at least: 4.4.0 8 8 Tested up to: 4.4.1 9 Stable tag: 1.0. 09 Stable tag: 1.0.1 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 == Changelog == 58 58 59 = 1.0.1 = 60 61 * Fixed issue with meta box appearing on published posts. 62 59 63 = 1.0.0: January 2016 = 60 64 … … 63 67 == Upgrade Notice == 64 68 69 = 1.0.1 = 70 71 * Fixed issue with meta box appearing on published posts. 72 65 73 = 1.0.0: January 2016 = 66 74
Note: See TracChangeset
for help on using the changeset viewer.