Make WordPress Core

Changeset 40607

Timestamp:
05/10/2017 08:03:01 PM (7 years ago)
Author:
azaozz
Message:

Dashboard: Update the existing WordPress News dashboard widget to also include upcoming meetup events and WordCamps near the current user’s location.

Props @afercia, @andreamiddleton, @azaozz, @camikaos, @coreymckrill, @chanthaboune, @courtneypk, @dd32, @iandunn, @iseulde, @mapk, @mayukojpn, @melchoyce, @nao, @obenland, @pento, @samuelsidler, @stephdau, @tellyworth.
See #40702.

Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-ajax.php

    r38159 r40607  
    6565    'press-this-add-category', 'crop-image', 'generate-password', 'save-wporg-username', 'delete-plugin',
    6666    'search-plugins', 'search-install-plugins', 'activate-plugin', 'update-theme', 'delete-theme',
    67     'install-theme', 'get-post-thumbnail-html',
     67    'install-theme', 'get-post-thumbnail-html',
    6868);
    6969
  • trunk/src/wp-admin/css/dashboard.css

    r40556 r40607  
    302302}
    303303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
     417
     418
     419
     420
     421
     422
     423
     424
     425
     426
     427
     428
     429
     430
     431
     432
     433
     434
     435
     436
     437
     438
     439
     440
     441
     442
    304443/* Dashboard WordPress news */
    305444
     
    334473
    335474#dashboard_primary .rss-widget {
    336     border-bottom: 1px solid #eee;
    337475    font-size: 13px;
    338     padding: 8px 12px 10px;
     476    padding: ;
    339477}
    340478
     
    358496
    359497#dashboard_primary .rss-widget ul li {
    360     margin-bottom: 8px;
     498    padding: 4px 0;
     499    margin: 0;
    361500}
    362501
     
    8751014
    8761015a.rsswidget {
    877     font-size: 14px;
     1016    font-size: 1px;
    8781017    font-weight: 600;
    879     line-height: 1.7em;
     1018    line-height: 1.em;
    8801019}
    8811020
     
    10871226        width: 30px;
    10881227        margin: 4px 10px 5px 0;
     1228
     1229
     1230
     1231
     1232
     1233
     1234
     1235
    10891236    }
    10901237}
     
    11111258    }
    11121259}
     1260
     1261
     1262
     1263
     1264
     1265
     1266
     1267
     1268
     1269
     1270
     1271
     1272
     1273
     1274
     1275
     1276
     1277
     1278
     1279
     1280
     1281
     1282
     1283
     1284
     1285
     1286
  • trunk/src/wp-admin/includes/ajax-actions.php

    r40476 r40607  
    295295
    296296    wp_die( wp_json_encode( $return ) );
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
    297331}
    298332
  • trunk/src/wp-admin/includes/dashboard.php

    r40556 r40607  
    5353    }
    5454
    55     // WordPress News
    56     wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress News' ), 'wp_dashboard_primary' );
     55    // WordPress News
     56    wp_add_dashboard_widget( 'dashboard_primary', __( 'WordPress ' );
    5757
    5858    if ( is_network_admin() ) {
     
    128128    /** This action is documented in wp-admin/edit-form-advanced.php */
    129129    do_action( 'do_meta_boxes', $screen->id, 'side', '' );
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
    130170}
    131171
     
    10701110}
    10711111
     1112
     1113
     1114
     1115
     1116
     1117
     1118
     1119
     1120
     1121
     1122
     1123
     1124
     1125
     1126
     1127
     1128
     1129
     1130
     1131
     1132
     1133
     1134
     1135
     1136
     1137
     1138
     1139
     1140
     1141
     1142
     1143
     1144
     1145
     1146
     1147
     1148
     1149
     1150
     1151
     1152
     1153
     1154
     1155
     1156
     1157
     1158
     1159
     1160
     1161
     1162
     1163
     1164
     1165
     1166
     1167
     1168
     1169
     1170
     1171
     1172
     1173
     1174
     1175
     1176
     1177
     1178
     1179
     1180
     1181
     1182
     1183
     1184
     1185
     1186
     1187
     1188
     1189
     1190
     1191
     1192
     1193
     1194
     1195
     1196
     1197
     1198
     1199
     1200
     1201
     1202
     1203
     1204
     1205
     1206
     1207
     1208
     1209
     1210
     1211
     1212
     1213
     1214
     1215
     1216
     1217
     1218
     1219
     1220
     1221
     1222
     1223
     1224
     1225
     1226
     1227
     1228
     1229
     1230
     1231
     1232
     1233
     1234
     1235
     1236
     1237
     1238
     1239
     1240
     1241
     1242
     1243
     1244
     1245
     1246
     1247
     1248
     1249
     1250
     1251
     1252
     1253
     1254
     1255
     1256
     1257
     1258
     1259
     1260
     1261
     1262
     1263
     1264
     1265
     1266
     1267
     1268
     1269
     1270
     1271
     1272
     1273
    10721274/**
    10731275 * WordPress News dashboard widget.
    10741276 *
    10751277 * @since 2.7.0
     1278
    10761279 */
    10771280function wp_dashboard_primary() {
     
    11061309            'title'        => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
    11071310            'items'        => 1,
    1108             'show_summary' => 1,
     1311            'show_summary' => ,
    11091312            'show_author'  => 0,
    1110             'show_date'    => 1,
     1313            'show_date'    => ,
    11111314        ),
    11121315        'planet' => array(
     
    11531356    );
    11541357
    1155     if ( ( ! wp_disallow_file_mods( 'dashboard_widget' ) ) && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
    1156         $feeds['plugins'] = array(
    1157             'link'         => '',
    1158             'url'          => array(
    1159                 'popular' => 'http://wordpress.org/plugins/rss/browse/popular/',
    1160             ),
    1161             'title'        => '',
    1162             'items'        => 1,
    1163             'show_summary' => 0,
    1164             'show_author'  => 0,
    1165             'show_date'    => 0,
    1166         );
    1167     }
    1168 
    11691358    wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_primary_output', $feeds );
    11701359}
     
    11741363 *
    11751364 * @since 3.8.0
     1365
    11761366 *
    11771367 * @param string $widget_id Widget ID.
     
    11821372        $args['type'] = $type;
    11831373        echo '<div class="rss-widget">';
    1184         if ( $type === 'plugins' ) {
    1185             wp_dashboard_plugins_output( $args['url'], $args );
    1186         } else {
    11871374            wp_widget_rss_output( $args['url'], $args );
    1188         }
    11891375        echo "</div>";
    11901376    }
    1191 }
    1192 
    1193 /**
    1194  * Display plugins text for the WordPress news widget.
    1195  *
    1196  * @since 2.5.0
    1197  *
    1198  * @param string $rss  The RSS feed URL.
    1199  * @param array  $args Array of arguments for this RSS feed.
    1200  */
    1201 function wp_dashboard_plugins_output( $rss, $args = array() ) {
    1202     // Plugin feeds plus link to install them
    1203     $popular = fetch_feed( $args['url']['popular'] );
    1204 
    1205     if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
    1206         $plugin_slugs = array_keys( get_plugins() );
    1207         set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
    1208     }
    1209 
    1210     echo '<ul>';
    1211 
    1212     foreach ( array( $popular ) as $feed ) {
    1213         if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
    1214             continue;
    1215 
    1216         $items = $feed->get_items(0, 5);
    1217 
    1218         // Pick a random, non-installed plugin
    1219         while ( true ) {
    1220             // Abort this foreach loop iteration if there's no plugins left of this type
    1221             if ( 0 == count($items) )
    1222                 continue 2;
    1223 
    1224             $item_key = array_rand($items);
    1225             $item = $items[$item_key];
    1226 
    1227             list($link, $frag) = explode( '#', $item->get_link() );
    1228 
    1229             $link = esc_url($link);
    1230             if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
    1231                 $slug = $matches[1];
    1232             else {
    1233                 unset( $items[$item_key] );
    1234                 continue;
    1235             }
    1236 
    1237             // Is this random plugin's slug already installed? If so, try again.
    1238             reset( $plugin_slugs );
    1239             foreach ( $plugin_slugs as $plugin_slug ) {
    1240                 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
    1241                     unset( $items[$item_key] );
    1242                     continue 2;
    1243                 }
    1244             }
    1245 
    1246             // If we get to this point, then the random plugin isn't installed and we can stop the while().
    1247             break;
    1248         }
    1249 
    1250         // Eliminate some common badly formed plugin descriptions
    1251         while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
    1252             unset($items[$item_key]);
    1253 
    1254         if ( !isset($items[$item_key]) )
    1255             continue;
    1256 
    1257         $raw_title = $item->get_title();
    1258 
    1259         $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
    1260         echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
    1261             '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
    1262             /* translators: %s: plugin name */
    1263             esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
    1264 
    1265         $feed->__destruct();
    1266         unset( $feed );
    1267     }
    1268 
    1269     echo '</ul>';
    12701377}
    12711378
  • trunk/src/wp-admin/includes/deprecated.php

    r38470 r40607  
    12961296
    12971297/**
     1298
     1299
     1300
     1301
     1302
     1303
     1304
     1305
     1306
     1307
     1308
     1309
     1310
     1311
     1312
     1313
     1314
     1315
     1316
     1317
     1318
     1319
     1320
     1321
     1322
     1323
     1324
     1325
     1326
     1327
     1328
     1329
     1330
     1331
     1332
     1333
     1334
     1335
     1336
     1337
     1338
     1339
     1340
     1341
     1342
     1343
     1344
     1345
     1346
     1347
     1348
     1349
     1350
     1351
     1352
     1353
     1354
     1355
     1356
     1357
     1358
     1359
     1360
     1361
     1362
     1363
     1364
     1365
     1366
     1367
     1368
     1369
     1370
     1371
     1372
     1373
     1374
     1375
     1376
     1377
     1378
     1379
    12981380 * This was once used to move child posts to a new parent.
    12991381 *
  • trunk/src/wp-admin/includes/upgrade.php

    r40296 r40607  
    565565    if ( $wp_current_db_version < 37965 )
    566566        upgrade_460();
     567
     568
     569
     570
    567571
    568572    maybe_disable_link_manager();
     
    17341738
    17351739/**
     1740
     1741
     1742
     1743
     1744
     1745
     1746
     1747
     1748
     1749
     1750
     1751
     1752
     1753
     1754
     1755
     1756
     1757
     1758
     1759
    17361760 * Executes network-level upgrade routines.
    17371761 *
  • trunk/src/wp-admin/index.php

    r38899 r40607  
    1616
    1717wp_enqueue_script( 'dashboard' );
     18
     19
    1820if ( current_user_can( 'edit_theme_options' ) )
    1921    wp_enqueue_script( 'customize-loader' );
     
    139141
    140142<?php
     143
     144
    141145require( ABSPATH . 'wp-admin/admin-footer.php' );
  • trunk/src/wp-admin/js/dashboard.js

    r34977 r40607  
    11/* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */
    22var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
     3
    34
    45jQuery(document).ready( function($) {
     
    188189
    189190} );
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
     282
     283
     284
     285
     286
     287
     288
     289
     290
     291
     292
     293
     294
     295
     296
     297
     298
     299
     300
     301
     302
     303
     304
     305
     306
     307
     308
     309
     310
     311
     312
     313
     314
     315
     316
     317
     318
     319
     320
     321
     322
     323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
     411
     412
     413
     414
     415
     416
     417
     418
     419
     420
     421
     422
     423
     424
     425
     426
     427
     428
     429
     430
     431
     432
     433
     434
     435
     436
     437
     438
     439
     440
     441
     442
     443
     444
     445
     446
     447
     448
     449
  • trunk/src/wp-admin/network/index.php

    r38721 r40607  
    5555
    5656wp_enqueue_script( 'dashboard' );
     57
    5758wp_enqueue_script( 'plugin-install' );
    5859add_thickbox();
     
    7475</div><!-- wrap -->
    7576
    76 <?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
     77<?php
     78wp_print_community_events_templates();
     79include( ABSPATH . 'wp-admin/admin-footer.php' );
  • trunk/src/wp-includes/script-loader.php

    r40283 r40607  
    725725        ) );
    726726
    727         $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), false, 1 );
     727        $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), false, 1 );
    728728
    729729        $scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js" );
Note: See TracChangeset for help on using the changeset viewer.