Changeset 3185072
- Timestamp:
- 11/10/2024 11:26:10 AM (17 months ago)
- Location:
- ts-search-slug
- Files:
-
- 6 added
- 2 edited
-
tags/1.0.4 (added)
-
tags/1.0.4/index.php (added)
-
tags/1.0.4/languages (added)
-
tags/1.0.4/license.txt (added)
-
tags/1.0.4/plugin.php (added)
-
tags/1.0.4/readme.txt (added)
-
trunk/plugin.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ts-search-slug/trunk/plugin.php
r2669765 r3185072 3 3 Plugin Name: TS Search Slug 4 4 Plugin URI: https://www.spiess-informatik.de/wordpress-plugins/ 5 License: GPLv3 (license.txt)5 License: GPLv3 6 6 Description: Search for Slug in Admin Post/Page Overview and add Slug Column to Post/Page Overview 7 7 Author: Tobias Spiess 8 8 Author URI: https://www.spiess-informatik.de 9 Version: 1.0. 310 Text-Domain: ts inf_search_plugin_textdomain9 Version: 1.0.4 10 Text-Domain: ts-search-slug 11 11 Domain Path: /languages 12 12 */ … … 16 16 */ 17 17 function tsinf_search_slug_load_plugin_textdomain() { 18 load_plugin_textdomain( 'ts inf_search_plugin_textdomain', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );18 load_plugin_textdomain( 'ts-search-slug', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 19 19 } 20 20 add_action( 'plugins_loaded', 'tsinf_search_slug_load_plugin_textdomain' ); … … 70 70 public static function render_main_page() { 71 71 if ( !current_user_can( 'edit_posts' ) ) { 72 wp_die( __('You do not have sufficient permissions to access this page.', 'tsinf_customstyle_plugin_textdomain'));72 wp_die( esc_html__('You do not have sufficient permissions to access this page.', 'ts-search-slug')); 73 73 } 74 74 75 75 ?> 76 <h1><?php _e('TS Search Slug', 'tsinf_search_plugin_textdomain'); ?></h1>76 <h1><?php esc_html_e('TS Search Slug', 'ts-search-slug'); ?></h1> 77 77 78 78 <form method="POST" action="options.php"> … … 90 90 add_settings_section( 91 91 'ts_search_slug_plugin_main_section', 92 __('Allgemein', 'ts inf_search_plugin_textdomain'),92 __('Allgemein', 'ts-search-slug'), 93 93 array('TS_Search_Slug', 'render_options_page_main_section'), 94 94 'ts_search_slug' … … 97 97 add_settings_field( 98 98 'ts_search_slug_post_types', 99 __('Enable Post Slug Functionality for Custom Post Types', 'ts inf_search_plugin_textdomain'),99 __('Enable Post Slug Functionality for Custom Post Types', 'ts-search-slug'), 100 100 array('TS_Search_Slug', 'render_options_page_field_post_types'), 101 101 'ts_search_slug', … … 140 140 ?> 141 141 <div class="tsinf_search_slug_line"> 142 <input type="checkbox" name="ts_search_slug_settings[post_types][]" <?php echo $checked; ?> value="<?php echo $post_type->name; ?>" />143 <span class="label"><?php echo $post_type->label; ?> (<?php echo $post_type->name; ?>)</span>142 <input type="checkbox" name="ts_search_slug_settings[post_types][]" <?php echo esc_attr($checked); ?> value="<?php echo esc_attr($post_type->name); ?>" /> 143 <span class="label"><?php echo esc_html($post_type->label); ?> (<?php echo esc_attr($post_type->name); ?>)</span> 144 144 </div> 145 145 <?php … … 157 157 */ 158 158 public static function append_admin_columns($columns) { 159 $columns['ts_search_slug_post_name'] = __('Postname/Slug', 'ts inf_search_plugin_textdomain');159 $columns['ts_search_slug_post_name'] = __('Postname/Slug', 'ts-search-slug'); 160 160 161 161 return $columns; … … 172 172 173 173 case 'ts_search_slug_post_name': 174 echo basename(get_permalink());174 echo esc_attr(basename(get_permalink())); 175 175 break; 176 176 … … 202 202 if(isset($_GET['post_type'])) 203 203 { 204 $post_type = htmlspecialchars(strip_tags($_GET['post_type']));204 $post_type = wp_strip_all_tags(wp_unslash($_GET['post_type'])); 205 205 } 206 206 … … 212 212 } 213 213 214 if(is_admin() && 'edit.php' === $pagenow && isset($_GET['s']) && is_string($_GET['s']) && strlen($_GET['s']) && ($post_type === 'post' || $post_type === 'page' || in_array($post_type, $activated_cpts))) 214 $search = (isset($_GET['s'])) ? sanitize_text_field(wp_unslash($_GET['s'])) : ''; 215 if(is_admin() && 'edit.php' === $pagenow && is_string($search) && strlen($search) > 0 && ($post_type === 'post' || $post_type === 'page' || in_array($post_type, $activated_cpts))) 215 216 { 216 217 global $wpdb; 217 218 218 $like = '%' . $wpdb->esc_like($ _GET['s']) . '%';219 $like = '%' . $wpdb->esc_like($search) . '%'; 219 220 $like_term = $wpdb->prepare("({$wpdb->posts}.post_name LIKE %s)", $like); 220 221 -
ts-search-slug/trunk/readme.txt
r3130337 r3185072 3 3 Tags: post, slug 4 4 Requires at least: 4.8 5 Tested up to: 6.5 6 Stable Tag: 4.9 5 Tested up to: 6.6 6 Stable Tag: 1.0.4 7 License: GPLv3 7 8 Creation time: 01.05.2018 8 Last updated time: 21.01.20229 Last updated time: 10.11.2024 9 10 10 11 Search for Slug in Admin Post/Page Overview and add Slug Column to Post/Page Overview. … … 20 21 21 22 == Changelog == 23 * 1.0.4 24 WP Plugin Check related fixes 25 22 26 * 1.0.3 23 27 Fix PHP Warning "Parameter 2 to posts_where() expected to be a reference, value given"
Note: See TracChangeset
for help on using the changeset viewer.