当前位置: 首页>>代码示例>>PHP>>正文


PHP acf_render_field函数代码示例

本文整理汇总了PHP中acf_render_field函数的典型用法代码示例。如果您正苦于以下问题:PHP acf_render_field函数的具体用法?PHP acf_render_field怎么用?PHP acf_render_field使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了acf_render_field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render_field

function render_field($field)
{
    acf_render_field($field);
}
开发者ID:de190909,项目名称:WPTest,代码行数:4,代码来源:api-template.php

示例2: _e

?>
" />
			</div>
			<table class="form-table">
                <tbody>
                	<tr>
                    	<th>
                    		<label for="acf-field-acf_pro_licence"><?php 
_e('License Key', 'acf');
?>
</label>
                    	</th>
						<td>
							<?php 
// render field
acf_render_field(array('type' => $input, 'name' => 'acf_pro_licence', 'value' => str_repeat('*', strlen($license)), 'readonly' => $readonly));
?>
						</td>
					</tr>
					<tr>
						<th></th>
						<td>
							<input type="submit" value="<?php 
echo $button;
?>
" class="button button-primary">
						</td>
					</tr>
				</tbody>
			</table>
			</form>
开发者ID:darbymanning,项目名称:Family-Church,代码行数:31,代码来源:settings-updates.php

示例3: acf_render_field

        acf_render_field(array('type' => 'select', 'prefix' => $prefix, 'name' => 'field', 'value' => $rule['field'], 'choices' => $choices, 'class' => 'conditional-logic-field', 'disabled' => $disabled));
        ?>
								</td>
								<td class="operator">
									<?php 
        $choices = array('==' => __("is equal to", 'acf'), '!=' => __("is not equal to", 'acf'));
        // create field
        acf_render_field(array('type' => 'select', 'prefix' => $prefix, 'name' => 'operator', 'value' => $rule['operator'], 'choices' => $choices, 'class' => 'conditional-logic-operator', 'disabled' => $disabled));
        ?>
								</td>
								<td class="value">
									<?php 
        $choices = array();
        $choices[$rule['value']] = $rule['value'];
        // create field
        acf_render_field(array('type' => 'select', 'prefix' => $prefix, 'name' => 'value', 'value' => $rule['value'], 'choices' => $choices, 'class' => 'conditional-logic-value', 'disabled' => $disabled));
        ?>
								</td>
								<td class="add">
									<a href="#" class="acf-button location-add-rule"><?php 
        _e("and", 'acf');
        ?>
</a>
								</td>
								<td class="remove">
									<a href="#" class="acf-icon location-remove-rule"><i class="acf-sprite-remove"></i></a>
								</td>
								</tr>
							<?php 
    }
    ?>
开发者ID:pellio11,项目名称:ns-select-project,代码行数:31,代码来源:field-group-field-conditional-logic.php

示例4: render_field

 function render_field($field)
 {
     // Change Field into a select
     $field['type'] = 'select';
     $field['ui'] = 1;
     $field['ajax'] = 1;
     $field['choices'] = array();
     // populate choices if value exists
     if (!empty($field['value'])) {
         // get posts
         $posts = $this->get_posts($field['value'], $field);
         // set choices
         if (!empty($posts)) {
             foreach (array_keys($posts) as $i) {
                 // vars
                 $post = acf_extract_var($posts, $i);
                 if (is_object($post)) {
                     // append to choices
                     $field['choices'][$post->ID] = $this->get_post_title($post, $field);
                 } else {
                     // append to choices
                     $field['choices'][$post] = $post;
                 }
             }
         }
     }
     // render
     acf_render_field($field);
 }
开发者ID:de190909,项目名称:WPTest,代码行数:29,代码来源:page_link.php

示例5: wp_parse_args

        $rule = wp_parse_args($rule, array('field' => '', 'operator' => '==', 'value' => ''));
        // $group_id must be completely different to $rule_id to avoid JS issues
        $rule_id = "rule_{$rule_id}";
        ?>
								<tr data-id="<?php 
        echo $rule_id;
        ?>
">
								<td class="param"><?php 
        // create field
        acf_render_field(array('type' => 'select', 'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]", 'name' => 'param', 'value' => $rule['param'], 'choices' => $rule_types, 'class' => 'location-rule-param'));
        ?>
</td>
								<td class="operator"><?php 
        // create field
        acf_render_field(array('type' => 'select', 'prefix' => "acf_field_group[location][{$group_id}][{$rule_id}]", 'name' => 'operator', 'value' => $rule['operator'], 'choices' => $rule_operators, 'class' => 'location-rule-operator'));
        ?>
</td>
								<td class="value"><?php 
        $this->render_location_value(array('group_id' => $group_id, 'rule_id' => $rule_id, 'value' => $rule['value'], 'param' => $rule['param'], 'class' => 'location-rule-value'));
        ?>
</td>
								<td class="add">
									<a href="#" class="button add-location-rule"><?php 
        _e("and", 'acf');
        ?>
</a>
								</td>
								<td class="remove">
									<a href="#" class="acf-icon -minus remove-location-rule"></a>
								</td>
开发者ID:ReLiFeD,项目名称:irreversible.eu,代码行数:31,代码来源:field-group-locations.php

示例6: render_location_value


//.........这里部分代码省略.........
              *  Page
              */
         /*
          *  Page
          */
         case "page":
             // get posts grouped by post type
             $groups = acf_get_grouped_posts(array('post_type' => 'page'));
             if (!empty($groups)) {
                 foreach (array_keys($groups) as $group_title) {
                     // vars
                     $posts = acf_extract_var($groups, $group_title);
                     // override post data
                     foreach (array_keys($posts) as $post_id) {
                         // update
                         $posts[$post_id] = acf_get_post_title($posts[$post_id]);
                     }
                     // append to $choices
                     $choices = $posts;
                 }
             }
             break;
         case "page_type":
             $choices = array('front_page' => __("Front Page", 'acf'), 'posts_page' => __("Posts Page", 'acf'), 'top_level' => __("Top Level Page (no parent)", 'acf'), 'parent' => __("Parent Page (has children)", 'acf'), 'child' => __("Child Page (has parent)", 'acf'));
             break;
         case "page_parent":
             // refer to "page"
             break;
         case "page_template":
             // vars
             $templates = wp_get_theme()->get_page_templates();
             $default = apply_filters('default_page_template_title', __('Default Template', 'acf'));
             // merge
             $choices = array_merge(array('default' => $default), $templates);
             break;
             /*
              *  User
              */
         /*
          *  User
          */
         case "current_user":
             // viewing
             $choices = array('logged_in' => __('Logged in', 'acf'), 'viewing_front' => __('Viewing front end', 'acf'), 'viewing_back' => __('Viewing back end', 'acf'));
             break;
         case "current_user_role":
             // global
             global $wp_roles;
             // specific roles
             $choices = $wp_roles->get_names();
             // multi-site
             if (is_multisite()) {
                 $choices = array_merge(array('super_admin' => __('Super Admin', 'acf')), $choices);
             }
             break;
         case "user_role":
             global $wp_roles;
             $choices = array_merge(array('all' => __('All', 'acf')), $wp_roles->get_names());
             break;
         case "user_form":
             $choices = array('all' => __('All', 'acf'), 'edit' => __('Add / Edit', 'acf'), 'register' => __('Register', 'acf'));
             break;
             /*
              *  Forms
              */
         /*
          *  Forms
          */
         case "attachment":
             $choices = array('all' => __('All', 'acf'));
             break;
         case "taxonomy":
             $choices = array_merge(array('all' => __('All', 'acf')), acf_get_taxonomies());
             // unset post_format
             if (isset($choices['post_format'])) {
                 unset($choices['post_format']);
             }
             break;
         case "comment":
             // vars
             $choices = array('all' => __('All', 'acf'));
             // append post types
             $choices = array_merge($choices, acf_get_pretty_post_types());
             // end
             break;
         case "widget":
             global $wp_widget_factory;
             $choices = array('all' => __('All', 'acf'));
             if (!empty($wp_widget_factory->widgets)) {
                 foreach ($wp_widget_factory->widgets as $widget) {
                     $choices[$widget->id_base] = $widget->name;
                 }
             }
             break;
     }
     // allow custom location rules
     $choices = apply_filters('acf/location/rule_values/' . $options['param'], $choices);
     // create field
     acf_render_field(array('type' => 'select', 'prefix' => "acf_field_group[location][{$options['group_id']}][{$options['rule_id']}]", 'name' => 'value', 'value' => $options['value'], 'choices' => $choices));
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:101,代码来源:field-group.php

示例7: acf_render_field

					</td>
					<td class="acf-input">
						<ul class="acf-hl">
							<li style="width:33%; padding-right:15px;">
							<?php 
acf_render_field(array('type' => 'text', 'name' => 'width', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['width'], 'prepend' => 'width', 'append' => '%'));
?>
							</li>
							<li style="width:33%; padding-right:15px;">
							<?php 
acf_render_field(array('type' => 'text', 'name' => 'class', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['class'], 'prepend' => 'class'));
?>
							</li>
							<li style="float:none;">
							<?php 
acf_render_field(array('type' => 'text', 'name' => 'id', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['id'], 'prepend' => 'id'));
?>
							</li>
						</ul>
					</td>
				</tr>	
				<tr class="field_save">
					<td class="acf-label"></td>
					<td class="acf-input">
						<ul class="acf-hl acf-clearfix">
							<li>
								<a class="edit-field acf-button grey" title="<?php 
_e("Close Field", 'acf');
?>
" href="#"><?php 
_e("Close Field", 'acf');
开发者ID:mariussunde,项目名称:Sn-hetta-Designmanual-WP-Theme,代码行数:31,代码来源:field-group-field.php

示例8: acf_render_field_wrap

function acf_render_field_wrap($field, $el = 'div', $instruction = 'label')
{
    // get valid field
    $field = acf_get_valid_field($field);
    // prepare field for input
    $field = acf_prepare_field($field);
    // el
    $elements = apply_filters('acf/render_field_wrap/elements', array('div' => 'div', 'tr' => 'td', 'ul' => 'li', 'ol' => 'li', 'dl' => 'dt', 'td' => 'div'));
    // validate $el
    if (!array_key_exists($el, $elements)) {
        $el = 'div';
    }
    // wrapper
    $wrapper = array('id' => '', 'class' => 'acf-field', 'width' => '', 'style' => '', 'data-name' => $field['name'], 'data-type' => $field['type'], 'data-key' => '');
    // add required
    if ($field['required']) {
        $wrapper['data-required'] = 1;
    }
    // add type
    $wrapper['class'] .= " acf-field-{$field['type']}";
    // add key
    if ($field['key']) {
        $wrapper['class'] .= " acf-field-{$field['key']}";
        $wrapper['data-key'] = $field['key'];
    }
    // replace
    $wrapper['class'] = str_replace('_', '-', $wrapper['class']);
    $wrapper['class'] = str_replace('field-field-', 'field-', $wrapper['class']);
    // wrap classes have changed (5.2.7)
    if (acf_get_compatibility('field_wrapper_class')) {
        $wrapper['class'] .= " field_type-{$field['type']}";
        if ($field['key']) {
            $wrapper['class'] .= " field_key-{$field['key']}";
        }
    }
    // merge in atts
    $wrapper = acf_merge_atts($wrapper, $field['wrapper']);
    // add width
    $width = (int) acf_extract_var($wrapper, 'width');
    if ($el == 'tr' || $el == 'td') {
        $width = 0;
    } elseif ($width > 0 && $width < 100) {
        $wrapper['data-width'] = $width;
        $wrapper['style'] .= " width:{$width}%;";
    }
    // remove empty attributes
    foreach ($wrapper as $k => $v) {
        if ($v == '') {
            unset($wrapper[$k]);
        }
    }
    // vars
    $show_label = $el !== 'td' ? true : false;
    ?>
<<?php 
    echo $el;
    ?>
 <?php 
    echo acf_esc_attr($wrapper);
    ?>
>
<?php 
    if ($show_label) {
        ?>
	<<?php 
        echo $elements[$el];
        ?>
 class="acf-label">
		<label for="<?php 
        echo $field['id'];
        ?>
"><?php 
        echo acf_get_field_label($field);
        ?>
</label>
<?php 
        if ($instruction == 'label' && $field['instructions']) {
            ?>
		<p class="description"><?php 
            echo $field['instructions'];
            ?>
</p>
<?php 
        }
        ?>
	</<?php 
        echo $elements[$el];
        ?>
>
<?php 
    }
    ?>
	<<?php 
    echo $elements[$el];
    ?>
 class="acf-input">
		<?php 
    acf_render_field($field);
    if ($instruction == 'field' && $field['instructions']) {
        ?>
//.........这里部分代码省略.........
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:101,代码来源:api-field.php

示例9: acf_render_field_wrap

function acf_render_field_wrap($field, $el = 'div', $instruction = 'label', $atts = array())
{
    // get valid field
    $field = acf_get_valid_field($field);
    // prepare field for input
    $field = acf_prepare_field($field);
    // el
    $elements = apply_filters('acf/render_field_wrap/elements', array('div' => 'div', 'tr' => 'td', 'ul' => 'li', 'ol' => 'li', 'dl' => 'dt', 'td' => 'div'));
    // validate $el
    if (!array_key_exists($el, $elements)) {
        $el = 'div';
    }
    // atts
    $atts = acf_parse_args($atts, array('class' => '', 'data-name' => $field['name'], 'data-type' => $field['type']));
    // add to atts
    $atts['class'] .= " acf-field field_type-{$field['type']}";
    // add key
    if ($field['key']) {
        $atts['class'] .= " field_key-{$field['key']}";
        $atts['data-key'] = $field['key'];
    }
    // add required
    if ($field['required']) {
        $atts['data-required'] = 1;
    }
    // vars
    $show_label = true;
    if ($el == 'td') {
        $show_label = false;
    }
    ?>
<<?php 
    echo $el;
    ?>
 <?php 
    echo acf_esc_attr($atts);
    ?>
>
		<?php 
    if ($show_label) {
        ?>
		<<?php 
        echo $elements[$el];
        ?>
 class="acf-label">
			
			<label for="<?php 
        echo $field['id'];
        ?>
"><?php 
        echo acf_get_field_label($field);
        ?>
</label>
			
			<?php 
        if ($instruction == 'label' && $field['instructions']) {
            ?>
				<p class="description"><?php 
            echo $field['instructions'];
            ?>
</p>
			<?php 
        }
        ?>
			
		</<?php 
        echo $elements[$el];
        ?>
>
		<?php 
    }
    ?>
		<<?php 
    echo $elements[$el];
    ?>
 class="acf-input">
		
			<?php 
    acf_render_field($field);
    ?>
			
			<?php 
    if ($instruction == 'field' && $field['instructions']) {
        ?>
				<p class="description"><?php 
        echo $field['instructions'];
        ?>
</p>
			<?php 
    }
    ?>
			
			<?php 
    if (!empty($field['conditional_logic'])) {
        ?>
			<script type="text/javascript">
			(function($) {
				
			if( typeof acf !== 'undefined' )
			{
//.........这里部分代码省略.........
开发者ID:spiff888,项目名称:rockharbor,代码行数:101,代码来源:api-helpers.php

示例10: html

    static function html($args)
    {
        //print_r($_POST);
        if (isset($_POST) && !empty($_POST)) {
            return;
        }
        if (!function_exists('acf_get_field_groups')) {
            echo 'You need ACF activated to use this screen';
            exit;
        }
        /* Todo intercept and update the special key here */
        //print_r($json); exit;
        ?>
        <div class="wrap acf-settings-wrap">

            <h2><?php 
        _e('Import / Export', 'acf');
        ?>
</h2>

            <div class="acf-box">
                <div class="title">
                    <h3><?php 
        _e('Generate Your Template Output', 'inboundnow');
        ?>
</h3>
                </div>

                <div class="inner">
                <script type="text/javascript">
                function replaceUrlParam(url, paramName, paramValue){
                    var pattern = new RegExp('('+paramName+'=).*?(&|$)')
                    var newUrl=url
                    if(url.search(pattern)>=0){
                        newUrl = url.replace(pattern,'$1' + paramValue + '$2');
                    }
                    else{
                        newUrl = newUrl + (newUrl.indexOf('?')>0 ? '&' : '?') + paramName + '=' + paramValue
                    }
                    return newUrl
                }
                jQuery(document).ready(function($) {
                   // put all your jQuery goodness in here.
                    jQuery("#generate_template").on('change', function () {
                        var val = jQuery(this).val();
                        var newUrl = replaceUrlParam(window.location.href, 'generate-template-id', val);
                       window.location.href = newUrl;
                    });
                 });

                </script>
                <div id="options-available">
                <?php 
        $choices = array('none' => "Choose template");
        $field_groups_ids = acf_get_field_groups();
        // populate choices
        if (!empty($field_groups_ids)) {
            foreach ($field_groups_ids as $field_group) {
                //print_r($field_group);
                $choices[$field_group['key']] = $field_group['title'];
            }
        }
        echo "<label>Select the ACF options you wish to generate markup for</label>";
        // render field
        $acf_id = isset($_GET['generate-template-id']) ? $_GET['generate-template-id'] : false;
        $template_name = isset($_GET['template-name']) ? $_GET['template-name'] : '';
        acf_render_field(array('type' => 'select', 'name' => 'generate_template', 'prefix' => false, 'value' => $acf_id, 'toggle' => true, 'choices' => $choices));
        acf_render_field(array('type' => 'text', 'name' => 'template_name', 'prefix' => false, 'value' => $template_name, 'placeholder' => "Template Name"));
        ?>



                </div>
                <p>This page is for helping developing templating super simple.</p>

                <p>This is generated output from your landing page options to copy/paste into your index.php</p>

<?php 
        /**
         * Generate the template here
         */
        /* get the data */
        $json = self::get_json();
        //print_r($json);
        // validate
        if ($json === false || empty($json)) {
            acf_add_admin_notice(__("No field groups selected", 'acf'), 'error');
            exit;
        }
        // vars
        $field_groups = $json;
        ?>

<textarea style="width:100%; height:500px;"  class="pre" readonly="true">
<?php 
        echo "<?php\n/**\n* Template Name: __TEMPLATE_NAME__\n* @package  WordPress Landing Pages\n* @author   Inbound Template Generator\n*/\n\n/* Declare Template Key */\n\$key = basename(dirname(__FILE__));\n\n/* discover the absolute path of where this template is located. Core templates are loacted in /wp-content/plugins/landing-pages/templates/ while custom templates belong in /wp-content/uploads/landing-pages/tempaltes/ */\n\$path = (preg_match(\"/uploads/\", dirname(__FILE__))) ? LANDINGPAGES_UPLOADS_PATH . \$key .'/' : LANDINGPAGES_PATH.'templates/'.\$key.'/';\n\n\$urlpath = (preg_match(\"/uploads/\", dirname(__FILE__))) ? LANDINGPAGES_UPLOADS_URLPATH . \$key .'/' : LANDINGPAGES_URLPATH.'templates/'.\$key.'/';\n\n/* Include ACF Field Definitions  */\ninclude_once(\$path .'config.php');\n\n/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */\ndo_action('wp_head');\n\$post_id = get_the_ID(); ";
        ?>
?>

<?php 
//.........这里部分代码省略.........
开发者ID:julsquintanilla,项目名称:landing-pages,代码行数:101,代码来源:class.template-utils.php

示例11: array

?>
</label>
                    	</th>
						<td>
							<?php 
// vars
$choices = array();
$field_groups = acf_get_field_groups();
// populate choices
if (!empty($field_groups)) {
    foreach ($field_groups as $field_group) {
        $choices[$field_group['key']] = $field_group['title'];
    }
}
// render field
acf_render_field(array('type' => 'checkbox', 'name' => 'acf_export_keys', 'prefix' => false, 'value' => false, 'toggle' => true, 'choices' => $choices));
?>
						</td>
					</tr>
					<tr>
						<th></th>
						<td>
							<input type="submit" name="download" class="acf-button blue" value="<?php 
_e('Download export file', 'acf');
?>
" />
							<input type="submit" name="generate" class="acf-button blue" value="<?php 
_e('Generate export code', 'acf');
?>
" />
						</td>
开发者ID:jewbre,项目名称:vdlhr,代码行数:31,代码来源:settings-export.php

示例12: pmai_render_field


//.........这里部分代码省略.........
                    echo $field['key'];
                    ?>
]" value="yes" <?php 
                    echo 'no' != $current_is_multiple_field_value ? 'checked="checked"' : '';
                    ?>
/>
								<label for="is_multiple_field_value_<?php 
                    echo str_replace(array('[', ']'), '', $field_name);
                    ?>
_<?php 
                    echo $field['key'];
                    ?>
_yes" class="chooser_label"><?php 
                    _e("Select value for all records", "pmxi_plugin");
                    ?>
</label>
							</div>
							<div class="wpallimport-clear"></div>
							<div class="switcher-target-is_multiple_field_value_<?php 
                    echo str_replace(array('[', ']'), '', $field_name);
                    ?>
_<?php 
                    echo $field['key'];
                    ?>
_yes">
								<div class="input sub_input">
									<div class="input">
										<?php 
                    if ($acf and version_compare($acf->settings['version'], '5.0.0') >= 0) {
                        $field_class = 'acf_field_' . $field['type'];
                        $field['other_choice'] = false;
                        $field['_input'] = 'multiple_value' . $field_name . '[' . $field['key'] . ']';
                        $field['value'] = $current_multiple_value;
                        acf_render_field($field);
                    } else {
                        $field_class = 'acf_field_' . $field['type'];
                        $new_field = new $field_class();
                        $field['other_choice'] = false;
                        $field['name'] = 'multiple_value' . $field_name . '[' . $field['key'] . ']';
                        $field['value'] = $current_multiple_value;
                        $new_field->create_field($field);
                    }
                    ?>
									</div>
								</div>
							</div>
						</div>											
						
						<div class="clear"></div>

						<div class="input">
							<div class="main_choise">
								<input type="radio" id="is_multiple_field_value_<?php 
                    echo str_replace(array('[', ']'), '', $field_name);
                    ?>
_<?php 
                    echo $field['key'];
                    ?>
_no" class="switcher" name="is_multiple_field_value<?php 
                    echo $field_name;
                    ?>
[<?php 
                    echo $field['key'];
                    ?>
]" value="no" <?php 
                    echo 'no' == $current_is_multiple_field_value ? 'checked="checked"' : '';
开发者ID:ryan2407,项目名称:Vision,代码行数:67,代码来源:pmai_render_field.php

示例13: render_field

 function render_field($field)
 {
     /*
      *  Review the data of $field.
      *  This will show what data is available
      */
     // Change Field into a select
     $field['type'] = 'select';
     $field['ui'] = 0;
     $field['ajax'] = 0;
     $field['choices'] = array();
     $args = array('posts_per_page' => -1, 'post_type' => 'page', 'orderby' => 'title', 'order' => 'ASC', 'post_status' => array('publish', 'private', 'draft', 'inherit', 'future'), 'sort_column' => 'menu_order, post_title', 'sort_order' => 'ASC', 'suppress_filters' => false, 'meta_key' => '_wp_page_template', 'meta_value' => '');
     $template_name_by_file = array();
     $page_templates = get_page_templates();
     foreach ($page_templates as $template_name => $template_file) {
         $template_name_by_file[$template_file] = $template_name;
     }
     foreach ($field['page_template'] as $page_template) {
         $template_name = $template_name_by_file[$page_template];
         // get pages
         $args['meta_value'] = $page_template;
         $pages = get_posts($args);
         if ($pages) {
             foreach ($pages as $post) {
                 // find page title. Could use get_the_title, but that uses get_post(), so I think this uses less Memory
                 $title = '';
                 $ancestors = get_ancestors($post->ID, $post->post_type);
                 if ($ancestors) {
                     foreach ($ancestors as $a) {
                         $title .= '–';
                     }
                 }
                 $title .= ' ' . apply_filters('the_title', $post->post_title, $post->ID);
                 // status
                 if ($post->post_status != 'publish') {
                     $title .= " ({$post->post_status})";
                 }
                 // WPML
                 if (defined('ICL_LANGUAGE_CODE')) {
                     $title .= ' (' . ICL_LANGUAGE_CODE . ')';
                 }
                 // add to choices
                 $field['choices'][$template_name][$post->ID] = $title;
             }
         }
     }
     // render
     acf_render_field($field);
 }
开发者ID:RobCreo,项目名称:acf-pages-by-template,代码行数:49,代码来源:acf_pages_by_template_v5.php

示例14: render_field

 function render_field($field)
 {
     // Change Field into a select
     $field['type'] = 'select';
     $field['ui'] = 1;
     $field['ajax'] = 1;
     $field['choices'] = array();
     // populate choices
     if (!empty($field['value'])) {
         // force value to array
         $field['value'] = acf_get_array($field['value']);
         // convert values to int
         $field['value'] = array_map('intval', $field['value']);
         $users = get_users(array('include' => $field['value']));
         if (!empty($users)) {
             foreach ($users as $user) {
                 $field['choices'][$user->ID] = $this->get_result($user, $field);
             }
         }
     }
     // render
     acf_render_field($field);
 }
开发者ID:jewbre,项目名称:vdlhr,代码行数:23,代码来源:user.php

示例15: render_field_select

 function render_field_select($field)
 {
     // Change Field into a select
     $field['type'] = 'select';
     $field['ui'] = 1;
     $field['ajax'] = 1;
     $field['choices'] = array();
     // value
     if (!empty($field['value'])) {
         // get terms
     }
     var_dump($field);
     // render select
     acf_render_field($field);
 }
开发者ID:quangnpd,项目名称:jobshop_web,代码行数:15,代码来源:taxonomy-object.php


注:本文中的acf_render_field函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。