/** * Create an admin menu item and settings page. * * @since 1.8.0 * * @uses GENESIS_ADMIN_IMAGES_URL URL for admin images. * @uses GENESIS_SETTINGS_FIELD Settings field key. * @uses PARENT_DB_VERSION Genesis database version. * @uses PARENT_THEME_VERSION Genesis Framework version. * @uses genesis_get_default_layout() Get default layout. * @uses \Genesis_Admin::create() Create an admin menu item and settings page. */ function __construct() { $page_id = 'genesis'; $menu_ops = apply_filters('genesis_theme_settings_menu_ops', array('main_menu' => array('sep' => array('sep_position' => '58.995', 'sep_capability' => 'edit_theme_options'), 'page_title' => 'Theme Settings', 'menu_title' => 'Genesis', 'capability' => 'edit_theme_options', 'icon_url' => GENESIS_ADMIN_IMAGES_URL . '/genesis-menu.png', 'position' => '58.996'), 'first_submenu' => array('page_title' => __('Theme Settings', 'genesis'), 'menu_title' => __('Theme Settings', 'genesis'), 'capability' => 'edit_theme_options'))); $page_ops = apply_filters('genesis_theme_settings_page_ops', array('save_button_text' => __('Save Settings', 'genesis'), 'reset_button_text' => __('Reset Settings', 'genesis'), 'saved_notice_text' => __('Settings saved.', 'genesis'), 'reset_notice_text' => __('Settings reset.', 'genesis'), 'error_notice_text' => __('Error saving settings.', 'genesis'))); $settings_field = GENESIS_SETTINGS_FIELD; $default_settings = apply_filters('genesis_theme_settings_defaults', array('update' => 1, 'update_email' => 0, 'update_email_address' => '', 'blog_title' => 'text', 'style_selection' => '', 'site_layout' => genesis_get_default_layout(), 'superfish' => 0, 'nav_extras' => '', 'nav_extras_twitter_id' => '', 'nav_extras_twitter_text' => __('Follow me on Twitter', 'genesis'), 'feed_uri' => '', 'redirect_feed' => 0, 'comments_feed_uri' => '', 'redirect_comments_feed' => 0, 'comments_pages' => 0, 'comments_posts' => 1, 'trackbacks_pages' => 0, 'trackbacks_posts' => 1, 'breadcrumb_home' => 0, 'breadcrumb_front_page' => 0, 'breadcrumb_posts_page' => 0, 'breadcrumb_single' => 0, 'breadcrumb_page' => 0, 'breadcrumb_archive' => 0, 'breadcrumb_404' => 0, 'breadcrumb_attachment' => 0, 'content_archive' => 'full', 'content_archive_thumbnail' => 0, 'image_size' => '', 'image_alignment' => 'alignleft', 'posts_nav' => 'numeric', 'blog_cat' => '', 'blog_cat_exclude' => '', 'blog_cat_num' => 10, 'header_scripts' => '', 'footer_scripts' => '', 'theme_version' => PARENT_THEME_VERSION, 'db_version' => PARENT_DB_VERSION, 'first_version' => genesis_first_version())); $this->create($page_id, $menu_ops, $page_ops, $settings_field, $default_settings); add_action('genesis_settings_sanitizer_init', array($this, 'sanitizer_filters')); }
/** * Helper function for comparing the "first install" version to a user specified version. * * @since 2.1.0 * * @uses version_compare() Compare two versions. * @uses genesis_get_option() Get theme setting value. * * @return bool */ function genesis_first_version_compare($version, $operator) { return version_compare(genesis_first_version(), $version, $operator); }