| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\User_Meta\Domain; |
| 4 |
|
| 5 |
/** |
| 6 |
* This interface describes a custom meta. |
| 7 |
*/ |
| 8 |
interface Custom_Meta_Interface { |
| 9 |
|
| 10 |
/** |
| 11 |
* Returns the priority which the custom meta's form field should be rendered with. |
| 12 |
* |
| 13 |
* @return int. |
| 14 |
*/ |
| 15 |
public function get_render_priority(): int; |
| 16 |
|
| 17 |
/** |
| 18 |
* Returns the db key of the custom meta. |
| 19 |
* |
| 20 |
* @return string |
| 21 |
*/ |
| 22 |
public function get_key(): string; |
| 23 |
|
| 24 |
/** |
| 25 |
* Returns the id of the custom meta's form field. |
| 26 |
* |
| 27 |
* @return string |
| 28 |
*/ |
| 29 |
public function get_field_id(): string; |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the meta value. |
| 33 |
* |
| 34 |
* @param int $user_id The user ID. |
| 35 |
* |
| 36 |
* @return string |
| 37 |
*/ |
| 38 |
public function get_value( $user_id ): string; |
| 39 |
|
| 40 |
/** |
| 41 |
* Returns whether the respective global setting is enabled. |
| 42 |
* |
| 43 |
* @return bool |
| 44 |
*/ |
| 45 |
public function is_setting_enabled(): bool; |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns whether the custom meta is allowed to be empty. |
| 49 |
* |
| 50 |
* @return bool |
| 51 |
*/ |
| 52 |
public function is_empty_allowed(): bool; |
| 53 |
|
| 54 |
/** |
| 55 |
* Renders the custom meta's field in the user form. |
| 56 |
* |
| 57 |
* @param int $user_id The user ID. |
| 58 |
* |
| 59 |
* @return void |
| 60 |
*/ |
| 61 |
public function render_field( $user_id ): void; |
| 62 |
} |
| 63 |
|