| 3330 | | |
| 3331 | | switch ( $screen->id ) { |
| 3332 | | case 'post': |
| 3333 | | $default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts')); |
| 3334 | | break; |
| 3335 | | case 'edit-page': |
| 3336 | | $default_action = array('post-new.php?post_type=page' => array(__('New Page'), 'edit_pages')); |
| 3337 | | break; |
| 3338 | | case 'page': |
| 3339 | | $default_action = array('edit.php?post_type=page' => array(__('Edit Pages'), 'edit_pages')); |
| 3340 | | break; |
| 3341 | | case 'upload.php': |
| 3342 | | $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); |
| 3343 | | break; |
| 3344 | | case 'media': |
| 3345 | | $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); |
| 3346 | | break; |
| 3347 | | case 'link-manager': |
| 3348 | | $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); |
| 3349 | | break; |
| 3350 | | case 'link-add': |
| 3351 | | $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); |
| 3352 | | break; |
| 3353 | | case 'users': |
| 3354 | | $default_action = array('user-new.php' => array(__('New User'), 'create_users')); |
| 3355 | | break; |
| 3356 | | case 'user': |
| 3357 | | $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); |
| 3358 | | break; |
| 3359 | | case 'plugins': |
| 3360 | | $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); |
| 3361 | | break; |
| 3362 | | case 'plugin-install': |
| 3363 | | $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); |
| 3364 | | break; |
| 3365 | | case 'themes': |
| 3366 | | $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); |
| 3367 | | break; |
| 3368 | | case 'theme-install': |
| 3369 | | $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); |
| 3370 | | break; |
| 3371 | | default: |
| 3372 | | $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); |
| 3373 | | break; |
| | 3334 | |
| | 3335 | if ( isset($post_type_object) ) { |
| | 3336 | switch ( $screen->id ) { |
| | 3337 | case $post_type_object->name: |
| | 3338 | $default_action = array('edit.php?post_type=' . $post_type_object->name => array(sprintf(__('Edit %s'), $post_type_object->label), $post_type_object->edit_type_cap)); |
| | 3339 | break; |
| | 3340 | case "edit-{$post_type_object->name}": |
| | 3341 | $default_action = array('post-new.php?post_type=' . $post_type_object->name => array(sprintf(__('New %s'), $post_type_object->singular_label), $post_type_object->edit_type_cap)); |
| | 3342 | break; |
| | 3343 | } |
| | 3345 | |
| | 3346 | if ( !$default_action ) { |
| | 3347 | switch ( $screen->id ) { |
| | 3348 | case 'upload.php': |
| | 3349 | $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); |
| | 3350 | break; |
| | 3351 | case 'media': |
| | 3352 | $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); |
| | 3353 | break; |
| | 3354 | case 'link-manager': |
| | 3355 | $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); |
| | 3356 | break; |
| | 3357 | case 'link-add': |
| | 3358 | $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); |
| | 3359 | break; |
| | 3360 | case 'users': |
| | 3361 | $default_action = array('user-new.php' => array(__('New User'), 'create_users')); |
| | 3362 | break; |
| | 3363 | case 'user': |
| | 3364 | $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); |
| | 3365 | break; |
| | 3366 | case 'plugins': |
| | 3367 | $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); |
| | 3368 | break; |
| | 3369 | case 'plugin-install': |
| | 3370 | $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); |
| | 3371 | break; |
| | 3372 | case 'themes': |
| | 3373 | $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); |
| | 3374 | break; |
| | 3375 | case 'theme-install': |
| | 3376 | $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); |
| | 3377 | break; |
| | 3378 | default: |
| | 3379 | $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); |
| | 3380 | break; |
| | 3381 | } |
| | 3382 | } |