Ticket #5750: 5750.diff
| File 5750.diff, 39.9 KB (added by , 18 years ago) |
|---|
-
wp-includes/version.php
16 16 * 17 17 * @global int $wp_db_version 18 18 */ 19 $wp_db_version = 6 124;19 $wp_db_version = 6689; 20 20 21 21 ?> 22 No newline at end of file -
wp-includes/widgets.php
221 221 222 222 $did_one = false; 223 223 foreach ( $sidebars_widgets[$index] as $id ) { 224 $callback = $wp_registered_widgets[$id]['callback']; 224 $params = array_merge( 225 array( array_merge( $sidebar, array('widget_id' => $id, 'widget_name' => $wp_registered_widgets[$id]['name']) ) ), 226 (array) $wp_registered_widgets[$id]['params'] 227 ); 225 228 226 $params = array_merge(array($sidebar), (array) $wp_registered_widgets[$id]['params']);227 228 229 // Substitute HTML id and class attributes into before_widget 229 230 $classname_ = ''; 230 231 foreach ( (array) $wp_registered_widgets[$id]['classname'] as $cn ) { … … 236 237 $classname_ = ltrim($classname_, '_'); 237 238 $params[0]['before_widget'] = sprintf($params[0]['before_widget'], $id, $classname_); 238 239 240 $params = apply_filters( 'dynamic_sidebar_params', $params ); 241 242 $callback = $wp_registered_widgets[$id]['callback']; 243 239 244 if ( is_callable($callback) ) { 240 245 call_user_func_array($callback, $params); 241 246 $did_one = true; … … 1003 1008 if ( isset($options[$number]['error']) && $options[$number]['error'] ) 1004 1009 return; 1005 1010 1006 $num_items = (int) $options[$number]['items'];1007 $show_summary = $options[$number]['show_summary'];1008 if ( empty($num_items) || $num_items < 1 || $num_items > 10 ) $num_items = 10;1009 1011 $url = $options[$number]['url']; 1010 1012 while ( strstr($url, 'http') != $url ) 1011 1013 $url = substr($url, 1); … … 1032 1034 else 1033 1035 $icon = get_option('siteurl').'/wp-includes/images/rss.png'; 1034 1036 $title = "<a class='rsswidget' href='$url' title='" . attribute_escape(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>"; 1035 ?> 1036 <?php echo $before_widget; ?> 1037 <?php $title ? print($before_title . $title . $after_title) : null; ?> 1038 <?php 1037 1038 echo $before_widget; 1039 echo $before_title . $title . $after_title; 1040 1041 wp_widget_rss_output( $rss, $options[$number] ); 1042 1043 echo $after_widget; 1044 } 1045 1046 function wp_widget_rss_output( $rss, $args = null ) { 1047 if ( is_string( $rss ) ) { 1048 require_once(ABSPATH . WPINC . '/rss.php'); 1049 if ( !$rss = fetch_rss($rss) ) 1050 return; 1051 } elseif ( is_array($rss) && isset($rss['url']) ) { 1052 require_once(ABSPATH . WPINC . '/rss.php'); 1053 $args = $rss; 1054 if ( !$rss = fetch_rss($rss['url']) ) 1055 return; 1056 } elseif ( !is_object($rss) ) { 1057 return; 1058 } 1059 1060 extract( $args, EXTR_SKIP ); 1061 1062 $items = (int) $items; 1063 if ( $items < 1 || 20 < $items ) 1064 $items = 10; 1065 $show_summary = (int) $show_summary; 1066 $show_author = (int) $show_author; 1067 $show_date = (int) $show_date; 1068 1039 1069 if ( is_array( $rss->items ) && !empty( $rss->items ) ) { 1040 $rss->items = array_slice($rss->items, 0, $ num_items);1070 $rss->items = array_slice($rss->items, 0, $items); 1041 1071 echo '<ul>'; 1042 1072 foreach ($rss->items as $item ) { 1043 1073 while ( strstr($item['link'], 'http') != $item['link'] ) … … 1047 1077 if ( empty($title) ) 1048 1078 $title = __('Untitled'); 1049 1079 $desc = ''; 1080 if ( isset( $item['description'] ) && is_string( $item['description'] ) ) 1081 $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES)))); 1082 elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) ) 1083 $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES)))); 1084 1085 $summary = ''; 1086 if ( isset( $item['description'] ) && is_string( $item['description'] ) ) 1087 $summary = $item['description']; 1088 elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) ) 1089 $summary = $item['summary']; 1090 1091 $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($summary, ENT_QUOTES)))); 1092 1050 1093 if ( $show_summary ) { 1051 $summary = '<div class="rssSummary">' . $item['description'] . '</div>'; 1094 $desc = ''; 1095 $summary = wp_specialchars( $summary ); 1096 $summary = "<div class='rssSummary'>$summary</div>"; 1052 1097 } else { 1053 if ( isset( $item['description'] ) && is_string( $item['description'] ) )1054 $desc = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES))));1055 1098 $summary = ''; 1056 1099 } 1057 echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>$summary</li>"; 1100 1101 $date = ''; 1102 if ( $show_date ) { 1103 if ( isset($item['pubdate']) ) 1104 $date = $item['pubdate']; 1105 elseif ( isset($item['published']) ) 1106 $date = $item['published']; 1107 1108 if ( $date ) { 1109 if ( $date_stamp = strtotime( $date ) ) 1110 $date = '<span class="rss-date">' . gmdate( get_option( 'date_format' ), $date_stamp ) . '</span>'; 1111 else 1112 $date = ''; 1113 } 1114 } 1115 1116 $author = ''; 1117 if ( $show_author ) { 1118 if ( isset($item['dc']['creator']) ) 1119 $author = ' <cite>' . wp_specialchars( strip_tags( $item['dc']['creator'] ) ) . '</cite>'; 1120 elseif ( isset($item['author_name']) ) 1121 $author = ' <cite>' . wp_specialchars( strip_tags( $item['author_name'] ) ) . '</cite>'; 1122 } 1123 1124 echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>"; 1058 1125 } 1059 1126 echo '</ul>'; 1060 1127 } else { 1061 1128 echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>'; 1062 1129 } 1063 1064 echo $after_widget;1065 1130 } 1066 1131 1067 1132 function wp_widget_rss_control($widget_args) { … … 1082 1147 if ( isset($option['url']) ) 1083 1148 $urls[$option['url']] = true; 1084 1149 1085 if ( !$updated && !empty($_POST['sidebar']) ) {1150 if ( !$updated && 'POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['sidebar']) ) { 1086 1151 $sidebar = (string) $_POST['sidebar']; 1087 1152 1088 1153 $sidebars_widgets = wp_get_sidebars_widgets(); … … 1099 1164 } 1100 1165 1101 1166 foreach( (array) $_POST['widget-rss'] as $widget_number => $widget_rss ) { 1102 $items = (int) $widget_rss['items']; 1103 if ( $items < 1 ) 1104 $items = 10; 1105 $url = sanitize_url(strip_tags(stripslashes($widget_rss['url']))); 1106 $title = trim(strip_tags(stripslashes($widget_rss['title']))); 1107 1108 if ( !isset($urls[$url]) ) { 1109 require_once(ABSPATH . WPINC . '/rss.php'); 1110 $rss = fetch_rss($url); 1111 $error = false; 1112 if ( !is_object($rss) ) { 1113 $url = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1); 1114 $error = sprintf(__('Error in RSS %1$d'), $widget_number ); 1115 } 1116 } 1117 $options[$widget_number] = compact( 'title', 'url', 'items', 'error' ); 1167 $widget_rss = stripslashes_deep( $widget_rss ); 1168 $url = sanitize_url(strip_tags($widget_rss['url'])); 1169 $options[$widget_number] = wp_widget_rss_process( $widget_rss, !isset($urls[$url]) ); 1118 1170 } 1119 1171 1120 1172 update_option('widget_rss', $options); … … 1127 1179 $items = 10; 1128 1180 $error = false; 1129 1181 $number = '%i%'; 1182 $show_summary = 0; 1183 $show_author = 0; 1184 $show_date = 0; 1130 1185 } else { 1131 $title = attribute_escape($options[$number]['title']); 1132 $url = attribute_escape($options[$number]['url']); 1133 $items = (int) $options[$number]['items']; 1134 if ( $items < 1 ) 1135 $items = 10; 1136 $error = $options[$number]['error']; 1186 extract( $options[$number] ); 1137 1187 } 1138 1188 1189 wp_widget_rss_form( compact( 'number', 'title', 'url', 'items', 'error', 'show_summary', 'show_author', 'show_date' ) ); 1190 } 1191 1192 function wp_widget_rss_form( $args, $inputs = null ) { 1193 $default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true ); 1194 $inputs = wp_parse_args( $inputs, $default_inputs ); 1195 extract( $args ); 1196 $number = attribute_escape( $number ); 1197 $title = attribute_escape( $title ); 1198 $url = attribute_escape( $url ); 1199 $items = (int) $items; 1200 if ( $items < 1 || 20 < $items ) 1201 $items = 10; 1202 $show_summary = (int) $show_summary; 1203 $show_author = (int) $show_author; 1204 $show_date = (int) $show_date; 1205 1206 if ( $inputs['url'] ) : 1139 1207 ?> 1140 <p> 1141 <label for="rss-url-<?php echo $number; ?>"><?php _e('Enter the RSS feed URL here:'); ?> 1142 <input class="widefat" id="rss-url-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][url]" type="text" value="<?php echo $url; ?>" /> 1143 </label> 1144 </p> 1145 <p> 1146 <label for="rss-title-<?php echo $number; ?>"><?php _e('Give the feed a title (optional):'); ?> 1147 <input class="widefat" id="rss-title-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" /> 1148 </label> 1149 </p> 1150 <p> 1151 <label for="rss-items-<?php echo $number; ?>"><?php _e('How many items would you like to display?'); ?> 1152 <select id="rss-items-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][items]"> 1153 <?php 1154 for ( $i = 1; $i <= 10; ++$i ) 1155 echo "<option value='$i' " . ( $items == $i ? "selected='selected'" : '' ) . ">$i</option>"; 1156 ?> 1157 </select> 1158 </label> 1159 </p> 1160 <input type="hidden" id="rss-submit-<?php echo $number; ?>" name="rss-submit-<?php echo $number; ?>" value="1" /> 1208 <p> 1209 <label for="rss-url-<?php echo $number; ?>"><?php _e('Enter the RSS feed URL here:'); ?> 1210 <input class="widefat" id="rss-url-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][url]" type="text" value="<?php echo $url; ?>" /> 1211 </label> 1212 </p> 1213 <?php endif; if ( $inputs['title'] ) : ?> 1214 <p> 1215 <label for="rss-title-<?php echo $number; ?>"><?php _e('Give the feed a title (optional):'); ?> 1216 <input class="widefat" id="rss-title-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][title]" type="text" value="<?php echo $title; ?>" /> 1217 </label> 1218 </p> 1219 <?php endif; if ( $inputs['items'] ) : ?> 1220 <p> 1221 <label for="rss-items-<?php echo $number; ?>"><?php _e('How many items would you like to display?'); ?> 1222 <select id="rss-items-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][items]"> 1223 <?php 1224 for ( $i = 1; $i <= 20; ++$i ) 1225 echo "<option value='$i' " . ( $items == $i ? "selected='selected'" : '' ) . ">$i</option>"; 1226 ?> 1227 </select> 1228 </label> 1229 </p> 1230 <?php endif; if ( $inputs['show_summary'] ) : ?> 1231 <p> 1232 <label for="rss-show-summary-<?php echo $number; ?>"> 1233 <input id="rss-show-summary-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][show_summary]" type="checkbox" value="1" <?php if ( $show_summary ) echo 'checked="checked"'; ?>/> 1234 <?php _e('Display item content?'); ?> 1235 </label> 1236 </p> 1237 <?php endif; if ( $inputs['show_author'] ) : ?> 1238 <p> 1239 <label for="rss-show-author-<?php echo $number; ?>"> 1240 <input id="rss-show-author-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][show_author]" type="checkbox" value="1" <?php if ( $show_author ) echo 'checked="checked"'; ?>/> 1241 <?php _e('Display item author if available?'); ?> 1242 </label> 1243 </p> 1244 <?php endif; if ( $inputs['show_date'] ) : ?> 1245 <p> 1246 <label for="rss-show-date-<?php echo $number; ?>"> 1247 <input id="rss-show-date-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][show_date]" type="checkbox" value="1" <?php if ( $show_date ) echo 'checked="checked"'; ?>/> 1248 <?php _e('Display item date?'); ?> 1249 </label> 1250 </p> 1251 <input type="hidden" id="rss-submit-<?php echo $number; ?>" name="rss-submit-<?php echo $number; ?>" value="1" /> 1161 1252 <?php 1253 endif; 1254 foreach ( array_keys($default_inputs) as $input ) : 1255 if ( 'hidden' === $inputs[$input] ) : 1256 $id = str_replace( '_', '-', $input ); 1257 ?> 1258 <input type="hidden" id="rss-<?php echo $id; ?>-<?php echo $number; ?>" name="widget-rss[<?php echo $number; ?>][<?php echo $input; ?>]" value="<?php echo $$input; ?>" /> 1259 <?php 1260 endif; 1261 endforeach; 1162 1262 } 1163 1263 1264 // Expects unescaped data 1265 function wp_widget_rss_process( $widget_rss, $check_feed = true ) { 1266 $items = (int) $widget_rss['items']; 1267 if ( $items < 1 || 20 < $items ) 1268 $items = 10; 1269 $url = sanitize_url(strip_tags( $widget_rss['url'] )); 1270 $title = trim(strip_tags( $widget_rss['title'] )); 1271 $show_summary = (int) $widget_rss['show_summary']; 1272 $show_author = (int) $widget_rss['show_author']; 1273 $show_date = (int) $widget_rss['show_date']; 1274 1275 if ( $check_feed ) { 1276 require_once(ABSPATH . WPINC . '/rss.php'); 1277 $rss = fetch_rss($url); 1278 $error = false; 1279 $link = ''; 1280 if ( !is_object($rss) ) { 1281 $url = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1); 1282 $error = sprintf(__('Error in RSS %1$d'), $widget_number ); 1283 } else { 1284 $link = clean_url(strip_tags($rss->channel['link'])); 1285 while ( strstr($link, 'http') != $link ) 1286 $link = substr($link, 1); 1287 } 1288 } 1289 1290 return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' ); 1291 } 1292 1164 1293 function wp_widget_rss_register() { 1165 1294 if ( !$options = get_option('widget_rss') ) 1166 1295 $options = array(); -
wp-admin/wp-admin.css
1017 1017 background: #464646 url('images/logo-ghost.png') no-repeat 20px 10px; 1018 1018 color: #999; 1019 1019 position: relative; 1020 margin-top: -75px;1020 // margin-top: -75px; 1021 1021 } 1022 1022 1023 1023 #footer a { -
wp-admin/includes/schema.php
251 251 populate_roles_160(); 252 252 populate_roles_210(); 253 253 populate_roles_230(); 254 populate_roles_250(); 254 255 } 255 256 256 257 function populate_roles_160() { … … 390 391 } 391 392 } 392 393 394 function populate_roles_250() { 395 $role = get_role( 'administrator' ); 396 397 if ( !empty( $role ) ) { 398 $role->add_cap( 'edit_dashboard' ); 399 } 400 } 401 393 402 ?> -
wp-admin/includes/upgrade.php
198 198 if ( $wp_current_db_version < 6124 ) 199 199 upgrade_230_old_tables(); 200 200 201 if ( $wp_current_db_version < 6689 ) 202 upgrade_250(); 203 201 204 maybe_disable_automattic_widgets(); 202 205 203 206 $wp_rewrite->flush_rules(); … … 716 719 } 717 720 718 721 722 function upgrade_250() { 723 global $wp_current_db_version; 724 725 if ( $wp_current_db_version < 6689 ) { 726 populate_roles_250(); 727 } 728 } 729 719 730 // The functions we use to actually do stuff 720 731 721 732 // General -
wp-admin/includes/dashboard.php
1 <?php 2 3 // Registers dashboard widgets, handles POST data, sets up filters 4 function wp_dashboard_setup() { 5 global $wpdb, $wp_dashboard_sidebars; 6 $update = false; 7 if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) 8 $widget_options = array(); 9 10 11 /* Register WP Dashboard Dynamic Sidebar */ 12 register_sidebar( array( 13 'name' => 'WordPress Dashboard', 14 'id' => 'wp_dashboard', 15 'before_widget' => "\t<div class='dashboard-widget-holder %2\$s' id='%1\$s'>\n\n\t\t<div class='dashboard-widget'>\n\n", 16 'after_widget' => "\t\t</div>\n\n\t</div>\n\n", 17 'before_title' => "\t\t\t<h3 class='dashboard-widget-title'>", 18 'after_title' => "</h3>\n\n" 19 ) ); 20 21 22 /* Register Widgets and Controls */ 23 24 // Recent Comments Widget 25 if ( $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { 26 $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); 27 $notice = "<a href='moderation.php'>$notice</a>"; 28 } else { 29 $notice = ''; 30 } 31 wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments', 32 array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' ) 33 ); 34 35 36 // Incoming Links Widget 37 if ( !isset( $widget_options['dashboard_incoming_links'] ) ) { 38 $update = true; 39 $widget_options['dashboard_incoming_links'] = array( 40 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 41 'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), 42 'items' => 5, 43 'show_date' => 0 44 ); 45 } 46 wp_register_sidebar_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_empty', 47 array( 'all_link' => $widget_options['dashboard_incoming_links']['link'], 'feed_link' => $widget_options['dashboard_incoming_links']['url'], 'width' => 'half' ) 48 ); 49 wp_register_widget_control( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_rss_control', array(), 50 array( 'widget_id' => 'dashboard_incoming_links', 'form_inputs' => array( 'title' => false, 'show_summary' => false, 'show_author' => false ) ) 51 ); 52 53 54 // WP Plugins Widget 55 wp_register_sidebar_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty', 56 array( 'all_link' => 'http://wordpress.org/extend/plugins/', 'feed_link' => 'http://wordpress.org/extend/plugins/rss/', 'width' => 'half' ) 57 ); 58 wp_register_widget_control( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty', array(), 59 array( 'widget_id' => 'dashboard_plugins' ) 60 ); 61 62 63 // Primary feed (Dev Blog) Widget 64 if ( !isset( $widget_options['dashboard_primary'] ) ) { 65 $update = true; 66 $widget_options['dashboard_primary'] = array( 67 'link' => apply_filters( 'dashboard_primary_link', 'http://wordpress.org/development/' ), 68 'url' => apply_filters( 'dashboard_primary_feed', 'http://wordpress.org/development/feed/' ), 69 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ), 70 'items' => 2, 71 'show_summary' => 1, 72 'show_author' => 0, 73 'show_date' => 1 74 ); 75 } 76 wp_register_sidebar_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_empty', 77 array( 'all_link' => $widget_options['dashboard_primary']['link'], 'feed_link' => $widget_options['dashboard_primary']['url'], 'width' => 'half', 'class' => 'widget_rss' ) 78 ); 79 wp_register_widget_control( 'dashboard_primary', __( 'Primary Feed' ), 'wp_dashboard_rss_control', array(), 80 array( 'widget_id' => 'dashboard_primary' ) 81 ); 82 83 84 // Secondary Feed (Planet) Widget 85 if ( !isset( $widget_options['dashboard_secondary'] ) ) { 86 $update = true; 87 $widget_options['dashboard_secondary'] = array( 88 'link' => apply_filters( 'dashboard_secondary_link', 'http://planet.wordpress.org/' ), 89 'url' => apply_filters( 'dashboard_secondary_feed', 'http://planet.wordpress.org/feed/' ), 90 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ), 91 'items' => 15 92 ); 93 } 94 wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty', 95 array( 'all_link' => $widget_options['dashboard_secondary']['link'], 'feed_link' => $widget_options['dashboard_secondary']['url'], 'width' => 'full' ) 96 ); 97 wp_register_widget_control( 'dashboard_secondary', __( 'Secondary Feed' ), 'wp_dashboard_rss_control', array(), 98 array( 'widget_id' => 'dashboard_secondary', 'form_inputs' => array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) ) 99 ); 100 101 102 // Hook to register new widgets 103 do_action( 'wp_dashboard_setup' ); 104 105 // Hard code the sidebar's widgets and order 106 $dashboard_widgets = array( 'dashboard_recent_comments', 'dashboard_incoming_links', 'dashboard_primary', 'dashboard_plugins', 'dashboard_secondary' ); 107 108 // Filter widget order 109 $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets ); 110 111 $wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets ); 112 113 add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' ); 114 115 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) { 116 ob_start(); // hack - but the same hack wp-admin/widgets.php uses 117 wp_dashbaord_trigger_widget_control( $_POST['widget_id'] ); 118 ob_end_clean(); 119 wp_redirect( remove_query_arg( 'edit' ) ); 120 exit; 121 } 122 123 if ( $update ) 124 update_option( 'dashboard_widget_options', $widget_options ); 125 } 126 127 // Echoes out the dashboard 128 function wp_dashboard() { 129 echo "<div id='dashboard-widgets'>\n\n"; 130 131 // We're already filtering dynamic_sidebar_params obove 132 add_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); // here there be hackery 133 dynamic_sidebar( 'wp_dashboard' ); 134 remove_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); 135 136 echo "<br class='clear' />\n</div>\n\n\n"; 137 } 138 139 // Makes sidebar_widgets option reflect the dashboard settings 140 function wp_dashboard_sidebars_widgets() { // hackery 141 return $GLOBALS['wp_dashboard_sidebars']; 142 } 143 144 // Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget) 145 // Switches widget to edit mode if $_GET['edit'] 146 function wp_dashboard_dynamic_sidebar_params( $params ) { 147 global $wp_registered_widgets, $wp_registered_widget_controls; 148 149 extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' ); 150 extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' ); 151 152 $the_classes = array(); 153 if ( in_array($widget_width, array( 'third', 'fourth', 'full' ) ) ) 154 $the_classes[] = $widget_width; 155 156 if ( 'double' == $widget_height ) 157 $the_classes[] = 'double'; 158 159 if ( $widget_class ) 160 $the_classes[] = $widget_class; 161 162 // Add classes to the widget holder 163 if ( $the_classes ) 164 $sidebar_before_widget = str_replace( "<div class='dashboard-widget-holder ", "<div class='dashboard-widget-holder " . join( ' ', $the_classes ) . ' ', $sidebar_before_widget ); 165 166 $links = array(); 167 if ( $widget_all_link ) 168 $links[] = '<a href="' . clean_url( $widget_all_link ) . '">' . __( 'See All' ) . '</a>'; 169 170 $content_class = 'dashboard-widget-content'; 171 if ( current_user_can( 'edit_dashboard' ) && isset($wp_registered_widget_controls[$widget_id]) && is_callable($wp_registered_widget_controls[$widget_id]['callback']) ) { 172 // Switch this widget to edit mode 173 if ( isset($_GET['edit']) && $_GET['edit'] == $widget_id ) { 174 $content_class .= ' dashboard-widget-control'; 175 $wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty'; 176 $sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name']; 177 $params[1] = $widget_id; 178 $sidebar_before_widget .= '<form action="' . remove_query_arg( 'edit' ) . '" method="post">'; 179 $sidebar_after_widget = "<div class='dashboard-widget-submit'><input type='hidden' name='sidebar' value='wp_dashboard' /><input type='hidden' name='widget_id' value='$widget_id' /><input type='submit' value='" . __( 'Save' ) . "' /></div></form>$sidebar_after_widget"; 180 $links[] = '<a href="' . remove_query_arg( 'edit' ) . '">' . __( 'Cancel' ) . '</a>'; 181 } else { 182 $links[] = '<a href="' . add_query_arg( 'edit', $widget_id ) . "#$widget_id" . '">' . __( 'Edit' ) . '</a>'; 183 } 184 } 185 186 if ( $widget_feed_link ) 187 $links[] = '<img class="rss-icon" src="' . get_option( 'siteurl' ) . '/' . WPINC . '/images/rss.png" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>'; 188 189 $links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links ); 190 191 // Add links to widget's title bar 192 if ( $links ) { 193 $sidebar_before_title .= '<span>'; 194 $sidebar_after_title = '</span><small>' . join( ' | ', $links ) . "</small><br class='clear' />$sidebar_after_title"; 195 } 196 197 // Could have put this in widget-content. Doesn't really matter 198 if ( $widget_notice ) 199 $sidebar_after_title .= "\t\t\t<div class='dashboard-widget-notice'>$widget_notice</div>\n\n"; 200 201 if ( $widget_error ) 202 $sidebar_after_title .= "\t\t\t<div class='dashboard-widget-error'>$widget_error</div>\n\n"; 203 204 $sidebar_after_title .= "\t\t\t<div class='$content_class'>\n\n"; 205 206 $sidebar_after_widget .= "\t\t\t</div>\n\n"; 207 208 foreach( array_keys( $params[0] ) as $key ) 209 $$key = ${'sidebar_' . $key}; 210 211 $params[0] = compact( array_keys( $params[0] ) ); 212 213 return $params; 214 } 215 216 217 /* Dashboard Widgets */ 218 219 function wp_dashboard_recent_comments( $sidebar_args ) { 220 global $comment; 221 222 extract( $sidebar_args, EXTR_SKIP ); 223 224 echo $before_widget; 225 226 echo $before_title; 227 echo $widget_name; 228 echo $after_title; 229 230 $lambda = create_function( '', 'return 5;' ); 231 add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter 232 $comments_query = new WP_Query('feed=rss2&withcomments=1'); 233 remove_filter( 'option_posts_per_rss', $lambda ); 234 235 $is_first = true; 236 237 if ( $comments_query->have_comments() ) { 238 while ( $comments_query->have_comments() ) { $comments_query->the_comment(); 239 240 $comment_post_url = get_permalink( $comment->comment_post_ID ); 241 $comment_post_title = get_the_title( $comment->comment_post_ID ); 242 $comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>"; 243 $comment_link = '<a class="comment-link" href="' . get_comment_link() . '">#</a>'; 244 $comment_meta = sprintf( __( 'From <strong>%s</strong> on %s %s' ), get_comment_author(), $comment_post_link, $comment_link ); 245 246 if ( $is_first ) : $is_first = false; 247 ?> 248 <blockquote><?php comment_text(); ?></blockquote> 249 <p class='comment-meta'><?php echo $comment_meta; ?></p> 250 251 <ul id="dashboard-comments-list"> 252 <?php 253 else : 254 ?> 255 256 <li class='comment-meta'><?php echo $comment_meta; ?></li> 257 <?php 258 endif; 259 } 260 ?> 261 262 </ul> 263 264 <?php 265 266 } 267 268 echo $after_widget; 269 } 270 271 // Empty widget used for JS/AJAX created output. Also used when widget is in edit mode. 272 function wp_dashboard_empty( $sidebar_args, $widget_control_id = false ) { 273 extract( $sidebar_args, EXTR_SKIP ); 274 275 echo $before_widget; 276 277 echo $before_title; 278 echo $widget_name; 279 echo $after_title; 280 281 if ( $widget_control_id ) // If in edit mode 282 wp_dashbaord_trigger_widget_control( $widget_control_id ); 283 284 echo $after_widget; 285 } 286 287 /* Dashboard Widgets Controls. Ssee also wp_dashboard_empty() */ 288 289 // Calls widget_control callback 290 function wp_dashbaord_trigger_widget_control( $widget_control_id = false ) { 291 global $wp_registered_widget_controls; 292 if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_registered_widget_controls[$widget_control_id]) && is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) ) 293 call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] ); 294 } 295 296 // Sets up $args to be used as input to wp_widget_rss_form(), handles POST data from RSS-type widgets 297 function wp_dashboard_rss_control( $args ) { 298 extract( $args ); 299 if ( !$widget_id ) 300 return false; 301 302 if ( !$widget_options = get_option( 'dashboard_widget_options' ) ) 303 $widget_options = array(); 304 305 if ( !isset($widget_options[$widget_id]) ) 306 $widget_options[$widget_id] = array(); 307 308 $number = 1; // Hack to use wp_widget_rss_form() 309 $widget_options[$widget_id]['number'] = $number; 310 311 if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) { 312 $_POST['widget-rss'][$number] = stripslashes_deep( $_POST['widget-rss'][$number] ); 313 $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] ); 314 // title is optional. If black, fill it if possible 315 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 316 require_once(ABSPATH . WPINC . '/rss.php'); 317 $rss = fetch_rss($widget_options[$widget_id]['url']); 318 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->channel['title'])); 319 } 320 update_option( 'dashboard_widget_options', $widget_options ); 321 } 322 323 wp_widget_rss_form( $widget_options[$widget_id], $form_inputs ); 324 } 325 326 327 // Move this into wp-admin.css 328 function temp_dashboard_css() { 329 ?> 330 <style type="text/css"> 331 /* <![CDATA[ */ 332 333 div#dashboard-widgets { 334 position: relative; 335 left: 20px; 336 margin-left: -20px; 337 } 338 339 div.dashboard-widget-holder { 340 margin-top: 20px; 341 width: 50%; 342 float: left; 343 } 344 345 div.dashboard-widget-holder.third { 346 width: 33.3%; 347 } 348 349 div.dashboard-widget-holder.fourth { 350 width: 25%; 351 } 352 353 div.dashboard-widget-holder.full { 354 width: 100%; 355 } 356 357 div.dashboard-widget-holder.double div.dashboard-widget { 358 height: 52em; 359 padding-bottom: 28px /* lame */ 360 } 361 362 div.dashboard-widget { 363 position: relative; 364 margin-right: 20px; 365 border: 1px solid #ccc; 366 padding: 2px; 367 height: 26em; 368 overflow: auto; 369 } 370 371 h3.dashboard-widget-title { 372 background-color: #eaf3fa; 373 margin: 0; 374 position: relative; 375 padding: 0 10px; 376 font-size: 1.2em; 377 line-height: 2; 378 } 379 380 h3.dashboard-widget-title span { 381 background-color: #eaf3fa; 382 display: block; 383 text-align: left; 384 float: left; 385 } 386 387 h3.dashboard-widget-title small { 388 background-color: #eaf3fa; 389 display: block; 390 text-align: right; 391 float: right; 392 font-size: 75%; 393 line-height: 2.67; /* math: it works */ 394 margin-top: 2px; 395 } 396 397 h3.dashboard-widget-title img.rss-icon { 398 vertical-align: middle; 399 } 400 401 div.dashboard-widget-notice { 402 background-color: #cfe1ef; 403 padding: 0 20px; 404 font-size: 1.2em; 405 line-height: 2; 406 } 407 408 div.dashboard-widget-error { 409 background-color: #c43; 410 padding: 0 20px; 411 font-size: 1.2em; 412 line-height: 2; 413 } 414 415 div.dashboard-widget-content { 416 margin: 10px 15px; 417 } 418 419 div.dashboard-widget-submit { 420 border-top: 1px solid #ccc; 421 margin: 10px 15px; 422 padding-top: 10px; 423 } 424 div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl { 425 text-indent: 0; 426 padding-left: 15px; 427 } 428 429 div.dashboard-widget-content blockquote { 430 margin: 0 0 -1em; 431 } 432 433 div.dashboard-widget-content .comment-meta { 434 font-size: 95%; 435 } 436 437 #dashboard_secondary div.dashboard-widget-content ul { 438 list-style: none; 439 padding: 0; 440 margin: 0; 441 } 442 443 #dashboard_secondary div.dashboard-widget-content ul li { 444 display: block; 445 width: 20%; 446 height: 6em; 447 padding-bottom: 20px; 448 margin: 0; 449 float: left; 450 font-size: 95%; 451 } 452 453 #dashboard_secondary div.dashboard-widget-content { 454 margin: 10px 5px; 455 padding: 0; 456 } 457 458 #dashboard_secondary div.dashboard-widget-content ul li .post { 459 display:block; 460 font-family:Georgia,"Times New Roman",Times,serif; 461 font-size:18px; 462 height:60px; 463 overflow:hidden; 464 } 465 466 #dashboard_secondary div.dashboard-widget-content ul li a { 467 background:#DDDDDD none repeat scroll 0%; 468 display:block; 469 height:100%; 470 overflow:hidden; 471 margin: 10px; 472 padding: .5em; 473 } 474 475 #dashboard_secondary div.dashboard-widget-content ul li a cite { 476 display: block; 477 } 478 479 #dashboard-widgets .widget_rss ul { 480 list-style: none; 481 padding: 0; 482 margin: 0; 483 } 484 485 #dashboard-widgets .widget_rss ul li { 486 clear: both; 487 } 488 489 #dashboard-widgets .widget_rss ul li span.rss-date { 490 float: left; 491 margin: .5em 0 1em; 492 } 493 494 #dashboard-widgets .widget_rss ul li a { 495 float: left; 496 margin: .5em .5em 1em 0; 497 font-weight: bold; 498 } 499 500 #dashboard-widgets .widget_rss ul li div { 501 clear: both; 502 } 503 /* ]]> */ 504 </style> 505 <?php 506 } 507 508 add_action( 'admin_head', 'temp_dashboard_css' ); 509 510 ?> -
wp-admin/index.php
1 1 <?php 2 2 3 require_once('admin.php'); 3 4 5 require( './includes/dashboard.php' ); 6 7 wp_dashboard_setup(); 8 4 9 function index_js() { 5 10 ?> 6 11 <script type="text/javascript"> 7 12 jQuery(function() { 8 jQuery('#incominglinks').load('index-extra.php?jax=incominglinks'); 9 jQuery('#devnews').load('index-extra.php?jax=devnews'); 10 // jQuery('#planetnews').load('index-extra.php?jax=planetnews'); 13 jQuery('#dashboard_incoming_links div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=incominglinks'); 14 jQuery('#dashboard_primary div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=devnews'); 15 jQuery('#dashboard_secondary div.dashboard-widget-content').not( '.dashboard-widget-control' ).load('index-extra.php?jax=planetnews'); 16 jQuery('#dashboard_plugins div.dashboard-widget-content').not( '.dashboard-widget-control' ).html( 'TODO' ); 11 17 }); 12 18 </script> 13 19 <?php … … 77 83 $widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets ); 78 84 ?> 79 85 <p><?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, "<a href='widgets.php'>$widgets_text</a>" ); ?> <a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a> You're using BetaPress TODO.</p> 80 <p>81 86 <?php do_action( 'rightnow_end' ); ?> 82 87 <?php do_action( 'activity_box_end' ); ?> 83 </div> 88 </div><!-- rightnow --> 84 89 85 < div id="dashboard-widgets">90 <?php wp_dashboard(); ?> 86 91 87 <div class="dashboard-widget"> 88 <div class="dashboard-widget-edit"><a href=""><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 89 <h3>Recent Comments</h3> 92 </div><!-- wrap --> 90 93 91 <?php 92 $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5"); 93 $numcomments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'"); 94 95 if ( $comments || $numcomments ) : 96 ?> 97 98 <?php if ( $numcomments ) : ?> 99 <p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s) »'), number_format_i18n($numcomments) ); ?></a></strong></p> 100 <?php endif; ?> 101 102 <ul> 103 <?php 104 if ( $comments ) { 105 foreach ($comments as $comment) { 106 echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>'); 107 edit_comment_link(__("Edit"), ' <small>(', ')</small>'); 108 echo '</li>'; 109 } 110 } 111 ?> 112 </ul> 113 <?php endif; ?> 114 </div> 115 116 117 <div class="dashboard-widget"> 118 <?php 119 $more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ); 120 ?> 121 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 122 <h3><?php _e('Incoming Links'); ?></h3> 123 124 <div id="incominglinks"></div> 125 </div> 126 127 <div class="dashboard-widget"> 128 <?php 129 $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql('post') . " AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5"); 130 ?> 131 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 132 <h3>Recent Posts</h3> 133 134 <ul> 135 <?php 136 foreach ($recentposts as $post) { 137 if ($post->post_title == '') 138 $post->post_title = sprintf(__('Post #%s'), $post->ID); 139 echo "<li><a href='post.php?action=edit&post=$post->ID'>"; 140 the_title(); 141 echo '</a></li>'; 142 } 143 ?> 144 </ul> 145 </div> 146 147 <div class="dashboard-widget"> 148 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a> | <a href=""><?php _e('RSS'); ?></a></div> 149 <h3><?php echo apply_filters( 'dashboard_primary_title', __('Blog') ); ?></h3> 150 151 <div id="devnews"></div> 152 </div> 153 154 <?php do_action( 'dashboard_widgets' ); ?> 155 156 <p><a href=""><?php _e('Customize this page'); ?></a>.</p> 157 158 </div> 159 160 161 <div id="planetnews"></div> 162 163 <div style="clear: both"> 164 <br clear="all" /> 165 </div> 166 </div> 167 168 <?php 169 require('./admin-footer.php'); 170 ?> 94 <?php require('./admin-footer.php'); ?> -
wp-admin/index-extra.php
4 4 5 5 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 6 6 7 $widgets = get_option( 'dashboard_widget_options' ); 8 9 7 10 switch ( $_GET['jax'] ) { 8 11 9 12 case 'incominglinks' : 10 11 $rss_feed = apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ); 12 13 14 $rss = @fetch_rss( $rss_feed ); 13 @extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP ); 14 $rss = @fetch_rss( $url ); 15 15 if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results 16 16 ?> 17 17 18 18 <ul> 19 19 <?php 20 $rss->items = array_slice($rss->items, 0, 10);20 $rss->items = array_slice($rss->items, 0, $items); 21 21 foreach ($rss->items as $item ) { 22 $publisher = ''; 23 $site_link = ''; 24 $link = ''; 25 $content = ''; 26 $date = ''; 27 $link = clean_url( strip_tags( $item['link'] ) ); 28 29 if ( isset( $item['author_uri'] ) ) 30 $site_link = clean_url( strip_tags( $item['author_uri'] ) ); 31 32 if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) ) 33 $publisher = __( 'Somebody' ); 34 if ( $site_link ) 35 $publisher = "<a href='$site_link'>$publisher</a>"; 36 else 37 $publisher = "<strong>$publisher</strong>"; 38 39 if ( isset($item['description']) ) 40 $content = $item['description']; 41 elseif ( isset($item['summary']) ) 42 $content = $item['summary']; 43 elseif ( isset($item['atom_content']) ) 44 $content = $item['atom_content']; 45 else 46 $content = __( 'something' ); 47 $content = strip_tags( $content ); 48 if ( 50 < strlen($content) ) 49 $content = substr($content, 0, 50) . ' ...'; 50 $content = wp_specialchars( $content ); 51 if ( $link ) 52 $text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' ); 53 else 54 $text = _c( '%1$s linked here saying, "%3$s"|feed_display' ); 55 56 if ( $show_date ) { 57 if ( $show_author || $show_summary ) 58 $text .= _c( ' on %4$s|feed_display' ); 59 $date = wp_specialchars( strip_tags( isset($item['pubdate']) ? $item['pubdate'] : $item['published'] ) ); 60 $date = strtotime( $date ); 61 $date = gmdate( get_option( 'date_format' ), $date ); 62 } 63 22 64 ?> 23 <li>< a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>65 <li><?php printf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ); ?></li> 24 66 <?php } ?> 25 67 </ul> 26 68 <?php … … 32 74 break; 33 75 34 76 case 'devnews' : 35 $rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', 'http://wordpress.org/development/feed/' )); 36 if ( isset($rss->items) && 0 != count($rss->items) ) { 37 38 $rss->items = array_slice($rss->items, 0, 2); 39 foreach ($rss->items as $item ) { 40 ?> 41 <h4><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> <?php gmdate( 'Y/m/d', strtotime( $item['pubdate'] ) ); ?></h4> 42 <p><?php echo $item['description']; ?></p> 43 <?php 44 } 45 } 46 ?> 47 48 <?php 77 wp_widget_rss_output( $widgets['dashboard_primary'] ); 49 78 break; 50 79 51 80 case 'planetnews' : 52 $rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', 'http://planet.wordpress.org/feed/' )); 81 extract( $widgets['dashboard_secondary'], EXTR_SKIP ); 82 $rss = @fetch_rss( $url ); 53 83 if ( isset($rss->items) && 0 != count($rss->items) ) { 54 84 ?> 55 <h3><?php echo apply_filters( 'dashboard_secondary_title', __('Other WordPress News') ); ?></h3>56 85 <ul> 57 86 <?php 58 $rss->items = array_slice($rss->items, 0, 20);87 $rss->items = array_slice($rss->items, 0, $items); 59 88 foreach ($rss->items as $item ) { 60 89 $title = wp_specialchars($item['title']); 61 90 $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] ); … … 66 95 } 67 96 ?> 68 97 </ul> 69 <p class="readmore"><a href="<?php echo apply_filters( 'dashboard_secondary_link', 'http://planet.wordpress.org/' ); ?>"><?php _e('Read more »'); ?></a></p>70 98 <?php 71 99 } 72 100 break;