本文整理汇总了PHP中acf_form函数的典型用法代码示例。如果您正苦于以下问题:PHP acf_form函数的具体用法?PHP acf_form怎么用?PHP acf_form使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acf_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_acf_form_to_post
function add_acf_form_to_post($content)
{
if (is_singular(array("cases", "persons", "organizations", "objects"))) {
if (function_exists('acf_form')) {
ob_start();
?>
<section id="data_acf_post" class="cases-box">
<div class="cases-box-header">
<h1>Данные</h1>
<hr />
</div>
<div class="cases-box-content" id="cases_add_data">
<?php
acf_form();
?>
</div>
</section>
<?php
$html = ob_get_contents();
ob_get_clean();
return $content . $html;
}
}
return $content;
}
示例2: render_form
static function render_form($id, $update, $second_category, $second_field_group)
{
while (have_posts()) {
the_post();
acf_form(array('post_id' => $id, 'new_post' => array('post_category' => array(4, $second_category), 'post_status' => 'publish'), 'field_groups' => array(1065, $second_field_group, 1131), 'post_title' => true, 'submit_value' => 'Submit', 'updated_message' => $update));
}
}
示例3: plugin_settings_page_content
public function plugin_settings_page_content()
{
do_action('acf/input/admin_head');
do_action('acf/input/admin_enqueue_scripts');
$options = array('id' => 'acf-form', 'post_id' => 'options', 'new_post' => false, 'field_groups' => array('acf_awesome-options'), 'return' => admin_url('admin.php?page=smashing_fields'), 'submit_value' => 'Update');
acf_form($options);
}
示例4: acp
function acp($atts)
{
extract(shortcode_atts(array('post_type' => 'post', 'taxonomy' => '', 'term_id' => '', 'acf_id' => ''), $atts));
$post_data = 'apc' . ':' . $atts['post_type'] . ':' . $atts['taxonomy'] . ':' . $atts['term_id'];
$args = array('post_id' => $post_data, 'field_groups' => array($atts['acf_id']));
echo '<div class="acp_container">';
acf_form($args);
echo '</div>';
}
示例5: tsm_do_create_post_form
function tsm_do_create_post_form()
{
// Bail if not logged in or able to post
if (!(is_user_logged_in() || current_user_can('publish_posts'))) {
echo '<p>You must be a registered author to post.</p>';
return;
}
$new_post = array('post_id' => 'new', 'field_groups' => array(7, 9), 'form' => true, 'html_before_fields' => '', 'html_after_fields' => '', 'submit_value' => 'Place Order', 'updated_message' => 'Saved!');
acf_form($new_post);
}
示例6: sm_process_repeat_order
function sm_process_repeat_order()
{
// Verify a nonce has been set, else don't run the script
if (!isset($_POST['sm_nonce']) || !wp_verify_nonce($_POST['sm_nonce'], 'sm-nonce')) {
die('Permissions check failed');
}
$author = $_POST['author'];
$pid = $_POST['pid'];
$args = array('form_attributes' => array('id' => 'repeat-form'), 'post_id' => '', 'field_groups' => array(1784), 'html_before_fields' => '', 'html_after_fields' => '
<input type="hidden" class="text" id="set_repeat_uid" name="set_repeat_uid" value="' . $author . '">
<input type="hidden" class="text" id="set_repeat_oid" name="set_repeat_oid" value="' . $pid . '">', 'return' => add_query_arg('repeat', '1', get_permalink($pid)), 'submit_value' => 'Order');
$output = acf_form($args);
die($output);
}
示例7: acf_contact_shortcode
function acf_contact_shortcode($atts)
{
$a = shortcode_atts(array('id' => 1), $atts);
$form_id = $a['id'] - 1;
$forms = get_field('forms', 'option');
$f = $forms[$form_id];
$title = 'New Form Submission';
//This is a temporary page title, which will change when fields are saved.
$post = array('post_type' => $f['post_type'], 'post_status' => 'publish', 'post_title' => $title);
$form = '<div id="acf_contact' . $f["group"] . '">';
$form .= "</div>";
//Move form down to content
$form .= "<script>jQuery(function(\$) {\n\t\t\t\t\t\$('#acf_contactform" . $f["group"] . "').appendTo('#acf_contact" . $f["group"] . "');\n\t \t\t\t });</script>";
echo '<div id="acf_contactform' . $f["group"] . '">';
acf_form(array('submit_value' => $f["submit_text"], 'return' => $f["return_url"], 'post_id' => 'new_post', 'new_post' => $post, 'uploader' => 'basic', 'field_groups' => array($f["group"])));
echo '</div>';
return $form;
}
示例8: acf_form
</div>
<div class="container">
<div class="form-group">
<div class="well">
<label>
What is the name of your App?
</label>
<form id="insert_term" name="insert_term" method="post" action="">
<input type="text" value="<?php
echo $app_name;
?>
" name="term" id="term" class="form-control" />
<input type="hidden" name="update" id="update" value="<?php
echo $update;
?>
" />
</form>
</div>
</div>
<hr>
<?php
acf_form(array('post_id' => $basic_post, 'form_attributes' => array('id' => 'basic_form', 'action' => '', 'method' => 'post'), 'field_groups' => $group, 'submit_value' => __("Submit your answers", 'acf'), 'return' => home_url('the-results')));
?>
</div>
<?php
get_footer();
示例9: wp_get_object_terms
?>
新規</h2>
<?php
$cat = wp_get_object_terms($post->ID, 'status');
$cat = $cat[0];
$cat_termname = $cat->name;
$cat_term = $cat->term_id;
$termset = '78';
//完了のIDをセット
echo $cat_termname;
if ($termset == $cat_term) {
$my_post = array('post_status' => 'publish', 'post_id' => $post_id, 'post_author' => $user_ID, 'post_category' => array("{$cat_ID}"), 'new_post' => array('post_name' => array($post_id), 'post_title' => true, 'validation' => true, 'field_groups' => array('group_556d83105301a ', "{$description}"), 'html_before_fields' => '
<input type="hidden" id="acf-_post_title" class name="acf[_post_title]" value="作業申請" >'), 'submit_value' => '提出', 'return' => '%post_url%?foo=bar');
wp_update_post($my_post);
acf_form($my_post);
} else {
}
?>
依頼IDを発行してから提出となります。
<?php
}
?>
<!-- /pager -->
<?php
} else {
示例10: wa_get_acf_form
/**
* Get html for acf field form
* @param string $field_key acf field key (non prefixed)
* @param mixed $post_id
* @return string html
*/
public function wa_get_acf_form($field_key = false, $post_id = false)
{
$is_ajax = false;
if (isset($_POST['field_key'])) {
$is_ajax = true;
$field_key = $_POST['field_key'];
$post_id = $_POST['post_id'];
if (intval($post_id)) {
$post_id = intval($post_id);
}
}
$form_id = 'acf-form-' . $field_key;
$redirect_uri = isset($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI'];
$options = array('id' => $form_id, 'post_id' => $post_id, 'fields' => array($field_key), 'return' => $redirect_uri);
ob_start();
acf_form($options);
$output = ob_get_clean();
$return = array('form_id' => $form_id, 'output' => $output);
if ($is_ajax) {
wp_send_json($return);
} else {
return $return;
}
}
示例11: while
while (have_posts()) {
the_post();
?>
<?php
get_template_part('content', 'page');
?>
<?php
}
// end of the loop.
?>
<?php
if (is_page('Profile')) {
acf_form(array('post_id' => 'user_' . $current_user->ID, 'field_groups' => array(130, 261), 'submit_value' => 'Update Profile'));
}
//$user_id = 1;
//$password = 'HelloWorld';
//wp_set_password( $password, $user_id );
?>
<?php
// Get current user object
$current_user = wp_get_current_user();
// Get the last login time of the user
$last_login_time = get_user_meta($current_user->ID, 'last_login', true);
$post_date = get_the_date('m/d/y');
// WP_Query with post modified time
示例12: while
?>
<?php
if (have_posts()) {
?>
<?php
while (have_posts()) {
the_post();
?>
<section class="left_proposer">
<div class="text">
<h2>Proposez nous votre recette</h2>
<?php
the_content();
?>
</div>
</section>
<section class="form_proposer">
<?php
acf_form_head();
?>
<?php
acf_form(array('id' => 'contact-form', 'post_id' => 'new_post', 'new_post' => array('post_type' => 'recette', 'post_status' => 'draft'), 'post_title' => 'true', 'post_content' => 'true', 'submit_value' => 'Proposez !', 'updated_message' => 'Recette envoyée !', 'return' => ''));
?>
</section>
<div class="clear"></div>
<?php
}
?>
<?php
}
get_footer();
示例13: while
?>
<div id="primary" class="container">
<div id="content" class="site-content" role="main">
<?php
/* The loop */
?>
<?php
while (have_posts()) {
the_post();
?>
<h1 class="landing__title container"><?php
the_title();
?>
</h1>
<?php
acf_form(array('post_id' => 'new_post', 'new_post' => array('post_type' => 'support_group', 'post_status' => 'draft'), 'post_title' => true, 'submit_value' => 'Submit your support group', 'updated_message' => 'Thank you. Your group has been submitted for review and will be available publicly shortly. For questions or concerns, please contact <a href="mailto:idetaeye@afsp.org">idetaeye@afsp.org</a>.'));
?>
<?php
}
?>
</div><!-- #content -->
</div><!-- #primary -->
<?php
get_footer();
示例14: while
<?php
/* The loop */
?>
<?php
while (have_posts()) {
the_post();
?>
<h1 class="landing__title container"><?php
the_title();
?>
</h1>
<?php
acf_form(array('post_id' => 'new_post', 'new_post' => array('post_type' => 'survivor_day', 'post_status' => 'draft'), 'post_title' => true, 'submit_value' => 'Submit your Survivor Day Organizer Application/Event Registration', 'updated_message' => '<h2>Thank you. Your Survivor Day Organizer Application/Event Registration has been submitted for review. For questions or concerns, please contact Inge De Taeye at <a href="mailto:idetaeye@afsp.org">idetaeye@afsp.org</a>.</h2>'));
?>
<?php
}
?>
</div><!-- #content -->
</div><!-- #primary -->
<script>
var title = document.getElementsByTagName('label');
title[1].innerHTML = "Where would you like to organize a Survivor Day 2016 event (city, state/province, country)? *";
//helpful date code comes from http://stackoverflow.com/questions/1531093/how-to-get-current-date-in-javascript
var today = new Date();
var dd = today.getDate();
示例15: while
<?php
while (have_posts()) {
the_post();
?>
<h1 class="landing__title container"><?php
the_title();
?>
</h1>
<?php
the_content();
?>
<?php
acf_form(array('post_id' => 'new_post', 'new_post' => array('post_type' => 'quilt_square', 'post_status' => 'draft'), 'post_title' => true, 'submit_value' => 'Submit your quilt square', 'return' => 'http://afsp.org/find-support/ive-lost-someone/digital-memory-quilt/thank-creating-quilt-square/'));
?>
<?php
}
?>
</div><!-- #content -->
</div><!-- #primary -->
<script type="text/javascript">
var title = document.getElementsByTagName('label');
title[1].innerHTML = "Quilt Square Title or Name of Person Lost";
</script>
<?php
get_footer();