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


PHP acf_get_setting函数代码示例

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


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

示例1: admin_footer

    function admin_footer()
    {
        // vars
        $args = acf_get_setting('form_data');
        // validate
        if (empty($args)) {
            return;
        }
        // global
        global $wp_version;
        // options
        $o = array('post_id' => $args['post_id'], 'nonce' => wp_create_nonce('acf_nonce'), 'admin_url' => admin_url(), 'ajaxurl' => admin_url('admin-ajax.php'), 'ajax' => $args['ajax'], 'wp_version' => $wp_version);
        // l10n
        $l10n = apply_filters('acf/input/admin_l10n', array('core' => array('expand_details' => __('Expand Details', 'acf'), 'collapse_details' => __('Collapse Details', 'acf'), 'save_alert' => __('The changes you made will be lost if you navigate away from this page.', 'acf')), 'validation' => array('error' => __("Validation Failed. One or more fields below are required.", 'acf'))));
        ?>
		<script type="text/javascript">
		(function($) {
		
			acf.o = <?php 
        echo json_encode($o);
        ?>
;
			acf.l10n = <?php 
        echo json_encode($l10n);
        ?>
;
		
		})(jQuery);	
		</script>
		<?php 
    }
开发者ID:dleatherman,项目名称:timbangular-js,代码行数:31,代码来源:input.php

示例2: inject_update

 function inject_update($transient)
 {
     // bail early if not admin
     if (!is_admin()) {
         return $transient;
     }
     // bail early if no update available
     if (!acf_pro_is_update_available()) {
         return $transient;
     }
     // vars
     $info = acf_pro_get_remote_info();
     $basename = acf_get_setting('basename');
     $slug = acf_get_setting('slug');
     // create new object for update
     $obj = new stdClass();
     $obj->slug = $slug;
     $obj->new_version = $info['version'];
     $obj->url = $info['homepage'];
     $obj->package = '';
     // license
     if (acf_pro_is_license_active()) {
         $obj->package = acf_pro_get_remote_url('download', array('k' => acf_pro_get_license()));
     }
     // add to transient
     $transient->response[$basename] = $obj;
     // return
     return $transient;
 }
开发者ID:tofubuddha,项目名称:example,代码行数:29,代码来源:connect.php

示例3: modify_plugin_update

 function modify_plugin_update($transient)
 {
     // bail early if no response (dashboard showed an error)
     if (!isset($transient->response)) {
         return $transient;
     }
     // vars
     $basename = acf_get_setting('basename');
     $show_updates = acf_get_setting('show_updates');
     // bail early if not a plugin (included in theme)
     if (!acf_is_plugin_active()) {
         $show_updates = false;
     }
     // bail early if no show_updates
     if (!$show_updates) {
         // remove from transient
         unset($transient->response[$basename]);
         // return
         return $transient;
     }
     // get update
     $update = acf_maybe_get($transient->response, $basename);
     // filter
     $update = apply_filters('acf/updates/plugin_update', $update, $transient);
     // update
     if ($update) {
         $transient->response[$basename] = $update;
     } else {
         unset($transient->response[$basename]);
     }
     // return
     return $transient;
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:33,代码来源:updates.php

示例4: input_admin_enqueue_scripts

 function input_admin_enqueue_scripts()
 {
     // bail ealry if no enqueue
     if (!acf_get_setting('enqueue_select2')) {
         return;
     }
     // globals
     global $wp_scripts, $wp_styles;
     // vars
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     $major = acf_get_setting('select2_version');
     $version = '';
     $script = '';
     $style = '';
     // v4
     if ($major == 4) {
         $version = '4.0';
         $script = acf_get_dir("assets/inc/select2/4/select2.full{$min}.js");
         $style = acf_get_dir("assets/inc/select2/4/select2{$min}.css");
         // v3
     } else {
         $version = '3.5.2';
         $script = acf_get_dir("assets/inc/select2/3/select2{$min}.js");
         $style = acf_get_dir("assets/inc/select2/3/select2.css");
     }
     // enqueue
     wp_enqueue_script('select2', $script, array('jquery'), $version);
     wp_enqueue_style('select2', $style, '', $version);
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:29,代码来源:select.php

示例5: admin_footer

    function admin_footer()
    {
        // vars
        $args = acf_get_setting('form_data');
        // global
        global $wp_version;
        // options
        $o = array('post_id' => $args['post_id'], 'nonce' => wp_create_nonce('acf_nonce'), 'admin_url' => admin_url(), 'ajaxurl' => admin_url('admin-ajax.php'), 'ajax' => $args['ajax'], 'validation' => $args['validation'], 'wp_version' => $wp_version);
        // l10n
        $l10n = apply_filters('acf/input/admin_l10n', array('unload' => __('The changes you made will be lost if you navigate away from this page', 'acf'), 'expand_details' => __('Expand Details', 'acf'), 'collapse_details' => __('Collapse Details', 'acf')));
        ?>
<script type="text/javascript">
/* <![CDATA[ */
if( typeof acf !== 'undefined' ) {

	acf.o = <?php 
        echo json_encode($o);
        ?>
;
	acf.l10n = <?php 
        echo json_encode($l10n);
        ?>
;
	<?php 
        do_action('acf/input/admin_footer_js');
        ?>
	
}
/* ]]> */
</script>
<?php 
    }
开发者ID:TMBR,项目名称:johnjohn,代码行数:32,代码来源:input.php

示例6: is_version_compatible

 /**
  * Check if the installed version of ACF is compatible with this version of Layotter
  *
  * @return bool
  */
 public static function is_version_compatible()
 {
     if (self::is_pro_installed()) {
         return version_compare(acf_get_setting('version'), self::REQUIRED_PRO_VERSION) >= 0;
     } else {
         return version_compare(acf()->get_info('version'), self::REQUIRED_VERSION) >= 0;
     }
 }
开发者ID:hingst,项目名称:layotter,代码行数:13,代码来源:acf-abstraction.php

示例7: admin_menu

 function admin_menu()
 {
     // bail early if no show_admin
     if (!acf_get_setting('show_admin')) {
         return;
     }
     add_menu_page(__("Custom Fields", 'acf'), __("Custom Fields", 'acf'), 'manage_options', 'edit.php?post_type=acf-field-group', false, false, '80.025');
 }
开发者ID:mariussunde,项目名称:Sn-hetta-Designmanual-WP-Theme,代码行数:8,代码来源:admin.php

示例8: wp_init

 function wp_init()
 {
     // register acf scripts
     wp_register_script('acf-pro-input', acf_get_dir('pro/js/pro-input.js'), false, acf_get_setting('version'));
     wp_register_style('acf-pro-input', acf_get_dir('pro/css/pro-input.css'), false, acf_get_setting('version'));
     // register acf scripts
     wp_register_script('acf-pro-field-group', acf_get_dir('pro/js/pro-field-group.js'), false, acf_get_setting('version'));
     wp_register_style('acf-pro-field-group', acf_get_dir('pro/css/pro-field-group.css'), false, acf_get_setting('version'));
 }
开发者ID:pellio11,项目名称:ns-select-project,代码行数:9,代码来源:acf-pro.php

示例9: is_enabled

 function is_enabled()
 {
     // bail early if no local allowed
     if (!acf_get_setting('local')) {
         return false;
     }
     // return
     return acf_is_filter_enabled('local');
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:9,代码来源:local.php

示例10: admin_menu

 function admin_menu()
 {
     // bail early if no show_admin
     if (!acf_get_setting('show_admin')) {
         return;
     }
     // add page
     $page = add_submenu_page('edit.php?post_type=acf-field-group', __('Import / Export', 'acf'), __('Import/Export', 'acf'), 'manage_options', 'acf-settings-export', array($this, 'html'));
     // actions
     add_action('load-' . $page, array($this, 'load'));
 }
开发者ID:mariussunde,项目名称:Sn-hetta-Designmanual-WP-Theme,代码行数:11,代码来源:settings-export.php

示例11: wp_init

 function wp_init()
 {
     // min
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     // register scripts
     wp_register_script('acf-pro-input', acf_get_dir("pro/js/pro-input{$min}.js"), false, acf_get_setting('version'));
     wp_register_script('acf-pro-field-group', acf_get_dir("pro/js/pro-field-group{$min}.js"), false, acf_get_setting('version'));
     // register styles
     wp_register_style('acf-pro-input', acf_get_dir('pro/css/pro-input.css'), false, acf_get_setting('version'));
     wp_register_style('acf-pro-field-group', acf_get_dir('pro/css/pro-field-group.css'), false, acf_get_setting('version'));
 }
开发者ID:dleatherman,项目名称:timbangular-js,代码行数:11,代码来源:acf-pro.php

示例12: acf_get_valid_field_group

function acf_get_valid_field_group($field_group = false)
{
    // parse in defaults
    $field_group = acf_parse_args($field_group, array('ID' => 0, 'key' => '', 'title' => '', 'fields' => array(), 'location' => array(), 'menu_order' => 0, 'position' => 'normal', 'style' => 'default', 'label_placement' => 'top', 'instruction_placement' => 'label', 'hide_on_screen' => array(), 'active' => 1, 'description' => ''));
    // translate
    $field_group = acf_translate_keys($field_group, acf_get_setting('l10n_field_group'));
    // filter
    $field_group = apply_filters('acf/get_valid_field_group', $field_group);
    // return
    return $field_group;
}
开发者ID:ReLiFeD,项目名称:irreversible.eu,代码行数:11,代码来源:api-field-group.php

示例13: 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

示例14: admin_menu

 function admin_menu()
 {
     // bail early if no show_admin
     if (!acf_get_setting('show_admin')) {
         return;
     }
     // add parent menu page
     add_menu_page(__("Custom Fields", 'acf'), __("Custom Fields", 'acf'), acf_get_setting('capability'), 'edit.php?post_type=acf-field-group', false, false, '80.025');
     // add child menu page
     add_submenu_page('edit.php?post_type=acf-field-group', __('Add New', 'acf'), __('Add New', 'acf'), acf_get_setting('capability'), 'post-new.php?post_type=acf-field-group');
 }
开发者ID:coreymargulis,项目名称:coreymargulis,代码行数:11,代码来源:admin.php

示例15: admin_menu

 function admin_menu()
 {
     // bail early if no show_admin
     if (!acf_get_setting('show_admin')) {
         return;
     }
     // add page
     $page = add_submenu_page('edit.php?post_type=acf-field-group', __('Tools', 'acf'), __('Tools', 'acf'), acf_get_setting('capability'), 'acf-settings-tools', array($this, 'html'));
     // actions
     add_action('load-' . $page, array($this, 'load'));
 }
开发者ID:Aqro,项目名称:NewDWM,代码行数:11,代码来源:settings-tools.php


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