Guest User

Untitled

a guest
May 6th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 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.  
  8. define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/themeOptions/admin/');
  9. define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/themeOptions/admin/');
  10.  
  11. require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
  12. }
  13. /*
  14. * This is an example of how to add custom scripts to the options panel.
  15. * This one shows/hides the an option when a checkbox is clicked.
  16. */
  17. add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
  18. function optionsframework_custom_scripts() { ?>
  19. <script type="text/javascript">
  20. jQuery(document).ready(function() {
  21. jQuery('#example_showhidden').click(function() {
  22. jQuery('#section-example_text_hidden').fadeToggle(400);
  23. });
  24. if (jQuery('#example_showhidden:checked').val() !== undefined) {
  25. jQuery('#section-example_text_hidden').show();
  26. }
  27. });
  28. </script>
  29. <?php
  30. }
  31. /*
  32. * Turns off the default options panel from Twenty Eleven
  33. */
  34. add_action('after_setup_theme','remove_twentyeleven_options', 100);
  35. function remove_twentyeleven_options() {
  36. remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
  37. }
  38. ?>
Add Comment
Please, Sign In to add comment