2362 | | if ( !$value && function_exists('add_settings_error') ) |
2363 | | add_settings_error('admin_email', 'invalid_admin_email', __('The email address submitted was not in the right format. Please enter a valid email address.')); |
| 2362 | if ( !is_email( $value ) ){ |
| 2363 | $value = get_option( $option ); // Resets option to stored val in case of invalid email |
| 2364 | if( function_exists('add_settings_error') ) |
| 2365 | add_settings_error('admin_email', 'invalid_admin_email', __('The email address submitted was not in the right format. Please enter a valid email address.')); |
| 2366 | } |
2437 | | case 'siteurl': |
2438 | | case 'home': |
2439 | | $value = esc_url_raw($value); |
2440 | | break; |
| 2440 | case 'siteurl': |
| 2441 | $value = esc_url_raw($value); |
| 2442 | if ( !is_url( $value ) ) |
| 2443 | { |
| 2444 | $value = get_option( $option ); // Resets option to stored val in case of empty |
| 2445 | if( function_exists('add_settings_error') ) |
| 2446 | add_settings_error('siteurl', 'invalid_siteurl', __('The WordPress address you submitted was not in the right format. Please enter a valid URL.')); |
| 2447 | } |
| 2448 | break; |
| 2449 | case 'home': |
| 2450 | $value = esc_url_raw($value); |
| 2451 | if ( !is_url( $value ) ) |
| 2452 | { |
| 2453 | $value = get_option( $option ); // Resets option to stored val in case of empty |
| 2454 | if( function_exists('add_settings_error') ) |
| 2455 | add_settings_error('home', 'invalid_home', __('The Site address you submitted was not in the right format. Please enter a valid URL.')); |
| 2456 | } |
| 2457 | break; |