Title: get_all_user_settings
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_all_user_settings(): array

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#wp--skip-link--target)

Retrieves all user interface settings.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#return)󠁿

 array The last saved user settings or empty array.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#source)󠁿

    ```php
    function get_all_user_settings() {
    	global $_updated_user_settings;

    	$user_id = get_current_user_id();
    	if ( ! $user_id ) {
    		return array();
    	}

    	if ( isset( $_updated_user_settings ) && is_array( $_updated_user_settings ) ) {
    		return $_updated_user_settings;
    	}

    	$user_settings = array();

    	if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) {
    		$cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] );

    		if ( strpos( $cookie, '=' ) ) { // '=' cannot be 1st char.
    			parse_str( $cookie, $user_settings );
    		}
    	} else {
    		$option = get_user_option( 'user-settings', $user_id );

    		if ( $option && is_string( $option ) ) {
    			parse_str( $option, $user_settings );
    		}
    	}

    	$_updated_user_settings = $user_settings;
    	return $user_settings;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/option.php#L1828)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/option.php#L1828-L1858)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#related)󠁿

| Uses | Description | 
| [get_user_option()](https://developer.wordpress.org/reference/functions/get_user_option/)`wp-includes/user.php` |

Retrieves user option that can be either per Site or per Network.

  | 
| [get_current_user_id()](https://developer.wordpress.org/reference/functions/get_current_user_id/)`wp-includes/user.php` |

Gets the current user’s ID.

  |

| Used by | Description | 
| [get_user_setting()](https://developer.wordpress.org/reference/functions/get_user_setting/)`wp-includes/option.php` |

Retrieves user interface setting value based on setting name.

  | 
| [set_user_setting()](https://developer.wordpress.org/reference/functions/set_user_setting/)`wp-includes/option.php` |

Adds or updates user interface setting.

  | 
| [delete_user_setting()](https://developer.wordpress.org/reference/functions/delete_user_setting/)`wp-includes/option.php` |

Deletes user interface settings.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_all_user_settings/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_all_user_settings%2F)
before being able to contribute a note or feedback.