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


PHP acf_field类代码示例

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


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

示例1: __construct

 /**
  *  __construct
  *
  *  @since	1.0.0
  */
 function __construct()
 {
     // Vars
     global $wp_filesystem;
     if (empty($wp_filesystem)) {
         require_once ABSPATH . '/wp-admin/includes/file.php';
         WP_Filesystem();
     }
     $this->name = 'fonticonpicker';
     $this->label = __('Icon Picker', 'acf');
     $this->category = __("jQuery", 'acf');
     $this->defaults = array('allow_null' => 0);
     $this->l10n = array();
     parent::__construct();
     // Settings
     $this->settings = array('dir' => get_template_directory_uri() . '/inc/includes/acf-fonticonpicker', 'path' => get_template_directory() . '/inc/includes/acf-fonticonpicker', 'config' => get_template_directory() . '/inc/includes/acf-fonticonpicker', 'icons' => get_template_directory_uri() . '/inc/includes/acf-fonticonpicker/icons/style.css', 'version' => '1.0.0');
     // Apply a filter so that you can load icon set from theme
     $this->settings = apply_filters('acf/acf_field_fonticonpicker/settings', $this->settings);
     // Enqueue icons style in the frontend
     add_action('wp_enqueue_scripts', array($this, 'frontend_enqueue'));
     // Load icons list from the icons JSON file
     if (is_admin()) {
         $json_file = trailingslashit($this->settings['config']) . '/icons/selection.json';
         if ($wp_filesystem->exists($json_file)) {
             $json_content = $wp_filesystem->get_contents($json_file);
             if (!$json_content) {
                 return new WP_Error('reading_error', 'Error when reading file');
             }
             $this->json_content = json_decode($json_content, true);
         }
     }
 }
开发者ID:chrisuehlein,项目名称:couponsite,代码行数:37,代码来源:fonticonpicker-v5.php

示例2: __construct

 function __construct()
 {
     $this->name = 'qtranslate_textarea';
     $this->label = __("Text Area", 'acf');
     $this->category = __("qTranslate", 'acf');
     acf_field::__construct();
 }
开发者ID:warruda,项目名称:portalsaudecrianca,代码行数:7,代码来源:textarea.php

示例3: __construct

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'image_crop';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Image with user-crop', 'acf-image_crop');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'content';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('force_crop' => 'no', 'crop_type' => 'hard', 'preview_size' => 'medium', 'save_format' => 'id', 'save_in_media_library' => 'yes', 'target_size' => 'thumbnail', 'library' => 'all', 'retina_mode' => 'no');
     $this->options = get_option('acf_image_crop_settings');
     // add ajax action to be able to retrieve full image size via javascript
     add_action('wp_ajax_acf_image_crop_get_image_size', array(&$this, 'crop_get_image_size'));
     add_action('wp_ajax_acf_image_crop_perform_crop', array(&$this, 'perform_crop'));
     // add filter to media query function to hide cropped images from media library
     add_filter('ajax_query_attachments_args', array($this, 'filterMediaQuery'));
     // Register extra fields on the media settings page on admin_init
     add_action('admin_init', array($this, 'registerSettings'));
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('image_crop', 'error');
      */
     $this->l10n = array('width_should_be' => __('Width should be at least: ', 'acf-image_crop'), 'height_should_be' => __('Height should be at least: ', 'acf-image_crop'), 'selected_width' => __('Selected image width: ', 'acf-image_crop'), 'selected_height' => __('Selected image height: ', 'acf-image_crop'), 'size_warning' => __('Warning: The selected image is smaller than the required size!', 'acf-image_crop'), 'crop_error' => __('Sorry, an error occurred when trying to crop your image:'));
     // do not delete!
     acf_field::__construct();
     //parent::__construct();
 }
开发者ID:jenniwhite6,项目名称:My-Blog,代码行数:35,代码来源:acf-image-crop-v5.php

示例4: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'smart_button';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Smart Button');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'basic';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array();
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('FIELD_NAME', 'error');
      */
     $this->l10n = array('error' => __('Error! Please enter a higher value', 'acf-smart-button'));
     $this->settings = array('path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'version' => '1.0.0');
     // do not delete!
     parent::__construct();
 }
开发者ID:cyberwani,项目名称:acf-smart-button,代码行数:27,代码来源:acf-smart-button-v5.php

示例5: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'link_picker';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Link Picker', 'acf-link_picker');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'choice';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array();
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('link_picker', 'error');
      */
     $this->l10n = array('yes' => __('Yes'), 'no' => __('No'), 'edit_link' => __('Edit Link', 'acf-link_picker'), 'insert_link' => __('Insert Link', 'acf-link_picker'));
     // do not delete!
     parent::__construct();
 }
开发者ID:Emotion-nl,项目名称:ACF-Link-Picker-Field,代码行数:26,代码来源:acf-link_picker-v5.php

示例6: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'multi-taxonomy-chooser';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Multi Taxonomy Chooser', 'acf-multi-taxonomy-chooser');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'choice';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('choices' => array(), 'allow_null' => 0, 'multiple' => 0, 'ui' => 0, 'ajax' => 0, 'type_value' => 1, 'data_type' => 1);
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('multi-taxonomy-chooser', 'error');
      */
     $this->l10n = array('error' => __('Error! Please enter a higher value', 'acf-multi-taxonomy-chooser'));
     // do not delete!
     parent::__construct();
 }
开发者ID:marktimemedia,项目名称:acf-multi-taxonomy-chooser,代码行数:26,代码来源:acf-multi-taxonomy-chooser-v5.php

示例7: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'image_area_selection';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Image Area Selection', 'acf-image_area_selection');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'jquery';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('image_field_class' => '');
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('image_area_selection', 'error');
      */
     $this->l10n = array('edit' => __("Edit Selection", 'acf'), 'confirm' => __("Confirm Selection", 'acf'), 'cancel' => __("Cancel", 'acf'));
     // do not delete!
     parent::__construct();
 }
开发者ID:alebiavati,项目名称:acf-image-area-selection,代码行数:26,代码来源:acf-image_area_selection-v5.php

示例8: array

 /**
  *  Set everything up
  */
 function __construct()
 {
     /**
      * Name of field
      */
     $this->name = 'widget_area';
     /**
      *  label visible when selecting a field type
      */
     $this->label = __('Widget Area', 'acf_widget_area');
     /**
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'content';
     /**
      *  defaults (array) Array of default settings which are merged into the field object.
      */
     $this->defaults = array();
     /**
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('FIELD_NAME', 'error');
      */
     $this->l10n = array();
     // do not delete!
     parent::__construct();
 }
开发者ID:hhgr,项目名称:EveryonePlay,代码行数:29,代码来源:widget-area-v5.php

示例9: array

 /**
  *  __construct
  *
  *  This function will setup the field type data
  *
  *  @date	5/03/2014
  *  @since	5.0.0
  *
  *  @param	$settings
  */
 function __construct($settings)
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'custom_font_icons';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Custom Font Icons', 'acf-custom_font_icons');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'basic';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('class_prefix' => "fa");
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('custom_font_icons', 'error');
      */
     $this->l10n = array('error' => __('Error! Please enter a higher value', 'acf-custom_font_icons'));
     /*
      *  settings (array) Store plugin settings (url, path, version) as a reference for later use with assets
      */
     $this->settings = $settings;
     // do not delete!
     parent::__construct();
 }
开发者ID:trampoline-digital,项目名称:acf-custom-font-icons,代码行数:40,代码来源:acf-custom_font_icons-v5.php

示例10: array

 function __construct()
 {
     // $test = get_field( 'test_term_select', $_GET['post'] );
     // echo 'shit<pre>';
     // print_r( $test );
     // echo '</pre>';
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'taxonomy-chooser';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Term and Taxonomy Chooser', 'acf-taxonomy-chooser');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'choice';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('choices' => array(), 'tax_type' => 0, 'allow_null' => 0, 'ui' => 0, 'ajax' => 0, 'type_value' => 1, 'multiple' => 0);
     // Notes: 'multiple' used to be associated with a 'select multiple values field' also
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('taxonomy-chooser', 'error');
      */
     $this->l10n = array('error' => __('Error! Please enter a higher value', 'acf-taxonomy-chooser'));
     // do not delete!
     parent::__construct();
 }
开发者ID:marktimemedia,项目名称:acf-term-and-taxonomy-chooser,代码行数:31,代码来源:acf-taxonomy-chooser-v5.php

示例11: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'address_map';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Address Map', 'acf-address_map');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'jQuery';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->default_values = array('center_lat' => '47.6256211', 'center_lng' => '-122.3529964', 'zoom' => '14');
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('address_map', 'error');
      */
     $this->l10n = array('locating' => __("Locating", 'acf'), 'browser_support' => __("Sorry, this browser does not support geolocation", 'acf'));
     // do not delete!
     parent::__construct();
 }
开发者ID:ethanclevenger91,项目名称:acf-address-map-field,代码行数:26,代码来源:acf-address-map-v5.php

示例12: array

 function __construct()
 {
     // vars
     $this->name = 'wysiwyg';
     $this->label = __("Wysiwyg Editor", 'acf');
     $this->category = 'content';
     $this->defaults = array('tabs' => 'all', 'toolbar' => 'full', 'media_upload' => 1, 'default_value' => '');
     // Create an acf version of the_content filter (acf_the_content)
     if (!empty($GLOBALS['wp_embed'])) {
         add_filter('acf_the_content', array($GLOBALS['wp_embed'], 'run_shortcode'), 8);
         add_filter('acf_the_content', array($GLOBALS['wp_embed'], 'autoembed'), 8);
     }
     add_filter('acf_the_content', 'capital_P_dangit', 11);
     add_filter('acf_the_content', 'wptexturize');
     add_filter('acf_the_content', 'convert_smilies');
     add_filter('acf_the_content', 'convert_chars');
     // not found in WP 4.4
     add_filter('acf_the_content', 'wpautop');
     add_filter('acf_the_content', 'shortcode_unautop');
     //add_filter( 'acf_the_content', 'prepend_attachment' ); should only be for the_content (causes double image on attachment page)
     if (function_exists('wp_make_content_images_responsive')) {
         add_filter('acf_the_content', 'wp_make_content_images_responsive');
         // added in WP 4.4
     }
     add_filter('acf_the_content', 'do_shortcode', 11);
     // actions
     add_action('acf/input/admin_footer', array($this, 'input_admin_footer'));
     // do not delete!
     parent::__construct();
 }
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:30,代码来源:wysiwyg.php

示例13: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'focal_point';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Focal Point', 'acf-focal_point');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'jquery';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('save_format' => 'tag', 'preview_size' => 'large', 'image_size' => 'large');
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('focal_point', 'error');
      */
     $this->l10n = array();
     // do not delete!
     parent::__construct();
 }
开发者ID:evu,项目名称:acf-focal_point,代码行数:26,代码来源:acf-focal_point-v5.php

示例14: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'icon_font';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Icon Font', 'acf-icon_font');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'basic';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array();
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('icon_font', 'error');
      */
     $this->l10n = array('error' => __('Error! Please select another value', 'acf-icon_font'));
     $this->settings = array('path' => dirname(__FILE__), 'dir' => $this->helpers_get_dir(__FILE__), 'version' => '1.0');
     $this->selectedIcon = null;
     $fontInfo = file_get_contents($this->settings['path'] . '/font-info.json');
     $fontInfo = json_decode($fontInfo);
     $this->iconNames = $fontInfo->iconClasses;
     // do not delete!
     parent::__construct();
 }
开发者ID:Kreshnik,项目名称:acf-field-icon-font,代码行数:31,代码来源:acf-icon_font-v5.php

示例15: array

 function __construct()
 {
     /*
      *  name (string) Single word, no spaces. Underscores allowed
      */
     $this->name = 'Range';
     /*
      *  label (string) Multiple words, can include spaces, visible when selecting a field type
      */
     $this->label = __('Range', 'acf-range');
     /*
      *  category (string) basic | content | choice | relational | jquery | layout | CUSTOM GROUP NAME
      */
     $this->category = 'jQuery';
     /*
      *  defaults (array) Array of default settings which are merged into the field object. These are used later in settings
      */
     $this->defaults = array('font_size' => 14, 'slider_type' => 'default', 'min' => 0, 'max' => 100, 'default_value_1' => 0, 'default_value_2' => 100, 'step' => 1, 'title' => __('Range', 'acf'), 'separate' => '-', 'prepend' => '', 'append' => '');
     /*
      *  l10n (array) Array of strings that are used in JavaScript. This allows JS strings to be translated in PHP and loaded via:
      *  var message = acf._e('FIELD_NAME', 'error');
      */
     $this->l10n = array('error' => __('Error! Please enter a higher value', 'acf-range'));
     // do not delete!
     parent::__construct();
     $this->settings = array('path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'version' => '1.1.4');
 }
开发者ID:nicholastillman,项目名称:acf-field-range,代码行数:27,代码来源:range-v5.php


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