Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hrenaud/eda821719a34528c608d2c095c2d9323 to your computer and use it in GitHub Desktop.

Select an option

Save hrenaud/eda821719a34528c608d2c095c2d9323 to your computer and use it in GitHub Desktop.
<?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