Ticket #31449: 31449.patch
File 31449.patch, 9.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/press-this.css
217 217 } 218 218 219 219 fieldset { 220 border: 1px solid #c0c0c0;221 margin: 0 2px;222 padding: 0 .35em 0.625em 0.75em;220 border: 0; 221 margin: 0; 222 padding: 0; 223 223 } 224 224 225 225 legend { -
src/wp-admin/includes/class-wp-press-this.php
133 133 if ( empty( $_POST['post_ID'] ) || ! $post_id = (int) $_POST['post_ID'] ) { 134 134 wp_send_json_error( array( 'errorMessage' => __( 'Missing post ID.' ) ) ); 135 135 } 136 136 137 137 if ( ! current_user_can( 'edit_post', $post_id ) ) { 138 138 wp_send_json_error( array( 'errorMessage' => __( 'Cheatin’ uh?' ) ) ); 139 139 } 140 140 141 141 $post = array( 142 142 'ID' => $post_id, 143 143 'post_title' => ( ! empty( $_POST['title'] ) ) ? sanitize_text_field( trim( $_POST['title'] ) ) : '', … … 148 148 'tax_input' => ( ! empty( $_POST['tax_input'] ) ) ? $_POST['tax_input'] : array(), 149 149 'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(), 150 150 ); 151 151 152 152 if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) { 153 153 if ( current_user_can( 'publish_posts' ) ) { 154 154 $post['post_status'] = 'publish'; … … 164 164 } 165 165 166 166 $updated = wp_update_post( $post, true ); 167 167 168 168 if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) { 169 169 wp_send_json_error( array( 'errorMessage' => __( 'Error while saving the post. Please try again later.' ) ) ); 170 170 } else { … … 192 192 /** This filter is documented in wp-admin/includes/class-wp-press-this.php */ 193 193 $redirect = apply_filters( 'press_this_save_redirect', get_edit_post_link( $post_id, 'raw' ), $post_id, $post['post_status'] ); 194 194 } 195 195 196 196 wp_send_json_success( array( 'redirect' => $redirect ) ); 197 197 } 198 198 } … … 537 537 538 538 ?> 539 539 <div id="post-formats-select"> 540 <fieldset><legend class="screen-reader-text"><?php _e( 'Post formats' ); ?></legend> 540 541 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> 541 542 <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> 542 543 <?php … … 550 551 <?php 551 552 } 552 553 ?> 554 </fieldset> 553 555 </div> 554 556 <?php 555 557 } … … 569 571 570 572 if ( current_user_can( $taxonomy->cap->edit_terms ) ) { 571 573 ?> 572 <button type="button" class="add-cat-toggle button-subtle" >573 <span class="dashicons dashicons-plus"></span> 574 <button type="button" class="add-cat-toggle button-subtle" aria-expanded="false"> 575 <span class="dashicons dashicons-plus"></span><span class="screen-reader-text"><?php _e( 'Toggle add category' ); ?></span> 574 576 </button> 575 577 <div class="add-category is-hidden"> 576 578 <label class="screen-reader-text" for="new-category"><?php echo $taxonomy->labels->add_new_item; ?></label> … … 592 594 </div> 593 595 <?php } ?> 594 596 <div class="categories-search-wrapper"> 595 <input id="categories-search" type="search" class="categories-search" placeholder="<?php esc_attr_e( 'Search categories ' ) ?>">597 <input id="categories-search" type="search" class="categories-search" placeholder="<?php esc_attr_e( 'Search categories by name' ) ?>"> 596 598 <label for="categories-search"> 597 <span class="dashicons dashicons-search"></span> 599 <span class="dashicons dashicons-search"></span><span class="screen-reader-text"><?php _e( 'Search categories' ); ?></span> 598 600 </label> 599 601 </div> 600 <ul class="categories-select" >602 <ul class="categories-select" aria-label="<?php esc_attr_e( 'Categories' ); ?>"> 601 603 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => 'category' ) ); ?> 602 604 </ul> 603 605 <?php … … 645 647 <?php 646 648 if ( $user_can_assign_terms ) { 647 649 ?> 648 <p> 649 <a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php echo $taxonomy->labels->choose_from_most_used; ?></a> 650 </p> 650 <button type="button" class="button-reset button-link tagcloud-link" id="link-post_tag"><?php echo $taxonomy->labels->choose_from_most_used; ?></button> 651 651 <?php 652 652 } 653 653 } … … 756 756 757 757 <div id="scanbar" class="scan"> 758 758 <form method="GET"> 759 <label for="url-scan" class="screen-reader-text"><?php _e( 'Scan site for content' ); ?></label> 759 760 <input type="url" name="u" id="url-scan" class="scan-url" value="" placeholder="<?php esc_attr_e( 'Enter a URL to scan' ) ?>" /> 760 761 <input type="submit" name="url-scan-submit" id="url-scan-submit" class="scan-submit" value="<?php esc_attr_e( 'Scan' ) ?>" /> 761 762 </form> … … 841 842 842 843 <?php if ( $supports_formats ) : ?> 843 844 <div class="setting-modal is-off-screen is-hidden"> 844 <button type="button" class="button-reset modal-close"> 845 <span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title"><?php _e( 'Post format' ); ?></span> 846 </button> 845 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title" aria-hidden="true"><?php _e( 'Post format' ); ?></span><span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span></button> 847 846 <?php $this->post_formats_html( $post ); ?> 848 847 </div> 849 848 <?php endif; ?> 850 849 851 850 <div class="setting-modal is-off-screen is-hidden"> 852 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title" ><?php _e( 'Categories' );?></span></button>851 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span><span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span></button> 853 852 <?php $this->categories_html( $post ); ?> 854 853 </div> 855 854 856 855 <div class="setting-modal tags is-off-screen is-hidden"> 857 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title" ><?php _e( 'Tags' );?></span></button>856 <button type="button" class="button-reset modal-close"><span class="dashicons dashicons-arrow-left-alt2"></span><span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span><span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span></button> 858 857 <?php $this->tags_html( $post ); ?> 859 858 </div> 860 859 </div><!-- .options-panel --> -
src/wp-admin/js/press-this.js
810 810 $targetSettingModal 811 811 .removeClass( isOffScreen + ' ' + isHidden ) 812 812 .one( transitionEndEvent, function() { 813 $( this ).find( $modalClose).focus();813 $( this ).find( '.modal-close' ).focus(); 814 814 } ); 815 815 } ); 816 816 … … 827 827 .addClass( isOffScreen ) 828 828 .one( transitionEndEvent, function() { 829 829 $( this ).addClass( isHidden ); 830 $postOption.eq( index - 1 ).focus(); 830 831 } ); 831 832 832 833 // For browser that don't support transitionend. … … 833 834 if ( ! transitionEndEvent ) { 834 835 setTimeout( function() { 835 836 $targetSettingModal.addClass( isHidden ); 837 $postOption.eq( index - 1 ).focus(); 836 838 }, 350 ); 837 839 } 838 839 $postOption.eq( index - 1 ).focus();840 840 } ); 841 841 } 842 842 … … 964 964 965 965 $( 'button.add-cat-toggle' ).on( 'click.press-this', function() { 966 966 $( this ).toggleClass( 'is-toggled' ); 967 $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); 967 968 $( '.setting-modal .add-category' ).toggleClass( 'is-hidden' ); 968 969 $( '.categories-search-wrapper' ).toggleClass( 'is-hidden' ); 969 970 } ); -
src/wp-admin/js/tags-box.js
18 18 19 19 return out; 20 20 }; 21 21 22 22 tagBox = { 23 23 clean : function(tags) { 24 24 var comma = window.tagsBoxL10n.tagDelimiter; … … 193 193 }); 194 194 195 195 // tag cloud 196 $(' a.tagcloud-link').click(function(){196 $('.tagcloud-link').click(function(){ 197 197 tagBox.get( $(this).attr('id') ); 198 198 $(this).unbind().click(function(){ 199 199 $(this).siblings('.the-tagcloud').toggle(); -
src/wp-admin/tools.php
57 57 </button> 58 58 </p> 59 59 60 <div class="hidden js-pressthis-code-wrap" >60 <div class="hidden js-pressthis-code-wrap" id="pressthis-code-wrap"> 61 61 <p id="pressthis-code-desc"> 62 62 <?php _e( 'If you can\'t drag it to your bookmarks, copy the following code and create new bookmark. Paste the code into the new bookmark\'s URL field.' ) ?> 63 63 </p>