WordPress.org

Make WordPress Core

Ticket #43339: 43339.4.diff

File 43339.4.diff, 8.2 KB (added by zkancs, 16 months ago)
  • src/wp-admin/includes/ajax-actions.php

    diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
    index ab521ba0ad..5551fe2a61 100644
    a b function wp_ajax_get_community_events() { 
    304304                 * The location is stored network-wide, so that the user doesn't have to set it on each site.
    305305                 */
    306306                if ( $ip_changed || $search ) {
    307                         update_user_option( $user_id, 'community-events-location', $events['location'], true );
     307                        update_user_meta( $user_id, 'community-events-location', $events['location'] );
    308308                }
    309309
    310310                wp_send_json_success( $events );
    function wp_ajax_closed_postboxes() { 
    15451545        }
    15461546
    15471547        if ( is_array( $closed ) ) {
    1548                 update_user_option( $user->ID, "closedpostboxes_$page", $closed, true );
     1548                update_user_meta( $user->ID, "closedpostboxes_$page", $closed );
    15491549        }
    15501550
    15511551        if ( is_array( $hidden ) ) {
    15521552                $hidden = array_diff( $hidden, array( 'submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu' ) ); // postboxes that are always shown
    1553                 update_user_option( $user->ID, "metaboxhidden_$page", $hidden, true );
     1553                update_user_meta( $user->ID, "metaboxhidden_$page", $hidden );
    15541554        }
    15551555
    15561556        wp_die( 1 );
    function wp_ajax_hidden_columns() { 
    15741574        }
    15751575
    15761576        $hidden = ! empty( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array();
    1577         update_user_option( $user->ID, "manage{$page}columnshidden", $hidden, true );
     1577        update_user_meta( $user->ID, "manage{$page}columnshidden", $hidden );
    15781578
    15791579        wp_die( 1 );
    15801580}
    function wp_ajax_meta_box_order() { 
    17271727        }
    17281728
    17291729        if ( $order ) {
    1730                 update_user_option( $user->ID, "meta-box-order_$page", $order, true );
     1730                update_user_meta( $user->ID, "meta-box-order_$page", $order );
    17311731        }
    17321732
    17331733        if ( $page_columns ) {
    1734                 update_user_option( $user->ID, "screen_layout_$page", $page_columns, true );
     1734                update_user_meta( $user->ID, "screen_layout_$page", $page_columns );
    17351735        }
    17361736
    17371737        wp_die( 1 );
  • src/wp-admin/includes/nav-menu.php

    diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php
    index 5b8bfd7e00..7d1fdc3f6c 100644
    a b function wp_nav_menu_setup() { 
    148148        // If first time editing, disable advanced items by default.
    149149        if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
    150150                $user = wp_get_current_user();
    151                 update_user_option(
     151                update_user_meta(
    152152                        $user->ID, 'managenav-menuscolumnshidden',
    153153                        array(
    154154                                0 => 'link-target',
    function wp_nav_menu_setup() { 
    156156                                2 => 'xfn',
    157157                                3 => 'description',
    158158                                4 => 'title-attribute',
    159                         ),
    160                         true
     159                        )
    161160                );
    162161        }
    163162}
    function wp_initial_nav_menu_meta_boxes() { 
    192191        }
    193192
    194193        $user = wp_get_current_user();
    195         update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
     194        update_user_meta( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes );
    196195}
    197196
    198197/**
  • src/wp-admin/includes/upgrade.php

    diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
    index 7ab369dc7b..d81908fec2 100644
    a b if ( ! function_exists( 'wp_install' ) ) : 
    7979                        $user_password = wp_generate_password( 12, false );
    8080                        $message       = __( '<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.' );
    8181                        $user_id       = wp_create_user( $user_name, $user_password, $user_email );
    82                         update_user_option( $user_id, 'default_password_nag', true, true );
     82                        update_user_meta( $user_id, 'default_password_nag', true );
    8383                        $email_password = true;
    8484                } elseif ( ! $user_id ) {
    8585                        // Password has been provided
  • src/wp-admin/includes/user.php

    diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php
    index 269d64fb26..073f087d1a 100644
    a b function default_password_nag_handler( $errors = false ) { 
    464464        // get_user_setting = JS saved UI setting. else no-js-fallback code.
    465465        if ( 'hide' == get_user_setting( 'default_password_nag' ) || isset( $_GET['default_password_nag'] ) && '0' == $_GET['default_password_nag'] ) {
    466466                delete_user_setting( 'default_password_nag' );
    467                 update_user_option( $user_ID, 'default_password_nag', false, true );
     467                update_user_meta( $user_ID, 'default_password_nag', false );
    468468        }
    469469}
    470470
    function default_password_nag_edit_user( $user_ID, $old_data ) { 
    485485        // Remove the nag if the password has been changed.
    486486        if ( $new_data->user_pass != $old_data->user_pass ) {
    487487                delete_user_setting( 'default_password_nag' );
    488                 update_user_option( $user_ID, 'default_password_nag', false, true );
     488                update_user_meta( $user_ID, 'default_password_nag', false );
    489489        }
    490490}
    491491
  • src/wp-admin/my-sites.php

    diff --git a/src/wp-admin/my-sites.php b/src/wp-admin/my-sites.php
    index 588afb06a0..97532470d2 100644
    a b if ( 'updateblogsettings' == $action && isset( $_POST['primary_blog'] ) ) { 
    2727
    2828        $blog = get_site( (int) $_POST['primary_blog'] );
    2929        if ( $blog && isset( $blog->domain ) ) {
    30                 update_user_option( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true );
     30                update_user_meta( $current_user->ID, 'primary_blog', (int) $_POST['primary_blog'] );
    3131                $updated = true;
    3232        } else {
    3333                wp_die( __( 'The primary site you chose does not exist.' ) );
  • src/wp-admin/network/site-new.php

    diff --git a/src/wp-admin/network/site-new.php b/src/wp-admin/network/site-new.php
    index bc4809e005..383d28ff3d 100644
    a b if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) { 
    139139        $wpdb->show_errors();
    140140        if ( ! is_wp_error( $id ) ) {
    141141                if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {
    142                         update_user_option( $user_id, 'primary_blog', $id, true );
     142                        update_user_meta( $user_id, 'primary_blog', $id );
    143143                }
    144144
    145145                wp_mail(
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 225f1869be..97a20b6ce9 100644
    a b function wp_localize_community_events() { 
    13111311         */
    13121312        if ( $saved_ip_address && $current_ip_address && $current_ip_address !== $saved_ip_address ) {
    13131313                $saved_location['ip'] = $current_ip_address;
    1314                 update_user_option( $user_id, 'community-events-location', $saved_location, true );
     1314                update_user_meta( $user_id, 'community-events-location', $saved_location );
    13151315        }
    13161316
    13171317        $events_client = new WP_Community_Events( $user_id, $saved_location );
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index dd5d5367ba..6ee1d2977d 100644
    a b function clean_user_cache( $user ) { 
    13701370
    13711371/**
    13721372 * Determines whether the given username exists.
    1373  * 
     1373 *
    13741374 * For more information on this and similar theme functions, check out
    1375  * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
     1375 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
    13761376 * Conditional Tags} article in the Theme Developer Handbook.
    13771377 *
    13781378 * @since 2.0.0
    function username_exists( $username ) { 
    14001400
    14011401/**
    14021402 * Determines whether the given email exists.
    1403  * 
     1403 *
    14041404 * For more information on this and similar theme functions, check out
    1405  * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ 
     1405 * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
    14061406 * Conditional Tags} article in the Theme Developer Handbook.
    14071407 *
    14081408 * @since 2.1.0
    function reset_password( $user, $new_pass ) { 
    23762376        do_action( 'password_reset', $user, $new_pass );
    23772377
    23782378        wp_set_password( $new_pass, $user->ID );
    2379         update_user_option( $user->ID, 'default_password_nag', false, true );
     2379        update_user_meta( $user->ID, 'default_password_nag', false );
    23802380
    23812381        /**
    23822382         * Fires after the user's password is reset.
    function register_new_user( $user_login, $user_email ) { 
    24802480                return $errors;
    24812481        }
    24822482
    2483         update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.
     2483        update_user_meta( $user->ID, 'default_password_nag', true ); //Set up the Password change nag.
    24842484
    24852485        /**
    24862486         * Fires after a new user registration has been recorded.