Tribe__Events__Pro__Editor__Meta::fake_recurrence_description( $value, $post_id, $meta_key, $single )
Fake the description value from _EventRecurrence into a dynamic meta value that is located at tribe( ‘events-pro.editor.recurrence.blocks-meta’ )->get_description_key();
Contents
Parameters
- $value
-
(Required) mixed The original value
- $post_id
-
(Required) int The Id of the post
- $meta_key
-
(Required) string The name of the meta key
- $single
-
(Required) Bool true if a single value should be returned
Return
(array|string)
Source
File: src/Tribe/Editor/Meta.php
public function fake_recurrence_description( $value, $post_id, $meta_key, $single ) {
/** @var Tribe__Events__Pro__Editor__Recurrence__Blocks_Meta $blocks_meta */
$blocks_meta = tribe( 'events-pro.editor.recurrence.blocks-meta' );
if ( $meta_key !== $blocks_meta->get_description_key() ) {
return $value;
}
$description = $this->get_value( $post_id, $meta_key );
if ( empty( $description ) ) {
$recurrence = get_post_meta( $post_id, '_EventRecurrence', true );
$description = isset( $recurrence['description'] ) ? $recurrence['description'] : '';
}
return $single ? $description : array( $description );
}
Changelog
| Version | Description |
|---|---|
| 4.5 | Introduced. |