Skip to main content

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

NameReturn TypeSummary/Returns
get_archive_page()array or falseMethod to get the archive page for the post type.

Returns: The archive link.
get_email()string or falseGet the person's email address

Returns: the escaped email address or false if not set
get_excerpt()stringCustom excerpt.

Returns: Returns the excerpt.
get_other_items()\Timber\PostCollectionInterface or arrayMethod to get other post items.

Returns: The other items.
get_phonenumber()array or falseGet 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.

NameTypeDescription
$lengthstring or intAmount 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.

NameTypeDescription
$numberintThe number of items to get.
$taxonomystringName of the taxonomy to query.
$termsarrayID of the term to query inside $taxonomy.

get_phonenumber()

Get the person's phone number

since 5.55.0

Returns: array|false