Changeset 2896523
- Timestamp:
- 04/10/2023 10:10:45 AM (3 years ago)
- Location:
- smart-admin-search/trunk
- Files:
-
- 6 edited
-
README.txt (modified) (2 diffs)
-
includes/class-smart-admin-search-functions.php (modified) (1 diff)
-
languages/smart-admin-search-it_IT.mo (modified) (previous)
-
languages/smart-admin-search-it_IT.po (modified) (3 diffs)
-
languages/smart-admin-search.pot (modified) (3 diffs)
-
smart-admin-search.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
smart-admin-search/trunk/README.txt
r2799636 r2896523 3 3 Tags: search, admin, dashboard 4 4 Requires at least: 5.0 5 Tested up to: 6. 15 Tested up to: 6.2 6 6 Requires PHP: 5.6 7 Stable tag: 1.4. 07 Stable tag: 1.4.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 91 91 == Changelog == 92 92 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 93 98 **1.4.0 [2022-10-16]** 94 99 -
smart-admin-search/trunk/includes/class-smart-admin-search-functions.php
r2799636 r2896523 595 595 ); 596 596 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 } 643 645 } 644 646 } -
smart-admin-search/trunk/languages/smart-admin-search-it_IT.po
r2799636 r2896523 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Smart Admin Search 1.4. 0\n"5 "Project-Id-Version: Smart Admin Search 1.4.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-admin-" 7 7 "search\n" 8 "POT-Creation-Date: 202 2-10-16T15:31:10+00:00\n"9 "PO-Revision-Date: 202 2-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" 10 10 "Last-Translator: Andrea Porotti <[email protected]>\n" 11 11 "Language-Team: \n" … … 15 15 "Content-Transfer-Encoding: 8bit\n" 16 16 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 "X-Generator: Poedit 3. 1.1\n"17 "X-Generator: Poedit 3.2.2\n" 18 18 "X-Domain: smart-admin-search\n" 19 19 … … 231 231 #: includes/class-smart-admin-search-functions.php:403 232 232 #: includes/class-smart-admin-search-functions.php:536 233 #: includes/class-smart-admin-search-functions.php:61 8233 #: includes/class-smart-admin-search-functions.php:619 234 234 msgid "(no title)" 235 235 msgstr "(senza titolo)" -
smart-admin-search/trunk/languages/smart-admin-search.pot
r2799636 r2896523 1 # Copyright (C) 202 2Andrea Porotti1 # Copyright (C) 2023 Andrea Porotti 2 2 # This file is distributed under the GPL-2.0+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Smart Admin Search 1.4. 0\n"5 "Project-Id-Version: Smart Admin Search 1.4.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smart-admin-search\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 2-10-16T15:31:10+00:00\n"12 "POT-Creation-Date: 2023-04-10T09:44:45+00:00\n" 13 13 "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" 15 15 "X-Domain: smart-admin-search\n" 16 16 … … 203 203 #: includes/class-smart-admin-search-functions.php:403 204 204 #: includes/class-smart-admin-search-functions.php:536 205 #: includes/class-smart-admin-search-functions.php:61 8205 #: includes/class-smart-admin-search-functions.php:619 206 206 msgid "(no title)" 207 207 msgstr "" -
smart-admin-search/trunk/smart-admin-search.php
r2799636 r2896523 4 4 * Plugin URI: https://github.com/andreaporotti/smart-admin-search 5 5 * Description: A search engine to quickly find elements and contents inside the WordPress dashboard. 6 * Version: 1.4. 06 * Version: 1.4.1 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 5.6
Note: See TracChangeset
for help on using the changeset viewer.