php ACF复选框

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php ACF复选框相关的知识,希望对你有一定的参考价值。

<?php //Vars
							$check_the_box = get_sub_field('needs_to_link_to_another_page'); ?>
						<?php if ( $check_the_box && in_array('yes', $check_the_box) ) : ?>
						<!-- Function gets field conten if it is 'yes' and returns it to the variable.  And then,
						since it meets the criteria of being 'yes', it continues on and performs the rest of the code.
						It basically reads, "If the field content matches 'yes', then . . . " -->
						 <a href="<?php the_sub_field('concentration_link'); ?>" style="color:#ffffff;">Find out more!</a>
						<?php endif; ?>
						
						<!-- In this case, the custom fields for this section are all sub-fields in a repeater section. 
						There are fields for title, text, and then 'needs_to_link_to_another_page' is a yes/no checkbox
						sub-field, followed by 'concentration_link', which is an acf "page link".  It looks up pages on
						the site and returns the link that you choose.  The checkbox sub-field should have
						the conditional logic option chosen, as 'needs_to_link_to_another_page' is equal to 
						yes.-->
						
						

以上是关于php ACF复选框的主要内容,如果未能解决你的问题,请参考以下文章

php acf关系循环根据复选框值加载不同的模板

php 重力Wiz //重力形式//将GF复选框字段映射到ACF复选框字段

php 重力Wiz //重力形式//将GF复选框字段映射到ACF复选框字段

ACF 循环表复选框(WordPress)的问题

选中一个复选框时,如何在 ACF 中创建的另一个块中隐藏其他复选框?

如何隐藏 ACF 中灵活内容框中的复选框但不隐藏其他复选框