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


PHP acf_get_view函数代码示例

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


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

示例1: html

 function html()
 {
     // vars
     $view = array('version' => acf_get_setting('version'), 'have_pro' => acf_get_setting('pro'), 'tabs' => array('new' => __("What's New", 'acf'), 'changelog' => __("Changelog", 'acf')), 'active' => 'new');
     // set active tab
     if (!empty($_GET['tab']) && array_key_exists($_GET['tab'], $view['tabs'])) {
         $view['active'] = $_GET['tab'];
     }
     // load view
     acf_get_view('settings-info', $view);
 }
开发者ID:harrisonsmith,项目名称:active-progression,代码行数:11,代码来源:settings-info.php

示例2: mb_fields

 function mb_fields()
 {
     // global
     global $post;
     // vars
     $field_group = acf_get_field_group($post);
     // get fields
     $view = array('fields' => acf_get_fields_by_id($field_group['ID']));
     // load view
     acf_get_view('field-group-fields', $view);
 }
开发者ID:eea76,项目名称:hammer,代码行数:11,代码来源:field-group.php

示例3: html

 function html()
 {
     // load view
     acf_get_view($this->view, $this->data);
 }
开发者ID:Aqro,项目名称:NewDWM,代码行数:5,代码来源:settings-tools.php

示例4: render_field_settings

        function render_field_settings($field)
        {
            // load default layout
            if (empty($field['layouts'])) {
                $field['layouts'] = array();
                $field['layouts'][] = $this->get_valid_layout();
            }
            // loop through layouts
            foreach ($field['layouts'] as $layout) {
                // get valid layout
                $layout = $this->get_valid_layout($layout);
                // vars
                $layout_prefix = "{$field['prefix']}[layouts][{$layout['key']}]";
                ?>
<tr class="acf-field" data-name="fc_layout" data-setting="flexible_content" data-id="<?php 
                echo $layout['key'];
                ?>
">
	<td class="acf-label">
		<label><?php 
                _e("Layout", 'acf');
                ?>
</label>
		<p class="description acf-fl-actions">
			<a data-name="acf-fc-reorder" title="<?php 
                _e("Reorder Layout", 'acf');
                ?>
" ><?php 
                _e("Reorder", 'acf');
                ?>
</a>
			<a data-name="acf-fc-delete" title="<?php 
                _e("Delete Layout", 'acf');
                ?>
" href="#"><?php 
                _e("Delete", 'acf');
                ?>
</a>
			<a data-name="acf-fc-duplicate" title="<?php 
                _e("Duplicate Layout", 'acf');
                ?>
" href="#"><?php 
                _e("Duplicate", 'acf');
                ?>
</a>
			<a data-name="acf-fc-add" title="<?php 
                _e("Add New Layout", 'acf');
                ?>
" href="#"><?php 
                _e("Add New", 'acf');
                ?>
</a>
		</p>
	</td>
	<td class="acf-input">
		
		<ul class="acf-fc-meta acf-bl">
			<li class="acf-fc-meta-key">
				<?php 
                acf_hidden_input(array('name' => "{$layout_prefix}[key]", 'data-name' => 'layout-key', 'value' => $layout['key']));
                ?>
			</li>
			<li class="acf-fc-meta-label">
				<?php 
                acf_render_field(array('type' => 'text', 'name' => 'label', 'prefix' => $layout_prefix, 'value' => $layout['label'], 'prepend' => __('Label', 'acf')));
                ?>
			</li>
			<li class="acf-fc-meta-name">
				<?php 
                acf_render_field(array('type' => 'text', 'name' => 'name', 'prefix' => $layout_prefix, 'value' => $layout['name'], 'prepend' => __('Name', 'acf')));
                ?>
			</li>
			<li class="acf-fc-meta-display">
				<div class="acf-input-prepend"><?php 
                _e('Layout', 'acf');
                ?>
</div>
				<div class="acf-input-wrap select">
					<?php 
                acf_render_field(array('type' => 'select', 'name' => 'display', 'prefix' => $layout_prefix, 'value' => $layout['display'], 'choices' => array('table' => __('Table', 'acf'), 'block' => __('Block', 'acf'), 'row' => __('Row', 'acf'))));
                ?>
				</div>
			</li>
			<li class="acf-fc-meta-min">
				<?php 
                acf_render_field(array('type' => 'text', 'name' => 'min', 'prefix' => $layout_prefix, 'value' => $layout['min'], 'prepend' => __('Min', 'acf')));
                ?>
			</li>
			<li class="acf-fc-meta-max">
				<?php 
                acf_render_field(array('type' => 'text', 'name' => 'max', 'prefix' => $layout_prefix, 'value' => $layout['max'], 'prepend' => __('Max', 'acf')));
                ?>
			</li>
		</ul>
		<?php 
                // vars
                $args = array('fields' => $layout['sub_fields'], 'layout' => $layout['display'], 'parent' => $field['ID']);
                acf_get_view('field-group-fields', $args);
                ?>
	</td>
//.........这里部分代码省略.........
开发者ID:Aqro,项目名称:NewDWM,代码行数:101,代码来源:flexible-content.php

示例5: render_field_settings

        function render_field_settings($field)
        {
            // vars
            $args = array('fields' => $field['sub_fields'], 'layout' => $field['layout'], 'parent' => $field['ID']);
            ?>
<tr class="acf-field" data-setting="repeater" data-name="sub_fields">
			<td class="acf-label">
				<label><?php 
            _e("Sub Fields", 'acf');
            ?>
</label>
				<p class="description"></p>		
			</td>
			<td class="acf-input">
				<?php 
            acf_get_view('field-group-fields', $args);
            ?>
			</td>
		</tr>
		<?php 
            // rows
            $field['min'] = empty($field['min']) ? '' : $field['min'];
            $field['max'] = empty($field['max']) ? '' : $field['max'];
            // min
            acf_render_field_setting($field, array('label' => __('Minimum Rows', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'min', 'placeholder' => '0'));
            // max
            acf_render_field_setting($field, array('label' => __('Maximum Rows', 'acf'), 'instructions' => '', 'type' => 'number', 'name' => 'max', 'placeholder' => '0'));
            // layout
            acf_render_field_setting($field, array('label' => __('Layout', 'acf'), 'instructions' => '', 'class' => 'acf-repeater-layout', 'type' => 'radio', 'name' => 'layout', 'layout' => 'horizontal', 'choices' => array('table' => __('Table', 'acf'), 'block' => __('Block', 'acf'), 'row' => __('Row', 'acf'))));
            // button_label
            acf_render_field_setting($field, array('label' => __('Button Label', 'acf'), 'instructions' => '', 'type' => 'text', 'name' => 'button_label'));
        }
开发者ID:quangnpd,项目名称:jobshop_web,代码行数:32,代码来源:repeater.php

示例6: html

 function html()
 {
     // load view
     acf_get_view('settings-addons', $this->view);
 }
开发者ID:de190909,项目名称:WPTest,代码行数:5,代码来源:settings-addons.php

示例7: html

 function html()
 {
     // view
     $view = array('updates' => acf_get_updates(), 'plugin_version' => acf_get_setting('version'));
     // enqueue
     acf_enqueue_scripts();
     // load view
     acf_get_view('update', $view);
 }
开发者ID:slavic18,项目名称:cats,代码行数:9,代码来源:update.php

示例8: _e

    }
}
?>
		
	</div>
	
	<ul class="acf-hl acf-tfoot">
		<li class="acf-fr">
			<a href="#" class="button button-primary button-large add-field"><?php 
_e('+ Add Field', 'acf');
?>
</a>
		</li>
	</ul>
	
<?php 
if (!$parent) {
    // get clone
    $clone = acf_get_valid_field(array('ID' => 'acfcloneindex', 'key' => 'acfcloneindex', 'label' => __('New Field', 'acf'), 'name' => 'new_field', 'type' => 'text'));
    ?>
	<script type="text/html" id="tmpl-acf-field">
	<?php 
    acf_get_view('field-group-field', array('field' => $clone));
    ?>
	</script>
<?php 
}
?>
	
</div>
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:30,代码来源:field-group-fields.php

示例9: html

 function html()
 {
     // view
     $view = array('updates' => acf_get_updates());
     // load view
     acf_get_view('update', $view);
 }
开发者ID:dleatherman,项目名称:timbangular-js,代码行数:7,代码来源:update.php

示例10: network_html

 function network_html()
 {
     // vars
     $plugin_version = acf_get_setting('version');
     // loop through sites and find updates
     $sites = acf_get_sites();
     if ($sites) {
         foreach ($sites as $i => $site) {
             // switch blog
             switch_to_blog($site['blog_id']);
             // extra info
             $site['name'] = get_bloginfo('name');
             $site['url'] = home_url();
             // get site updates
             $site['updates'] = acf_get_db_updates();
             // get site version
             $site['acf_version'] = get_option('acf_version');
             // no value equals new instal
             if (!$site['acf_version']) {
                 $site['acf_version'] = $plugin_version;
             }
             // update
             $sites[$i] = $site;
             // restore
             restore_current_blog();
         }
     }
     // view
     $view = array('sites' => $sites, 'plugin_version' => $plugin_version);
     // load view
     acf_get_view('install-network', $view);
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:32,代码来源:install-network.php

示例11: mb_fields

 function mb_fields()
 {
     // global
     global $field_group;
     // get fields
     $view = array('fields' => acf_get_fields_by_id($field_group['ID']), 'parent' => 0);
     // load view
     acf_get_view('field-group-fields', $view);
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:9,代码来源:field-group.php

示例12: html

 function html()
 {
     // view
     $view = array('updates' => acf_get_db_updates(), 'plugin_version' => acf_get_setting('version'));
     // load view
     acf_get_view('install', $view);
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:7,代码来源:install.php

示例13: acf_render_field_wrap

// label
acf_render_field_wrap(array('label' => __('Field Label', 'acf'), 'instructions' => __('This is the name which will appear on the EDIT page', 'acf'), 'required' => 1, 'type' => 'text', 'name' => 'label', 'prefix' => $field['prefix'], 'value' => $field['label']), 'tr');
// name
acf_render_field_wrap(array('label' => __('Field Name', 'acf'), 'instructions' => __('Single word, no spaces. Underscores and dashes allowed', 'acf'), 'required' => 1, 'type' => 'text', 'name' => 'name', 'prefix' => $field['prefix'], 'value' => $field['name']), 'tr');
// type
acf_render_field_wrap(array('label' => __('Field Type', 'acf'), 'instructions' => '', 'required' => 1, 'type' => 'select', 'name' => 'type', 'prefix' => $field['prefix'], 'value' => $field['type'], 'choices' => acf_get_field_types()), 'tr');
// instructions
acf_render_field_wrap(array('label' => __('Instructions', 'acf'), 'instructions' => __('Instructions for authors. Shown when submitting data', 'acf'), 'type' => 'textarea', 'name' => 'instructions', 'prefix' => $field['prefix'], 'value' => $field['instructions'], 'rows' => 5), 'tr');
// required
acf_render_field_wrap(array('label' => __('Required?', 'acf'), 'instructions' => '', 'type' => 'radio', 'name' => 'required', 'prefix' => $field['prefix'], 'value' => $field['required'], 'choices' => array(1 => __("Yes", 'acf'), 0 => __("No", 'acf')), 'layout' => 'horizontal'), 'tr');
// type specific settings
do_action("acf/render_field_settings/type={$field['type']}", $field);
// 3rd party settings
do_action('acf/render_field_settings', $field);
// conditional logic
acf_get_view('field-group-field-conditional-logic', array('field' => $field));
// wrapper
acf_render_field_wrap(array('label' => __('Wrapper Attributes', 'acf'), 'instructions' => '', 'type' => 'text', 'name' => 'width', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['width'], 'prepend' => __('width', 'acf'), 'append' => '%', 'wrapper' => array('data-name' => 'wrapper')), 'tr');
acf_render_field_wrap(array('label' => '', 'instructions' => '', 'type' => 'text', 'name' => 'class', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['class'], 'prepend' => __('class', 'acf'), 'wrapper' => array('data-append' => 'wrapper')), 'tr');
acf_render_field_wrap(array('label' => '', 'instructions' => '', 'type' => 'text', 'name' => 'id', 'prefix' => $field['prefix'] . '[wrapper]', 'value' => $field['wrapper']['id'], 'prepend' => __('id', 'acf'), 'wrapper' => array('data-append' => 'wrapper')), 'tr');
?>
				<tr class="acf-field acf-field-save">
					<td class="acf-label"></td>
					<td class="acf-input">
						<ul class="acf-hl">
							<li>
								<a class="edit-field acf-button grey" title="<?php 
_e("Close Field", 'acf');
?>
" href="#"><?php 
_e("Close Field", 'acf');
开发者ID:slavic18,项目名称:cats,代码行数:31,代码来源:field-group-field.php

示例14: foreach

</li>
	</ul>
	
	<div class="acf-field-list<?php 
if ($layout) {
    echo " layout-{$layout}";
}
?>
">
		
		<?php 
foreach ($fields as $i => $field) {
    ?>
			
			<?php 
    acf_get_view('field-group-field', array('field' => $field, 'i' => $i));
    ?>
			
		<?php 
}
?>
		
		<div class="no-fields-message" <?php 
if (count($fields) > 1) {
    echo 'style="display:none;"';
}
?>
>
			<?php 
_e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.", 'acf');
?>
开发者ID:esjosemartinez,项目名称:PrototestWP,代码行数:31,代码来源:field-group-fields.php


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