Changeset 2639094
- Timestamp:
- 12/03/2021 12:22:57 PM (4 years ago)
- Location:
- wp-category-sort/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
wp-category-sort.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-category-sort/trunk/readme.txt
r2636439 r2639094 4 4 Requires at least: 2.8 5 5 Tested up to: 5.8.1 6 Stable tag: 2.0. 26 Stable tag: 2.0.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wp-category-sort/trunk/wp-category-sort.php
r2636439 r2639094 4 4 Plugin URI: https://wordpress.org/plugins/wp-category-sort/ 5 5 Description: The WP Category Sort plugin allows you to easily reorder your categories the way you want via drag and drop. 6 Version: 2.0. 26 Version: 2.0.3 7 7 Author: Lovin Nagi 8 8 Author URI: https://profiles.wordpress.org/lovinnagi … … 130 130 if ( ! wp_verify_nonce( $_POST['_nonce'], 'update-category-order' ) ) 131 131 die(); 132 133 // Set your custom capability through this filter.134 $custom_cap = apply_filters( 'wpcatsort_custom_cap', 'manage_categories' );135 132 136 if ( ! current_user_can( $custom_cap) ) {133 if ( ! current_user_can( 'manage_options' ) ) { 137 134 die(esc_html__( 'You need a higher level of permission.', 'wpcatsort' )); 138 135 } … … 149 146 foreach ($items as $item_key => $item_) 150 147 { 151 $items[ $item_key] = trim(str_replace("item[]=", "",$item_));148 $items[sanitize_text_field( $item_key )] = trim( str_replace("item[]=", "", sanitize_text_field( $item_ ))); 152 149 } 153 150 … … 155 152 foreach( $items as $item_key => $term_id ) 156 153 { 157 $wpdb->update( $wpdb->terms, array('term_order' => ($item_key + 1)), array('term_id' => $term_id) );154 $wpdb->update( $wpdb->terms, array('term_order' => ($item_key + 1)), array('term_id' => $term_id), array( '%d' ), array( '%d' ) ) ; 158 155 } 159 156 } … … 177 174 register_activation_hook( __FILE__, array ($wpCategorySort , 'activate' ) ); 178 175 } 179 180 181 182 183 184 185 186 187 188 189 190 191 192
Note: See TracChangeset
for help on using the changeset viewer.