Plugin Directory

Changeset 3241561


Ignore:
Timestamp:
02/17/2025 02:38:09 AM (10 months ago)
Author:
tmatsuur
Message:

[Update] Posts filter multiselect:2.4.0 Added the ability to search using NOT conditions for each item.

Location:
posts-filter-multiselect/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • posts-filter-multiselect/trunk/languages/posts-filter-multiselect-ja.po

    r2706694 r3241561  
    33"Project-Id-Version: Posts filter multiselect\n"
    44"POT-Creation-Date: 2017-08-03 13:32+0900\n"
    5 "PO-Revision-Date: 2022-04-07 20:07:09+09:00\n"
     5"PO-Revision-Date: 2025-02-16 00:18:56+09:00\n"
    66"Last-Translator: adminwp <[email protected]>\n"
    77"Language-Team: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "X-Generator: Poppoppoo/0.8.0\n"
     12"X-Generator: Poppoppoo/0.9.9\n"
    1313"X-Poedit-Basepath: ..\n"
    1414"Plural-Forms: nplurals=1; plural=0;\n"
     
    1717"X-Poedit-SearchPath-0: posts-filter-multiselect.php\n"
    1818
    19 #: posts-filter-multiselect.php:819
     19#: posts-filter-multiselect.php:1075
    2020msgid "Modified"
    2121msgstr "更新日時"
     
    2929msgstr "投稿一覧ページの各プルダウンメニューを単一選択から複数選択に変更します。また、投稿タグおよび投稿者フィルターを追加し、それらの絞り込みを可能にします。"
    3030
    31 #: posts-filter-multiselect.php:775
     31#: posts-filter-multiselect.php:1026
    3232msgid "All Authors"
    3333msgstr "すべての投稿者"
    3434
    35 #: posts-filter-multiselect.php:751
     35#: posts-filter-multiselect.php:1002
    3636msgid "? Unknown %d"
    3737msgstr "? 不明 %d"
    3838
    39 #: posts-filter-multiselect.php:711
     39#: posts-filter-multiselect.php:962
    4040msgid "Filter by tag"
    4141msgstr "タグで絞り込む"
    4242
    43 #: posts-filter-multiselect.php:773
     43#: posts-filter-multiselect.php:1024
    4444msgid "Filter by author"
    4545msgstr "投稿者で絞り込む"
     
    7373#~ msgid "Change each pull-down menu on the post list page from single selection to multiple selection."
    7474#~ msgstr "投稿リストページの各プルダウンメニューを単一選択から複数選択に変更します。"
     75
     76#: posts-filter-multiselect.php:1038
     77#~ msgid "Reset"
     78#~ msgstr "リセット"
  • posts-filter-multiselect/trunk/posts-filter-multiselect.php

    r3207255 r3241561  
    55 Description: Each pull-down menu on the post list page will be changed from single selection to multiple selection. Also, tags and author filters will be added to allow you to narrow down your search.
    66 Author: tmatsuur
    7  Version: 2.3.0
     7 Version: 2.4.0
    88 Author URI: https://12net.jp/
    9 Text Domain: posts-filter-multiselect
    10 Domain Path: /languages
     9 Text Domain: posts-filter-multiselect
     10 Domain Path: /languages
    1111 */
    1212
    1313/*
    14  Copyright (C) 2015-2024 tmatsuur (Email: takenori dot matsuura at 12net dot jp)
     14 Copyright (C) 2015-2025 tmatsuur (Email: takenori dot matsuura at 12net dot jp)
    1515 This program is licensed under the GNU GPL Version 2.
    1616 */
     
    1818define( 'POSTS_FILTER_MULTISELECT_DOMAIN', 'posts-filter-multiselect' );
    1919define( 'POSTS_FILTER_MULTISELECT_DB_VERSION_NAME', 'posts-filter-multiselect-db-version' );
    20 define( 'POSTS_FILTER_MULTISELECT_DB_VERSION', '2.2.1' );
     20define( 'POSTS_FILTER_MULTISELECT_DB_VERSION', '2.4.0' );
    2121
    2222$plugin_posts_filter_multiselect = new posts_filter_multiselect();
     
    2525    const PROPERTIES_NAME = '-properties';
    2626    var $get_params = array();
     27    var $not_params = array();
     28    var $not_date_query = '';
    2729    var $font_weight_normal = true;
    2830    var $ui_theme = 'redmond';  // see jquery ui themes
    29     var $standard_keys = array( 's', 'post_status', 'post_type', 'action', 'action2', 'filter_action', 'paged', 'mode', 'post',
    30         'author', 'category_name' );
     31    var $standard_keys = array( 's', 'post_status', 'post_type', 'action', 'action2', 'filter_action', 'paged', 'mode', 'post', 'category_name' );
    3132    var $has_edit_published_posts = false;
    3233
     
    4344        if ( isset( $pagenow ) && in_array( $pagenow, array( 'edit.php' ) ) ) {
    4445            add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
     46            add_filter( 'get_date_sql', array( $this, 'get_date_sql' ), 10, 2 ); // @since 2.4.0
    4547            add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
    4648            add_action( 'admin_head', array( $this, 'admin_head' ) );
     
    7779     */
    7880    public function pre_get_posts( $query ) {
     81        if ( ! $query->is_main_query() ) {
     82            return;
     83        }
    7984        $this->get_params = array();
     85        $this->not_params = array();
     86        if ( isset( $_GET['not'] ) ) {
     87            $this->not_params = $_GET['not'];
     88        }
    8089        foreach ( array_keys( $_GET ) as $key ) {
    81             if ( ! in_array( $key, $this->standard_keys ) && is_string( $_GET[$key] ) ) {
    82                 $this->get_params[$key] = explode( ',', $_GET[$key] );
    83 
    84                 if ( 'modified_author' === $key ) { // [1.4.0] add.
    85                     $query->set( 'meta_query',
    86                         array( 'relation' => 'AND',
    87                             array(
    88                                 'key' => '_edit_last',
    89                                 'value' => intval( $_GET[$key] ),
    90                                 'compare' => '=',
    91                                 'type' => 'UNSIGNED'
    92                             ),
    93                         )
    94                     );
    95                     $query->set( $key, '' );
    96                 } elseif ( count( $this->get_params[$key] ) > 1 ) {
    97                     if ( 'm' === $key ) {
    98                         $date_query = array( 'relation'=>'OR' );
     90            if ( ! in_array( $key, $this->standard_keys ) ) {
     91                $this->get_params[$key] = is_string( $_GET[$key] ) ?
     92                    explode( ',', $_GET[$key] ) : $_GET[$key];
     93                switch ( $key ) {
     94                    case 'm':
     95                        $date_query = array( 'relation' => 'OR' );
    9996                        foreach ( $this->get_params[$key] as $yyyymm ) {
    10097                            if ( preg_match( '/^[0-9]+$/u', $yyyymm ) ) {
    101                                 $yyyy = intval( substr( $yyyymm, 0, 4 ) );
     98                                $yyyy = (int)substr( $yyyymm, 0, 4 );
    10299                                if ( strlen( $yyyymm ) > 5 ) {
    103                                     $mm2 = $mm = intval( substr( $yyyymm, 4, 2 ) );
    104                                 } else {
    105                                     $mm = 1;
    106                                     $mm2 = 12;
     100                                    $mm = (int)substr( $yyyymm, 4, 2 );
    107101                                }
    108102                                if ( strlen( $yyyymm ) > 7 ) {
    109                                     $date_query[] = array( 'year'=>$yyyy, 'month'=>$mm, 'day'=>intval( substr( $yyyymm, 6, 2 ) ) );
     103                                    $date_query[] = array(
     104                                        'year'  => $yyyy,
     105                                        'month' => $mm,
     106                                        'day'   => (int)substr( $yyyymm, 6, 2 )
     107                                    );
     108                                } elseif ( strlen( $yyyymm ) > 5 ) {
     109                                    $date_query[] = array(
     110                                        'year'  => $yyyy,
     111                                        'month' => $mm,
     112                                    );
    110113                                } else {
    111114                                    $date_query[] = array(
    112                                         'compare'=>'BETWEEN',
    113                                         'inclusive'=>true,
    114                                         'after'=>$yyyy.'/'.$mm.'/1',
    115                                         'before'    =>date( 'Y/m/d H:i:s', strtotime( '+1 month '.$yyyy.'/'.$mm2.'/1' )-1 ) );
     115                                        'year'  => $yyyy,
     116                                    );
    116117                                }
    117118                            }
    118119                        }
    119                         if ( count( $date_query ) > 1 ) {
    120                             $query->set( 'm', '' );
    121                             $query->set( 'date_query', $date_query );
     120                        $query->set( 'm', '' );
     121                        $query->set( 'date_query', $date_query );
     122                        if ( in_array( 'm', $this->not_params ) && $date_query ) {
     123                            $date_query = new WP_Date_Query( $date_query );
     124                            $this->not_date_query = $date_query->get_sql();
    122125                        }
    123                     } elseif ( 'tag__in' === $key ) {
    124                         $query->set( $key, $this->get_params[$key] );
    125                     } elseif ( 'post_format' === $key ) {   // [1.3.2] for post_format
    126                         $slugs = array_keys( get_post_format_slugs() );
    127                         $post_format = array();
    128                         foreach ( $this->get_params[$key] as $term ) {
    129                             if ( in_array( $term, $slugs ) ) {
    130                                 $post_format[] = 'post-format-' . $term;
     126                        break;
     127
     128                    case 'cat':
     129                        if ( in_array( $key, $this->not_params ) ) {
     130                            $query->set( 'cat',  '' );
     131                            $query->set( 'category__not_in', $this->get_params[$key] );
     132                        } else {
     133                            $query->set( $key, $this->get_params[$key] );
     134                        }
     135                        break;
     136
     137                    case 'tag__in':
     138                        if ( '-1' === $_GET[$key] ) {
     139                            if ( in_array( $key, $this->not_params ) ) {
     140                                $query->set( 'tag__in', get_tags( array( 'fields'=>'ids', 'hide_empty' => true ) ) );
     141                            } else {
     142                                $query->set( 'tag__in',  '' );
     143                                $query->set( 'tag__not_in', get_tags( array( 'fields'=>'ids', 'hide_empty' => true ) ) );
     144                            }
     145                        } elseif ( '0' === $_GET[$key] ) {
     146                            $query->set( 'tag__in', '' );
     147                        } else {
     148                            if ( in_array( $key, $this->not_params ) ) {
     149                                $query->set( 'tag__in', '' );
     150                                $query->set( 'tag__not_in', $this->get_params[$key] );
     151                            } else {
     152                                $query->set( $key, $this->get_params[$key] );
    131153                            }
    132154                        }
    133                         $query->set( $key, $post_format );
    134                     } else {
    135                         $query->set( $key, $_GET[$key] );
    136                     }
    137                 } else {
    138                     if ( '0' === $_GET[$key] ) {
     155                        break;
     156
     157                    case 'author':
     158                        if ( in_array( $key, $this->not_params ) ) {
     159                            $query->set( 'author', '' );
     160                            $query->set( 'author__not_in', $this->get_params[$key] );
     161                        }
     162                        break;
     163
     164                    case 'modified_author':
     165                        if ( preg_match( '/^\d+$/', $_GET[$key] ) ) {
     166                            $_GET[$key] = (int)$_GET[$key];
     167                            $query->set( 'meta_query',
     168                                array( 'relation' => 'OR',
     169                                    'last' => array(
     170                                        'key'     => '_edit_last',
     171                                        'value'   => $_GET[$key],
     172                                        'compare' => '=',
     173                                        'type'    => 'UNSIGNED'
     174                                    ),
     175                                    'lock' => array(
     176                                        'key'     => '_edit_lock',
     177                                        'value'   => '^\d+:' . $_GET[$key] . '$',
     178                                        'compare' => 'REGEXP',
     179                                    ),
     180                                )
     181                            );
     182                        }
    139183                        $query->set( $key, '' );
    140                     } else {
    141                         // may be tag__in
    142                         if ( 'tag__in' === $key && '-1' === $_GET[$key] ) { // [1.2.0] add.
    143                             $query->set( 'tag__in',  '' );
    144                             $query->set( 'tag__not_in', get_tags( array( 'fields'=>'ids' ) ));
    145                         } elseif ( 'post_format' === $key && ! empty( $_GET[$key] ) ) { // [1.3.2] for post_format
    146                             $slugs = array_keys( get_post_format_slugs() );
    147                             if ( in_array( $_GET[$key], $slugs ) ) {
    148                                 $query->set( $key, 'post-format-' . $_GET[$key] );
    149                             }
    150                         } else {
    151                             $query->set( $key, $_GET[$key] );
    152                         }
    153                     }
    154                 }
    155             } elseif ( 'author' === $key ) { // [2.1.0] add.
    156                 $this->get_params[$key] = explode( ',', $_GET[$key] );
    157             }
    158         }
     184                        break;
     185                }
     186            }
     187        }
     188    }
     189
     190    /**
     191     * Adds a NOT condition to a date query.
     192     *
     193     * @see get_date_sql filter.
     194     *
     195     * @param string       $where
     196     * @param WP_DateQuery $date_query
     197     * @return string
     198     */
     199    public function get_date_sql( $where, $date_query ) {
     200        if ( in_array( 'm', $this->not_params ) &&
     201            0 === strcmp( $this->not_date_query, $where ) ) {
     202            $where = preg_replace( '#^ AND \(#u', ' AND NOT (', $where );
     203        }
     204        return $where;
    159205    }
    160206
     
    234280/* adjustment */
    235281.fixed .column-modified { width: 10%; }
    236 .ui-multiselect { line-height: 1.55em; position: relative; margin-left: 2px; margin-top: 1px; outline: none; overflow: hidden; }
     282.ui-multiselect { line-height: 1.55em; position: relative; margin: 1px 0.5rem 1px 2px; outline: none; overflow: hidden;
     283    text-overflow: ellipsis; max-width: 15.5em;
     284}
    237285.ui-multiselect.ui-state-default { border: 1px solid #7e8993; color: {$color}; }
    238286.ui-multiselect span.ui-icon-triangle-2-n-s { position: absolute; right: 0; }
    239287.ui-multiselect span { white-space: nowrap; }
     288.ui-multiselect-header ul li { padding: 0 8px 0 0; }
    240289
    241290.ui-widget-content { background-image: none; }
     
    253302    width: 20px;
    254303    height: 16px;
     304}
     305.ui-multiselect-header .ui-icon-check,
     306.ui-multiselect-header .ui-icon-closethick {
     307    width: 16px;
    255308}
    256309.ui-multiselect-header span.ui-icon:before,
     
    278331.ui-multiselect-header .ui-icon.ui-icon-circle-close { text-align: left; }
    279332.ui-multiselect-header .ui-icon.ui-icon-circle-close:before { content: '\\f153'; }
     333
     334#posts-filter fieldset {
     335    margin: 0 0 0.25rem 0;
     336}
     337input[type="checkbox"].not-select {
     338    margin-left: 0;
     339    margin-right: 0.125rem;
     340}
     341input[type="checkbox"].not-select:checked::before {
     342    font-family: dashicons;
     343    content: '\\f460';
     344    color: #3582c4;
     345    position: relative;
     346    top: 10px;
     347}
     348.wp-core-ui .button-unfilter {
     349    margin-right: 0.125rem;
     350    padding: 0 5px;
     351}
     352.button-unfilter span {
     353    font-size: 16px;
     354    vertical-align: middle;
     355}
    280356EOT;
    281357        if ( $this->_use_multiselect_js() ) {
     
    423499<script id="posts-filter-multiselect-js" type="text/javascript">
    424500//<![CDATA[
     501const columns_width = { <?php
     502if ( is_array( $columns_width ) ) {
     503    foreach ( $columns_width as $key => $value ) {
     504        printf( "'%s':%d,", esc_js( $key ), esc_js( (int)$value ) );
     505    }
     506}
     507?> };
     508document.querySelectorAll( '.metabox-prefs:not(.view-mode) > label' ).forEach( ( column ) => {
     509    const column_name = column.querySelector( 'input' ).value;
     510    const widthp = document.createElement( 'input' );
     511    widthp.setAttribute( 'type', 'number' );
     512    widthp.setAttribute( 'min', 1 );
     513    widthp.setAttribute( 'max', 50 );
     514    if ( columns_width[column_name] && 0 < columns_width[column_name] ) {
     515        widthp.setAttribute( 'value', columns_width[column_name] );
     516        document.getElementById( column_name ).style.width = columns_width[column_name] + '%';
     517    } else {
     518        widthp.setAttribute( 'value', '' );
     519    }
     520    widthp.classList.add( 'column-widthp' );
     521    widthp.dataset.column = column_name;
     522    const span = document.createElement( 'span' );
     523    span.classList.add( 'prefix-widthp' );
     524    span.append( widthp );
     525    column.append( span );
     526    widthp.addEventListener( 'change', ( event ) => {
     527        document.getElementById( event.target.dataset.column ).style.width = event.target.value + '%';
     528        save_columns_width();
     529    } );
     530    widthp.addEventListener( 'input', ( event ) => {
     531        if ( '' === event.target.value ) {
     532            document.getElementById( event.target.dataset.column ).style.removeProperty( 'width' );
     533            save_columns_width();
     534        }
     535    } );
     536} );
     537let timeoutID = null;
     538function save_columns_width() {
     539    if ( null !== timeoutID ) {
     540        clearTimeout( timeoutID );
     541    }
     542    timeoutID = setTimeout( () => {
     543        timeoutID = null;
     544        const params = new URLSearchParams();
     545        params.append( 'action', 'save_post_type_columns_width' );
     546        params.append( '_ajax_nonce', '<?php echo esc_js( $this->create_nonce( 'save_post_type_columns_width' ) ); ?>' );
     547        params.append( 'post_type', '<?php echo esc_js( $post_type ); ?>' );
     548        document.querySelectorAll( '.column-widthp' ).forEach( ( widthp ) => {
     549            params.append( 'width[' + widthp.dataset.column + ']', widthp.value );
     550        } );
     551        fetch( ajaxurl, {
     552            method:      'POST',
     553            cache:       'no-cache',
     554            credentials: 'same-origin',
     555            body:        params
     556        } )
     557        .then( ( response ) => response.json() )
     558        .then( ( data ) => {} );
     559    }, 1000 );
     560}
     561
    425562( function ( $ ) {
    426     const columns_width = { <?php
    427     if ( is_array( $columns_width ) ) {
    428         foreach ( $columns_width as $key => $value ) {
    429             printf( "'%s':%d,", esc_js( $key ), esc_js( (int)$value ) );
    430         }
    431     }
    432 ?> };
    433     document.querySelectorAll( '.metabox-prefs:not(.view-mode) > label' ).forEach( ( column ) => {
    434         const column_name = column.querySelector( 'input' ).value;
    435         const widthp = document.createElement( 'input' );
    436         widthp.setAttribute( 'type', 'number' );
    437         widthp.setAttribute( 'min', 1 );
    438         widthp.setAttribute( 'max', 50 );
    439         if ( columns_width[column_name] && 0 < columns_width[column_name] ) {
    440             widthp.setAttribute( 'value', columns_width[column_name] );
    441             document.getElementById( column_name ).style.width = columns_width[column_name] + '%';
    442         } else {
    443             widthp.setAttribute( 'value', '' );
    444         }
    445         widthp.classList.add( 'column-widthp' );
    446         widthp.dataset.column = column_name;
    447         const span = document.createElement( 'span' );
    448         span.classList.add( 'prefix-widthp' );
    449         span.append( widthp );
    450         column.append( span );
    451         widthp.addEventListener( 'change', ( event ) => {
    452             document.getElementById( event.target.dataset.column ).style.width = event.target.value + '%';
    453             save_columns_width();
    454         } );
    455         widthp.addEventListener( 'input', ( event ) => {
    456             if ( '' === event.target.value ) {
    457                 document.getElementById( event.target.dataset.column ).style.removeProperty( 'width' );
    458                 save_columns_width();
    459             }
    460         } );
    461     } );
    462     let timeoutID = null;
    463     function save_columns_width() {
    464         if ( null !== timeoutID ) {
    465             clearTimeout( timeoutID );
    466         }
    467         timeoutID = setTimeout( () => {
    468             timeoutID = null;
    469             const params = new URLSearchParams();
    470             params.append( 'action', 'save_post_type_columns_width' );
    471             params.append( '_ajax_nonce', '<?php echo esc_js( $this->create_nonce( 'save_post_type_columns_width' ) ); ?>' );
    472             params.append( 'post_type', '<?php echo esc_js( $post_type ); ?>' );
    473             document.querySelectorAll( '.column-widthp' ).forEach( ( widthp ) => {
    474                 params.append( 'width[' + widthp.dataset.column + ']', widthp.value );
    475             } );
    476             fetch( ajaxurl, {
    477                 method:      'POST',
    478                 cache:       'no-cache',
    479                 credentials: 'same-origin',
    480                 body:        params
    481             } )
    482             .then( ( response ) => response.json() )
    483             .then( ( data ) => {} );
    484         }, 1000 );
    485     }
    486 
    487563<?php if ( ! $this->_use_multiselect_js() ) { ?>
    488564    document.addEventListener('DOMContentLoaded', function() {
    489565        let get_filter = JSON.parse( '<?php echo json_encode( $this->get_params ); ?>' );
     566        let not_filter = JSON.parse( '<?php echo json_encode( $this->not_params ); ?>' );
    490567        $( '#posts-filter input[name=filter_action]' ).siblings( 'select' ).each( function () {
    491             first_text = $(this).find(':first' ).text();
     568            // [2.4.0]
     569            const select_name = $(this).attr( 'name' );
     570            $(this).wrap( '<fieldset></fieldset>' ).before( '<input type="checkbox" class="not-select" id="filter-not-' + select_name + '" name="not[]" value="' + select_name + '" ' + ( not_filter.includes( select_name ) ? 'checked="checked"' : '' ) + ' />' );
     571
     572            first_text = $(this).find( ':first' ).text();
    492573            let multiselect_option = [];
    493574            $(this).find( 'option' ).each( function () {
     
    663744                    selectedText = e.target.title;
    664745                    selectedValue = e.target.value;
     746                    // const multiselect_id = multiselect_checkboxes.parent().attr( 'id' ).replace( 'multiselect-', '' );
     747                    // $( '#filter-not-' + $( '#' + multiselect_id ).attr( 'name' ) ).prop( 'checked', false );
    665748                } else if ( '-1' === e.target.value ) {
    666749                    multiselect_checkboxes.find( 'li input[value!=-1]:checked' ).prop( 'checked', false );
     
    699782                $(this).addClass( 'ui-state-active' ).addClass( 'ui-state-focus' );
    700783            } ).on( 'blur', function ( e ) {
    701                 if ( 'ui-narrow-keyword' === mouseDown.target.className ) { // [2.2.0]
     784                if ( null != mouseDown && 'ui-narrow-keyword' === mouseDown.target.className ) { // [2.2.0]
    702785                    return;
    703786                }
     
    760843
    761844            let selectedVal = get_filter[$(this).attr('name')];
    762             if ( Array.isArray( selectedVal ) && selectedVal.length > 1 ) {
     845            if ( Array.isArray( selectedVal ) && selectedVal.length >= 1 ) {
    763846                for ( var key in selectedVal ) {
    764847                    multiselect_menu.find( '[value='+selectedVal[key]+']' ).each( function () {
     
    772855        } );
    773856        $( '#posts-filter' ).on( 'submit', function () {
    774             $( '#posts-filter input[name=filter_action]' ).siblings( 'select' ).each( function () {
    775                 let selected = $(this).next().prop( 'selectedValue' );
     857            $( '#posts-filter input[name=filter_action]' ).siblings( 'fieldset' ).each( function () {
     858                let selected = $(this).find( 'select' ).next().prop( 'selectedValue' );
    776859                if ( selected == '' ) selected = '0';
    777860                $(this).find( 'option:selected' ).val( selected );
     
    894977            }
    895978            $dropdown_options = array(
    896                 'show_option_all' => __( $labels->all_items ),
     979                'show_option_all'  => __( $labels->all_items ),
    897980                'show_option_none' => __( $labels->no_terms ),
    898                 'hide_empty' => 0,
    899                 'hierarchical' => 1,
    900                 'show_count' => 0,
    901                 'taxonomy' => 'post_tag',
    902                 'name'=>'tag__in',
    903                 'orderby' => 'name',
    904                 'hide_if_empty' => true,
    905                 'selected' => $tag__in
     981                'hide_empty'       => 1,
     982                'hierarchical'     => 0,
     983                'show_count'       => 0,
     984                'taxonomy'         => 'post_tag',
     985                'name'             => 'tag__in',
     986                'orderby'          => 'name',
     987                'hide_if_empty'    => true,
     988                'selected'         => $tag__in
    906989            );
    907990            $filter_by_item = isset( get_taxonomy( 'post_tag' )->labels->filter_by_item )? get_taxonomy( 'post_tag' )->labels->filter_by_item: null;
     
    9791062                echo $output;
    9801063            }
     1064
     1065            // [2.4.0]
     1066            printf( '<a href="%s" class="button button-unfilter">%s</a>',
     1067                remove_query_arg( array( 'not', 'm', 'cat', 'tag__in', 'author', 'modified_author', 'paged', 'action', 'action2' ) ),
     1068                '<span class="dashicons dashicons-image-rotate"></span>' );
    9811069        }
    9821070    }
     
    10391127            if ( $this->has_edit_published_posts ) {    // [2.1.1]
    10401128                // [1.4.0] Add modified author link.
    1041                 $last_id = get_post_meta( $post->ID, '_edit_last', true );
     1129                $lock_id = get_post_meta( $post->ID, '_edit_lock', true );
     1130                if ( empty( $lock_id ) ) {
     1131                    $last_id = get_post_meta( $post->ID, '_edit_last', true );
     1132                } elseif ( false !== strpos( $lock_id, ':' ) ) {
     1133                    list( $last_access, $last_id ) = explode( ':', $lock_id );
     1134                }
    10421135                if ( $last_id ) {
    10431136                    $last_user = get_userdata( $last_id );
  • posts-filter-multiselect/trunk/readme.txt

    r3207255 r3241561  
    44Tags: posts
    55Requires at least: 4.1.0
    6 Tested up to: 6.7.1
    7 Stable tag: 2.3.0
     6Tested up to: 6.7.2
     7Stable tag: 2.4.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6464
    6565== Changelog ==
     66
     67= 2.4.0 =
     68* Added the ability to search using NOT conditions for each item.
     69* Fixed an issue where the name of the last editor was not displayed correctly.
     70* Added a "Unfilter" button.
     71* Modified to hide post tags that are not assigned to the post.
    6672
    6773= 2.3.0 =
Note: See TracChangeset for help on using the changeset viewer.