| @@ 408-421 (lines=14) @@ | ||
| 405 | * |
|
| 406 | * @return mixed |
|
| 407 | */ |
|
| 408 | public function __get( $key ) { |
|
| 409 | ||
| 410 | if ( method_exists( $this, 'get_' . $key ) ) { |
|
| 411 | ||
| 412 | return call_user_func( array( $this, 'get_' . $key ) ); |
|
| 413 | ||
| 414 | } else { |
|
| 415 | ||
| 416 | /* translators: %s: property key */ |
|
| 417 | return new WP_Error( 'give-form-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) ); |
|
| 418 | ||
| 419 | } |
|
| 420 | ||
| 421 | } |
|
| 422 | ||
| 423 | /** |
|
| 424 | * Creates a donation form |
|
| @@ 334-347 (lines=14) @@ | ||
| 331 | * |
|
| 332 | * @return mixed|\WP_Error |
|
| 333 | */ |
|
| 334 | public function __get( $key ) { |
|
| 335 | ||
| 336 | if ( method_exists( $this, 'get_' . $key ) ) { |
|
| 337 | ||
| 338 | return call_user_func( array( $this, 'get_' . $key ) ); |
|
| 339 | ||
| 340 | } else { |
|
| 341 | ||
| 342 | /* translators: %s: property key */ |
|
| 343 | return new WP_Error( 'give-donor-invalid-property', sprintf( esc_html__( 'Can\'t get property %s.', 'give' ), $key ) ); |
|
| 344 | ||
| 345 | } |
|
| 346 | ||
| 347 | } |
|
| 348 | ||
| 349 | /** |
|
| 350 | * Creates a donor. |
|