class-acf-field-accordion.php
5 months ago
class-acf-field-button-group.php
5 months ago
class-acf-field-checkbox.php
2 months ago
class-acf-field-color_picker.php
5 months ago
class-acf-field-date_picker.php
5 months ago
class-acf-field-date_time_picker.php
5 months ago
class-acf-field-email.php
5 months ago
class-acf-field-file.php
5 months ago
class-acf-field-google-map.php
5 months ago
class-acf-field-group.php
5 months ago
class-acf-field-icon_picker.php
6 months ago
class-acf-field-image.php
1 month ago
class-acf-field-link.php
5 months ago
class-acf-field-message.php
6 months ago
class-acf-field-number.php
5 months ago
class-acf-field-oembed.php
2 months ago
class-acf-field-output.php
6 months ago
class-acf-field-page_link.php
1 month ago
class-acf-field-password.php
5 months ago
class-acf-field-post_object.php
1 month ago
class-acf-field-radio.php
2 months ago
class-acf-field-range.php
5 months ago
class-acf-field-relationship.php
1 month ago
class-acf-field-select.php
2 months ago
class-acf-field-separator.php
6 months ago
class-acf-field-tab.php
6 months ago
class-acf-field-taxonomy.php
2 months ago
class-acf-field-text.php
5 months ago
class-acf-field-textarea.php
5 months ago
class-acf-field-time_picker.php
5 months ago
class-acf-field-true_false.php
5 months ago
class-acf-field-url.php
5 months ago
class-acf-field-user.php
2 months ago
class-acf-field-wysiwyg.php
5 months ago
class-acf-field.php
5 months ago
index.php
2 years ago
class-acf-field-separator.php
84 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package ACF |
| 4 | * @author WP Engine |
| 5 | * |
| 6 | * © 2026 Advanced Custom Fields (ACF®). All rights reserved. |
| 7 | * "ACF" is a trademark of WP Engine. |
| 8 | * Licensed under the GNU General Public License v2 or later. |
| 9 | * https://www.gnu.org/licenses/gpl-2.0.html |
| 10 | */ |
| 11 | |
| 12 | if ( ! class_exists( 'acf_field_separator' ) ) : |
| 13 | |
| 14 | class acf_field_separator extends acf_field { |
| 15 | |
| 16 | |
| 17 | /** |
| 18 | * This function will setup the field type data |
| 19 | * |
| 20 | * @type function |
| 21 | * @date 5/03/2014 |
| 22 | * @since 5.0.0 |
| 23 | * |
| 24 | * @param n/a |
| 25 | * @return n/a |
| 26 | */ |
| 27 | function initialize() { |
| 28 | |
| 29 | // vars |
| 30 | $this->name = 'separator'; |
| 31 | $this->label = __( 'Separator', 'acf' ); |
| 32 | $this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-separator.png'; |
| 33 | $this->supports = array( 'required' => false ); |
| 34 | $this->category = 'layout'; |
| 35 | } |
| 36 | |
| 37 | |
| 38 | /** |
| 39 | * Create the HTML interface for your field |
| 40 | * |
| 41 | * @param $field - an array holding all the field's data |
| 42 | * |
| 43 | * @type action |
| 44 | * @since 3.6 |
| 45 | * @date 23/01/13 |
| 46 | */ |
| 47 | function render_field( $field ) { |
| 48 | |
| 49 | /* do nothing */ |
| 50 | } |
| 51 | |
| 52 | |
| 53 | /** |
| 54 | * This filter is appied to the $field after it is loaded from the database |
| 55 | * |
| 56 | * @type filter |
| 57 | * @since 3.6 |
| 58 | * @date 23/01/13 |
| 59 | * |
| 60 | * @param $field - the field array holding all the field options |
| 61 | * |
| 62 | * @return $field - the field array holding all the field options |
| 63 | */ |
| 64 | function load_field( $field ) { |
| 65 | |
| 66 | // remove name to avoid caching issue |
| 67 | $field['name'] = ''; |
| 68 | |
| 69 | // remove required to avoid JS issues |
| 70 | $field['required'] = 0; |
| 71 | |
| 72 | // set value other than 'null' to avoid ACF loading / caching issue |
| 73 | $field['value'] = false; |
| 74 | |
| 75 | // return |
| 76 | return $field; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | |
| 81 | // initialize |
| 82 | acf_register_field_type( 'acf_field_separator' ); |
| 83 | endif; // class_exists check |
| 84 |