php事件日历pro:将pro_addl_fields变量添加到tribe_event_inline短代码中。(代码片段)

author author     2022-12-09     355

关键词:

<?php
/**
 * Events Calendar PRO: Add pro_addl_fields variable to the tribe_event_inline shortcode.
 *
 * @see  cliff_render_pro_addl_fields_within_inline_shortcode()
 *
 * @link https://gist.github.com/cliffordp/376e8c204ccd34ec78fbc38d519350ef This snippet.
 * @link https://theeventscalendar.com/knowledgebase/embedding-single-events-tribe_event_inline-shortcode/
 * @link https://theeventscalendar.com/knowledgebase/pro-additional-fields/
 */
function cliff_add_pro_addl_fields_to_inline_shortcode( $placeholders ) 
	if (
		method_exists( 'Tribe__Events__Pro__Single_Event_Meta', 'additional_fields' )
		&& function_exists( 'cliff_render_pro_addl_fields_within_inline_shortcode' )
	) 
		$placeholders['pro_addl_fields'] = 'cliff_render_pro_addl_fields_within_inline_shortcode';
	

	return $placeholders;


/**
 * Render an event's PRO Additional Fields template for a given Event ID, as part of the custom pro_addl_fields
 * variable for the tribe_event_inline shortcode.
 *
 * @see cliff_add_pro_addl_fields_to_inline_shortcode() This function must go hand-in-hand.
 * @see Tribe__Events__Pro__Single_Event_Meta::additional_fields() The functionality we are mimicking.
 * @see Tribe__Events__Pro__Shortcodes__Inline__Parser::process() This only works because `call_user_func()` passes its `$id` parameter.
 *
 * @param int $event_id
 */
function cliff_render_pro_addl_fields_within_inline_shortcode( $event_id = 0 ) 
	tribe_get_template_part(
		'pro/modules/meta/additional-fields', null, [
			'fields' => tribe_get_custom_fields( $event_id ),
		]
	);


add_filter( 'tribe_events_pro_inline_placeholders', 'cliff_add_pro_addl_fields_to_inline_shortcode' );

php事件日历pro:从单个事件页面上显示删除pro附加字段。(代码片段)

查看详情

php事件日历pro:限制地图视图默认仅显示今天的事件。(代码片段)

查看详情

php事件日历pro:限制地图视图默认仅显示今天的事件。(代码片段)

查看详情

php事件日历pro:在日视图上输出附加字段元信息。(代码片段)

查看详情

php事件日历pro:在日视图上输出附加字段元信息。(代码片段)

查看详情

php事件日历pro:从相关的帖子逻辑中删除帖子标签,因此,仅使用事件类别。(代码片段)

查看详情

php事件日历pro:从相关的帖子逻辑中删除帖子标签,因此,仅使用事件类别。(代码片段)

查看详情

php事件日历pro:照片视图:反转每页事件的显示顺序(即显示相同的事件,仅使用最近的upc(代码片段)

查看详情

php事件日历pro:照片视图:反转每页事件的显示顺序(即显示相同的事件,仅使用最近的upc(代码片段)

查看详情

php事件日历pro:在单一地点的列表视图中为每个事件添加json-ld标记。(代码片段)

查看详情

php事件日历pro:在单一地点的列表视图中为每个事件添加json-ld标记。(代码片段)

查看详情

php事件日历pro:仅在某些p上设置“仅显示每个周期事件的第一个实例(仅影响列表样式视图)”选项(代码片段)

查看详情

php事件日历和/或pro:为google地图设置区域和语言偏差(本例中为澳大利亚)(代码片段)

查看详情

php将事件日历“所有事件”页面重定向到custonurl(代码片段)

查看详情

php事件日历:将“所有事件”链接转换为真正的“后退”按钮。(代码片段)

查看详情

php事件日历:将“所有事件”链接转换为真正的“后退”按钮。(代码片段)

查看详情

php事件日历pro:即使对于tribe_events短代码,也使tribe_is_week()返回true。(代码片段)

查看详情

php事件日历pro:即使对于tribe_events短代码,也使tribe_is_week()返回true。(代码片段)

查看详情