| @@ 339-354 (lines=16) @@ | ||
| 336 | return $updated_num; |
|
| 337 | } |
|
| 338 | ||
| 339 | private function read_option( $name, $default = null ) { |
|
| 340 | global $wpdb; |
|
| 341 | $value = $wpdb->get_var( |
|
| 342 | $wpdb->prepare( |
|
| 343 | "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", |
|
| 344 | $name |
|
| 345 | ) |
|
| 346 | ); |
|
| 347 | $value = maybe_unserialize( $value ); |
|
| 348 | ||
| 349 | if ( $value === null && $default !== null ) { |
|
| 350 | return $default; |
|
| 351 | } |
|
| 352 | ||
| 353 | return $value; |
|
| 354 | } |
|
| 355 | } |
|
| 356 | ||
| @@ 387-402 (lines=16) @@ | ||
| 384 | * |
|
| 385 | * @return mixed Option value, or null if option is not found and default is not specified. |
|
| 386 | */ |
|
| 387 | static function get_raw_option( $name, $default = null ) { |
|
| 388 | global $wpdb; |
|
| 389 | $value = $wpdb->get_var( |
|
| 390 | $wpdb->prepare( |
|
| 391 | "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", |
|
| 392 | $name |
|
| 393 | ) |
|
| 394 | ); |
|
| 395 | $value = maybe_unserialize( $value ); |
|
| 396 | ||
| 397 | if ( $value === null && $default !== null ) { |
|
| 398 | return $default; |
|
| 399 | } |
|
| 400 | ||
| 401 | return $value; |
|
| 402 | } |
|
| 403 | ||
| 404 | } |
|
| 405 | ||