Changeset 2841860
- Timestamp:
- 12/31/2022 05:29:47 PM (3 years ago)
- Location:
- edit-custom-fields/trunk
- Files:
-
- 2 edited
-
edit-custom-fields.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
edit-custom-fields/trunk/edit-custom-fields.php
r2438021 r2841860 4 4 Plugin URI: 5 5 Description: A simple interface to edit or delete Custom Fields. 6 Version: 0.1. 76 Version: 0.1.8 7 7 Author: Jay Sitter 8 8 Author URI: http://www.jaysitter.com/ … … 28 28 29 29 if ( isset( $_POST['delete'] ) ) { // If the user has confirmed a delete action 30 $nonce = $_REQUEST['_wpnonce']; 30 31 31 32 if ( $_POST['delete'] == 'confirm' ) { 32 33 33 if ( ! check_admin_referer('ecf_delete') ) {34 if ( !wp_verify_nonce( $nonce, 'ecf_delete') ) { 34 35 die( __( 'Nonce doesn’t match', 'ecf' ) ); 35 36 } … … 46 47 47 48 if ( $_POST['rename'] == 'confirm' || $_POST['rename'] == 'undo' ) { 48 49 if ( !check_admin_referer('ecf_rename' ) ) { 49 $nonce = $_REQUEST['_wpnonce']; 50 51 if ( !wp_verify_nonce( $nonce, 'ecf_rename') ) { 50 52 die( __( 'Nonce doesn’t match', 'ecf' ) ); 51 53 } … … 62 64 $existing = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '%s'", $value ) ); 63 65 if ( count( $existing ) > 0 ) { 64 echo '<p style="color:red;">', __( 'The Custom Field', 'ecf' ), ' "', $key, '" ', __( 'could not be renamed to', 'ecf' ), ' "', $value, '" ', __( 'because a Custom Field with that key already exists.', 'ecf'), '</p>';66 echo '<p style="color:red;">', sprintf( __( 'The Custom Field "%s" could not be renamed to "%s" because a Custom Field with that key already exists.', 'ecf' ), $key, $value ), '</p>'; 65 67 } else { 66 68 $wpdb->update( $wpdb->postmeta, array( 'meta_key' => $value ), array( 'meta_key' => $key ) ); 67 echo '<p>', __( 'The Custom Field', 'ecf' ), ' "', $key, '" ', __( 'was renamed to', 'ecf' ), ' "', $value, '" .</p>';69 echo '<p>', sprintf( __( 'The Custom Field "%s" was renamed to "%s".', 'ecf'), $key, $value ), '</p>'; 68 70 $success = true; 69 71 } -
edit-custom-fields/trunk/readme.txt
r2438021 r2841860 3 3 Tags: custom fields, customfields, custom field, customfield, admin 4 4 Requires at least: 3.5.1 5 Tested up to: 5.5.36 Stable tag: 0.1. 75 Tested up to: 6.1.1 6 Stable tag: 0.1.8 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 32 32 33 33 == Changelog == 34 35 = 0.1.8 = 36 37 - Use wp_verify_nonce to protect against CSRF 38 - Use sprintf for translations. 34 39 35 40 = 0.1.7 =
Note: See TracChangeset
for help on using the changeset viewer.