| 1 |
<?php |
| 2 |
/** |
| 3 |
* Gets UsersWP setting value using key. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
* @package userswp |
| 7 |
* |
| 8 |
* @param string $key Setting Key. |
| 9 |
* @param bool|string $default Default value. |
| 10 |
* @param bool $cache Use cache to retrieve the value?. |
| 11 |
* |
| 12 |
* @return string Setting Value. |
| 13 |
*/ |
| 14 |
function uwp_get_option( $key = '', $default = false, $cache = true ) { |
| 15 |
$meta = new UsersWP_Meta(); |
| 16 |
return $meta->get_option($key, $default, $cache); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Updates UsersWP setting value using key. |
| 21 |
* |
| 22 |
* @since 1.0.0 |
| 23 |
* @package userswp |
| 24 |
* |
| 25 |
* @param string|bool $key Setting Key. |
| 26 |
* @param string $value Setting Value. |
| 27 |
* |
| 28 |
* @return bool Update success or not?. |
| 29 |
*/ |
| 30 |
function uwp_update_option( $key = false, $value = '') { |
| 31 |
$meta = new UsersWP_Meta(); |
| 32 |
return $meta->update_option($key, $value); |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* Gets UsersWP user meta value using key. |
| 37 |
* |
| 38 |
* @since 1.0.0 |
| 39 |
* @package userswp |
| 40 |
* |
| 41 |
* @param int|bool $user_id User ID. |
| 42 |
* @param string $key User meta Key. |
| 43 |
* @param bool|string $default Default value. |
| 44 |
* |
| 45 |
* @return string User meta Value. |
| 46 |
*/ |
| 47 |
function uwp_get_usermeta( $user_id = false, $key = '', $default = false ) { |
| 48 |
$meta = new UsersWP_Meta(); |
| 49 |
return $meta->get_usermeta($user_id, $key, $default); |
| 50 |
} |
| 51 |
|
| 52 |
/** |
| 53 |
* Updates UsersWP user meta value using key. |
| 54 |
* |
| 55 |
* @since 1.0.0 |
| 56 |
* @package userswp |
| 57 |
* |
| 58 |
* @param int|bool $user_id User ID. |
| 59 |
* @param string|bool $key User meta Key. |
| 60 |
* @param string $value User meta Value. |
| 61 |
* |
| 62 |
* @return bool Update success or not?. |
| 63 |
*/ |
| 64 |
function uwp_update_usermeta( $user_id = false, $key, $value ) { |
| 65 |
$meta = new UsersWP_Meta(); |
| 66 |
return $meta->update_usermeta($user_id, $key, $value); |
| 67 |
} |
| 68 |
|
| 69 |
/** |
| 70 |
* Gets UsersWP user meta row using user ID. |
| 71 |
* |
| 72 |
* @since 1.0.0 |
| 73 |
* @package userswp |
| 74 |
* |
| 75 |
* @param int|bool $user_id User ID. |
| 76 |
* |
| 77 |
* @return object|bool User meta row object. |
| 78 |
*/ |
| 79 |
function uwp_get_usermeta_row($user_id = false) { |
| 80 |
$meta = new UsersWP_Meta(); |
| 81 |
return $meta->get_usermeta_row($user_id); |
| 82 |
} |
| 83 |
|
| 84 |
/** |
| 85 |
* Deletes a UsersWP meta row using the user ID. |
| 86 |
* |
| 87 |
* @since 1.0.5 |
| 88 |
* @package UsersWP |
| 89 |
* |
| 90 |
* @param int|bool $user_id User ID. |
| 91 |
* |
| 92 |
* @return void |
| 93 |
*/ |
| 94 |
function uwp_delete_usermeta_row($user_id = false) { |
| 95 |
$meta = new UsersWP_Meta(); |
| 96 |
$meta->delete_usermeta_row($user_id); |
| 97 |
} |