Tengo varias paginas de administración en la plantilla que estoy creando, pero cada pagina tengo que registrar un register_setting para que me devuelva los valores de la pagina es decir si estoy en la pagina de general de la configuracion del template tengo esto
Código PHP:
Ver original
register_setting( 'clearly_theme_options_general', 'clearly_theme_options_general' );
add_settings_section(
'clearly_general_section', // ID used to identify this section and with which to register options
'', // Title to be displayed on the administration page
'clearly_general_callback', // Callback used to render the description of the section
'clearly-general-option' // Page on which to add this section of options
);
add_settings_field(
'slider-type', // ID used to identify the field throughout the theme
'Homepage Slider Type', // The label to the left of the option interface element
'clearly_slider_type_callback', // The name of the function responsible for rendering the option interface
'clearly-general-option', // The page on which this option will be displayed
'clearly_general_section', // The name of the section to which this field belongs
'Choose the type of posts the homepage featured slider displays..',
'Text number 2'
)
);
Ahora si estoy en la de Colores tengo esta
Código PHP:
Ver original
register_setting( 'clearly_theme_options_colors', 'clearly_theme_options_colors' );
add_settings_section(
'clearly_colors_section', // ID used to identify this section and with which to register options
'', // Title to be displayed on the administration page
'clearly_colors_callback', // Callback used to render the description of the section
'clearly-color-option' // Page on which to add this section of options
);
add_settings_field(
'color_global_accent', // ID used to identify the field throughout the theme
'Global Accent Color', // The label to the left of the option interface element
'clearly_color_global_accent_callback', // The name of the function responsible for rendering the option interface
'clearly-color-option', // The page on which this option will be displayed
'clearly_colors_section', // The name of the section to which this field belongs
'Enter any text you want to be output to the footer.',
''
)
);
entonces cada vez que voy llamar a la opciones del template de la primera pagina de opciones tengo hacer esto
Código PHP:
Ver original
get_option('clearly_theme_options_general');
y si quiero llamar alguna funcion registrada de color
Código PHP:
Ver original
get_option('clearly_theme_options_colors');
hasta alli todo me funciona bien, pero quiero es tener todas los campos en un solo register_setting, no se como hacerlo...
por ejemplo que tan solo con llamar el
Código PHP:
me devuelva todos los valores del template que tengo en varios register_setting Ver original
<?php get_option('clearly_theme_options') ?>
 
  
 

 Uso del 'register_setting' para varias opciones de pagina
 Uso del 'register_setting' para varias opciones de pagina 

