Created
September 21, 2020 18:55
-
-
Save hrenaud/eda821719a34528c608d2c095c2d9323 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Ajouter une page option configurable avec ACF | |
| * https://www.advancedcustomfields.com/resources/acf_add_options_page/ | |
| */ | |
| add_action('acf/init', 'my_acf_op_init'); | |
| function my_acf_op_init() { | |
| // Check function exists. | |
| if( function_exists('acf_add_options_page') ) { | |
| // Register options page. | |
| $option_page = acf_add_options_page(array( | |
| 'page_title' => __('Valeurs du site'), | |
| 'menu_title' => __('Valeurs du site'), | |
| 'menu_slug' => 'custom-site-settings', | |
| 'capability' => 'edit_posts', | |
| 'redirect' => false | |
| )); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment