Plugin Directory

Changeset 2639094


Ignore:
Timestamp:
12/03/2021 12:22:57 PM (4 years ago)
Author:
Lovinnagi
Message:

Minor Code Updates

Location:
wp-category-sort/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-category-sort/trunk/readme.txt

    r2636439 r2639094  
    44Requires at least: 2.8
    55Tested up to: 5.8.1
    6 Stable tag: 2.0.2
     6Stable tag: 2.0.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wp-category-sort/trunk/wp-category-sort.php

    r2636439 r2639094  
    44Plugin URI: https://wordpress.org/plugins/wp-category-sort/
    55Description: The WP Category Sort plugin allows you to easily reorder your categories the way you want via drag and drop.
    6 Version: 2.0.2
     6Version: 2.0.3
    77Author: Lovin Nagi
    88Author URI: https://profiles.wordpress.org/lovinnagi
     
    130130            if ( ! wp_verify_nonce( $_POST['_nonce'], 'update-category-order' ) )
    131131            die();
    132 
    133             // Set your custom capability through this filter.
    134             $custom_cap = apply_filters( 'wpcatsort_custom_cap', 'manage_categories' );
    135132           
    136             if ( ! current_user_can( $custom_cap ) ) {
     133            if ( ! current_user_can( 'manage_options' ) ) {
    137134                die(esc_html__( 'You need a higher level of permission.', 'wpcatsort' ));
    138135            }
     
    149146                    foreach ($items as $item_key => $item_)
    150147                        {
    151                             $items[$item_key] = trim(str_replace("item[]=", "",$item_));
     148                            $items[sanitize_text_field( $item_key )] = trim( str_replace("item[]=", "", sanitize_text_field( $item_ )));
    152149                        }
    153150                   
     
    155152                    foreach( $items as $item_key => $term_id )
    156153                        {
    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' ) )  ;
    158155                        }
    159156                }
     
    177174    register_activation_hook( __FILE__, array ($wpCategorySort , 'activate' ) );
    178175}
    179 
    180 
    181 
    182 
    183 
    184 
    185 
    186 
    187 
    188 
    189 
    190        
    191  
    192 
Note: See TracChangeset for help on using the changeset viewer.