Changeset 464462
- Timestamp:
- 11/18/2011 03:20:08 AM (14 years ago)
- Location:
- content-molecules/trunk
- Files:
-
- 2 edited
-
emc2_content_molecules.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
content-molecules/trunk/emc2_content_molecules.php
r461622 r464462 37 37 //property map for public namespace variables 38 38 public static $props = array( 39 'tag_id' => 'emc2_molecule_tag_identifier',40 39 'post_type' => 'emc2_molecule_pt', //cannot be longer than 20 characters... why?! 41 40 'meta_box' => 'emc2_content_molecules_meta', … … 114 113 115 114 static function manage_posts_columns_handler($cols) { 116 $cols['slug'] = __('Slug'); 117 return array( 118 'cb' => '<input type="checkbox" />', 119 'title' => 'Title', 120 'slug' => 'Slug', 121 'date' => "Date" 122 ); 115 $sort = array(); 116 //Inject slug just before date column 117 foreach ($cols as $k => $v) { 118 if ($k == "date") { 119 $sort['slug'] = __("Slug"); 120 $sort['author'] = __("Author"); 121 } 122 $sort[$k] = $v; 123 } 124 125 return $sort; 123 126 } 124 127 125 128 static function manage_posts_custom_column_handler($col_name) { 126 global $post;127 129 if ($col_name = "slug") echo $post->post_name; 128 130 } … … 145 147 146 148 static function init_admin() { 147 148 149 //save custom properties on this custom post type 149 add_action('save_post', array('EMC2_Molecule', 'save_post_handler'), 10, 2); //pass post_obj to call back 150 151 $mod_actions = array('deleted_post', 'trashed_post', 'edit_post', 'publish_post', 'publish_future_post'); 152 foreach($mod_actions as $action) { 153 add_filter($action, array('EMC2_Molecule', 'reset_transient_cache')); 154 } 155 156 //customize columns of molecule list view 157 add_filter('manage_posts_columns', array('EMC2_Molecule', 'manage_posts_columns_handler')); 158 add_filter('manage_posts_custom_column', array('EMC2_Molecule', 'manage_posts_custom_column_handler')); 159 add_filter('manage_edit-emc2_molecule_pt_sortable_columns', array('EMC2_Molecule', 'manage_column_sorting_handler')); 160 add_filter("request", array('EMC2_Molecule', 'custom_colum_sort_param_handler')); 150 if (@$_GET['post_type'] == EMC2_Molecule::$props['post_type']) { 151 add_action('save_post', array('EMC2_Molecule', 'save_post_handler'), 10, 2); //pass post_obj to call back 152 153 $mod_actions = array('deleted_post', 'trashed_post', 'edit_post', 'publish_post', 'publish_future_post'); 154 foreach($mod_actions as $action) { 155 add_filter($action, array('EMC2_Molecule', 'reset_transient_cache')); 156 } 157 158 //customize columns of molecule list view 159 add_filter('manage_posts_columns', array('EMC2_Molecule', 'manage_posts_columns_handler')); 160 add_filter('manage_posts_custom_column', array('EMC2_Molecule', 'manage_posts_custom_column_handler')); 161 add_filter('manage_edit-emc2_molecule_pt_sortable_columns', array('EMC2_Molecule', 'manage_column_sorting_handler')); 162 add_filter("request", array('EMC2_Molecule', 'custom_colum_sort_param_handler')); 163 } 161 164 } 162 165 -
content-molecules/trunk/readme.txt
r461623 r464462 51 51 == Changelog == 52 52 53 = 1.1 = 54 * Fixed two bugs: potential overwrite of other custom properties added to view all list. 55 loaded molecule specific filters are all custom post types. 53 56 = 1.0 = 54 57 * Initial creation of plugin
Note: See TracChangeset
for help on using the changeset viewer.