Changeset 9130
- Timestamp:
- 10/13/2008 05:30:45 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r9120 r9130 3004 3004 function favorite_actions() { 3005 3005 $actions = array( 3006 'page-new.php' => __('Add New Page'), 3007 'edit-comments.php' => __('Manage Comments') 3006 'post-new.php' => array(__('Add New Post'), 'edit_posts'), 3007 'page-new.php' => array(__('Add New Page'), 'edit_pages'), 3008 'edit-comments.php' => array(__('Manage Comments'), 'moderate_comments') 3008 3009 ); 3009 3010 3010 3011 $actions = apply_filters('favorite_actions', $actions); 3012 3013 $allowed_actions = array(); 3014 foreach ( $actions as $action => $data ) { 3015 if ( current_user_can($data[1]) ) 3016 $allowed_actions[$action] = $data[0]; 3017 } 3018 3019 if ( empty($allowed_actions) ) 3020 return; 3021 3022 $first = array_keys($allowed_actions); 3023 $first = $first[0]; 3011 3024 echo '<div id="favorite-actions">'; 3012 echo '<div id="favorite-first"><a href=" post-new.php">' . __('Add New Post'). '</a></div>';3025 echo '<div id="favorite-first"><a href="$first">' . $allowed_actions[$first] . '</a></div>'; 3013 3026 echo '<div id="favorite-action">'; 3014 foreach ( $actions as $action => $label) { 3027 3028 array_shift($allowed_actions); 3029 3030 foreach ( $allowed_actions as $action => $label) { 3015 3031 echo "<div class='favorite-action'><a href='$action'>"; 3016 3032 echo $label;
Note: See TracChangeset
for help on using the changeset viewer.