php活动日历-社区活动:将高级自定义字段排入社区活动添加/编辑表单页面。(代码片段)

author author     2022-12-11     131

关键词:

<?php
/**
 * The Events Calendar - Community Events: Enqueue Advanced Custom Fields into
 * the Community Events add/edit form pages.
 *
 * This will get ACF loaded but you will need to add your own additional code to
 * get ACF to do anything at all on the Community Events forms.
 *
 * @see cliff_is_community_page
 *
 * @link https://gist.github.com/cliffordp/9c88e97e5f2392b1c36eabb248a50b11
 * @link https://www.advancedcustomfields.com/
 * @link https://theeventscalendar.com/support/forums/topic/where-to-place-acf_form_head-to-save-submitted-data/
 */
add_action( 'wp_head', 'cliff_add_acf_to_ce' );

function cliff_add_acf_to_ce() 
	if (
		! function_exists( 'acf_form_head' )
		|| ! function_exists( 'cliff_is_community_page' )
		|| false === cliff_is_community_page()
	) 
		return;
	

	acf_form_head();


/**
 * Return TRUE if we are in the Community Events Add Event or Edit Event form.
 *
 * @return bool
 */
function cliff_is_community_page() 
	$main = tribe( 'community.main' );

	if ( empty( $main ) ) 
		// Community Events is not active (or may somehow not be loaded correctly)
		return false;
	

	$event_post_type = Tribe__Events__Main::POSTTYPE;
	$action          = Tribe__Utils__Array::get( $main->context, 'action' );
	$ce_post_type    = Tribe__Utils__Array::get( $main->context, 'post_type', $event_post_type ); // assume event post type if not set

	// bail if we are not doing what is expected from the start
	if ( $event_post_type !== $ce_post_type ) 
		return false;
	

	if (
		'edit' === $action
		|| 'add' === $action
	) 
		return true;
	 else 
		// if empty( $action ), you might be in the Community Events List view
		return false;
	

php活动日历:社区活动:将图片上传限制为3兆字节。(代码片段)

查看详情

php活动日历:社区活动:将图片上传限制为3兆字节。(代码片段)

查看详情

php事件日历:所有venueslugs都以自定义字符串为前缀。适用于wp-admin和社区活动。(代码片段)

查看详情

php活动日历:社区活动门票:在社区活动列表视图上显示“付款选项”按钮。(代码片段)

查看详情

php活动日历:社区活动门票:在社区活动列表视图上显示“付款选项”按钮。(代码片段)

查看详情

php活动日历+社区活动门票:强制全局股票被检查然后隐藏(以避免取消选中)。(代码片段)

查看详情

php活动日历+社区活动门票:强制全局股票被检查然后隐藏(以避免取消选中)。(代码片段)

查看详情

php将社区活动的“我的活动列表”从反向时间顺序更改为时间顺序(代码片段)

查看详情

php将社区活动的“我的活动列表”从反向时间顺序更改为时间顺序(代码片段)

查看详情

php将社区活动的登录表单重定向到您自己的登录表单。需要社区活动4。4。7(2017年6月1日)或之后。(代码片段)

查看详情

php将社区活动的登录表单重定向到您自己的登录表单。需要社区活动4。4。7(2017年6月1日)或之后。(代码片段)

查看详情

php活动日历:eventbrite门票:自定义iframe的高度。(代码片段)

查看详情

php活动日历:eventbrite门票:自定义iframe的高度。(代码片段)

查看详情

社区说|使用tensorflowlite构建和部署自定义对象检测模型

活动时间8月12日(本周四)20:00pm-21:00pm活动日程20:00-20:45主题分享使用TensorFlowLite构建和部署自定义对象检测模型对象检测简介对象检测模型的获取与训练编写代码在AndroidStudio完成对象检测demo内容回顾20:45-21:00互动问答举... 查看详情

社区说|今晚直播!使用tensorflowlite构建和部署自定义对象检测模型

活动时间8月12日(本周四)20:00pm-21:00pm活动日程20:00-20:45主题分享使用TensorFlowLite构建和部署自定义对象检测模型对象检测简介对象检测模型的获取与训练编写代码在AndroidStudio完成对象检测demo内容回顾20:45-21:00互动问答举... 查看详情

社区说|今晚直播!使用tensorflowlite构建和部署自定义对象检测模型

活动时间8月12日(本周四)20:00pm-21:00pm活动日程20:00-20:45主题分享使用TensorFlowLite构建和部署自定义对象检测模型对象检测简介对象检测模型的获取与训练编写代码在AndroidStudio完成对象检测demo内容回顾20:45-21:00互动问答举... 查看详情

php子菜单包括具有当前活动页面的自定义字段(代码片段)

查看详情

php社区活动(ce):如果用户已登录,请将发布状态设置为已发布,否则回退到ce设置的默认值。(代码片段)

查看详情