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


PHP acf_enqueue_scripts函数代码示例

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


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

示例1: load

 function load()
 {
     // hide upgrade
     remove_action('admin_notices', array($this, 'admin_notices'), 1);
     // load acf scripts
     acf_enqueue_scripts();
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:7,代码来源:install.php

示例2: network_load

 function network_load()
 {
     // hide notice on this page
     remove_action('network_admin_notices', array($this, 'network_admin_notices'), 1);
     // load acf scripts
     acf_enqueue_scripts();
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:7,代码来源:install-network.php

示例3: admin_enqueue_scripts

 function admin_enqueue_scripts()
 {
     // validate page
     if (!$this->validate_page()) {
         return;
     }
     // load acf scripts
     acf_enqueue_scripts();
 }
开发者ID:tofubuddha,项目名称:example,代码行数:9,代码来源:user.php

示例4: admin_enqueue_scripts

 function admin_enqueue_scripts()
 {
     // validate page
     if (!$this->validate_page()) {
         return;
     }
     // load acf scripts
     acf_enqueue_scripts();
     // actions
     add_action('add_meta_boxes_comment', array($this, 'edit_comment'), 10, 1);
 }
开发者ID:tofubuddha,项目名称:example,代码行数:11,代码来源:comment.php

示例5: admin_enqueue_scripts

 function admin_enqueue_scripts()
 {
     // validate page
     if (!$this->validate_page()) {
         return;
     }
     // load acf scripts
     acf_enqueue_scripts();
     // actions
     add_action('acf/input/admin_footer', array($this, 'admin_footer'));
 }
开发者ID:adnandot,项目名称:intenseburn,代码行数:11,代码来源:widget.php

示例6: admin_enqueue_scripts

 function admin_enqueue_scripts()
 {
     // validate screen
     if (acf_is_screen('widgets') || acf_is_screen('customize')) {
         // valid
     } else {
         return;
     }
     // load acf scripts
     acf_enqueue_scripts();
     // actions
     add_action('acf/input/admin_footer', array($this, 'admin_footer'), 1);
 }
开发者ID:ReLiFeD,项目名称:irreversible.eu,代码行数:13,代码来源:widget.php

示例7: admin_enqueue_scripts

 function admin_enqueue_scripts()
 {
     // validate page
     if (!$this->validate_page()) {
         return;
     }
     // vars
     $screen = get_current_screen();
     $taxonomy = $screen->taxonomy;
     // load acf scripts
     acf_enqueue_scripts();
     // render
     add_action("{$taxonomy}_add_form_fields", array($this, 'add_term'), 10, 1);
     add_action("{$taxonomy}_edit_form", array($this, 'edit_term'), 10, 2);
 }
开发者ID:tofubuddha,项目名称:example,代码行数:15,代码来源:taxonomy.php

示例8: load

 function load()
 {
     // disable filters to ensure ACF loads raw data from DB
     acf_disable_filters();
     // run import / export
     if (acf_verify_nonce('import')) {
         $this->import();
     } elseif (acf_verify_nonce('export')) {
         if (isset($_POST['generate'])) {
             $this->generate();
         } else {
             $this->export();
         }
     }
     // load acf scripts
     acf_enqueue_scripts();
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:17,代码来源:settings-tools.php

示例9: load

 function load()
 {
     // all export pages should not load local fields
     acf_disable_local();
     // run import / export
     if (acf_verify_nonce('import')) {
         $this->import();
     } elseif (acf_verify_nonce('export')) {
         if (isset($_POST['generate'])) {
             $this->generate();
         } else {
             $this->export();
         }
     }
     // load acf scripts
     acf_enqueue_scripts();
 }
开发者ID:Aqro,项目名称:NewDWM,代码行数:17,代码来源:settings-tools.php

示例10: current_screen

 function current_screen()
 {
     // validate screen
     if (!acf_is_screen('acf-field-group')) {
         return;
     }
     // disable filters to ensure ACF loads raw data from DB
     acf_disable_filters();
     // enqueue scripts
     acf_enqueue_scripts();
     // actions
     add_action('acf/input/admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('acf/input/admin_head', array($this, 'admin_head'));
     add_action('acf/input/form_data', array($this, 'form_data'));
     add_action('acf/input/admin_footer', array($this, 'admin_footer'));
     add_action('acf/input/admin_footer_js', array($this, 'admin_footer_js'));
     // filters
     add_filter('acf/input/admin_l10n', array($this, 'admin_l10n'));
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:19,代码来源:field-group.php

示例11: current_screen

 function current_screen()
 {
     // validate screen
     if (!acf_is_screen('acf-field-group')) {
         return;
     }
     // disable JSON to avoid conflicts between DB and JSON
     acf_disable_local();
     // enqueue scripts
     acf_enqueue_scripts();
     // actions
     add_action('acf/input/admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('acf/input/admin_head', array($this, 'admin_head'));
     add_action('acf/input/form_data', array($this, 'form_data'));
     add_action('acf/input/admin_footer', array($this, 'admin_footer'));
     add_action('acf/input/admin_footer_js', array($this, 'admin_footer_js'));
     // filters
     add_filter('acf/input/admin_l10n', array($this, 'admin_l10n'));
 }
开发者ID:uwmadisoncals,项目名称:vmmm,代码行数:19,代码来源:field-group.php

示例12: acf_form_head

function acf_form_head()
{
    // verify nonce
    if (acf_verify_nonce('acf_form')) {
        // validate data
        if (acf_validate_save_post(true)) {
            // form
            $form = acf_extract_var($_POST, '_acf_form');
            $form = @json_decode(base64_decode($form), true);
            // validate
            if (empty($form)) {
                return;
            }
            // allow for custom save
            $form['post_id'] = apply_filters('acf/pre_save_post', $form['post_id'], $form);
            // save
            acf_save_post($form['post_id']);
            // redirect
            if (!empty($form['return'])) {
                // update %placeholders%
                $form['return'] = str_replace('%post_url%', get_permalink($form['post_id']), $form['return']);
                // redirect
                wp_redirect($form['return']);
                exit;
            }
        }
        // if
    }
    // if
    // load acf scripts
    acf_enqueue_scripts();
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:32,代码来源:api-template.php

示例13: admin_load

 function admin_load()
 {
     // globals
     global $plugin_page;
     // vars
     $this->page = acf_get_options_page($plugin_page);
     // verify and remove nonce
     if (acf_verify_nonce('options')) {
         // save data
         if (acf_validate_save_post(true)) {
             // get post_id (allow lang modification)
             $post_id = acf_get_valid_post_id($this->page['post_id']);
             // set autoload
             acf_update_setting('autoload', $this->page['autoload']);
             // save
             acf_save_post($post_id);
             // redirect
             wp_redirect(add_query_arg(array('message' => '1')));
             exit;
         }
     }
     // load acf scripts
     acf_enqueue_scripts();
     // actions
     add_action('acf/input/admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('acf/input/admin_head', array($this, 'admin_head'));
     // add columns support
     add_screen_option('layout_columns', array('max' => 2, 'default' => 2));
 }
开发者ID:rmikeska,项目名称:ushipnetwork,代码行数:29,代码来源:options-page.php

示例14: acf_form_head

function acf_form_head()
{
    // verify nonce
    if (acf_verify_nonce('acf_form')) {
        // validate data
        if (acf_validate_save_post(true)) {
            // form
            $GLOBALS['acf_form'] = acf_extract_var($_POST, '_acf_form');
            $GLOBALS['acf_form'] = @json_decode(base64_decode($GLOBALS['acf_form']), true);
            // validate
            if (empty($GLOBALS['acf_form'])) {
                return;
            }
            // vars
            $post_id = acf_maybe_get($GLOBALS['acf_form'], 'post_id', 0);
            // allow for custom save
            $post_id = apply_filters('acf/pre_save_post', $post_id, $GLOBALS['acf_form']);
            // save
            acf_save_post($post_id);
            // vars
            $return = acf_maybe_get($GLOBALS['acf_form'], 'return', '');
            // redirect
            if ($return) {
                // update %placeholders%
                $return = str_replace('%post_url%', get_permalink($post_id), $return);
                // redirect
                wp_redirect($return);
                exit;
            }
        }
        // if
    }
    // if
    // load acf scripts
    acf_enqueue_scripts();
}
开发者ID:de190909,项目名称:WPTest,代码行数:36,代码来源:api-template.php

示例15: render

    public function render()
    {
        acf_enqueue_scripts();
        do_action('acf/view', $this->args, $this);
        $post_id = $this->post_id;
        $args = $this->args;
        // vars
        $field_groups = array();
        $fields = array();
        // post_title
        if ($args['post_title']) {
            $fields[] = acf_get_valid_field(array('name' => '_post_title', 'label' => 'Title', 'type' => 'text', 'value' => $post_id ? get_post_field('post_title', $post_id) : '', 'required' => true));
        }
        // post_content
        if ($args['post_content']) {
            $fields[] = acf_get_valid_field(array('name' => '_post_content', 'label' => 'Content', 'type' => 'wysiwyg', 'value' => $post_id ? get_post_field('post_content', $post_id) : ''));
        }
        // specific fields
        if ($args['fields']) {
            foreach ($args['fields'] as $selector) {
                // append field ($strict = false to allow for better compatibility with field names)
                $fields[] = acf_maybe_get_field($selector, $post_id, false);
            }
        } elseif ($args['field_groups']) {
            foreach ($args['field_groups'] as $selector) {
                $field_groups[] = acf_get_field_group($selector);
            }
        } elseif ($args['post_id'] == 'new_post') {
            $field_groups = acf_get_field_groups(array('post_type' => $args['new_post']['post_type']));
        } else {
            $field_groups = acf_get_field_groups(array('post_id' => $args['post_id']));
        }
        //load fields based on field groups
        if (!empty($field_groups)) {
            foreach ($field_groups as $field_group) {
                $field_group_fields = acf_get_fields($field_group);
                if (!empty($field_group_fields)) {
                    foreach (array_keys($field_group_fields) as $i) {
                        $fields[] = acf_extract_var($field_group_fields, $i);
                    }
                }
            }
        }
        ?>
		<div class="acf-fields acf-form-fields -<?php 
        echo $args['label_placement'];
        ?>
">

		<?php 
        // html before fields
        echo $args['html_before_fields'];
        // render
        acf_views_render_fields($post_id, $fields, $args['field_el'], $args['instruction_placement']);
        // html after fields
        echo $args['html_after_fields'];
        ?>

		</div><!-- acf-form-fields -->
		<?php 
    }
开发者ID:NikolaGrdanjski,项目名称:acf-views,代码行数:61,代码来源:acf-views-view.php


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