Make WordPress Core

Changeset 26144


Ignore:
Timestamp:
11/13/2013 10:08:47 PM (10 years ago)
Author:
nacin
Message:

Merge the new dashboard design into core.

Merges https://github.com/growthdesigner/wp-dash.

props lessbloat, joen, helen, dbernar1, kraftbj, ryelle, tillkruess, grapplerulrich, markjaquith.
see #25824.

Location:
trunk/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/colors-fresh.css

    r26072 r26144  
    127127}
    128128
    129 #dashboard_right_now .t,
    130 #dashboard_right_now .b {
    131     color: #777;
    132 }
    133 
    134129#the-comment-list .comment-item p.row-actions,
    135 #dashboard_recent_comments .subsubsub,
    136130.plugins .row-actions-visible,
    137131.row-actions {
     
    553547}
    554548
    555 #the-comment-list .comment-item,
    556 #dashboard-widgets #dashboard_quick_press form p.submit {
     549#the-comment-list .comment-item {
    557550    border: none;
    558551}
     
    581574table.widefat span.trash a,
    582575table.widefat span.spam a,
    583 #dashboard_recent_comments .delete a,
    584 #dashboard_recent_comments .trash a,
    585 #dashboard_recent_comments .spam a,
    586576.plugins a.delete,
    587577#all-plugins-table .plugins a.delete,
     
    597587table.widefat span.trash a:hover,
    598588table.widefat span.spam a:hover,
    599 #dashboard_recent_comments .delete a:hover,
    600 #dashboard_recent_comments .trash a:hover,
    601 #dashboard_recent_comments .spam a:hover,
    602589.plugins a.delete:hover,
    603590#all-plugins-table .plugins a.delete:hover,
     
    772759}
    773760
    774 #dashboard_secondary div.dashboard-widget-content ul li a {
    775     background-color: #f9f9f9;
    776 }
    777 
    778761input.readonly, textarea.readonly {
    779762    background-color: #ddd;
     
    930913
    931914#the-comment-list .unapproved th,
    932 #the-comment-list .unapproved td,
    933 #dashboard_recent_comments #the-comment-list .unapproved {
     915#the-comment-list .unapproved td {
    934916    background-color: #fefaf7;
    935917}
    936918
    937 #the-comment-list .unapproved th.check-column,
    938 #dashboard_recent_comments #the-comment-list .unapproved {
     919#the-comment-list .unapproved th.check-column {
    939920    border-left: 4px solid #d54e21;
    940 }
    941 
    942 #dashboard_recent_comments #the-comment-list .unapproved .avatar {
    943     margin-left: -4px;
    944921}
    945922
     
    10391016.postbox h3,
    10401017#namediv h3,
    1041 #submitdiv h3,
    1042 #dashboard_recent_comments .comment {
     1018#submitdiv h3 {
    10431019    color: #555;
    10441020    border-bottom: 1px solid #eeeeee;
     
    11451121}
    11461122
    1147 #screen-meta-links a:focus { 
    1148     border-color: #aaa; 
    1149     color: #333; 
    1150     -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.15); 
    1151     box-shadow: 0 2px 3px rgba(0,0,0,0.15); 
     1123#screen-meta-links a:focus {
     1124    border-color: #aaa;
     1125    color: #333;
     1126    -webkit-box-shadow: 0 2px 3px rgba(0,0,0,0.15);
     1127    box-shadow: 0 2px 3px rgba(0,0,0,0.15);
    11521128}
    11531129/* end screen options and help tabs */
     
    11661142table.widefat .delete a:hover,
    11671143table.widefat .trash a:hover,
    1168 table.widefat .spam a:hover,
    1169 #dashboard_recent_comments .delete a:hover,
    1170 #dashboard_recent_comments .trash a:hover
    1171 #dashboard_recent_comments .spam a:hover {
     1144table.widefat .spam a:hover {
    11721145    color: #f00;
    11731146}
     
    21982171}
    21992172
    2200 .rtl #the-comment-list .unapproved th.check-column,
    2201 .rtl #dashboard_recent_comments #the-comment-list .unapproved {
     2173.rtl #the-comment-list .unapproved th.check-column {
    22022174    border-left: none;
    22032175    border-right: 4px solid #d54e21;
    22042176}
    2205 
    2206 .rtl #dashboard_recent_comments #the-comment-list .unapproved .avatar {
    2207     margin-left: 10px;
    2208     margin-right: -4px;
    2209 }
  • trunk/src/wp-admin/css/ie.css

    r25846 r26144  
    140140#wpbody-content input.button-secondary {
    141141    overflow: visible;
    142 }
    143 
    144 #dashboard-widgets #dashboard_quick_press form p.submit #publish {
    145     float: none;
    146142}
    147143
  • trunk/src/wp-admin/css/wp-admin.css

    r26140 r26144  
    905905div.sidebar-name h3,
    906906#menu-management .nav-tab,
    907 #dashboard_plugins h5,
    908907a.rsswidget,
    909908#dashboard_right_now td.b,
     
    15281527}
    15291528
    1530 #screen-meta-links a { 
    1531     padding: 3px 6px 3px 16px; 
     1529#screen-meta-links a {
     1530    padding: 3px 6px 3px 16px;
    15321531}
    15331532
     
    24402439}
    24412440
     2441#dashboard-widgets .postbox-container {
     2442    width: 25%;
     2443}
     2444
     2445#dashboard-widgets-wrap .columns-3 #postbox-container-4 .empty-container {
     2446    border: none !important;
     2447}
     2448
     2449#dashboard-widgets-wrap {
     2450    overflow: hidden;
     2451}
     2452
    24422453/* one column on the dash */
    24432454@media only screen and (max-width: 799px) {
     
    24542465
    24552466/* two columns on the dash, but keep the setting if one is selected */
    2456 @media only screen and (min-width: 800px) and (max-width: 1200px) {
     2467@media only screen and (min-width: 800px) and (max-width: 1399px) {
    24572468    #wpbody-content #dashboard-widgets .postbox-container {
    24582469        width: 49.5%;
     
    24922503    .columns-prefs .columns-prefs-4 {
    24932504        display: none;
     2505    }
     2506}
     2507
     2508/* three columns on the dash */
     2509@media only screen and (min-width: 1400px) and (max-width: 1800px) {
     2510    #wpbody-content #dashboard-widgets .postbox-container {
     2511        width: 33.5%;
     2512    }
     2513
     2514    #wpbody-content #dashboard-widgets #postbox-container-1 {
     2515        width: 33%;
     2516    }
     2517
     2518    #wpbody-content #dashboard-widgets #postbox-container-3,
     2519    #wpbody-content #dashboard-widgets #postbox-container-4 {
     2520        float: right;
     2521    }
     2522
     2523    #dashboard-widgets #postbox-container-4 .empty-container {
     2524        border: 0 none;
     2525        height: 0;
     2526        min-height: 0;
    24942527    }
    24952528}
     
    26322665#dashboard-widgets .meta-box-sortables {
    26332666    margin: 0 8px;
    2634 }
    2635 
    2636 #dashboard_recent_comments div.undo {
    2637     margin: 0 -12px;
    2638     padding: 6px 12px;
    2639     font-size: 11px;
    2640 }
    2641 
    2642 #dashboard_recent_comments div.undo .avatar {
    2643     float: left;
    2644 }
    2645 
    2646 #dashboard_recent_comments div.undo div {
    2647     min-height: 20px;
    26482667}
    26492668
     
    28332852    line-height: 16px;
    28342853    list-style-type: none;
     2854}
     2855
     2856/* Dashboard WordPress news */
     2857
     2858#dashboard_rss .inside {
     2859    margin: 0;
     2860    padding: 0;
     2861}
     2862
     2863#dashboard_rss .widget-loading,
     2864#dashboard_rss .dashboard-widget-control-form {
     2865    padding: 12px 12px 0;
     2866}
     2867
     2868body #dashboard-widgets .postbox form .submit {
     2869    margin: 0;
     2870}
     2871
     2872.dashboard-widget-control-form {
     2873    overflow: hidden;
     2874}
     2875
     2876.dashboard-widget-control-form p {
     2877    margin-top: 0;
     2878}
     2879
     2880.rssSummary {
     2881    color: #999;
     2882    margin-top: 4px;
     2883}
     2884
     2885.rss-widget {
     2886    border-bottom: 1px solid #eee;
     2887    font-size: 13px;
     2888    padding: 8px 12px 12px;
     2889}
     2890
     2891.rss-widget:last-child {
     2892    border-bottom: none;
     2893    padding-bottom: 0;
     2894}
     2895
     2896.rss-widget a {
     2897    font-weight: normal;
     2898}
     2899
     2900.rss-widget span,
     2901.rss-widget span.rss-date {
     2902    color: #bbb;
     2903}
     2904
     2905.rss-widget span.rss-date {
     2906    margin-left: 12px;
     2907}
     2908
     2909.rss-widget ul li {
     2910    margin-bottom: 8px;
     2911}
     2912
     2913/* Dashboard right now */
     2914
     2915#dash-right-now ul {
     2916    margin: 0;
     2917    overflow: hidden;
     2918}
     2919
     2920#dash-right-now li {
     2921    width: 50%;
     2922    float: left;
     2923    margin-bottom: 10px;
     2924}
     2925
     2926#dash-right-now .inside {
     2927    margin-bottom: 0;
     2928    overflow: hidden;
     2929    padding: 0;
     2930}
     2931
     2932#dash-right-now .main {
     2933    padding: 0 12px;
     2934}
     2935
     2936#dash-right-now .main p {
     2937    margin: 0;
     2938}
     2939
     2940.mu-storage {
     2941    overflow: hidden;
     2942}
     2943
     2944/* Dashboard right now - Colors */
     2945
     2946#dash-right-now li a:before {
     2947    color: #888;
     2948}
     2949
     2950#dash-right-now .sub {
     2951    color: #bfbbbb;
     2952    background: #f5f5f5;
     2953    border-top-color: #dedede;
     2954    padding: 12px 12px 6px 12px;
     2955    border-top: 1px solid;
     2956}
     2957
     2958#dash-right-now .sub h4 {
     2959    color: #555;
     2960}
     2961
     2962#dash-right-now .sub p {
     2963    margin: 0 0 .5em;
     2964    font-size: 11px;
     2965}
     2966
     2967#dash-right-now .warning a:before {
     2968    color: #d54e21;
     2969}
     2970
     2971/* Dashboard right now - Icons */
     2972#dash-right-now li a:before {
     2973    content: '\f159';
     2974    font: normal 20px/1 'dashicons';
     2975    speak: none;
     2976    display: block;
     2977    float: left;
     2978    margin: 0 5px 0 0;
     2979    padding: 0;
     2980    text-indent: 0;
     2981    text-align: center;
     2982    position: relative;
     2983    -webkit-font-smoothing: antialiased;
     2984    text-decoration: none !important;
     2985}
     2986
     2987#dash-right-now .page-count a:before {
     2988    content: '\f105';
     2989}
     2990
     2991#dash-right-now .post-count a:before {
     2992    content: '\f109';
     2993}
     2994
     2995#dash-right-now .comment-count a:before {
     2996    content: '\f101';
     2997}
     2998
     2999#dash-right-now .comment-mod-count a:before {
     3000    content: '\f125';
     3001}
     3002
     3003#dash-right-now .storage-count a:before {
     3004    content: '\f104';
     3005}
     3006
     3007#dash-right-now .storage-count.warning a:before {
     3008    content: '\f153';
     3009}
     3010
     3011/* Dashboard Quick Draft */
     3012
     3013#dashboard_quick_draft div.updated {
     3014    margin-bottom: 10px;
     3015    border: 1px solid #eee;
     3016    border-width: 1px 1px 1px 0;
     3017}
     3018
     3019#dashboard_quick_draft form {
     3020    padding: 0 12px 1px 12px;
     3021    overflow: hidden;
     3022}
     3023
     3024#dashboard_quick_draft .drafts,
     3025#dashboard_quick_draft .easy-blogging {
     3026    padding: 8px 12px 0;
     3027}
     3028
     3029#dashboard-widgets .postbox .inside {
     3030    margin: 10px 0;
     3031    padding: 0;
     3032}
     3033
     3034/* Dashboard Quick Draft - Form styling */
     3035
     3036input#save-post {
     3037    float: right;
     3038}
     3039
     3040form.initial-form label.prompt {
     3041    font-style: italic;
     3042}
     3043
     3044form.initial-form input#title {
     3045    height: 3em;
     3046}
     3047
     3048form.initial-form.quickpress-open label.prompt {
     3049    font-style: normal;
     3050}
     3051
     3052form.initial-form.quickpress-open input#title {
     3053    height: auto;
     3054}
     3055
     3056#dashboard_quick_draft input,
     3057#dashboard_quick_draft textarea {
     3058    box-sizing: border-box;
     3059    -moz-box-sizing:border-box;
     3060    -webkit-box-sizing:border-box;
     3061    margin: 0;
     3062}
     3063
     3064#dashboard_quick_draft textarea {
     3065    resize: vertical;
     3066}
     3067
     3068#dashboard-widgets .postbox form .submit {
     3069    margin: -39px 0;
     3070    float: right;
     3071}
     3072
     3073#description-wrap {
     3074    margin-top: 12px;
     3075}
     3076
     3077#title-wrap #title-prompt-text,
     3078.textarea-wrap #content-prompt-text {
     3079    color: #BBB;
     3080}
     3081
     3082#title-wrap #title-prompt-text {
     3083    font-size: 1.1em;
     3084    padding: 7px 8px;
     3085}
     3086
     3087.initial-form #description-wrap,
     3088.initial-form p.submit {
     3089    display: none;
     3090}
     3091
     3092.input-text-wrap,
     3093.textarea-wrap {
     3094    position: relative;
     3095}
     3096
     3097.input-text-wrap .prompt,
     3098.textarea-wrap .prompt {
     3099    position: absolute;
     3100}
     3101
     3102.textarea-wrap #content-prompt-text {
     3103    font-size: 1.1em;
     3104    padding: 7px 8px;
     3105}
     3106
     3107.textarea-wrap textarea#content {
     3108    margin: 0 0 8px;
     3109    padding: 6px 7px;
     3110}
     3111
     3112/* Dashboard Quick Draft - Drafts list */
     3113
     3114#dashboard_quick_draft .drafts {
     3115    border-top: 1px solid #eee;
     3116    margin-top: 12px;
     3117}
     3118
     3119#dashboard_quick_draft .drafts abbr {
     3120    border: none;
     3121}
     3122
     3123#dashboard_quick_draft .drafts h4 {
     3124    margin: 0 0 8px 0;
     3125    font-weight: normal;
     3126}
     3127
     3128#dashboard_quick_draft .drafts .view-all {
     3129    float: right;
     3130    margin-top: 0;
     3131}
     3132
     3133#dashboard_rss a.rsswidget {
     3134    font-weight: normal;
     3135}
     3136
     3137#draft-list {
     3138    margin: 0;
     3139}
     3140
     3141#draft-list li {
     3142    margin-bottom: 1em;
     3143}
     3144#draft-list li time {
     3145    color: #bbb;
     3146}
     3147
     3148#draft-list p {
     3149    margin: 0;
     3150}
     3151
     3152#draft-list .draft-title {
     3153    overflow: hidden;
     3154}
     3155
     3156#draft-list .draft-title a,
     3157#draft-list .draft-title time {
     3158    float: left;
     3159    margin: 0 5px 0 0;
     3160}
     3161
     3162/* Dashboard activity widget */
     3163
     3164#dashboard-widgets #dashboard_activity h4 {
     3165    margin: 0 0 8px 12px;
     3166    font-weight: normal;
     3167}
     3168
     3169#dashboard-widgets #dashboard_activity h4.comment-meta {
     3170    margin: 0;
     3171}
     3172
     3173#dashboard_activity h4.comment-meta {
     3174    overflow: hidden;
     3175    text-overflow: ellipsis;
     3176    white-space: nowrap;
     3177    margin-bottom: 4px;
     3178}
     3179
     3180#dashboard_activity ul {
     3181    padding: 0 12px;
     3182}
     3183
     3184#dashboard_activity .comment-meta span.approve:before {
     3185    content: '\f227';
     3186    font: 20px/.5 "dashicons";
     3187    margin-left: 12px;
     3188    vertical-align: middle;
     3189    position: relative;
     3190    top: -1px;
     3191    margin-right: 2px;
     3192}
     3193
     3194#dashboard_activity .inside {
     3195    padding: 0;
     3196    margin: 0;
     3197}
     3198
     3199#dashboard_activity .no-activity {
     3200    overflow: hidden;
     3201    padding: 0 12px 12px;
     3202    text-align: center;
     3203}
     3204
     3205#dashboard_activity .no-activity p {
     3206    color: #999;
     3207    font-size: 16px;
     3208}
     3209
     3210#dashboard_activity .no-activity .smiley {
     3211    margin-top: 0;
     3212}
     3213
     3214#dashboard_activity .no-activity .smiley:before {
     3215    content: '\f328';
     3216    font: normal 120px/1 'dashicons';
     3217    speak: none;
     3218    display: block;
     3219    margin: 0 5px 0 0;
     3220    padding: 0;
     3221    text-indent: 0;
     3222    text-align: center;
     3223    position: relative;
     3224    -webkit-font-smoothing: antialiased;
     3225    text-decoration: none !important;
     3226}
     3227
     3228#dashboard_activity .subsubsub {
     3229    float: none;
     3230    border-top: 1px solid #eeeeee;
     3231    margin-top: 0;
     3232    padding: 8px 12px 0 12px;
     3233}
     3234
     3235#future-posts .show-more,
     3236#published-posts .show-more {
     3237    float: right;
     3238}
     3239
     3240#future-posts ul,
     3241#published-posts ul {
     3242    clear: both;
     3243    margin-bottom: 0;
     3244}
     3245
     3246#future-posts li,
     3247#published-posts li {
     3248    overflow: hidden;
     3249    margin-bottom: 8px;
     3250}
     3251
     3252#future-posts ul span,
     3253#published-posts ul span {
     3254    color: #bbb;
     3255    float: left;
     3256    margin-right: 8px;
     3257    min-width: 150px;
     3258}
     3259
     3260.activity-block {
     3261    border-bottom: 1px solid #eee;
     3262    overflow: hidden;
     3263    padding: 8px 0 0;
     3264}
     3265
     3266.activity-block:last-child {
     3267    border-bottom: none;
     3268}
     3269
     3270.activity-block .subsubsub li {
     3271    color: #ddd;
     3272}
     3273
     3274/* Dashboard activity widget - Comments */
     3275
     3276#the-comment-list tr.undo, #the-comment-list div.undo {
     3277    background: none;
     3278    padding: 6px 0;
     3279}
     3280
     3281#the-comment-list .alternate,
     3282#the-comment-list .alt {
     3283    background: none;
     3284}
     3285
     3286#the-comment-list .comment {
     3287    background: #f5f5f5;
     3288    padding: 12px;
     3289    position: relative;
     3290    border-top: 1px solid #eeeeee;
     3291}
     3292
     3293#the-comment-list img {
     3294    position: absolute;
     3295    left: 13px;
     3296    top: 13px;
     3297}
     3298
     3299#the-comment-list .dashboard-comment-wrap {
     3300    padding-left: 63px;
     3301}
     3302
     3303#the-comment-list .dashboard-comment-wrap blockquote {
     3304    margin: 1em 0;
     3305}
     3306
     3307#the-comment-list .comment-item h4 {
     3308    font-size: 13px;
     3309    color: #999;
     3310}
     3311
     3312#the-comment-list .comment-item p.row-actions {
     3313    margin: 4px 0 0 0;
     3314}
     3315
     3316#the-comment-list .comment-item:first-child {
     3317    border-top: 1px solid #eeeeee;
     3318}
     3319
     3320#the-comment-list .unapproved {
     3321    background: #f7fcfe;
     3322}
     3323
     3324#the-comment-list .unapproved:before {
     3325    content: "";
     3326    display: block;
     3327    position: absolute;
     3328    left: 0;
     3329    top: 0;
     3330    bottom: 0;
     3331    background: #d54e21;
     3332    width: 4px;
     3333}
     3334
     3335/* Browse happy box */
     3336
     3337#dashboard-widgets #dashboard_browser_nag.postbox .inside {
     3338    margin: 10px;
    28353339}
    28363340
     
    77538257
    77548258/* Recent Comments */
    7755 #dashboard_recent_comments h3 {
    7756     margin-bottom: 0;
    7757 }
    7758 
    7759 #dashboard_recent_comments .inside {
    7760     margin-top: 0;
    7761 }
    7762 
    7763 #dashboard_recent_comments .comment-meta .approve {
    7764     font-family: "Open Sans", sans-serif;
    7765     font-size: 13px;
    7766     line-height: 1;
    7767     margin: 0 10px;
    7768 }
    7769 
    7770 #dashboard_recent_comments .subsubsub {
    7771     float: none;
    7772     white-space: normal;
    7773 }
    7774 
    7775 #the-comment-list {
     8259
     8260#latest-comments #the-comment-list {
    77768261    position: relative;
    77778262}
    77788263
    7779 #the-comment-list .comment-item {
     8264#activity-widget #latest-comments #the-comment-list .comment-item {
    77808265    padding: 1em 12px;
    7781     border-top: 1px solid;
    7782 }
    7783 
    7784 #the-comment-list .pingback {
     8266    border-top: 1px solid #eee;
     8267}
     8268
     8269#latest-comments #the-comment-list .pingback {
    77858270    padding-left: 12px !important;
    77868271}
    77878272
    7788 #the-comment-list .comment-item,
    7789 #the-comment-list #replyrow {
    7790     margin: 0 -12px;
    7791 }
    7792 
    7793 #the-comment-list .comment-item:first-child {
     8273#latest-comments #the-comment-list .comment-item:first-child {
    77948274    border-top: none;
    77958275}
    77968276
    7797 #the-comment-list .comment-item .avatar {
    7798     float: left;
    7799     margin: 0 10px 5px 0;
    7800 }
    7801 
    7802 #the-comment-list .comment-item h4 {
     8277#latest-comments #the-comment-list .comment-item h4 {
    78038278    line-height: 1.5em;
    78048279    margin-top: 0;
     
    78068281}
    78078282
    7808 #the-comment-list .comment-item h4 cite {
     8283#latest-comments #the-comment-list .comment-item h4 cite {
    78098284    font-style: normal;
    78108285    font-weight: normal;
    78118286}
    78128287
    7813 #the-comment-list .comment-item blockquote,
    7814 #the-comment-list .comment-item blockquote p {
     8288#latest-comments #the-comment-list .comment-item blockquote,
     8289#latest-comments #the-comment-list .comment-item blockquote p {
    78158290    margin: 0;
    78168291    padding: 0;
     
    78188293}
    78198294
    7820 #dashboard_recent_comments #the-comment-list .trackback blockquote,
    7821 #dashboard_recent_comments #the-comment-list .pingback blockquote {
    7822     display: block;
    7823 }
    7824 
    7825 #the-comment-list .comment-item p.row-actions {
     8295#latest-comments #the-comment-list .comment-item p.row-actions {
    78268296    margin: 3px 0 0;
    78278297    padding: 0;
     
    78298299}
    78308300
    7831 /* QuickPress */
    7832 #header-logo {
    7833     display: none;
    7834 }
    7835 
    7836 #site-heading:before {
    7837     top: 3px;
    7838     position: relative;
    7839     display: inline-block;
    7840     font: normal 18px/1 'dashicons';
    7841     speak: none;
    7842     color: #727272;
    7843     content: '\f120';
    7844     -webkit-font-smoothing: antialiased;
    7845     -moz-osx-font-smoothing: grayscale;
    7846 }
    7847 .no-js #dashboard_quick_press {
    7848     display: none;
    7849 }
    7850 
    7851 #dashboard_quick_press .easy-blogging {
    7852     padding: 0 8px;
    7853     text-align: left;
    7854 }
    7855 
    7856 #dashboard_quick_press .input-text-wrap {
    7857     position: relative;
    7858 }
    7859 
    7860 #dashboard_quick_press .prompt {
    7861     color: #bbb;
    7862     position: absolute;
    7863 }
    7864 
    7865 #dashboard_quick_press div.updated  {
    7866     padding: 0 5px;
    7867 }
    7868 
    7869 #title-wrap label,
    7870 #tags-input-wrap label {
     8301/* QuickDraft */
     8302
     8303#title-wrap label {
    78718304    cursor: text;
    78728305}
     
    78798312}
    78808313
    7881 #tags-input-wrap #tags-input {
    7882     outline: none;
    7883     padding: 3px 6px;
    7884 }
    7885 
    78868314#title-wrap #title-prompt-text {
    7887     font-size: 1.3em;
    7888     padding: 5px 8px;
    7889 }
    7890 
    7891 #tags-input-wrap #tags-input-prompt-text {
    78928315    font-size: 1em;
    78938316    padding: 5px 8px;
    7894 }
    7895 
    7896 #dashboard_quick_press .input-text-wrap,
    7897 #dashboard_quick_press .textarea-wrap {
    7898     margin: 0 0 .7em 0;
    7899 }
    7900 
    7901 #dashboard_quick_press .input-text-wrap {
    7902     margin-right: 1px;
    7903 }
    7904 
    7905 #dashboard_quick_press .textarea-wrap {
    7906     margin-left: 1px;
    7907 }
    7908 
    7909 #dashboard_quick_press .wp-media-buttons {
    7910     margin: 0 0 2px 1px;
    7911     padding: 0;
    7912 }
    7913 
    7914 #dashboard_quick_press .wp-media-buttons a {
    7915     color: #777;
    7916     margin-bottom: 0;
    7917 }
    7918 
    7919 #dashboard-widgets #dashboard_quick_press form p.submit input {
    7920     float: left;
    7921 }
    7922 
    7923 #dashboard-widgets #dashboard_quick_press form p.submit #save-post {
    7924     margin: 0 0.7em 0 1px;
    7925 }
    7926 
    7927 #dashboard-widgets #dashboard_quick_press form p.submit #publish {
    7928     float: right;
    7929 }
    7930 
    7931 #dashboard-widgets #dashboard_quick_press form p.submit .spinner {
    7932     vertical-align: middle;
    7933     margin: 4px 6px 0 0;
    7934 }
    7935 
    7936 /* Recent Drafts */
    7937 #dashboard_recent_drafts ul,
    7938 #dashboard_recent_drafts p {
    7939     margin: 0;
    7940     padding: 0;
    7941     word-wrap: break-word;
    7942 }
    7943 
    7944 #dashboard_recent_drafts ul {
    7945     list-style: none;
    7946 }
    7947 
    7948 #dashboard_recent_drafts ul li {
    7949     margin-bottom: 1em;
    7950 }
    7951 
    7952 #dashboard_recent_drafts h4 {
    7953     line-height: 1.7em;
    7954     word-wrap: break-word;
    7955 }
    7956 
    7957 #dashboard_recent_drafts h4 abbr {
    7958     font-weight: normal;
    7959     font-family: "Open Sans", sans-serif;
    7960     font-size: 12px;
    7961     color: #999;
    7962     margin-left: 3px;
    79638317}
    79648318
     
    79968350.rss-widget cite:before {
    79978351    content: '\2014';
    7998 }
    7999 
    8000 /* Plugins */
    8001 #dashboard_plugins h4 {
    8002     line-height: 1.7em;
    8003 }
    8004 
    8005 #dashboard_plugins h5 {
    8006     font-weight: normal;
    8007     font-size: 13px;
    8008     margin: 0;
    8009     display: inline;
    8010     line-height: 1.4em;
    8011 }
    8012 
    8013 #dashboard_plugins h5 a {
    8014     line-height: 1.4em;
    8015 }
    8016 
    8017 #dashboard_plugins .inside span {
    8018     font-size: 12px;
    8019     padding-left: 5px;
    8020 }
    8021 
    8022 #dashboard_plugins p {
    8023     margin: 0.3em 0 1.4em;
    8024     line-height: 1.4em;
    80258352}
    80268353
  • trunk/src/wp-admin/includes/ajax-actions.php

    r26137 r26144  
    235235
    236236    switch ( $_GET['widget'] ) {
    237         case 'dashboard_incoming_links' :
    238             wp_dashboard_incoming_links();
    239             break;
    240         case 'dashboard_primary' :
    241             wp_dashboard_primary();
    242             break;
    243         case 'dashboard_secondary' :
    244             wp_dashboard_secondary();
    245             break;
    246         case 'dashboard_plugins' :
    247             wp_dashboard_plugins();
     237        case 'dashboard_rss' :
     238            wp_dashboard_rss();
    248239            break;
    249240    }
  • trunk/src/wp-admin/includes/dashboard.php

    r25868 r26144  
    3838    // Right Now
    3939    if ( is_blog_admin() && current_user_can('edit_posts') )
    40         wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
     40        add_meta_box( 'dash-right-now', 'Site Content', 'dashboard_new_right_now', 'dashboard', 'normal', 'high' );
    4141
    4242    if ( is_network_admin() )
    4343        wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
    4444
    45     // Recent Comments Widget
    46     if ( is_blog_admin() && current_user_can('moderate_comments') ) {
    47         if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
    48             $update = true;
    49             $widget_options['dashboard_recent_comments'] = array(
    50                 'items' => 5,
    51             );
    52         }
    53         $recent_comments_title = __( 'Recent Comments' );
    54         wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );
    55     }
    56 
    57     // Incoming Links Widget
    58     if ( is_blog_admin() && current_user_can('publish_posts') ) {
    59         if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
    60             $update = true;
    61             $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
    62             $widget_options['dashboard_incoming_links'] = array(
    63                 'home' => get_option('home'),
    64                 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    65                 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    66                 'items' => $num_items,
    67                 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
    68             );
    69         }
    70         wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
    71     }
    72 
    73     // WP Plugins Widget
    74     if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )
    75         wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
     45    // Activity Widget
     46    add_meta_box( 'dashboard_activity', __( 'Activity' ), 'wp_dashboard_activity', 'dashboard', 'normal', 'high' );
    7647
    7748    // QuickPress Widget
    78     if ( is_blog_admin() && current_user_can('edit_posts') )
    79         wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    80 
    81     // Recent Drafts
    82     if ( is_blog_admin() && current_user_can('edit_posts') )
    83         wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
    84 
    85     // Primary feed (Dev Blog) Widget
    86     if ( !isset( $widget_options['dashboard_primary'] ) ) {
    87         $update = true;
    88         $widget_options['dashboard_primary'] = array(
    89             'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
    90             'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
    91             'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ),
    92             'items' => 2,
    93             'show_summary' => 1,
    94             'show_author' => 0,
    95             'show_date' => 1,
    96         );
    97     }
    98     wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' );
    99 
    100     // Secondary Feed (Planet) Widget
    101     if ( !isset( $widget_options['dashboard_secondary'] ) ) {
    102         $update = true;
    103         $widget_options['dashboard_secondary'] = array(
    104             'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
    105             'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
    106             'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
    107             'items' => 5,
    108             'show_summary' => 0,
    109             'show_author' => 0,
    110             'show_date' => 0,
    111         );
    112     }
    113     wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );
     49    if ( is_blog_admin() && current_user_can( 'edit_posts' ) )
     50        add_meta_box( 'dashboard_quick_draft', __( 'Quick Draft' ), 'wp_dashboard_quick_draft', 'dashboard', 'side', 'high' );
     51
     52    // WordPress News
     53    add_meta_box( 'dashboard_rss', __( 'WordPress News' ), 'wp_dashboard_rss', 'dashboard', 'side', 'low' );
    11454
    11555    // Hook to register new widgets
     
    166106
    167107    if ( is_blog_admin () )
    168         $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
     108        $side_widgets = array('dashboard_quick_draft');
    169109    else if (is_network_admin() )
    170         $side_widgets = array('dashboard_primary', 'dashboard_secondary');
     110        $side_widgets = array();
    171111    else
    172112        $side_widgets = array();
     
    225165/* Dashboard Widgets */
    226166
    227 function wp_dashboard_right_now() {
    228     global $wp_registered_sidebars;
    229 
    230     $num_posts = wp_count_posts( 'post' );
    231     $num_pages = wp_count_posts( 'page' );
    232 
    233     $num_cats  = wp_count_terms('category');
    234 
    235     $num_tags = wp_count_terms('post_tag');
    236 
     167function dashboard_new_right_now() {
     168    $theme = wp_get_theme();
     169    if ( current_user_can( 'switch_themes' ) )
     170        $theme_name = sprintf( '<a href="themes.php">%1$s</a>', $theme->display('Name') );
     171    else
     172        $theme_name = $theme->display('Name');
     173?>
     174    <div class="main">
     175    <ul>
     176    <?php
     177    do_action( 'rightnow_list_start' );
     178    // Using show_in_nav_menus as my arg for grabbing what post types should show, is there better?
     179    $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
     180    $post_types = (array) apply_filters( 'rightnow_post_types', $post_types );
     181    foreach ( $post_types as $post_type => $post_type_obj ){
     182        $num_posts = wp_count_posts( $post_type );
     183        if ( $num_posts && $num_posts->publish ) {
     184            printf(
     185                '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s %3$s</a></li>',
     186                $post_type,
     187                number_format_i18n( $num_posts->publish ),
     188                $post_type_obj->label
     189            );
     190        }
     191    }
     192    // Comments
    237193    $num_comm = wp_count_comments();
    238 
    239     echo "\n\t".'<div class="table table_content">';
    240     echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
    241     echo "\n\t".'<tr class="first">';
    242 
    243     // Posts
    244     $num = number_format_i18n( $num_posts->publish );
    245     $text = _n( 'Post', 'Posts', intval($num_posts->publish) );
    246     if ( current_user_can( 'edit_posts' ) ) {
    247         $num = "<a href='edit.php'>$num</a>";
    248         $text = "<a href='edit.php'>$text</a>";
    249     }
    250     echo '<td class="first b b-posts">' . $num . '</td>';
    251     echo '<td class="t posts">' . $text . '</td>';
    252 
    253     echo '</tr><tr>';
    254     /* TODO: Show status breakdown on hover
    255     if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can
    256         $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
    257     }
    258     if ( $can_edit_posts && !empty($num_posts->draft) ) {
    259         $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( _n( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>';
    260     }
    261     if ( $can_edit_posts && !empty($num_posts->future) ) {
    262         $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( _n( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>';
    263     }
    264     if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) {
    265         $pending_text = sprintf( _n( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) );
    266     } else {
    267         $pending_text = '';
    268     }
    269     */
    270 
    271     // Pages
    272     $num = number_format_i18n( $num_pages->publish );
    273     $text = _n( 'Page', 'Pages', $num_pages->publish );
    274     if ( current_user_can( 'edit_pages' ) ) {
    275         $num = "<a href='edit.php?post_type=page'>$num</a>";
    276         $text = "<a href='edit.php?post_type=page'>$text</a>";
    277     }
    278     echo '<td class="first b b_pages">' . $num . '</td>';
    279     echo '<td class="t pages">' . $text . '</td>';
    280 
    281     echo '</tr><tr>';
    282 
    283     // Categories
    284     $num = number_format_i18n( $num_cats );
    285     $text = _n( 'Category', 'Categories', $num_cats );
    286     if ( current_user_can( 'manage_categories' ) ) {
    287         $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>";
    288         $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>";
    289     }
    290     echo '<td class="first b b-cats">' . $num . '</td>';
    291     echo '<td class="t cats">' . $text . '</td>';
    292 
    293     echo '</tr><tr>';
    294 
    295     // Tags
    296     $num = number_format_i18n( $num_tags );
    297     $text = _n( 'Tag', 'Tags', $num_tags );
    298     if ( current_user_can( 'manage_categories' ) ) {
    299         $num = "<a href='edit-tags.php'>$num</a>";
    300         $text = "<a href='edit-tags.php'>$text</a>";
    301     }
    302     echo '<td class="first b b-tags">' . $num . '</td>';
    303     echo '<td class="t tags">' . $text . '</td>';
    304 
    305     echo "</tr>";
    306     do_action('right_now_content_table_end');
    307     echo "\n\t</table>\n\t</div>";
    308 
    309     echo "\n\t".'<div class="table table_discussion">';
    310     echo "\n\t".'<p class="sub">' . __('Discussion') . '</p>'."\n\t".'<table>';
    311     echo "\n\t".'<tr class="first">';
    312 
    313     // Total Comments
    314     $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
    315     $text = _n( 'Comment', 'Comments', $num_comm->total_comments );
    316     if ( current_user_can( 'moderate_comments' ) ) {
    317         $num = '<a href="edit-comments.php">' . $num . '</a>';
    318         $text = '<a href="edit-comments.php">' . $text . '</a>';
    319     }
    320     echo '<td class="b b-comments">' . $num . '</td>';
    321     echo '<td class="last t comments">' . $text . '</td>';
    322 
    323     echo '</tr><tr>';
    324 
    325     // Approved Comments
    326     $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
    327     $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' );
    328     if ( current_user_can( 'moderate_comments' ) ) {
    329         $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
    330         $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>";
    331     }
    332     echo '<td class="b b_approved">' . $num . '</td>';
    333     echo '<td class="last t">' . $text . '</td>';
    334 
    335     echo "</tr>\n\t<tr>";
    336 
    337     // Pending Comments
    338     $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
    339     $text = _n( 'Pending', 'Pending', $num_comm->moderated );
    340     if ( current_user_can( 'moderate_comments' ) ) {
    341         $num = "<a href='edit-comments.php?comment_status=moderated'>$num</a>";
    342         $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>";
    343     }
    344     echo '<td class="b b-waiting">' . $num . '</td>';
    345     echo '<td class="last t">' . $text . '</td>';
    346 
    347     echo "</tr>\n\t<tr>";
    348 
    349     // Spam Comments
    350     $num = number_format_i18n($num_comm->spam);
    351     $text = _nx( 'Spam', 'Spam', $num_comm->spam, 'comment' );
    352     if ( current_user_can( 'moderate_comments' ) ) {
    353         $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>";
    354         $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>";
    355     }
    356     echo '<td class="b b-spam">' . $num . '</td>';
    357     echo '<td class="last t">' . $text . '</td>';
    358 
    359     echo "</tr>";
    360     do_action('right_now_table_end');
    361     do_action('right_now_discussion_table_end');
    362     echo "\n\t</table>\n\t</div>";
    363 
    364     echo "\n\t".'<div class="versions">';
    365     $theme = wp_get_theme();
    366 
    367     echo "\n\t<p>";
    368 
    369     if ( $theme->errors() ) {
    370         if ( ! is_multisite() || is_super_admin() )
    371             echo '<span class="error-message">' . sprintf( __( 'ERROR: %s' ), $theme->errors()->get_error_message() ) . '</span>';
    372     } elseif ( ! empty($wp_registered_sidebars) ) {
    373         $sidebars_widgets = wp_get_sidebars_widgets();
    374         $num_widgets = 0;
    375         foreach ( (array) $sidebars_widgets as $k => $v ) {
    376             if ( 'wp_inactive_widgets' == $k || 'orphaned_widgets' == substr( $k, 0, 16 ) )
    377                 continue;
    378             if ( is_array($v) )
    379                 $num_widgets = $num_widgets + count($v);
    380         }
    381         $num = number_format_i18n( $num_widgets );
    382 
    383         $switch_themes = $theme->display('Name');
    384         if ( current_user_can( 'switch_themes') )
    385             $switch_themes = '<a href="themes.php">' . $switch_themes . '</a>';
    386         if ( current_user_can( 'edit_theme_options' ) ) {
    387             printf(_n('Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widget</a></span>', 'Theme <span class="b">%1$s</span> with <span class="b"><a href="widgets.php">%2$s Widgets</a></span>', $num_widgets), $switch_themes, $num);
    388         } else {
    389             printf(_n('Theme <span class="b">%1$s</span> with <span class="b">%2$s Widget</span>', 'Theme <span class="b">%1$s</span> with <span class="b">%2$s Widgets</span>', $num_widgets), $switch_themes, $num);
    390         }
    391     } else {
    392         if ( current_user_can( 'switch_themes' ) )
    393             printf( __('Theme <span class="b"><a href="themes.php">%1$s</a></span>'), $theme->display('Name') );
    394         else
    395             printf( __('Theme <span class="b">%1$s</span>'), $theme->display('Name') );
    396     }
    397     echo '</p>';
    398 
    399     // Check if search engines are asked not to index this site.
    400     if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ) {
    401         $title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') );
    402         $content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged') );
    403 
    404         echo "<p><a href='options-reading.php' title='$title'>$content</a></p>";
    405     }
    406 
    407     update_right_now_message();
    408 
    409     echo "\n\t".'<br class="clear" /></div>';
     194    if ( $num_comm && $num_comm->total_comments ) {
     195        $text = _n( 'comment', 'comments', $num_comm->total_comments );
     196        printf(
     197            '<li class="comment-count"><a href="edit-comments.php">%1$s %2$s</a></li>',
     198            number_format_i18n( $num_comm->total_comments ),
     199            $text
     200        );
     201        if ( $num_comm->moderated ) {
     202            $text = _n( 'in moderation', 'in moderation', $num_comm->total_comments );
     203            printf(
     204                '<li class="comment-mod-count"><a href="edit-comments.php?comment_status=moderated">%1$s %2$s</a></li>',
     205                number_format_i18n( $num_comm->moderated ),
     206                $text
     207            );
     208        }
     209    }
     210    do_action( 'rightnow_list_end' );
     211    ?>
     212    </ul>
     213    <p><?php printf( __( 'WordPress %1$s running %2$s theme.' ), get_bloginfo( 'version', 'display' ), $theme_name ); ?></p>
     214    </div>
     215
     216    <?php
     217    // activity_box_end has a core action, but only prints content when multisite.
     218    // Using an output buffer is the only way to really check if anything's displayed here.
     219    ob_start();
    410220    do_action( 'rightnow_end' );
    411221    do_action( 'activity_box_end' );
     222    $actions = ob_get_clean();
     223
     224    if ( !empty( $actions ) ) : ?>
     225    <div class="sub">
     226        <?php echo $actions; ?>
     227    </div>
     228    <?php endif;
    412229}
    413230
     
    459276}
    460277
    461 function wp_dashboard_quick_press() {
     278/**
     279 * The Quick Draft widget display and creation of drafts
     280 *
     281 *
     282 *
     283 * @since 3.8.0
     284 *
     285 */
     286function wp_dashboard_quick_draft( $error_msg=false ) {
    462287    global $post_ID;
    463 
    464     $drafts = false;
    465     if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) {
    466         $view = get_permalink( $_POST['post_ID'] );
    467         $edit = esc_url( get_edit_post_link( $_POST['post_ID'] ) );
    468         if ( 'post-quickpress-publish' == $_POST['action'] ) {
    469             if ( current_user_can('publish_posts') )
    470                 printf( '<div class="updated"><p>' . __( 'Post published. <a href="%s">View post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( $view ), $edit );
    471             else
    472                 printf( '<div class="updated"><p>' . __( 'Post submitted. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit );
    473         } else {
    474             printf( '<div class="updated"><p>' . __( 'Draft saved. <a href="%s">Preview post</a> | <a href="%s">Edit post</a>' ) . '</p></div>', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit );
    475             $drafts_query = new WP_Query( array(
    476                 'post_type' => 'post',
    477                 'post_status' => 'draft',
    478                 'author' => $GLOBALS['current_user']->ID,
    479                 'posts_per_page' => 1,
    480                 'orderby' => 'modified',
    481                 'order' => 'DESC'
    482             ) );
    483 
    484             if ( $drafts_query->posts )
    485                 $drafts =& $drafts_query->posts;
    486         }
    487         printf('<p class="easy-blogging">' . __('You can also try %s, easy blogging from anywhere on the Web.') . '</p>', '<a href="' . esc_url( admin_url( 'tools.php' ) ) . '">' . __('Press This') . '</a>' );
    488         $_REQUEST = array(); // hack for get_default_post_to_edit()
    489     }
    490288
    491289    /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */
     
    494292        $post = get_post( $last_post_id );
    495293        if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore
    496             $post = get_default_post_to_edit('post', true);
     294            $post = get_default_post_to_edit( 'post', true );
    497295            update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID
    498296        } else {
     
    509307    $post_ID = (int) $post->ID;
    510308
    511     $media_settings = array(
    512         'id' => $post->ID,
    513         'nonce' => wp_create_nonce( 'update-post_' . $post->ID ),
    514     );
    515 
    516     if ( current_theme_supports( 'post-thumbnails', $post->post_type ) && post_type_supports( $post->post_type, 'thumbnail' ) ) {
    517         $featured_image_id = get_post_meta( $post->ID, '_thumbnail_id', true );
    518         $media_settings['featuredImageId'] = $featured_image_id ? $featured_image_id : -1;
    519     }
     309    do_action( 'dashboard_quickdraft_beginning', $post );
    520310?>
    521311
    522     <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press">
     312    <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form">
     313
     314        <?php if ($error_msg) : ?>
     315        <div class="error"><?php _e( $error_msg ); ?></div>
     316        <?php endif; ?>
     317
    523318        <div class="input-text-wrap" id="title-wrap">
    524             <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( 'Enter title here' ); ?></label>
    525             <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo esc_attr( $post->post_title ); ?>" />
     319            <label class="screen-reader-text prompt" for="title" id="title-prompt-text"><?php _e( "What's on your mind?" ); ?></label>
     320            <input type="text" name="post_title" id="title" autocomplete="off" />
    526321        </div>
    527322
    528         <?php if ( current_user_can( 'upload_files' ) ) : ?>
    529         <div id="wp-content-wrap" class="wp-editor-wrap hide-if-no-js wp-media-buttons">
    530             <?php do_action( 'media_buttons', 'content' ); ?>
     323        <div class="textarea-wrap" id="description-wrap">
     324            <label class="screen-reader-text prompt" for="content" id="content-prompt-text"><?php _e( 'Enter a description' ); ?></label>
     325            <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"></textarea>
    531326        </div>
    532         <?php endif; ?>
    533 
    534         <div class="textarea-wrap">
    535             <label class="screen-reader-text" for="content"><?php _e( 'Content' ); ?></label>
    536             <textarea name="content" id="content" class="mceEditor" rows="3" cols="15"><?php echo esc_textarea( $post->post_content ); ?></textarea>
    537         </div>
    538 
    539         <script type="text/javascript">
    540         edCanvas = document.getElementById('content');
    541         edInsertContent = null;
    542         <?php if ( $_POST ) : ?>
    543         wp.media.editor.remove('content');
    544         wp.media.view.settings.post = <?php echo json_encode( $media_settings ); // big juicy hack. ?>;
    545         wp.media.editor.add('content');
    546         <?php endif; ?>
    547         </script>
    548 
    549         <div class="input-text-wrap" id="tags-input-wrap">
    550             <label class="screen-reader-text prompt" for="tags-input" id="tags-input-prompt-text"><?php _e( 'Tags (separate with commas)' ); ?></label>
    551             <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
    552         </div>
    553327
    554328        <p class="submit">
    555             <span id="publishing-action">
    556                 <input type="submit" name="publish" id="publish" accesskey="p" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
    557                 <span class="spinner"></span>
    558             </span>
    559             <input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" />
     329            <input type="hidden" name="action" id="quickpost-action" value="post-quickdraft-save" />
    560330            <input type="hidden" name="post_ID" value="<?php echo $post_ID; ?>" />
    561331            <input type="hidden" name="post_type" value="post" />
    562             <?php wp_nonce_field('add-post'); ?>
    563             <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post' ) ); ?>
    564             <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
     332            <?php wp_nonce_field( 'add-post' ); ?>
     333            <?php submit_button( __( 'Save Draft' ), 'primary', 'save', false, array( 'id' => 'save-post' ) ); ?>
    565334            <br class="clear" />
    566335        </p>
     
    569338
    570339<?php
    571     if ( $drafts )
    572         wp_dashboard_recent_drafts( $drafts );
    573 }
    574 
    575 function wp_dashboard_recent_drafts( $drafts = false ) {
    576     if ( !$drafts ) {
    577         $drafts_query = new WP_Query( array(
    578             'post_type' => 'post',
    579             'post_status' => 'draft',
    580             'author' => $GLOBALS['current_user']->ID,
    581             'posts_per_page' => 5,
    582             'orderby' => 'modified',
    583             'order' => 'DESC'
    584         ) );
    585         $drafts =& $drafts_query->posts;
    586     }
     340    wp_dashboard_recent_quickdrafts();
     341
     342    do_action( 'dashboard_quickdraft_end' );
     343}
     344
     345/**
     346 * Show `Recent Drafts` below Quick Draft form
     347 *
     348 *
     349 *
     350 * @since 3.8.0
     351 *
     352 */
     353function wp_dashboard_recent_quickdrafts() {
     354
     355    $query_args = array(
     356        'post_type'      => 'post',
     357        'post_status'    => 'draft',
     358        'author'         => $GLOBALS['current_user']->ID,
     359        'posts_per_page' => 4,
     360        'orderby'        => 'modified',
     361        'order'          => 'DESC'
     362    );
     363    $query_args = apply_filters( 'dash_recent_quickdrafts_query_args', $query_args );
     364    $drafts_query = new WP_Query( $query_args );
     365    $drafts =& $drafts_query->posts;
     366
    587367
    588368    if ( $drafts && is_array( $drafts ) ) {
    589369        $list = array();
     370        $draft_count = 0;
    590371        foreach ( $drafts as $draft ) {
     372            if ( 3 == $draft_count )
     373                break;
     374
     375            $draft_count++;
     376
    591377            $url = get_edit_post_link( $draft->ID );
    592378            $title = _draft_or_post_title( $draft->ID );
    593             $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
     379            $item = '<div class="draft-title"><a href="' . $url . '" title="' . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . '">' . esc_html( $title ) . '</a> <time datetime="' . get_the_time( 'c', $draft) . '">' . get_the_time( get_option( 'date_format' ), $draft ) . '</time></div>';
    594380            if ( $the_content = wp_trim_words( $draft->post_content, 10 ) )
    595381                $item .= '<p>' . $the_content . '</p>';
    596382            $list[] = $item;
    597383        }
     384
     385        do_action( 'dashboard_quickdraft_drafts_list', $drafts );
    598386?>
    599     <ul>
    600         <li><?php echo join( "</li>\n<li>", $list ); ?></li>
    601     </ul>
    602     <p class="textright"><a href="edit.php?post_status=draft" ><?php _e('View all'); ?></a></p>
    603 <?php
    604     } else {
    605         _e('There are no drafts at the moment');
    606     }
    607 }
    608 
    609 /**
    610  * Display recent comments dashboard widget content.
    611  *
    612  * @since 2.5.0
    613  */
    614 function wp_dashboard_recent_comments() {
    615     global $wpdb;
    616 
    617     // Select all comment types and filter out spam later for better query performance.
    618     $comments = array();
    619     $start = 0;
    620 
    621     $widgets = get_option( 'dashboard_widget_options' );
    622     $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
    623         ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;
    624 
    625     $comments_query = array( 'number' => $total_items * 5, 'offset' => 0 );
    626     if ( ! current_user_can( 'edit_posts' ) )
    627         $comments_query['status'] = 'approve';
    628 
    629     while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
    630         foreach ( $possible as $comment ) {
    631             if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) )
    632                 continue;
    633             $comments[] = $comment;
    634             if ( count( $comments ) == $total_items )
    635                 break 2;
    636         }
    637         $comments_query['offset'] += $comments_query['number'];
    638         $comments_query['number'] = $total_items * 10;
    639     }
    640 
    641     if ( $comments ) {
    642         echo '<div id="the-comment-list" data-wp-lists="list:comment">';
    643         foreach ( $comments as $comment )
    644             _wp_dashboard_recent_comments_row( $comment );
    645         echo '</div>';
    646 
    647         if ( current_user_can('edit_posts') )
    648             _get_list_table('WP_Comments_List_Table')->views();
    649 
    650         wp_comment_reply( -1, false, 'dashboard', false );
    651         wp_comment_trashnotice();
    652     } else {
    653         echo '<p>' . __( 'No comments yet.' ) . '</p>';
    654     }
     387    <div class="drafts">
     388        <?php if ( 3 < count($drafts) ) { ?>
     389        <p class="view-all"><a href="edit.php?post_status=draft" ><?php _e( 'View all' ); ?></a></p>
     390        <?php } ?>
     391        <h4><?php _e('Drafts'); ?></h4>
     392        <ul id="draft-list">
     393            <li><?php echo join( "</li>\n<li>", $list ); ?></li>
     394        </ul>
     395    </div>
     396<?php }
    655397}
    656398
     
    749491
    750492/**
    751  * The recent comments dashboard widget control.
    752  *
    753  * @since 3.0.0
    754  */
    755 function wp_dashboard_recent_comments_control() {
    756     if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
    757         $widget_options = array();
    758 
    759     if ( !isset($widget_options['dashboard_recent_comments']) )
    760         $widget_options['dashboard_recent_comments'] = array();
    761 
    762     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {
    763         $number = absint( $_POST['widget-recent-comments']['items'] );
    764         $widget_options['dashboard_recent_comments']['items'] = $number;
    765         update_option( 'dashboard_widget_options', $widget_options );
    766     }
    767 
    768     $number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : '';
    769 
    770     echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>';
    771     echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>';
    772 }
    773 
    774 function wp_dashboard_incoming_links() {
    775     wp_dashboard_cached_rss_widget( 'dashboard_incoming_links', 'wp_dashboard_incoming_links_output' );
    776 }
    777 
    778 /**
    779  * Display incoming links dashboard widget content.
    780  *
    781  * @since 2.5.0
    782  */
    783 function wp_dashboard_incoming_links_output() {
    784     $widgets = get_option( 'dashboard_widget_options' );
    785     @extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
    786     $rss = fetch_feed( $url );
    787 
    788     if ( is_wp_error($rss) ) {
    789         if ( is_admin() || current_user_can('manage_options') ) {
    790             echo '<p>';
    791             printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
    792             echo '</p>';
    793         }
    794         return;
    795     }
    796 
    797     if ( !$rss->get_item_quantity() ) {
    798         echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links&hellip; yet. It&#8217;s okay &#8212; there is no rush.') . "</p>\n";
    799         $rss->__destruct();
    800         unset($rss);
    801         return;
    802     }
    803 
    804     echo "<ul>\n";
    805 
    806     if ( !isset($items) )
    807         $items = 10;
    808 
    809     foreach ( $rss->get_items(0, $items) as $item ) {
    810         $publisher = '';
    811         $site_link = '';
    812         $link = '';
    813         $content = '';
    814         $date = '';
    815         $link = esc_url( strip_tags( $item->get_link() ) );
    816 
    817         $author = $item->get_author();
    818         if ( $author ) {
    819             $site_link = esc_url( strip_tags( $author->get_link() ) );
    820 
    821             if ( !$publisher = esc_html( strip_tags( $author->get_name() ) ) )
    822                 $publisher = __( 'Somebody' );
    823         } else {
    824           $publisher = __( 'Somebody' );
    825         }
    826         if ( $site_link )
    827             $publisher = "<a href='$site_link'>$publisher</a>";
    828         else
    829             $publisher = "<strong>$publisher</strong>";
    830 
    831         $content = $item->get_content();
    832         $content = wp_html_excerpt( $content, 50, ' &hellip;' );
    833 
    834         if ( $link )
    835             /* translators: incoming links feed, %1$s is other person, %3$s is content */
    836             $text = __( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"' );
    837         else
    838             /* translators: incoming links feed, %1$s is other person, %3$s is content */
    839             $text = __( '%1$s linked here saying, "%3$s"' );
    840 
    841         if ( !empty( $show_date ) ) {
    842             if ( $link )
    843                 /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */
    844                 $text = __( '%1$s linked here <a href="%2$s">saying</a>, "%3$s" on %4$s' );
    845             else
    846                 /* translators: incoming links feed, %1$s is other person, %3$s is content, %4$s is the date */
    847                 $text = __( '%1$s linked here saying, "%3$s" on %4$s' );
    848             $date = esc_html( strip_tags( $item->get_date() ) );
    849             $date = strtotime( $date );
    850             $date = gmdate( get_option( 'date_format' ), $date );
    851         }
    852 
    853         echo "\t<li>" . sprintf( $text, $publisher, $link, $content, $date ) . "</li>\n";
    854     }
    855 
    856     echo "</ul>\n";
    857     $rss->__destruct();
    858     unset($rss);
    859 }
    860 
    861 function wp_dashboard_incoming_links_control() {
    862     wp_dashboard_rss_control( 'dashboard_incoming_links', array( 'title' => false, 'show_summary' => false, 'show_author' => false ) );
    863 }
    864 
    865 function wp_dashboard_primary() {
    866     wp_dashboard_cached_rss_widget( 'dashboard_primary', 'wp_dashboard_rss_output' );
    867 }
    868 
    869 function wp_dashboard_primary_control() {
    870     wp_dashboard_rss_control( 'dashboard_primary' );
    871 }
    872 
    873 /**
    874  * Display primary dashboard RSS widget feed.
    875  *
    876  * @since 2.5.0
    877  *
    878  * @param string $widget_id
    879  */
    880 function wp_dashboard_rss_output( $widget_id ) {
    881     $widgets = get_option( 'dashboard_widget_options' );
    882     echo '<div class="rss-widget">';
    883     wp_widget_rss_output( $widgets[$widget_id] );
    884     echo "</div>";
    885 }
    886 
    887 function wp_dashboard_secondary() {
    888     wp_dashboard_cached_rss_widget( 'dashboard_secondary', 'wp_dashboard_secondary_output' );
    889 }
    890 
    891 function wp_dashboard_secondary_control() {
    892     wp_dashboard_rss_control( 'dashboard_secondary' );
    893 }
    894 
    895 /**
    896  * Display secondary dashboard RSS widget feed.
    897  *
    898  * @since 2.5.0
    899  *
    900  * @return unknown
    901  */
    902 function wp_dashboard_secondary_output() {
    903     $widgets = get_option( 'dashboard_widget_options' );
    904     @extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
    905     $rss = @fetch_feed( $url );
    906 
    907     if ( is_wp_error($rss) ) {
    908         if ( is_admin() || current_user_can('manage_options') ) {
    909             echo '<div class="rss-widget"><p>';
    910             printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
    911             echo '</p></div>';
    912         }
    913     } elseif ( !$rss->get_item_quantity() ) {
    914         $rss->__destruct();
    915         unset($rss);
     493 * callback function for `Activity` widget
     494 *
     495 *
     496 *
     497 * @since 3.8.0
     498 *
     499 */
     500function wp_dashboard_activity() {
     501
     502    echo '<div id="activity-widget">';
     503
     504    do_action( 'dashboard_activity_beginning' );
     505
     506    $future_posts = dashboard_show_published_posts( array(
     507        'display' => 2,
     508        'max'     => 5,
     509        'status'  => 'future',
     510        'order'   => 'ASC',
     511        'title'   => __( 'Publishing Soon' ),
     512        'id'      => 'future-posts',
     513    ) );
     514    $recent_posts = dashboard_show_published_posts( array(
     515        'display' => 2,
     516        'max'     => 5,
     517        'status'  => 'publish',
     518        'order'   => 'DESC',
     519        'title'   => __( 'Recently Published' ),
     520        'id'      => 'published-posts',
     521    ) );
     522
     523    do_action( 'dashboard_activity_middle' );
     524
     525    $recent_comments = dashboard_comments();
     526
     527    if ( !$future_posts && !$recent_posts && !$recent_comments ) {
     528        echo '<div class="no-activity">';
     529        echo '<p class="smiley"></p>';
     530        echo '<p>' . __( 'No activity yet!' ) . '</p>';
     531        echo '</div>';
     532    }
     533
     534    do_action( 'dashboard_activity_end' );
     535
     536    echo '</div>';
     537}
     538
     539/**
     540 * Generates `Publishing Soon` and `Recently Published` sections
     541 *
     542 *
     543 *
     544 * @since 3.8.0
     545 *
     546 */
     547function dashboard_show_published_posts( $args ) {
     548
     549    $query_args = array(
     550        'post_type'      => 'post',
     551        'post_status'    => $args['status'],
     552        'orderby'        => 'date',
     553        'order'          => $args['order'],
     554        'posts_per_page' => intval( $args['max'] ),
     555        'no_found_rows'  => true,
     556        'cache_results'  => false
     557    );
     558    $query_args = apply_filters( 'dash_show_published_posts_query_args', $query_args );
     559    $posts = new WP_Query( $query_args );
     560
     561    if ( $posts->have_posts() ) {
     562
     563        echo '<div id="' . $args['id'] . '" class="activity-block">';
     564
     565        if ( $posts->post_count > $args['display'] ) {
     566            echo '<small class="show-more"><a href="#">' . sprintf( __( 'See %s more&hellip;'), $posts->post_count - intval( $args['display'] ) ) . '</a></small>';
     567        }
     568
     569        echo '<h4>' . $args['title'] . '</h4>';
     570
     571        echo '<ul>';
     572
     573        $i = 0;
     574        while ( $posts->have_posts() ) {
     575            $posts->the_post();
     576            printf(
     577                '<li%s><span>%s, %s</span> <a href="%s">%s</a></li>',
     578                ( $i >= intval ( $args['display'] ) ? ' class="hidden"' : '' ),
     579                dashboard_relative_date( get_the_time( 'U' ) ),
     580                get_the_time(),
     581                get_edit_post_link(),
     582                get_the_title()
     583            );
     584            $i++;
     585        }
     586
     587        echo '</ul>';
     588        echo '</div>';
     589
     590    } else {
    916591        return false;
     592    }
     593
     594    wp_reset_postdata();
     595
     596    return true;
     597}
     598
     599/**
     600 * Show `Comments` section
     601 *
     602 *
     603 *
     604 * @since 3.8.0
     605 *
     606 */
     607function dashboard_comments( $total_items = 5 ) {
     608    global $wpdb;
     609
     610    // Select all comment types and filter out spam later for better query performance.
     611    $comments = array();
     612    $start = 0;
     613
     614    $comments_query = array(
     615        'number' => $total_items * 5,
     616        'offset' => 0
     617    );
     618    if ( ! current_user_can( 'edit_posts' ) )
     619        $comments_query['status'] = 'approve';
     620
     621    while ( count( $comments ) < $total_items && $possible = get_comments( $comments_query ) ) {
     622        foreach ( $possible as $comment ) {
     623            if ( ! current_user_can( 'read_post', $comment->comment_post_ID ) )
     624                continue;
     625            $comments[] = $comment;
     626            if ( count( $comments ) == $total_items )
     627                break 2;
     628        }
     629        $comments_query['offset'] += $comments_query['number'];
     630        $comments_query['number'] = $total_items * 10;
     631    }
     632
     633
     634
     635    if ( $comments ) {
     636        echo '<div id="latest-comments" class="activity-block">';
     637        echo '<h4>' . __( 'Comments' ) . '</h4>';
     638
     639        echo '<div id="the-comment-list" data-wp-lists="list:comment">';
     640        foreach ( $comments as $comment )
     641            _wp_dashboard_recent_comments_row( $comment );
     642        echo '</div>';
     643
     644        if ( current_user_can('edit_posts') )
     645            _get_list_table('WP_Comments_List_Table')->views();
     646
     647        wp_comment_reply( -1, false, 'dashboard', false );
     648        wp_comment_trashnotice();
     649
     650        echo '</div>';
    917651    } else {
    918         echo '<div class="rss-widget">';
    919         wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
    920         echo '</div>';
    921         $rss->__destruct();
    922         unset($rss);
    923     }
    924 }
    925 
    926 function wp_dashboard_plugins() {
    927     wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
    928         'http://wordpress.org/plugins/rss/browse/popular/',
    929         'http://wordpress.org/plugins/rss/browse/new/'
    930     ) );
    931 }
    932 
    933 /**
    934  * Display plugins most popular, newest plugins, and recently updated widget text.
    935  *
    936  * @since 2.5.0
    937  */
    938 function wp_dashboard_plugins_output() {
    939     $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' );
    940     $new     = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' );
    941 
    942     if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
    943         $plugin_slugs = array_keys( get_plugins() );
    944         set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
    945     }
    946 
    947     foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins') ) as $feed => $label ) {
    948         if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )
    949             continue;
    950 
    951         $items = $$feed->get_items(0, 5);
    952 
    953         // Pick a random, non-installed plugin
    954         while ( true ) {
    955             // Abort this foreach loop iteration if there's no plugins left of this type
    956             if ( 0 == count($items) )
    957                 continue 2;
    958 
    959             $item_key = array_rand($items);
    960             $item = $items[$item_key];
    961 
    962             list($link, $frag) = explode( '#', $item->get_link() );
    963 
    964             $link = esc_url($link);
    965             if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
    966                 $slug = $matches[1];
    967             else {
    968                 unset( $items[$item_key] );
    969                 continue;
    970             }
    971 
    972             // Is this random plugin's slug already installed? If so, try again.
    973             reset( $plugin_slugs );
    974             foreach ( $plugin_slugs as $plugin_slug ) {
    975                 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
    976                     unset( $items[$item_key] );
    977                     continue 2;
    978                 }
    979             }
    980 
    981             // If we get to this point, then the random plugin isn't installed and we can stop the while().
    982             break;
    983         }
    984 
    985         // Eliminate some common badly formed plugin descriptions
    986         while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
    987             unset($items[$item_key]);
    988 
    989         if ( !isset($items[$item_key]) )
    990             continue;
    991 
    992         $title = esc_html( $item->get_title() );
    993 
    994         $description = esc_html( strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))) );
    995 
    996         $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) .
    997                             '&amp;TB_iframe=true&amp;width=600&amp;height=800';
    998 
    999         echo "<h4>$label</h4>\n";
    1000         echo "<h5><a href='$link'>$title</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
    1001         echo "<p>$description</p>\n";
    1002 
    1003         $$feed->__destruct();
    1004         unset($$feed);
    1005     }
     652        return false;
     653    }
     654    return true;
     655}
     656
     657/**
     658 * return relative date for given timestamp
     659 *
     660 *
     661 *
     662 * @since 3.8.0
     663 *
     664 */
     665function dashboard_relative_date( $time ) {
     666
     667    $diff = floor( ( $time - time() ) / DAY_IN_SECONDS );
     668
     669    if ( $diff == 0 )
     670        return __( 'Today' );
     671
     672    if ( $diff == 1 )
     673        return __( 'Tomorrow' );
     674
     675    return date( 'M jS', $time);
     676
    1006677}
    1007678
     
    1075746
    1076747/**
    1077  * The RSS dashboard widget control.
    1078  *
    1079  * Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data
    1080  * from RSS-type widgets.
    1081  *
    1082  * @since 2.5.0
    1083  *
    1084  * @param string $widget_id
    1085  * @param array $form_inputs
    1086  */
    1087 function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
    1088     if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
     748 * Returns default WordPress News feeds
     749 *
     750 *
     751 *
     752 * @since 3.8.0
     753 *
     754 */
     755function wp_dashboard_default_feeds() {
     756    return array(
     757        'news'   => array(
     758            'link'         => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/news/' ) ),
     759            'url'          => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
     760            'title'        => '',
     761            'items'        => 1,
     762            'show_summary' => 1,
     763            'show_author'  => 0,
     764            'show_date'    => 1,
     765        ),
     766        'planet' => array(
     767            'link'         => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ),
     768            'url'          => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ),
     769            'title'        => '',
     770            'items'        => 3,
     771            'show_summary' => 0,
     772            'show_author'  => 0,
     773            'show_date'    => 0,
     774        ),
     775        'plugins' => array(
     776            'link'         => '',
     777            'url'          => array(
     778                    'popular' => 'http://wordpress.org/plugins/rss/browse/popular/'
     779            ),
     780            'title'        => '',
     781            'items'        => 1,
     782            'show_summary' => 0,
     783            'show_author'  => 0,
     784            'show_date'    => 0,
     785        )
     786    );
     787}
     788
     789/**
     790 * Check for cached feeds
     791 *
     792 *
     793 *
     794 * @since 3.8.0
     795 *
     796 */
     797function wp_dashboard_rss() {
     798    $default_feeds = wp_dashboard_default_feeds();
     799
     800    $widget_options = get_option( 'dashboard_widget_options' );
     801
     802    if ( !$widget_options || !is_array($widget_options) )
    1089803        $widget_options = array();
    1090804
    1091     if ( !isset($widget_options[$widget_id]) )
    1092         $widget_options[$widget_id] = array();
    1093 
    1094     $number = 1; // Hack to use wp_widget_rss_form()
    1095     $widget_options[$widget_id]['number'] = $number;
    1096 
    1097     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) {
    1098         $_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] );
    1099         $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] );
    1100         $widget_options[$widget_id]['number'] = $number;
    1101         // title is optional. If black, fill it if possible
    1102         if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
    1103             $rss = fetch_feed($widget_options[$widget_id]['url']);
    1104             if ( is_wp_error($rss) ) {
    1105                 $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
    1106             } else {
    1107                 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
    1108                 $rss->__destruct();
    1109                 unset($rss);
     805    //if ( ! isset( $widget_options['dashboard_rss'] ) ) {
     806        $widget_options['dashboard_rss'] = $default_feeds;
     807        update_option( 'dashboard_widget_options', $widget_options );
     808    //}
     809
     810    foreach( $default_feeds as $key => $value ) {
     811        $default_urls[] = $value['url'];
     812    }
     813
     814    $cache_key = 'dash_' . md5( 'dashboard_rss' );
     815    delete_transient( $cache_key );
     816
     817    do_action( 'dashboard_news_beginning' );
     818
     819    wp_dashboard_cached_rss_widget( 'dashboard_rss', 'wp_dashboard_news_output', $default_urls );
     820
     821    do_action( 'dashboard_news_end' );
     822}
     823
     824/**
     825 * Display news feeds
     826 *
     827 *
     828 *
     829 * @since 3.8.0
     830 *
     831 */
     832function wp_dashboard_news_output() {
     833    $widgets = get_option( 'dashboard_widget_options' );
     834
     835    foreach( $widgets['dashboard_rss'] as $type => $args ) {
     836        $args['type'] = $type;
     837        echo '<div class="rss-widget">';
     838        wp_widget_news_output( $args['url'], $args );
     839        echo "</div>";
     840    }
     841}
     842
     843/**
     844 * Generate code for each news feed
     845 *
     846 *
     847 *
     848 * @since 3.8.0
     849 *
     850 */
     851function wp_widget_news_output( $rss, $args = array() ) {
     852
     853    // Regular RSS feeds
     854    if ( isset( $args['type'] ) && 'plugins' != $args['type'] )
     855        return wp_widget_rss_output( $rss, $args );
     856
     857    // Plugin feeds plus link to install them
     858    if ( ! is_multisite() && current_user_can( 'install_plugins' ) ) {
     859        $popular = fetch_feed( $args['url']['popular'] );
     860
     861        if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
     862            $plugin_slugs = array_keys( get_plugins() );
     863            set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
     864        }
     865
     866        echo '<ul>';
     867
     868        foreach ( array(
     869            'popular' => __( 'Popular Plugin' )
     870        ) as $feed => $label ) {
     871            if ( is_wp_error($$feed) || !$$feed->get_item_quantity() )
     872                continue;
     873
     874            $items = $$feed->get_items(0, 5);
     875
     876            // Pick a random, non-installed plugin
     877            while ( true ) {
     878                // Abort this foreach loop iteration if there's no plugins left of this type
     879                if ( 0 == count($items) )
     880                    continue 2;
     881
     882                $item_key = array_rand($items);
     883                $item = $items[$item_key];
     884
     885                list($link, $frag) = explode( '#', $item->get_link() );
     886
     887                $link = esc_url($link);
     888                if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
     889                    $slug = $matches[1];
     890                else {
     891                    unset( $items[$item_key] );
     892                    continue;
     893                }
     894
     895                // Is this random plugin's slug already installed? If so, try again.
     896                reset( $plugin_slugs );
     897                foreach ( $plugin_slugs as $plugin_slug ) {
     898                    if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
     899                        unset( $items[$item_key] );
     900                        continue 2;
     901                    }
     902                }
     903
     904                // If we get to this point, then the random plugin isn't installed and we can stop the while().
     905                break;
    1110906            }
    1111         }
    1112         update_option( 'dashboard_widget_options', $widget_options );
    1113         $cache_key = 'dash_' . md5( $widget_id );
    1114         delete_transient( $cache_key );
    1115     }
    1116 
    1117     wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
     907
     908            // Eliminate some common badly formed plugin descriptions
     909            while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
     910                unset($items[$item_key]);
     911
     912            if ( !isset($items[$item_key]) )
     913                continue;
     914
     915            $title = esc_html( $item->get_title() );
     916
     917            $description = esc_html( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ) ) );
     918
     919            $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';
     920
     921            echo "<li class='dashboard-news-plugin'><span>$label:</span> <a href='$link' class='dashboard-news-plugin-link'>$title</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span></li>";
     922
     923            $$feed->__destruct();
     924            unset( $$feed );
     925        }
     926
     927        echo '</ul>';
     928    }
    1118929}
    1119930
     
    1128939*/
    1129940function wp_dashboard_quota() {
    1130     if ( !is_multisite() || !current_user_can('upload_files') || get_site_option( 'upload_space_check_disabled' ) )
     941    if ( !is_multisite() || !current_user_can( 'upload_files' ) || get_site_option( 'upload_space_check_disabled' ) )
    1131942        return true;
    1132943
     
    1138949    else
    1139950        $percentused = ( $used / $quota ) * 100;
    1140     $used_color = ( $percentused >= 70 ) ? ' spam' : '';
     951    $used_class = ( $percentused >= 70 ) ? ' warning' : '';
    1141952    $used = round( $used, 2 );
    1142953    $percentused = number_format( $percentused );
    1143954
    1144955    ?>
    1145     <p class="sub musub"><?php _e( 'Storage Space' ); ?></p>
    1146     <div class="table table_content musubtable">
    1147     <table>
    1148         <tr class="first">
    1149             <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $quota ) ); ?></td>
    1150             <td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
    1151         </tr>
    1152     </table>
    1153     </div>
    1154     <div class="table table_discussion musubtable">
    1155     <table>
    1156         <tr class="first">
    1157             <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), number_format_i18n( $used, 2 ), $percentused ); ?></td>
    1158             <td class="last t comments<?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
    1159         </tr>
    1160     </table>
    1161     </div>
    1162     <br class="clear" />
     956    <h4 class="mu-storage"><?php _e( 'Storage Space' ); ?></h4>
     957    <div class="mu-storage">
     958    <ul>
     959        <li class="storage-count">
     960            <?php printf(
     961                '<a href="%1$s" title="%3$s">%2$sMB %4$s</a>',
     962                esc_url( admin_url( 'upload.php' ) ),
     963                number_format_i18n( $quota ),
     964                __( 'Manage Uploads' ),
     965                __( 'Space Allowed' )
     966            ); ?>
     967        </li><li class="storage-count <?php echo $used_class; ?>">
     968            <?php printf(
     969                '<a href="%1$s" title="%4$s" class="musublink">%2$sMB (%3$s%%) %5$s</a>',
     970                esc_url( admin_url( 'upload.php' ) ),
     971                number_format_i18n( $used, 2 ),
     972                $percentused,
     973                __( 'Manage Uploads' ),
     974                __( 'Space Used' )
     975            ); ?>
     976        </li>
     977    </ul>
     978    </div>
    1163979    <?php
    1164980}
  • trunk/src/wp-admin/includes/deprecated.php

    r25964 r26144  
    731731function wp_dashboard_quick_press_output() {
    732732    _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
    733     wp_dashboard_quick_press();
     733    wp_dashboard_quick_draft();
    734734}
    735735
  • trunk/src/wp-admin/index.php

    r25880 r26144  
    3030$parent_file = 'index.php';
    3131
    32 if ( is_user_admin() )
    33     add_screen_option('layout_columns', array('max' => 4, 'default' => 1) );
    34 else
    35     add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
    36 
    3732$help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.' ) . '</p>';
    3833
     
    4843// Help tabs
    4944
    50 $help  = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.') . '</p>';
    51 $help .= '<p>' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
     45$help  = '<p>' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '</p>';
     46$help .= '<p>' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '</p>';
    5247
    5348$screen->add_help_tab( array(
    5449    'id'      => 'help-navigation',
    55     'title'   => __('Navigation'),
     50    'title'   => __( 'Navigation' ),
    5651    'content' => $help,
    5752) );
    5853
    59 $help  = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.') . '</p>';
    60 $help .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.') . '</p>';
    61 $help .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.') . '</p>';
    62 $help .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some boxes have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.') . '</p>';
     54$help  = '<p>' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '</p>';
     55$help .= '<p>' . __( '<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';
     56$help .= '<p>' . __( '<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '</p>';
     57$help .= '<p>' . __( '<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some boxes have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.' ) . '</p>';
    6358
    6459$screen->add_help_tab( array(
    6560    'id'      => 'help-layout',
    66     'title'   => __('Layout'),
     61    'title'   => __( 'Layout' ),
    6762    'content' => $help,
    6863) );
    6964
    70 $help  = '<p>' . __('The boxes on your Dashboard screen are:') . '</p>';
     65$help  = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';
    7166if ( current_user_can( 'edit_posts' ) )
    72     $help .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>';
    73 if ( current_user_can( 'moderate_comments' ) )
    74     $help .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>';
    75 if ( current_user_can( 'publish_posts' ) )
    76     $help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>';
    77 if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
    78     $help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>';
    79     $help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you&#8217;ve started.') . '</p>';
    80 }
    81 $help .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.') . '</p>';
    82 $help .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.') . '</p>';
     67    $help .= '<p>' . __( '<strong>Site Content</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>';
     68$help .= '<p>' . __( '<strong>Activity</strong> - Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>';
     69if ( is_blog_admin() && current_user_can( 'edit_posts' ) )
     70    $help .= '<p>' . __( "<strong>Quick Draft</strong> - Allows you to create a new post and save it as a draft. Also displays links to the 5 most recent draft posts you've started." ) . '</p>';
    8371if ( ! is_multisite() && current_user_can( 'install_plugins' ) )
    84     $help .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>';
     72    $help .= '<p>' . __( '<strong>WordPress News</strong> - Latest news from the official WordPress project, the <a href="http://planet.wordpress.org/">WordPress Planet</a>, and popular and recent plugins.' ) . '</p>';
     73else
     74    $help .= '<p>' . __( '<strong>WordPress News</strong> - Latest news from the official WordPress project, the <a href="http://planet.wordpress.org/">WordPress Planet</a>.' ) . '</p>';
    8575if ( current_user_can( 'edit_theme_options' ) )
    86     $help .= '<p>' . __('<strong>Welcome</strong> - Shows links for some of the most common tasks when setting up a new site.') . '</p>';
     76    $help .= '<p>' . __( '<strong>Welcome</strong> - Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';
    8777
    8878$screen->add_help_tab( array(
    8979    'id'      => 'help-content',
    90     'title'   => __('Content'),
     80    'title'   => __( 'Content' ),
    9181    'content' => $help,
    9282) );
     
    10090);
    10191
    102 include (ABSPATH . 'wp-admin/admin-header.php');
     92include ( ABSPATH . 'wp-admin/admin-header.php' );
    10393
    104 $today = current_time('mysql', 1);
     94$today = current_time( 'mysql', 1 );
    10595?>
    10696
    10797<div class="wrap">
    108 <?php screen_icon(); ?>
    109 <h2><?php echo esc_html( $title ); ?></h2>
     98    <?php screen_icon(); ?>
     99    <h2><?php echo esc_html( $title ); ?></h2>
    110100
    111 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
     101    <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
    112102    $classes = 'welcome-panel';
    113103
     
    118108        $classes .= ' hidden'; ?>
    119109
    120     <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
    121         <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
     110    <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
     111        <?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
    122112        <a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>"><?php _e( 'Dismiss' ); ?></a>
    123113        <?php
     
    133123        ?>
    134124    </div>
    135 <?php endif; ?>
     125    <?php endif; ?>
    136126
    137 <div id="dashboard-widgets-wrap">
    138 
    139 <?php wp_dashboard(); ?>
    140 
    141 <div class="clear"></div>
    142 </div><!-- dashboard-widgets-wrap -->
     127    <div id="dashboard-widgets-wrap">
     128    <?php wp_dashboard(); ?>
     129    </div><!-- dashboard-widgets-wrap -->
    143130
    144131</div><!-- wrap -->
    145132
    146 <?php require(ABSPATH . 'wp-admin/admin-footer.php'); ?>
     133<?php require( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
  • trunk/src/wp-admin/js/dashboard.js

    r22542 r26144  
    3030    // These widgets are sometimes populated via ajax
    3131    ajaxWidgets = [
    32         'dashboard_incoming_links',
    33         'dashboard_primary',
    34         'dashboard_secondary',
    35         'dashboard_plugins'
     32        'dashboard_rss'
    3633    ];
    3734
     
    6764        var act = $('#quickpost-action'), t;
    6865        t = $('#quick-press').submit( function() {
    69             $('#dashboard_quick_press #publishing-action .spinner').show();
     66            $('#dashboard_quick_draft #publishing-action .spinner').show();
    7067            $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
    7168
    72             if ( 'post' == act.val() ) {
    73                 act.val( 'post-quickpress-publish' );
     69            $.post( t.attr( 'action' ), t.serializeArray(), function( data ) {
     70                // Replace the form, and prepend the published post.
     71                $('#dashboard_quick_draft .inside').html( data );
     72                $('#quick-press').removeClass('initial-form');
     73                quickPressLoad();
     74                highlightLatestPost();
     75                $('#title').focus();
     76            });
     77
     78            function highlightLatestPost () {
     79                var latestPost = $('#draft-list li').first();
     80                latestPost.css('background', '#fffbe5');
     81                setTimeout(function () {
     82                    latestPost.css('background', 'none');
     83                }, 1000);
    7484            }
    7585
    76             $('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
    77                 $('#dashboard_quick_press #publishing-action .spinner').hide();
    78                 $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', false);
    79                 $('#dashboard_quick_press ul').next('p').remove();
    80                 $('#dashboard_quick_press ul').find('li').each( function() {
    81                     $('#dashboard_recent_drafts ul').prepend( this );
    82                 } ).end().remove();
    83                 quickPressLoad();
    84             } );
    8586            return false;
    8687        } );
     
    8889        $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
    8990
    90         $('#title, #tags-input').each( function() {
     91        $('#title, #tags-input, #content').each( function() {
    9192            var input = $(this), prompt = $('#' + this.id + '-prompt-text');
    9293
     
    110111
    111112        $('#quick-press').on( 'click focusin', function() {
     113            $(this).addClass("quickpress-open");
     114            $("#description-wrap, p.submit").slideDown(200);
    112115            wpActiveEditor = 'content';
    113116        });
     
    115118    quickPressLoad();
    116119
     120    // Activity Widget
     121    $( '.show-more a' ).on( 'click', function(e) {
     122        $( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' );
     123        e.preventDefault();
     124    })
     125
     126    // Dashboard columns
     127    jQuery(document).ready(function ($) {
     128        // Update main column count on load
     129        updateColumnCount();
     130    });
     131
     132    jQuery(window).resize( _.debounce( function(){
     133        updateColumnCount();
     134    }, 30) );
     135
     136    function updateColumnCount() {
     137        var cols = 1,
     138            windowWidth = parseInt(jQuery(window).width());
     139        if (799 < windowWidth && 1299 > windowWidth)
     140            cols = 2;
     141        if (1300 < windowWidth && 1799 > windowWidth)
     142            cols = 3;
     143        if (1800 < windowWidth)
     144            cols = 4;
     145        jQuery('.metabox-holder').attr('class', jQuery('.metabox-holder').attr('class').replace(/columns-\d+/, 'columns-' + cols));
     146    }
     147
    117148} );
  • trunk/src/wp-admin/js/plugin-install.js

    r23518 r26144  
    2828    $(window).resize(function(){ tb_position(); });
    2929
    30     $('#dashboard_plugins, .plugins').on( 'click', 'a.thickbox', function() {
     30    $('.plugins').on( 'click', 'a.thickbox', function() {
    3131        tb_click.call(this);
    3232
  • trunk/src/wp-admin/post.php

    r25616 r26144  
    6767        $location = explode('#', $location);
    6868        $location = $location[0] . '#postcustom';
    69     } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {
    70         $location = "post.php?action=edit&post=$post_id&message=7";
    7169    } else {
    7270        $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) );
     
    9795
    9896switch($action) {
     97case 'post-quickdraft-save':
     98    // Check nonce and capabilities
     99    $nonce = $_REQUEST['_wpnonce'];
     100    $error_msg = false;
     101    if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
     102        $error_msg = 'Unable to submit this form, please refresh and try again.';
     103
     104    if ( ! current_user_can( 'edit_posts' ) )
     105        $error_msg = "Oops, you don't have access to add new drafts.";
     106
     107    if ( $error_msg )
     108        return wp_dashboard_quick_draft( $error_msg );
     109
     110    $post = get_post( $_REQUEST['post_ID'] );
     111    check_admin_referer( 'add-' . $post->post_type );
     112    edit_post();
     113    // output the quickdraft dashboard widget
     114    require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
     115    wp_dashboard_quick_draft();
     116    exit;
     117    break;
     118
    99119case 'postajaxpost':
    100120case 'post':
    101 case 'post-quickpress-publish':
    102 case 'post-quickpress-save':
    103     check_admin_referer('add-' . $post_type);
    104 
    105     if ( 'post-quickpress-publish' == $action )
    106         $_POST['publish'] = 'publish'; // tell write_post() to publish
    107 
    108     if ( 'post-quickpress-publish' == $action || 'post-quickpress-save' == $action ) {
    109         $_POST['comment_status'] = get_option('default_comment_status');
    110         $_POST['ping_status'] = get_option('default_ping_status');
    111         $post_id = edit_post();
    112     } else {
    113         $post_id = 'postajaxpost' == $action ? edit_post() : write_post();
    114     }
    115 
    116     if ( 0 === strpos( $action, 'post-quickpress' ) ) {
    117         $_POST['post_ID'] = $post_id;
    118         // output the quickpress dashboard widget
    119         require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
    120         wp_dashboard_quick_press();
    121         exit;
    122     }
     121    // Check nonce and capabilities
     122    $nonce = $_REQUEST['_wpnonce'];
     123    $error_msg = false;
     124    if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
     125        $error_msg = 'Unable to submit this form, please refresh and try again.';
     126
     127    if ( ! current_user_can( 'edit_posts' ) )
     128        $error_msg = "Oops, you don't have access to add new drafts.";
     129
     130    $post_id = 'postajaxpost' == $action ? edit_post() : write_post();
    123131
    124132    redirect_post($post_id);
  • trunk/src/wp-includes/default-widgets.php

    r25675 r26144  
    905905            echo "<li>$title{$date}{$summary}{$author}</li>";
    906906        } else {
    907             echo "<li><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}{$summary}{$author}</li>";
     907            echo "<li><div class='rss-title-row'><a class='rsswidget' href='$link' title='$desc'>$title</a>{$date}</div>{$summary}{$author}</li>";
    908908        }
    909909    }
Note: See TracChangeset for help on using the changeset viewer.