Advertisement
Guest User

ayoshop_options

a guest
Dec 5th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.61 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Some tweaks for Options framework plugin
  5.  *
  6.  * Require Options Framework plugin
  7.  *
  8.  * @package  AyoShop
  9.  * @author    AyoThemes
  10.  * @license   GPL-2.0+
  11.  * @link      http://ayothemes.com/go/ayoshop
  12.  */
  13.  
  14.  
  15.  
  16. /* Exit if accessed directly */
  17.  
  18. if ( ! defined( 'ABSPATH' ) ) {
  19.     exit;
  20. }
  21.  
  22. /**
  23.  * Initialize unique ID for options framwework Settings
  24.  *
  25.  * @since  1.0
  26.  */
  27.  
  28. function optionsframework_option_name() {
  29.     $optionsframework_settings = get_option( 'optionsframework' );
  30.     $optionsframework_settings['id'] = AYOSHOP_SETTINGS;
  31.     update_option( 'optionsframework', $optionsframework_settings );
  32. }
  33.  
  34. add_filter( 'genesis_export_options', 'ayoshop_export_options' );
  35.  
  36. /**
  37.  * Hook AyoShop into Genesis Exporter, allowing AyoShop Setting to be exported.
  38.  *
  39.  * Requires Genesis 1.6+.
  40.  *
  41.  * @since  1.0
  42.  */
  43.  
  44. function ayoshop_export_options( $options ) {
  45.  
  46.     $options['ayoshop'] = array(
  47.         'label'    => __( 'AyoShop Settings', 'ayoshop' ),
  48.         'settings-field'  => AYOSHOP_SETTINGS
  49.     );
  50.  
  51.     return $options;
  52.  
  53. }
  54.  
  55. function ayoshop_menu_settings() {
  56.  
  57.     $menu = array(
  58.         'page_title' => __( 'AyoShop Settings', 'ayoshop'),
  59.         'menu_title' => __('AyoShop Settings', 'ayoshop'),
  60.         'capability' => 'edit_theme_options',
  61.         'menu_slug' => 'ayoshop-settings'
  62.     );
  63.  
  64.     return $menu;
  65. }
  66.  
  67. add_filter( 'optionsframework_menu', 'ayoshop_menu_settings' );
  68.  
  69.  
  70.  
  71. function ayoshop_options() {
  72.  
  73.     $menu = ayoshop_menu_settings();
  74.     add_submenu_page( 'genesis', $menu['page_title'], $menu['menu_title'], $menu['capability'], 'themes.php?page=ayoshop-settings' );
  75.  
  76. }
  77. add_action( 'admin_menu', 'ayoshop_options' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement