Plugin Directory

Changeset 3207254


Ignore:
Timestamp:
12/12/2024 11:37:03 PM (16 months ago)
Author:
de-ce
Message:

fix: minor warnings from plugin check

Location:
empty-tags-remover
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • empty-tags-remover/trunk/empty-tags-remover.php

    r3207250 r3207254  
    44Plugin URI: https://wordpress.org/plugins/empty-tags-remover/
    55Description: Removes the empty tags, tags with no posts attached.
    6 Version: 1.1.0
     6Version: 1.2.0
    77Author: Dan - Lucian Stefancu
    88Author URI: https://ospitalier.ro/
     9License: GPLv2 or later
    910*/
    1011
     
    2526        if(empty($_POST['remove_my_empty_tags'])) {
    2627
    27             $args = array('offset' => 0, 'number' => 0, 'hide_empty' => 0);
    28 
    29             $tags = get_terms( 'post_tag', $args );
     28            $tags = $tags = get_terms( array(
     29                'taxonomy'   => 'post_tag',
     30                'hide_empty' => false,
     31            ) );
    3032
    3133            $count_tags = count($tags);
     
    3537                foreach ($tags as $tag) {
    3638                    if ($tag->count == 0) {
    37                         echo "<li><a href='edit-tags.php?action=edit&amp;taxonomy=post_tag&amp;tag_ID=$tag->term_id'>" . $tag->name . "</a></li>\n";
     39                        echo esc_html("<li><a href='edit-tags.php?action=edit&amp;taxonomy=post_tag&amp;tag_ID=$tag->term_id'>" . $tag->name . "</a></li>\n");
    3840                    }
    3941                }
     
    5153            }
    5254        } else {
    53             $args = array('offset' => 0, 'number' => 0, 'hide_empty' => 0);
    5455
    55             $tags = get_terms( 'post_tag', $args );
     56            $tags = get_terms( array(
     57                'taxonomy'   => 'post_tag',
     58                'hide_empty' => false,
     59            ) );
    5660            $count_tags = 0;
    5761            echo '<ul>';
     
    5963                if ($tag->count == 0) {
    6064                    wp_delete_term($tag->term_id,'post_tag');
    61                     echo "<li>" . $tag->name . " deleted</li>";
     65                    echo "<li>" . esc_html($tag->name) . " deleted</li>";
    6266                    $count_tags++;
    6367                }
    6468            }
    6569            echo '</ul>';
    66             echo '<strong>' . $count_tags . " empty tags deleted</strong>";
     70            echo sprintf("<strong>%s empty tags deleted</strong>", esc_html($count_tags)) ;
    6771        }
    6872        ?>
  • empty-tags-remover/trunk/readme.txt

    r3207250 r3207254  
    44Requires at least: 2.5
    55Tested up to: 6.7.1
    6 Stable tag: 1.1.0
     6Stable tag: 1.2.0
     7License: GPLv2 or later
    78
    89Removes the empty tags, tags with no posts attached.
Note: See TracChangeset for help on using the changeset viewer.