[wp-trac] [WordPress Trac] #40379: newticket#ticket

WordPress Trac noreply at wordpress.org
Fri Apr 7 04:29:55 UTC 2017


#40379: newticket#ticket
-------------------------------------------------+-------------------------
 Reporter:  adminhoang                           |      Owner:
     Type:  defect (bug)                         |     Status:  new
 Priority:  normal                               |  Milestone:  Awaiting
Component:  General                              |  Review
 Severity:  normal                               |    Version:  trunk
  Focuses:  javascript, docs, administration,    |   Keywords:
  template                                       |
-------------------------------------------------+-------------------------
 //Fetch ALL dashboard widget options from the db...
     $opts = get_option( 'dashboard_widget_options' );

     //Get just our widget's options, or set empty array
     $w_opts = ( isset( $opts[$widget_id] ) ) ? $opts[$widget_id] :
 array();

     if ( $add_only ) {
         //Flesh out any missing options (existing ones overwrite new ones)
         $opts[$widget_id] = array_merge($args,$w_opts);
     }
     else {
         //Merge new options with existing ones, and add it back to the
 widgets array
         $opts[$widget_id] = array_merge($w_opts,$args);
     }

     //Save the entire widgets array back to the db
     return update_option('dashboard_widget_options', $opts);
 }

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40379>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list