[wp-trac] [WordPress Trac] #29505: Both update_user_option and update_user_meta returning false

WordPress Trac noreply at wordpress.org
Tue Aug 27 13:35:57 UTC 2019


#29505: Both update_user_option and update_user_meta returning false
--------------------------+---------------------
 Reporter:  miqdadk       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:
Component:  Users         |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+---------------------
Changes (by donmhico):

 * keywords:  needs-patch => close


Comment:

 Hello @miqdadk,

 Sorry if this ticket wasn't able to get much attention. I no longer able
 to reproduce the error in the latest trunk **5.3-alpha-45282-src**.

 This is the code i'm using.

 {{{#!php
 <?php
 /**
  * Plugin Name: Test Trac Bug # 29505
  * Plugin URI: https://core.trac.wordpress.org/ticket/29505
  */
 class test_plugin {
     function __construct(){
         register_activation_hook( __FILE__, array( $this,
 'plugin_activated'));
     }

     function plugin_activated(){
         $bgs = 'a:1:{i:0;s:93:"http://192.168.1.175/delta/wp4.0rc/wp-
 content/plugins/lock-it- up/templates/img/bg/default.jpg";}';
         $users = get_users( array( 'fields' => array( 'ID' ) ) );
         foreach( $users as $user ){
             $a = delete_user_meta( $user->ID, 'wp-lock-bg');
             $b = update_user_meta( $user->ID, 'wp-lock-bg', $bgs);

             if ( $a ) {
                 error_log( 'a TRUE' );
             }
             else {
                 error_log( 'a FALSE' );
             }

             if ( $b ) {
                 error_log( 'b TRUE' );
             }
             else {
                 error_log( 'b FALSE' );
             }
         }
     }
 }

 new test_plugin;
 }}}

 I used both `delete_user_option` and `delete_user_meta`, as well as
 `update_user_meta` and `update_user_option`. The functions are behaving as
 intended.

 Unfortunately, I can't find the ChangeSet that might have resolved this
 issue. Seeing that this ticket didn't have any interaction for the past 5
 years, I'll be marking this as close.

 Feel free to reopen if the issue still persist in your side.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/29505#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list