diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index 78cad54..55661dd 100644
|
a
|
b
|
function wp_ajax_query_attachments() {
|
| 2156 | 2156 | $query = isset( $_REQUEST['query'] ) ? (array) $_REQUEST['query'] : array(); |
| 2157 | 2157 | $query = array_intersect_key( $query, array_flip( array( |
| 2158 | 2158 | 's', 'order', 'orderby', 'posts_per_page', 'paged', 'post_mime_type', |
| 2159 | | 'post_parent', 'post__in', 'post__not_in', |
| | 2159 | 'post_parent', 'post__in', 'post__not_in', 'year', 'monthnum' |
| 2160 | 2160 | ) ) ); |
| 2161 | 2161 | |
| 2162 | 2162 | $query['post_type'] = 'attachment'; |
| … |
… |
function wp_ajax_parse_media_shortcode() {
|
| 2713 | 2713 | if ( ! empty( $wp_scripts ) ) { |
| 2714 | 2714 | $wp_scripts->done = array(); |
| 2715 | 2715 | } |
| 2716 | | |
| | 2716 | |
| 2717 | 2717 | if ( 'playlist' === $_REQUEST['type'] ) { |
| 2718 | 2718 | wp_underscore_playlist_templates(); |
| 2719 | 2719 | |
diff --git a/src/wp-includes/js/media-grid.js b/src/wp-includes/js/media-grid.js
index 67f4dc5..5e19753 100644
|
a
|
b
|
|
| 681 | 681 | } |
| 682 | 682 | }); |
| 683 | 683 | |
| | 684 | /** |
| | 685 | * A filter dropdown for month/dates. |
| | 686 | */ |
| | 687 | media.view.DateFilter = media.view.AttachmentFilters.extend({ |
| | 688 | createFilters: function() { |
| | 689 | var filters = {}; |
| | 690 | _.each( media.view.settings.months || {}, function( value, index ) { |
| | 691 | filters[ index ] = { |
| | 692 | text: value.text, |
| | 693 | props: { |
| | 694 | year: value.year, |
| | 695 | monthnum: value.month, |
| | 696 | } |
| | 697 | }; |
| | 698 | }); |
| | 699 | filters.all = { |
| | 700 | text: l10n.allDates, |
| | 701 | props: { |
| | 702 | monthnum: false, |
| | 703 | year: false |
| | 704 | }, |
| | 705 | priority: 10 |
| | 706 | }; |
| | 707 | this.filters = filters; |
| | 708 | } |
| | 709 | }); |
| | 710 | |
| 684 | 711 | }(jQuery, _, Backbone, wp)); |
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index c57df05..8336a0d 100644
|
a
|
b
|
|
| 5499 | 5499 | this.select(); |
| 5500 | 5500 | }, |
| 5501 | 5501 | |
| | 5502 | /** |
| | 5503 | * @abstract |
| | 5504 | */ |
| 5502 | 5505 | createFilters: function() { |
| 5503 | 5506 | this.filters = {}; |
| 5504 | 5507 | }, |
| 5505 | 5508 | |
| | 5509 | /** |
| | 5510 | * When the selection changes, set the Query properties |
| | 5511 | * accordingly for the selected filter. |
| | 5512 | */ |
| 5506 | 5513 | change: function() { |
| 5507 | 5514 | var filter = this.filters[ this.el.value ]; |
| 5508 | | |
| 5509 | 5515 | if ( filter ) { |
| 5510 | 5516 | this.model.set( filter.props ); |
| 5511 | 5517 | } |
| … |
… |
|
| 5735 | 5741 | priority: -90 |
| 5736 | 5742 | }).render() ); |
| 5737 | 5743 | |
| 5738 | | this.toolbar.set( 'BulkSelection', new media.view.BulkSelection({ |
| | 5744 | this.toolbar.set( 'bulkSelection', new media.view.BulkSelection({ |
| 5739 | 5745 | controller: this.controller, |
| 5740 | 5746 | priority: -70 |
| 5741 | 5747 | }).render() ); |
| | 5748 | this.toolbar.set( 'dateFilter', new media.view.DateFilter({ |
| | 5749 | controller: this.controller, |
| | 5750 | model: this.collection.props, |
| | 5751 | priority: -75 |
| | 5752 | }).render() ); |
| 5742 | 5753 | } |
| 5743 | 5754 | |
| 5744 | 5755 | filters = this.options.filters; |
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index fea3c34..cd32ae1 100644
|
a
|
b
|
function wp_enqueue_media( $args = array() ) {
|
| 2772 | 2772 | if ( did_action( 'wp_enqueue_media' ) ) |
| 2773 | 2773 | return; |
| 2774 | 2774 | |
| 2775 | | global $content_width, $wpdb; |
| | 2775 | global $content_width, $wpdb, $wp_locale; |
| 2776 | 2776 | |
| 2777 | 2777 | $defaults = array( |
| 2778 | 2778 | 'post' => null, |
| … |
… |
function wp_enqueue_media( $args = array() ) {
|
| 2825 | 2825 | AND post_mime_type LIKE 'video%' |
| 2826 | 2826 | LIMIT 1 |
| 2827 | 2827 | " ); |
| | 2828 | $months = $wpdb->get_results( $wpdb->prepare( " |
| | 2829 | SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month |
| | 2830 | FROM $wpdb->posts |
| | 2831 | WHERE post_type = %s |
| | 2832 | ORDER BY post_date DESC |
| | 2833 | ", 'attachment' ) ); |
| | 2834 | foreach ( $months as $month_year ) { |
| | 2835 | $month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year ); |
| | 2836 | } |
| 2828 | 2837 | |
| 2829 | 2838 | $settings = array( |
| 2830 | 2839 | 'tabs' => $tabs, |
| … |
… |
function wp_enqueue_media( $args = array() ) {
|
| 2846 | 2855 | 'embedExts' => $exts, |
| 2847 | 2856 | 'embedMimes' => $ext_mimes, |
| 2848 | 2857 | 'contentWidth' => $content_width, |
| | 2858 | 'months' => $months, |
| 2849 | 2859 | ); |
| 2850 | 2860 | |
| 2851 | 2861 | $post = null; |
| … |
… |
function wp_enqueue_media( $args = array() ) {
|
| 2904 | 2914 | 'returnToLibrary' => __( '← Return to library' ), |
| 2905 | 2915 | 'allMediaItems' => __( 'All media items' ), |
| 2906 | 2916 | 'allMediaTypes' => __( 'All media types' ), |
| | 2917 | 'allDates' => __( 'All dates' ), |
| 2907 | 2918 | 'noItemsFound' => __( 'No items found.' ), |
| 2908 | 2919 | 'insertIntoPost' => $hier ? __( 'Insert into page' ) : __( 'Insert into post' ), |
| 2909 | 2920 | 'uploadedToThisPost' => $hier ? __( 'Uploaded to this page' ) : __( 'Uploaded to this post' ), |