| @@ 72-92 (lines=21) @@ | ||
| 69 | ||
| 70 | } |
|
| 71 | ||
| 72 | private function errors_to_warnings( $context = null ) { |
|
| 73 | ||
| 74 | $errors = empty( $context ) ? $this->get_errors() : array( $context => $this->get_errors( $context ) ); |
|
| 75 | ||
| 76 | if ( empty( $errors ) ) { |
|
| 77 | return; |
|
| 78 | } |
|
| 79 | ||
| 80 | foreach ( $errors as $error_context => $context_errors ) { |
|
| 81 | foreach ( $context_errors as $error ) { |
|
| 82 | $this->warning( $error_context, $error ); |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | if ( $context ) { |
|
| 87 | unset( $this->errors[ $context ] ); |
|
| 88 | } else { |
|
| 89 | $this->errors = array(); |
|
| 90 | } |
|
| 91 | ||
| 92 | } |
|
| 93 | ||
| 94 | public function get_warnings( $context = null ) { |
|
| 95 | ||
| @@ 1407-1427 (lines=21) @@ | ||
| 1404 | * |
|
| 1405 | * @param null $context |
|
| 1406 | */ |
|
| 1407 | private function errors_to_warnings( $context = null ) { |
|
| 1408 | ||
| 1409 | $errors = empty( $context ) ? $this->get_errors() : array( $context => $this->get_errors( $context ) ); |
|
| 1410 | ||
| 1411 | if ( empty( $errors ) ) { |
|
| 1412 | return; |
|
| 1413 | } |
|
| 1414 | ||
| 1415 | foreach ( $errors as $error_context => $context_errors ) { |
|
| 1416 | foreach ( $context_errors as $error ) { |
|
| 1417 | $this->warning( $error_context, $error ); |
|
| 1418 | } |
|
| 1419 | } |
|
| 1420 | ||
| 1421 | if ( $context ) { |
|
| 1422 | unset( $this->errors[ $context ] ); |
|
| 1423 | } else { |
|
| 1424 | $this->errors = array(); |
|
| 1425 | } |
|
| 1426 | ||
| 1427 | } |
|
| 1428 | ||
| 1429 | /** |
|
| 1430 | * Get the warnings |
|