forked from vinkla/extended-acf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoption-page.php
34 lines (30 loc) · 999 Bytes
/
option-page.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
// This example is registering a option page using ACF. Please see the
// documentation for more information:
// https://www.advancedcustomfields.com/resources/acf_add_options_page/
use WordPlate\Acf\Fields\Text;
use WordPlate\Acf\Fields\Wysiwyg;
use WordPlate\Acf\Location;
acf_add_options_page([
'icon_url' => 'dashicons-star-filled', // https://developer.wordpress.org/resource/dashicons/
'menu_slug' => 'cookie',
'page_title' => 'Cookie',
'position' => 21,
]);
register_extended_field_group([
'title' => 'Cookie',
'fields' => [
Wysiwyg::make('Text', 'cookie_text')
->instructions('Add the cookie disclaimer text.')
->mediaUpload(false)
->toolbar('link')
->tabs('visual')
->required(),
Text::make('Label', 'cookie_label')
->instructions('Add the button label.')
->required(),
],
'location' => [
Location::if('options_page', 'cookie'),
],
]);