Changeset 15253
- Timestamp:
- 06/14/2010 07:33:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r15242 r15253 3317 3317 */ 3318 3318 function favorite_actions( $screen = null ) { 3319 global $post_type_object;3320 3321 3319 $default_action = false; 3322 3320 … … 3324 3322 $screen = convert_to_screen($screen); 3325 3323 3326 if ( isset($post_type_object) ) { 3327 switch ( $screen->id ) { 3328 case $post_type_object->name: 3329 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->cap->edit_posts)); 3330 break; 3331 case "edit-{$post_type_object->name}": 3332 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts)); 3333 break; 3334 } 3324 if ( isset($screen->post_type) ) { 3325 $post_type_object = get_post_type_object($screen->post_type); 3326 if ( 'add' != $screen->action ) 3327 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts)); 3328 else 3329 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->name, $post_type_object->cap->edit_posts)); 3335 3330 } 3336 3331 … … 3344 3339 break; 3345 3340 case 'link-manager': 3346 $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); 3347 break; 3348 case 'link-add': 3349 $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); 3341 case 'link': 3342 if ( 'add' != $screen->action ) 3343 $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); 3344 else 3345 $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); 3350 3346 break; 3351 3347 case 'users': … … 3903 3899 global $current_screen, $hook_suffix, $typenow, $taxnow; 3904 3900 3901 $action = ''; 3902 3905 3903 if ( empty($id) ) { 3906 3904 $current_screen = $hook_suffix; 3907 3905 $current_screen = str_replace('.php', '', $current_screen); 3906 if ( preg_match('/-add|-new$/', $current_screen) ) 3907 $action = 'add'; 3908 3908 $current_screen = str_replace('-new', '', $current_screen); 3909 3909 $current_screen = str_replace('-add', '', $current_screen); … … 3923 3923 3924 3924 $current_screen = (object) $current_screen; 3925 3926 $current_screen->action = $action; 3925 3927 3926 3928 // Map index to dashboard
Note: See TracChangeset
for help on using the changeset viewer.