Skip to main content

Person

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 if a wrapper around the excerpt method. It allows you to get a custom excerpt for the post with predefined settings.

In case you have an empty excerpt, please add your custom blocks that are most likely used on the top of the page to the the excerpt_allowed_wrapper_blocks filter .

TODO: Use this function inside our twig templates and deprecated the lemon_excerpt function inside Twig files.

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.

Twig

{% include 'components/other-items.twig' with {
more: {
title: __('Bekijk gerelateerde vacatures', 'wp-lemon-child'),
items: post.get_other_items(2, 'category', [12,34]),
classes: ['section'],
button: false
},
card_type: 'job',
link: true
} %}

get_phonenumber()

Get the person's phone number

since 5.55.0

Returns: array|false