Created
January 18, 2015 18:36
-
-
Save shahadat014/811f9ef3990e1f396281 to your computer and use it in GitHub Desktop.
Option tree demo theme option
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 | |
add_action( 'admin_init', 'my_theme_custom_theme_options', 1 ); | |
function my_theme_custom_theme_options() { | |
$saved_settings = get_option( 'option_tree_settings', array() ); | |
$custom_settings = array( | |
'contextual_help' => array( | |
'content' => array( | |
array( | |
'id' => 'general_help', | |
'title' => 'General', | |
'content' => '<p>Help content goes here!</p>' | |
) | |
), | |
'sidebar' => '<p>Sidebar content goes here!</p>' | |
), | |
'sections' => array( | |
array( | |
'title' => 'General', | |
'id' => 'general_default' | |
) | |
), | |
'settings' => array( | |
array( | |
'label' => 'News page Banner', | |
'id' => 'news_page_banner', | |
'type' => 'upload', | |
'section' => 'general_default' | |
) | |
) | |
); | |
$custom_settings = apply_filters( 'option_tree_settings_args', $custom_settings ); | |
if ( $saved_settings !== $custom_settings ) { | |
update_option( 'option_tree_settings', $custom_settings ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment