Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2. if ( !function_exists( 'optionsframework_init' ) ) {
  3. /*-----------------------------------------------------------------------------------*/
  4. /* Options Framework Theme
  5. /*-----------------------------------------------------------------------------------*/
  6. /* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */
  7. if ( get_stylesheet_directory() == get_template_directory() ) {
  8.     define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/themeOptions/admin/');
  9.     define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/themeOptions/admin/');
  10. } else {
  11.     define('OPTIONS_FRAMEWORK_URL', get_stylesheet_directory() . '/themeOptions/admin/');
  12.     define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/themeOptions/admin/');
  13. }
  14. require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
  15. }
  16. /*
  17.  * This is an example of how to add custom scripts to the options panel.
  18.  * This one shows/hides the an option when a checkbox is clicked.
  19.  */
  20. add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
  21. function optionsframework_custom_scripts() { ?>
  22. <script type="text/javascript">
  23. jQuery(document).ready(function() {
  24.     jQuery('#example_showhidden').click(function() {
  25.         jQuery('#section-example_text_hidden').fadeToggle(400);
  26.     });
  27.     if (jQuery('#example_showhidden:checked').val() !== undefined) {
  28.         jQuery('#section-example_text_hidden').show();
  29.     }
  30. });
  31. </script>
  32. <?php
  33. }
  34. /*
  35.  * Turns off the default options panel from Twenty Eleven
  36.  */
  37. add_action('after_setup_theme','remove_twentyeleven_options', 100);
  38. function remove_twentyeleven_options() {
  39.     remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement