🔥 HOT: Changeset/ - Full Archive

Changeset 2896523


Ignore:
Timestamp:
04/10/2023 10:10:45 AM (3 years ago)
Author:
andreaporotti
Message:

Updating to version 1.4.1.

Location:
smart-admin-search/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • smart-admin-search/trunk/README.txt

    r2799636 r2896523  
    33Tags: search, admin, dashboard
    44Requires at least: 5.0
    5 Tested up to: 6.1
     5Tested up to: 6.2
    66Requires PHP: 5.6
    7 Stable tag: 1.4.0
     7Stable tag: 1.4.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9191== Changelog ==
    9292
     93**1.4.1 [2023-04-10]**
     94- Fixed a bug in the search when the site has no custom post types.
     95- Tested on WordPress 6.2.
     96- Tested on PHP 8.0.
     97
    9398**1.4.0 [2022-10-16]**
    9499
  • smart-admin-search/trunk/includes/class-smart-admin-search-functions.php

    r2799636 r2896523  
    595595            );
    596596
    597             $cpt_names = array_keys( $cpt_obj );
    598 
    599             // Search custom post types posts.
    600             $args = array(
    601                 'post_type'      => $cpt_names,
    602                 'post_status'    => 'any',
    603                 'posts_per_page' => -1,
    604                 's'              => $query,
    605                 'orderby'        => 'title',
    606                 'order'          => 'ASC',
    607                 'perm'           => 'editable',
    608             );
    609 
    610             $posts_query = new WP_Query( $args );
    611             $posts       = $posts_query->posts;
    612             wp_reset_postdata();
    613 
    614             foreach ( $posts as $post ) {
    615                 // Skip this post if it's private and the user can't access private posts.
    616                 if ( ! ( 'private' === $post->post_status && ! current_user_can( 'read_private_posts' ) ) ) {
    617 
    618                     $text = ( ! empty( $post->post_title ) ) ? $post->post_title : esc_html__( '(no title)', 'smart-admin-search' );
    619 
    620                     if ( 'publish' !== $post->post_status ) {
    621                         $post_status = get_post_status_object( $post->post_status )->label;
    622                         $text       .= ' (' . $post_status . ')';
    623                     }
    624 
    625                     $link_url = get_edit_post_link( $post->ID, '' );
    626 
    627                     if ( empty( $link_url ) && 'draft' !== $post->post_status ) {
    628                         $link_url = get_the_permalink( $post->ID );
    629                     }
    630 
    631                     $cpt_icon   = $cpt_obj[ $post->post_type ]->menu_icon;
    632                     $icon_class = ( ! empty( $cpt_icon ) ) ? $cpt_icon : 'dashicons-admin-post';
    633                     $style      = '';
    634 
    635                     // Add the item to search results.
    636                     $search_results[] = array(
    637                         'text'        => $text,
    638                         'description' => $cpt_obj[ $post->post_type ]->labels->singular_name,
    639                         'link_url'    => ( ! empty( $link_url ) ) ? $link_url : '',
    640                         'icon_class'  => $icon_class,
    641                         'style'       => $style,
    642                     );
     597            if ( ! empty( $cpt_obj ) ) {
     598                $cpt_names = array_keys( $cpt_obj );
     599
     600                // Search custom post types posts.
     601                $args = array(
     602                    'post_type'      => $cpt_names,
     603                    'post_status'    => 'any',
     604                    'posts_per_page' => -1,
     605                    's'              => $query,
     606                    'orderby'        => 'title',
     607                    'order'          => 'ASC',
     608                    'perm'           => 'editable',
     609                );
     610
     611                $posts_query = new WP_Query( $args );
     612                $posts       = $posts_query->posts;
     613                wp_reset_postdata();
     614
     615                foreach ( $posts as $post ) {
     616                    // Skip this post if it's private and the user can't access private posts.
     617                    if ( ! ( 'private' === $post->post_status && ! current_user_can( 'read_private_posts' ) ) ) {
     618
     619                        $text = ( ! empty( $post->post_title ) ) ? $post->post_title : esc_html__( '(no title)', 'smart-admin-search' );
     620
     621                        if ( 'publish' !== $post->post_status ) {
     622                            $post_status = get_post_status_object( $post->post_status )->label;
     623                            $text       .= ' (' . $post_status . ')';
     624                        }
     625
     626                        $link_url = get_edit_post_link( $post->ID, '' );
     627
     628                        if ( empty( $link_url ) && 'draft' !== $post->post_status ) {
     629                            $link_url = get_the_permalink( $post->ID );
     630                        }
     631
     632                        $cpt_icon   = $cpt_obj[ $post->post_type ]->menu_icon;
     633                        $icon_class = ( ! empty( $cpt_icon ) ) ? $cpt_icon : 'dashicons-admin-post';
     634                        $style      = '';
     635
     636                        // Add the item to search results.
     637                        $search_results[] = array(
     638                            'text'        => $text,
     639                            'description' => $cpt_obj[ $post->post_type ]->labels->singular_name,
     640                            'link_url'    => ( ! empty( $link_url ) ) ? $link_url : '',
     641                            'icon_class'  => $icon_class,
     642                            'style'       => $style,
     643                        );
     644                    }
    643645                }
    644646            }
  • smart-admin-search/trunk/languages/smart-admin-search-it_IT.po

    r2799636 r2896523  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Smart Admin Search 1.4.0\n"
     5"Project-Id-Version: Smart Admin Search 1.4.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-admin-"
    77"search\n"
    8 "POT-Creation-Date: 2022-10-16T15:31:10+00:00\n"
    9 "PO-Revision-Date: 2022-10-16 17:37+0200\n"
     8"POT-Creation-Date: 2023-04-10T09:44:45+00:00\n"
     9"PO-Revision-Date: 2023-04-10 11:49+0200\n"
    1010"Last-Translator: Andrea Porotti <[email protected]>\n"
    1111"Language-Team: \n"
     
    1515"Content-Transfer-Encoding: 8bit\n"
    1616"Plural-Forms: nplurals=2; plural=(n != 1);\n"
    17 "X-Generator: Poedit 3.1.1\n"
     17"X-Generator: Poedit 3.2.2\n"
    1818"X-Domain: smart-admin-search\n"
    1919
     
    231231#: includes/class-smart-admin-search-functions.php:403
    232232#: includes/class-smart-admin-search-functions.php:536
    233 #: includes/class-smart-admin-search-functions.php:618
     233#: includes/class-smart-admin-search-functions.php:619
    234234msgid "(no title)"
    235235msgstr "(senza titolo)"
  • smart-admin-search/trunk/languages/smart-admin-search.pot

    r2799636 r2896523  
    1 # Copyright (C) 2022 Andrea Porotti
     1# Copyright (C) 2023 Andrea Porotti
    22# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Smart Admin Search 1.4.0\n"
     5"Project-Id-Version: Smart Admin Search 1.4.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-admin-search\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2022-10-16T15:31:10+00:00\n"
     12"POT-Creation-Date: 2023-04-10T09:44:45+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.6.0\n"
     14"X-Generator: WP-CLI 2.7.1\n"
    1515"X-Domain: smart-admin-search\n"
    1616
     
    203203#: includes/class-smart-admin-search-functions.php:403
    204204#: includes/class-smart-admin-search-functions.php:536
    205 #: includes/class-smart-admin-search-functions.php:618
     205#: includes/class-smart-admin-search-functions.php:619
    206206msgid "(no title)"
    207207msgstr ""
  • smart-admin-search/trunk/smart-admin-search.php

    r2799636 r2896523  
    44 * Plugin URI:        https://github.com/andreaporotti/smart-admin-search
    55 * Description:       A search engine to quickly find elements and contents inside the WordPress dashboard.
    6  * Version:           1.4.0
     6 * Version:           1.4.1
    77 * Requires at least: 5.0
    88 * Requires PHP:      5.6
Note: See TracChangeset for help on using the changeset viewer.