Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 143 lines (120 sloc) 4.619 kb
180e769 @billerickson first commit
authored
1 <?php
2 /**
3 * Functions
4 *
f3027c3 @billerickson add version number
authored
5 * @package BE_Genesis_Child
6 * @since 1.0.0
7 * @link https://github.com/billerickson/BE-Genesis-Child
180e769 @billerickson first commit
authored
8 * @author Bill Erickson <bill@billerickson.net>
9 * @copyright Copyright (c) 2011, Bill Erickson
10 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11 *
12 */
13
14 /**
15 * Theme Setup
f3027c3 @billerickson add version number
authored
16 * @since 1.0.0
180e769 @billerickson first commit
authored
17 *
18 * This setup function attaches all of the site-wide functions
19 * to the correct hooks and filters. All the functions themselves
20 * are defined below this setup function.
21 *
22 */
23
ec632d7 @billerickson Set priority of setup function to 15
authored
24 add_action('genesis_setup','child_theme_setup', 15);
180e769 @billerickson first commit
authored
25 function child_theme_setup() {
26
36966c1 @billerickson move post types, taxonomies, metaboxes, and widgets to core functiona…
authored
27 // ** Backend **
180e769 @billerickson first commit
authored
28
36966c1 @billerickson move post types, taxonomies, metaboxes, and widgets to core functiona…
authored
29 // Image Sizes
efbce06 @billerickson adjust spacing
authored
30 // add_image_size( 'be_featured', 400, 100, true );
180e769 @billerickson first commit
authored
31
a5342a4 @billerickson remove secondary menu
authored
32 // Menus
02b8ffc @billerickson typo
authored
33 add_theme_support( 'genesis-menus', array( 'primary' => 'Primary Navigation Menu' ) );
a5342a4 @billerickson remove secondary menu
authored
34
36966c1 @billerickson move post types, taxonomies, metaboxes, and widgets to core functiona…
authored
35 // Sidebars
efbce06 @billerickson adjust spacing
authored
36 //unregister_sidebar( 'sidebar-alt' );
37 //genesis_register_sidebar( array( 'name' => 'Blog Sidebar', 'id' => 'blog-sidebar' ) );
180e769 @billerickson first commit
authored
38 //add_theme_support( 'genesis-footer-widgets', 3 );
39
40 // Remove Unused Page Layouts
41 //genesis_unregister_layout( 'full-width-content' );
42 //genesis_unregister_layout( 'content-sidebar' );
43 //genesis_unregister_layout( 'sidebar-content' );
44 //genesis_unregister_layout( 'content-sidebar-sidebar' );
45 //genesis_unregister_layout( 'sidebar-sidebar-content' );
46 //genesis_unregister_layout( 'sidebar-content-sidebar' );
c64a422 @billerickson Add editor s tyles for column classes
authored
47
6bad7cb @billerickson remove unused theme settings
authored
48 // Remove Unused Theme Settings
49 add_action( 'genesis_theme_settings_metaboxes', 'be_remove_metaboxes' );
50
76680a2 @billerickson remove unused user settings
authored
51 // Remove Unused User Settings
52 add_filter( 'user_contactmethods', 'be_contactmethods' );
53 remove_action( 'show_user_profile', 'genesis_user_options_fields' );
54 remove_action( 'edit_user_profile', 'genesis_user_options_fields' );
55 remove_action( 'show_user_profile', 'genesis_user_archive_fields' );
56 remove_action( 'edit_user_profile', 'genesis_user_archive_fields' );
57 remove_action( 'show_user_profile', 'genesis_user_seo_fields' );
58 remove_action( 'edit_user_profile', 'genesis_user_seo_fields' );
59 remove_action( 'show_user_profile', 'genesis_user_layout_fields' );
60 remove_action( 'edit_user_profile', 'genesis_user_layout_fields' );
61
c64a422 @billerickson Add editor s tyles for column classes
authored
62 // Editor Styles
63 add_editor_style( 'editor-style.css' );
180e769 @billerickson first commit
authored
64
24a3be4 @billerickson remove genesis 1.8 requirement since 1.8 is public
authored
65 // Setup Theme Settings
efbce06 @billerickson adjust spacing
authored
66 //include_once( CHILD_DIR . '/lib/functions/child-theme-settings.php' );
b93a9f7 @billerickson Add theme settings
authored
67
7d1b13e @billerickson exclude theme from automatic updates
authored
68 // Don't update theme
69 add_filter( 'http_request_args', 'be_dont_update_theme', 5, 2 );
70
180e769 @billerickson first commit
authored
71 // ** Frontend **
36966c1 @billerickson move post types, taxonomies, metaboxes, and widgets to core functiona…
authored
72
180e769 @billerickson first commit
authored
73 // Remove Edit link
ad061d9 @billerickson remove edit post link using new genesis filter
authored
74 add_filter( 'genesis_edit_post_link', '__return_false' );
1192ca1 @billerickson remove default footer
authored
75
76 // Remove Genesis Footer
77 remove_action( 'genesis_footer', 'genesis_do_footer' );
180e769 @billerickson first commit
authored
78 }
79
80 // ** Backend Functions ** //
81
7d1b13e @billerickson exclude theme from automatic updates
authored
82 /**
6bad7cb @billerickson remove unused theme settings
authored
83 * Remove Metaboxes
f3027c3 @billerickson add version number
authored
84 * @since 1.0.0
85 *
6bad7cb @billerickson remove unused theme settings
authored
86 * This removes unused or unneeded metaboxes from Genesis > Theme Settings.
87 * See /genesis/lib/admin/theme-settings for all metaboxes.
88 *
89 * @author Bill Erickson
90 * @link http://www.billerickson.net/code/remove-metaboxes-from-genesis-theme-settings/
91 */
92
93 function be_remove_metaboxes( $_genesis_theme_settings_pagehook ) {
94 remove_meta_box( 'genesis-theme-settings-header', $_genesis_theme_settings_pagehook, 'main' );
95 remove_meta_box( 'genesis-theme-settings-nav', $_genesis_theme_settings_pagehook, 'main' );
96 remove_meta_box( 'genesis-theme-settings-breadcrumb', $_genesis_theme_settings_pagehook, 'main' );
97 remove_meta_box( 'genesis-theme-settings-blogpage', $_genesis_theme_settings_pagehook, 'main' );
98 }
99
100 /**
76680a2 @billerickson remove unused user settings
authored
101 * Customize Contact Methods
f3027c3 @billerickson add version number
authored
102 * @since 1.0.0
103 *
76680a2 @billerickson remove unused user settings
authored
104 * @author Bill Erickson
105 * @link http://sillybean.net/2010/01/creating-a-user-directory-part-1-changing-user-contact-fields/
106 *
107 * @param array $contactmethods
108 * @return array
109 */
110 function be_contactmethods( $contactmethods ) {
111 unset( $contactmethods['aim'] );
112 unset( $contactmethods['yim'] );
113 unset( $contactmethods['jabber'] );
114
115 return $contactmethods;
116 }
117
118 /**
7d1b13e @billerickson exclude theme from automatic updates
authored
119 * Don't Update Theme
f3027c3 @billerickson add version number
authored
120 * @since 1.0.0
121 *
7d1b13e @billerickson exclude theme from automatic updates
authored
122 * If there is a theme in the repo with the same name,
123 * this prevents WP from prompting an update.
124 *
0dcf0fc @billerickson update documentation on be_dont_update_theme
authored
125 * @author Mark Jaquith
7d1b13e @billerickson exclude theme from automatic updates
authored
126 * @link http://markjaquith.wordpress.com/2009/12/14/excluding-your-plugin-or-theme-from-update-checks/
127 *
0dcf0fc @billerickson update documentation on be_dont_update_theme
authored
128 * @param array $r, request arguments
129 * @param string $url, request url
130 * @return array request arguments
7d1b13e @billerickson exclude theme from automatic updates
authored
131 */
132
133 function be_dont_update_theme( $r, $url ) {
134 if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) )
135 return $r; // Not a theme update request. Bail immediately.
136 $themes = unserialize( $r['body']['themes'] );
137 unset( $themes[ get_option( 'template' ) ] );
138 unset( $themes[ get_option( 'stylesheet' ) ] );
139 $r['body']['themes'] = serialize( $themes );
140 return $r;
141 }
180e769 @billerickson first commit
authored
142
ee3d771 @billerickson remove function used for testing theme settings
authored
143 // ** Frontend Functions ** //
Something went wrong with that request. Please try again.