Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohyeahdev/73cdfeb67151ef33e7387fca5d92ed36 to your computer and use it in GitHub Desktop.
Save ohyeahdev/73cdfeb67151ef33e7387fca5d92ed36 to your computer and use it in GitHub Desktop.
Crear sub-páginas de opciones con ACF Pro
<?php
/*
* Description: Creación de sub-páginas de opciones con ACF Pro.
* Tested with: ACF Pro V5.7
* Author: @ohyeahdev
* Author URI: https://www.ohyeahdev.com
*/
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'menu_title' => 'Opciones Generales',
'menu_slug' => 'ohyd_opciones_generales',
'redirect' => true
));
acf_add_options_sub_page(array(
'page_title' => 'Ajustes de la Cabecera',
'menu_title' => 'Cabecera',
'parent_slug' => 'ohyd_opciones_generales',
'menu_slug' => 'ohyd_ajustes_cabecera',
));
acf_add_options_sub_page(array(
'page_title' => 'Ajustes de la página de inicio',
'menu_title' => 'Página de inicio',
'parent_slug' => 'ohyd_opciones_generales',
'menu_slug' => 'ohyd_ajustes_pagina_inicio',
));
acf_add_options_sub_page(array(
'page_title' => 'Ajustes del pié de página',
'menu_title' => 'Pié de página',
'parent_slug' => 'ohyd_opciones_generales',
'menu_slug' => 'ohyd_ajustes_pie_pagina',
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment