Make WordPress Core

Ticket #26369: 26369.3.patch

File 26369.3.patch, 3.0 KB (added by azaozz, 10 years ago)
  • src/wp-admin/includes/misc.php

     
    645645}
    646646add_action('admin_head', '_ipad_meta');
    647647
     648function _admin_font_face_test( $body_class ) {
     649        if ( wp_is_mobile() && ! _font_face_support() ) {
     650                if ( ! empty( $body_class ) )
     651                        $body_class .= ' ';
     652
     653                $body_class .= 'no-font-face';
     654        }
     655
     656        return $body_class;
     657}
     658add_filter( 'admin_body_class', '_admin_font_face_test' );
     659
    648660/**
    649661 * Check lock status for posts displayed on the Posts screen
    650662 *
  • src/wp-includes/class-wp-admin-bar.php

     
    353353                                $class .= ' ie9';
    354354                } elseif ( wp_is_mobile() ) {
    355355                        $class .= ' mobile';
     356
     357                        if ( ! _font_face_support() )
     358                                $class .= ' no-font-face';
    356359                }
    357360
    358361                ?>
     
    449452
    450453                        echo $node->title;
    451454
     455                        if ( ! empty( $node->meta['title'] ) ) {
     456                                ?><span class="ab-label-hidden"><?php echo esc_html( $node->meta['title'] ); ?></span><?php
     457                        }
     458
    452459                        if ( $has_link ) :
    453460                                ?></a><?php
    454461                        else:
  • src/wp-includes/css/admin-bar.css

     
    679679        background-image: none;
    680680}
    681681
     682/* No @font-face support */
     683#wpadminbar span.ab-label-hidden {
     684        display: none;
     685}
    682686
     687#wpadminbar.no-font-face span.ab-label-hidden {
     688        display: inline;
     689}
     690
     691#wpadminbar.no-font-face ul.ab-top-menu > li > a.ab-item {
     692        display: block;
     693        width: 45px;
     694        text-align: center;
     695        overflow: hidden;
     696        margin: 0 3px;
     697}
     698
     699#wpadminbar.no-font-face #wp-admin-bar-my-sites > .ab-item,
     700#wpadminbar.no-font-face #wp-admin-bar-site-name > .ab-item,
     701#wpadminbar.no-font-face #wp-admin-bar-edit > .ab-item {
     702        text-indent: 0;
     703}
     704
     705#wpadminbar.no-font-face .ab-icon,
     706#wpadminbar.no-font-face .ab-icon:before,
     707#wpadminbar.no-font-face a.ab-item:before {
     708        display: none !important;
     709}
     710
     711#wpadminbar.no-font-face ul.ab-top-menu > li > a > span.ab-label {
     712        display: none;
     713}
     714
    683715@media screen and ( max-width: 782px ) {
    684716        /* Toolbar Touchification*/
    685717        html #wpadminbar {
     
    10211053        #wpadminbar li#wp-admin-bar-updates {
    10221054                display: none;
    10231055        }
    1024 }
    1025  No newline at end of file
     1056}
  • src/wp-includes/vars.php

     
    139139
    140140        return $is_mobile;
    141141}
     142
     143function _font_face_support() {
     144        $pattern = '/Android (1.0|1.1|1.5|1.6|2.0|2.1)|Nokia|Opera Mini|' .
     145                'w(eb)?OSBrowser|webOS|UCWEB|Windows Phone OS 7|XBLWP7|ZuneWP7/';
     146
     147        if ( preg_match( $pattern, $_SERVER['HTTP_USER_AGENT'] ) )
     148                return false;
     149
     150        return true;
     151}