array( 'page_title' => __( 'Theme Settings', 'bizznis' ), 'menu_title' => __( 'Theme Settings', 'bizznis' ), 'capability' => 'edit_theme_options', ) ) ); $page_ops = apply_filters( 'bizznis_theme_settings_page_ops', array( 'screen_icon' => 'options-bizznis', 'save_button_text' => __( 'Save Settings', 'bizznis' ), 'reset_button_text' => __( 'Reset Settings', 'bizznis' ), 'saved_notice_text' => __( 'Settings saved.', 'bizznis' ), 'reset_notice_text' => __( 'Settings reset.', 'bizznis' ), 'error_notice_text' => __( 'Error saving settings.', 'bizznis' ), ) ); $settings_field = BIZZNIS_SETTINGS_FIELD; $default_settings = apply_filters( 'bizznis_theme_settings_defaults', array( 'blog_title' => 'text', 'style_selection' => '', 'header_right' => 0, 'site_layout' => bizznis_get_default_layout(), 'nav_extras' => '', 'nav_extras_twitter_id' => '', 'nav_extras_twitter_text' => __( 'Follow me on Twitter', 'bizznis' ), 'comments_pages' => 0, 'comments_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, '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, ) ); $this->create( $page_id, $menu_ops, $page_ops, $settings_field, $default_settings ); # Sanitize before saving add_action( 'bizznis_settings_sanitizer_init', array( $this, 'sanitizer_filters' ) ); } /** * Registers each of the settings with a sanitization filter type. * * @since 1.0.0 */ public function sanitizer_filters() { bizznis_add_option_filter( 'one_zero', $this->settings_field, array( 'breadcrumb_front_page', 'breadcrumb_home', 'breadcrumb_single', 'breadcrumb_posts_page', 'breadcrumb_archive', 'breadcrumb_404', 'breadcrumb_attachment', 'comments_posts', 'comments_pages', 'content_archive_thumbnail', 'redirect_feed', 'redirect_comments_feed', ) ); bizznis_add_option_filter( 'no_html', $this->settings_field, array( 'blog_cat_exclude', 'blog_title', 'content_archive', 'nav_extras', 'nav_extras_twitter_id', 'posts_nav', 'site_layout', 'style_selection', 'theme_version', ) ); bizznis_add_option_filter( 'absint', $this->settings_field, array( 'blog_cat', 'blog_cat_num', 'db_version', ) ); bizznis_add_option_filter( 'safe_html', $this->settings_field, array( 'nav_extras_twitter_text', ) ); bizznis_add_option_filter( 'requires_unfiltered_html', $this->settings_field, array( 'header_scripts', 'footer_scripts', ) ); bizznis_add_option_filter( 'url', $this->settings_field, array( // empty ) ); } /** * Contextual help content. * * @since 1.0.0 */ public function help() { $screen = get_current_screen(); $theme_settings_help = '
' . __( 'Bizznis Theme Settings provide control over how the theme works. You will be able to control a lot of common and even advanced features from this menu. Some child themes may add additional settings fields, including the ability to select different color styles or set theme specific features such as a slider. Below you\'ll find the items common to every child theme...' , 'bizznis' ) . '
'; $information_help = '' . __( 'The information field allows you to see the current Bizznis theme information.' , 'bizznis' ) . '
' . $layout_help = '' . __( 'This lets you select the default layout for your entire site. On most of the child themes you\'ll see these options:' , 'bizznis' ) . '
' . '' . __( 'These options can be extended or limited by the child theme. Additionally, many of the child themes do not allow different layouts on the home page as they have been designed for a specific home page layout.' , 'bizznis' ) . '
' . '' . __( 'This layout can also be overridden in the post/page/term layout options on each post/page/term.' , 'bizznis' ) . '
'; $archives_help = '' . __( 'In the Bizznis Theme Settings you may change the site wide Content Archives options to control what displays in the site\'s Archives.' , 'bizznis' ) . '
' . '' . __( 'Archives include any pages using the blog template, category pages, tag pages, date archive, author archives, and the latest posts if there is no custom home page.' , 'bizznis' ) . '
' . '' . __( 'The first option allows you to display the post content or the post excerpt. The Display post content setting will display the entire post including HTML code up to the tag if used (this is HTML for the comment tag that is not displayed in the browser).' , 'bizznis' ) . '
' . '' . __( 'It may also be coupled with the second field "Limit content to [___] characters" to limit the content to a specific number of letters or spaces. This will strip any HTML, but allows for more precise and easily changed lengths than the excerpt.' , 'bizznis' ) . '
' . '' . __( 'The Display post excerpt setting will display the first 55 words of the post after also stripping any included HTML or the manual/custom excerpt added in the post edit screen.' , 'bizznis' ) . '
' . '' . __( 'The \'Featured Image\' setting allows you to show a thumbnail of the first attached image or currently set featured image.' , 'bizznis' ) . '
' . '' . __( 'This option should not be used with the post content unless the content is limited to avoid duplicate images.' , 'bizznis' ) . '
' . '' . __( 'The \'Featured Image Size\' list is populated by the available image sizes defined in the theme.' , 'bizznis' ) . '
' . '' . __( 'Post Navigation Technique allows you to select one of two navigation methods.' , 'bizznis' ) . '
'; $navigation_help = '' . __( 'The Primary Navigation Extras typically display on the right side of your Primary Navigation menu.', 'bizznis' ) . '
' . '' . __( 'These options can be extended or limited by the child theme.', 'bizznis' ) . '
'; $breadcrumbs_help = '' . __( 'This field lets you define where the "Breadcrumbs" display. The Breadcrumb is the navigation tool that displays where a visitor is on the site at any given moment.' , 'bizznis' ) . '
'; $comments_help = '' . __( 'This allows to decide whether comments are enabled for posts and pages.' , 'bizznis' ) . '
' . '' . __( 'Even If you enable comments here, it can be disabled on an individual post or page. If you disable here, they cannot be enabled on an individual post or page.' , 'bizznis' ) . '
'; $scripts_help = '' . __( 'This provides you with two fields that will output HTML scripts to either header or the footer of your website. These will appear on every page of the site and are a great way to add scripts. You cannot use PHP in these fields. If you need to use PHP then add it via hooks inside a child theme.' , 'bizznis' ) . '
'; $home_help = '' . __( 'Most Bizznis child themes include a custom home page.' , 'bizznis' ) . '
' . '' . __( 'To use this type of home page, make sure your latest posts are set to show on the front page. You can setup a page with the Blog page template to show a blog style list of your latest posts on another page.' , 'bizznis' ) . '
' . '' . __( 'This home page is typically setup via widgets in the sidebars for the home page. This can be accessed via the Widgets menu item under Appearance.' , 'bizznis' ) . '
' . '' . __( 'Child themes that include this type of home page typically include additional theme-specific tutorials which can be accessed via a sticky post at the top of that child theme support forum.' , 'bizznis' ) . '
' . '' . __( 'If your theme uses a custom home page and you want to show the latest posts in a blog format, do not use the blog template. Instead, you need to rename the home.php file to home-old.php instead.' , 'bizznis' ) . '
' . '' . __( 'Another common home page is the "blog" type home page, which is common to most of the free child themes. This shows your latest posts and requires no additional setup.' , 'bizznis' ) . '
' . '' . __( 'The third type of home page is the new dynamic home page. This is common on the newest child themes. It will show your latest posts in a blog type listing unless you put widgets into the home page sidebars.' , 'bizznis' ) . '
' . '' . __( 'This setup is preferred because it makes it easier to show a blog on the front page (no need to rename the home.php file) and does not have the confusion of no content on the home page when the theme is initially installed.' , 'bizznis' ) . '
'; $screen->add_help_tab( array( 'id' => $this->pagehook . '-theme-settings', 'title' => __( 'Theme Settings' , 'bizznis' ), 'content' => $theme_settings_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-information', 'title' => __( 'Information' , 'bizznis' ), 'content' => $information_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-layout', 'title' => __( 'Default Layout' , 'bizznis' ), 'content' => $layout_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-navigation', 'title' => __( 'Primary Menu' , 'bizznis' ), 'content' => $navigation_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-breadcrumbs', 'title' => __( 'Breadcrumbs' , 'bizznis' ), 'content' => $breadcrumbs_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-comments', 'title' => __( 'Comments and Trackbacks' , 'bizznis' ), 'content' => $comments_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-archives', 'title' => __( 'Content Archives' , 'bizznis' ), 'content' => $archives_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-scripts', 'title' => __( 'Header and Footer Scripts' , 'bizznis' ), 'content' => $scripts_help, ) ); $screen->add_help_tab( array( 'id' => $this->pagehook . '-home', 'title' => __( 'Home Pages' , 'bizznis' ), 'content' => $home_help, ) ); # Add help sidebar $screen->set_help_sidebar( '' . __( 'For more information:', 'bizznis' ) . '
' . '' . __( 'Get Support', 'bizznis' ) . '
' ); } /** * Callback for Theme Settings Information meta box. * * @since 1.0.0 */ function form() { # Outputs hidden form fields before the metaboxes. printf( '', $this->get_field_name( 'theme_version' ), esc_attr( $this->get_field_value( 'theme_version' ) ) ); printf( '', $this->get_field_name( 'db_version' ), esc_attr( $this->get_field_value( 'db_version' ) ) ); ?>|
get_field_value( 'theme_version' ); ?> · |
|
$this->get_field_name( 'site_layout' ), 'selected' => $this->get_field_value( 'site_layout' ), 'type' => 'site' ) ); ?> |
|
add_theme_support( \'custom-header\' ); to your child theme\'s functions.php file.', 'bizznis' ); ?> |
|
|
|
| get_field_value( 'content_archive_thumbnail' ) ); ?> /> | |
custom menu, then assign it to the proper Menu Location.', 'bizznis' ), admin_url( 'nav-menus.php' ) ); ?>
|
get_field_value( 'nav_extras_enable' ) ); ?> /> |
|
get_field_value( 'breadcrumb_front_page' ) ); ?> />
get_field_value( 'breadcrumb_single' ) ); ?> />
|
| get_field_value( 'comments_posts' ) ); ?> /> get_field_value( 'comments_pages' ) ); ?> /> |
| wp_head()' ); ?> |
wp_head()', ' |
|---|---|
| wp_footer()' ); ?> |
wp_footer()', ' |