Changeset 3207254
- Timestamp:
- 12/12/2024 11:37:03 PM (16 months ago)
- Location:
- empty-tags-remover
- Files:
-
- 3 added
- 2 edited
-
tags/1.2.0 (added)
-
tags/1.2.0/empty-tags-remover.php (added)
-
tags/1.2.0/readme.txt (added)
-
trunk/empty-tags-remover.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
empty-tags-remover/trunk/empty-tags-remover.php
r3207250 r3207254 4 4 Plugin URI: https://wordpress.org/plugins/empty-tags-remover/ 5 5 Description: Removes the empty tags, tags with no posts attached. 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Dan - Lucian Stefancu 8 8 Author URI: https://ospitalier.ro/ 9 License: GPLv2 or later 9 10 */ 10 11 … … 25 26 if(empty($_POST['remove_my_empty_tags'])) { 26 27 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 ) ); 30 32 31 33 $count_tags = count($tags); … … 35 37 foreach ($tags as $tag) { 36 38 if ($tag->count == 0) { 37 echo "<li><a href='edit-tags.php?action=edit&taxonomy=post_tag&tag_ID=$tag->term_id'>" . $tag->name . "</a></li>\n";39 echo esc_html("<li><a href='edit-tags.php?action=edit&taxonomy=post_tag&tag_ID=$tag->term_id'>" . $tag->name . "</a></li>\n"); 38 40 } 39 41 } … … 51 53 } 52 54 } else { 53 $args = array('offset' => 0, 'number' => 0, 'hide_empty' => 0);54 55 55 $tags = get_terms( 'post_tag', $args ); 56 $tags = get_terms( array( 57 'taxonomy' => 'post_tag', 58 'hide_empty' => false, 59 ) ); 56 60 $count_tags = 0; 57 61 echo '<ul>'; … … 59 63 if ($tag->count == 0) { 60 64 wp_delete_term($tag->term_id,'post_tag'); 61 echo "<li>" . $tag->name. " deleted</li>";65 echo "<li>" . esc_html($tag->name) . " deleted</li>"; 62 66 $count_tags++; 63 67 } 64 68 } 65 69 echo '</ul>'; 66 echo '<strong>' . $count_tags . " empty tags deleted</strong>";70 echo sprintf("<strong>%s empty tags deleted</strong>", esc_html($count_tags)) ; 67 71 } 68 72 ?> -
empty-tags-remover/trunk/readme.txt
r3207250 r3207254 4 4 Requires at least: 2.5 5 5 Tested up to: 6.7.1 6 Stable tag: 1.1.0 6 Stable tag: 1.2.0 7 License: GPLv2 or later 7 8 8 9 Removes the empty tags, tags with no posts attached.
Note: See TracChangeset
for help on using the changeset viewer.