Person
Example post class that extends LemonPost. Can be used as a reference for creating custom post classes.
Overview
This class extends WP_Lemon\Classes\LemonPost
Methods
| Name | Return Type | Summary/Returns |
|---|---|---|
| get_archive_page() | array or false | Method to get the archive page for the post type. Returns: The archive link. |
| get_email() | string or false | Get the person's email address Returns: the escaped email address or false if not set |
| get_excerpt() | string | Custom excerpt. Returns: Returns the excerpt. |
| get_other_items() | \Timber\PostCollectionInterface or array | Method to get other post items. Returns: The other items. |
| get_phonenumber() | array or false | Get the person's phone number |
Class Methods
get_archive_page()
Method to get the archive page for the post type.
Returns: array|false The archive link.
This method is inherited from \WP_Lemon\Classes\LemonPost.
get_email()
Get the person's email address
since 5.55.0
Returns: string|false the escaped email address or false if not set
get_excerpt()
Custom excerpt.
This method is a wrapper around the excerpt method. It allows you to get a custom excerpt for the post with predefined settings.
get_excerpt( string|int $length = 100 )
Returns: string Returns the excerpt.
This method is inherited from \WP_Lemon\Classes\LemonPost.
| Name | Type | Description |
|---|---|---|
| $length | string or int | Amount of characters, if -1 all characters are returned. |
get_other_items()
Method to get other post items.
get_other_items( int $number, string $taxonomy = null, array $terms = [] )
Returns: \Timber\PostCollectionInterface|array The other items.
This method is inherited from \WP_Lemon\Classes\LemonPost.
| Name | Type | Description |
|---|---|---|
| $number | int | The number of items to get. |
| $taxonomy | string | Name of the taxonomy to query. |
| $terms | array | ID of the term to query inside $taxonomy. |
get_phonenumber()
Get the person's phone number
since 5.55.0
Returns: array|false