Last active
August 29, 2015 13:56
-
-
Save ajithrn/9150920 to your computer and use it in GitHub Desktop.
Wordpress: acf option page customization
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 | |
/** | |
* ======== acf option page customization ======== | |
* @param [type] $settings | |
* @return [type] | |
*/ | |
function my_acf_options_page_settings( $settings ) | |
{ | |
$settings['title'] = 'Page Title'; | |
$settings['menu'] = 'Menu Title'; | |
return $settings; | |
} | |
add_filter('acf/options_page/settings', 'my_acf_options_page_settings'); | |
/** | |
* ============= Create a simple sub options pages ========= | |
*/ | |
if( function_exists('acf_add_options_sub_page') ) | |
{ | |
//simple way | |
acf_add_options_sub_page( 'Sub Page One' ); | |
acf_add_options_sub_page( 'Sub Page Two' ); | |
// advanced | |
acf_add_options_sub_page(array( | |
'title' => 'Page Title', | |
'parent' => 'options-general.php', | |
'capability' => 'manage_options' | |
)); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment