Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 348 lines (270 sloc) 14.945 kB
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
1 <?php
2 /**
9337d50 Documentation updates.
greenshady authored
3 * Hybrid Core - A WordPress theme development framework.
4 *
3594f29 Documentation updates galore.
greenshady authored
5 * Hybrid Core is a framework for developing WordPress themes. The framework allows theme developers
6 * to quickly build themes without having to handle all of the "logic" behind the theme or having to code
7 * complex functionality for features that are often needed in themes. The framework does these things
8 * for developers to allow them to get back to what matters the most: developing and designing themes.
9 * The framework was built to make it easy for developers to include (or not include) specific, pre-coded
10 * features. Themes handle all the markup, style, and scripts while the framework handles the logic.
a84cd56 Update the license info specifically for the framework.
greenshady authored
11 *
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
12 * Hybrid Core is a modular system, which means that developers can pick and choose the features they
13 * want to include within their themes. Most files are only loaded if the theme registers support for the
14 * feature using the add_theme_support( $feature ) function within their theme.
15 *
3594f29 Documentation updates galore.
greenshady authored
16 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
17 * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
18 * that you can use any other version of the GPL.
a84cd56 Update the license info specifically for the framework.
greenshady authored
19 *
3594f29 Documentation updates galore.
greenshady authored
20 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
21 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
a84cd56 Update the license info specifically for the framework.
greenshady authored
22 *
3594f29 Documentation updates galore.
greenshady authored
23 * You should have received a copy of the GNU General Public License along with this program; if not, write
24 * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
a84cd56 Update the license info specifically for the framework.
greenshady authored
25 *
26 * @package HybridCore
e551e81 Updates Hybrid Core's i18n functionality to properly allow themes to …
greenshady authored
27 * @version 1.3.0-beta-3
9337d50 Documentation updates.
greenshady authored
28 * @author Justin Tadlock <justin@justintadlock.com>
ecabe8b Update copyright dates for 2012.
greenshady authored
29 * @copyright Copyright (c) 2008 - 2012, Justin Tadlock
8d8f1a3 Update the URL to the Hybrid Core page.
greenshady authored
30 * @link http://themehybrid.com/hybrid-core
9337d50 Documentation updates.
greenshady authored
31 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
a84cd56 Update the license info specifically for the framework.
greenshady authored
32 */
33
34 /**
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
35 * The Hybrid class launches the framework. It's the organizational structure behind the entire framework.
36 * This class should be loaded and initialized before anything else within the theme is called to properly use
37 * the framework.
38 *
39 * After parent themes call the Hybrid class, they should perform a theme setup function on the
40 * 'after_setup_theme' hook with a priority of 10. Child themes should add their theme setup function on
41 * the 'after_setup_theme' hook with a priority of 11. This allows the class to load theme-supported features
42 * at the appropriate time, which is on the 'after_setup_theme' hook with a priority of 12.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
43 *
3594f29 Documentation updates galore.
greenshady authored
44 * @since 0.7.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
45 */
46 class Hybrid {
47
48 /**
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
49 * Constructor method for the Hybrid class. This method adds other methods of the class to
50 * specific hooks within WordPress. It controls the load order of the required files for running
51 * the framework.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
52 *
c3cf33f Mark all 0.9.1 changes as 1.0.0 since that'll be the release version.
greenshady authored
53 * @since 1.0.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
54 */
7a9980c Appropriate PHP4 and PHP5 constructor methods.
greenshady authored
55 function __construct() {
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
56
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
57 /* Define framework, parent theme, and child theme constants. */
58 add_action( 'after_setup_theme', array( &$this, 'constants' ), 1 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
59
9337d50 Documentation updates.
greenshady authored
60 /* Load the core functions required by the rest of the framework. */
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
61 add_action( 'after_setup_theme', array( &$this, 'core' ), 2 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
62
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
63 /* Initialize the framework's default actions and filters. */
28a7169 The locale() method should be loaded after the default_filters() method.
greenshady authored
64 add_action( 'after_setup_theme', array( &$this, 'default_filters' ), 3 );
65
66 /* Language functions and translations setup. */
c701ae9 Change the locale() method name to i18n() and update the inline docs.
greenshady authored
67 add_action( 'after_setup_theme', array( &$this, 'i18n' ), 4 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
68
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
69 /* Handle theme supported features. */
70 add_action( 'after_setup_theme', array( &$this, 'theme_support' ), 12 );
71
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
72 /* Load the framework functions. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
73 add_action( 'after_setup_theme', array( &$this, 'functions' ), 13 );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
74
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
75 /* Load the framework extensions. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
76 add_action( 'after_setup_theme', array( &$this, 'extensions' ), 14 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
77
02c9e07 Cleaning up the admin functionality for a better development experience.
greenshady authored
78 /* Load admin files. */
79 add_action( 'wp_loaded', array( &$this, 'admin' ) );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
80 }
81
82 /**
c701ae9 Change the locale() method name to i18n() and update the inline docs.
greenshady authored
83 * Defines the constant paths for use within the core framework, parent theme, and child theme.
84 * Constants prefixed with 'HYBRID_' are for use only within the core framework and don't
85 * reference other areas of the parent or child theme.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
86 *
3594f29 Documentation updates galore.
greenshady authored
87 * @since 0.7.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
88 */
89 function constants() {
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
90
6d61b5d Change 'HYBRID_CORE_VERSION' to 'HYBRID_VERSION' to match the naming …
greenshady authored
91 /* Sets the framework version number. */
b1d9b73 Version number and inline doc cleanup.
greenshady authored
92 define( 'HYBRID_VERSION', '1.3.0' );
18e15fc Add the 'HYBRID_CORE_VERSION' constant.
greenshady authored
93
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
94 /* Sets the path to the parent theme directory. */
95 define( 'THEME_DIR', get_template_directory() );
96
97 /* Sets the path to the parent theme directory URI. */
98 define( 'THEME_URI', get_template_directory_uri() );
99
100 /* Sets the path to the child theme directory. */
101 define( 'CHILD_THEME_DIR', get_stylesheet_directory() );
102
103 /* Sets the path to the child theme directory URI. */
104 define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );
105
106 /* Sets the path to the core framework directory. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
107 define( 'HYBRID_DIR', trailingslashit( THEME_DIR ) . basename( dirname( __FILE__ ) ) );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
108
109 /* Sets the path to the core framework directory URI. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
110 define( 'HYBRID_URI', trailingslashit( THEME_URI ) . basename( dirname( __FILE__ ) ) );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
111
112 /* Sets the path to the core framework admin directory. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
113 define( 'HYBRID_ADMIN', trailingslashit( HYBRID_DIR ) . 'admin' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
114
115 /* Sets the path to the core framework classes directory. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
116 define( 'HYBRID_CLASSES', trailingslashit( HYBRID_DIR ) . 'classes' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
117
118 /* Sets the path to the core framework extensions directory. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
119 define( 'HYBRID_EXTENSIONS', trailingslashit( HYBRID_DIR ) . 'extensions' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
120
121 /* Sets the path to the core framework functions directory. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
122 define( 'HYBRID_FUNCTIONS', trailingslashit( HYBRID_DIR ) . 'functions' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
123
abfcf47 Complete overhaul of how translations and internationalization is han…
greenshady authored
124 /* Sets the path to the core framework languages directory. */
125 define( 'HYBRID_LANGUAGES', trailingslashit( HYBRID_DIR ) . 'languages' );
126
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
127 /* Sets the path to the core framework images directory URI. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
128 define( 'HYBRID_IMAGES', trailingslashit( HYBRID_URI ) . 'images' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
129
130 /* Sets the path to the core framework CSS directory URI. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
131 define( 'HYBRID_CSS', trailingslashit( HYBRID_URI ) . 'css' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
132
133 /* Sets the path to the core framework JavaScript directory URI. */
40f0819 Moving the Hybrid class to the root directory of the framework. This…
greenshady authored
134 define( 'HYBRID_JS', trailingslashit( HYBRID_URI ) . 'js' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
135 }
136
137 /**
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
138 * Loads the core framework functions. These files are needed before loading anything else in the
139 * framework because they have required functions for use.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
140 *
c3cf33f Mark all 0.9.1 changes as 1.0.0 since that'll be the release version.
greenshady authored
141 * @since 1.0.0
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
142 */
143 function core() {
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
144
145 /* Load the core framework functions. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
146 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'core.php' );
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
147
148 /* Load the context-based functions. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
149 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'context.php' );
abfcf47 Complete overhaul of how translations and internationalization is han…
greenshady authored
150
151 /* Load the core framework internationalization functions. */
152 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'i18n.php' );
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
153 }
154
155 /**
c701ae9 Change the locale() method name to i18n() and update the inline docs.
greenshady authored
156 * Loads both the parent and child theme translation files. If a locale-based functions file exists
157 * in either the parent or child theme (child overrides parent), it will also be loaded. All translation
158 * and locale functions files are expected to be within the theme's '/languages' folder, but the
159 * framework will fall back on the theme root folder if necessary. Translation files are expected
160 * to be prefixed with the template or stylesheet path (example: 'templatename-en_US.mo').
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
161 *
c701ae9 Change the locale() method name to i18n() and update the inline docs.
greenshady authored
162 * @since 1.2.0
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
163 */
c701ae9 Change the locale() method name to i18n() and update the inline docs.
greenshady authored
164 function i18n() {
e551e81 Updates Hybrid Core's i18n functionality to properly allow themes to …
greenshady authored
165 global $hybrid;
166
167 /* Get parent and child theme textdomains. */
168 $parent_textdomain = hybrid_get_parent_textdomain();
169 $child_textdomain = hybrid_get_child_textdomain();
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
170
abfcf47 Complete overhaul of how translations and internationalization is han…
greenshady authored
171 /* Load the framework textdomain. */
e551e81 Updates Hybrid Core's i18n functionality to properly allow themes to …
greenshady authored
172 $hybrid->textdomain_loaded['hybrid-core'] = hybrid_load_framework_textdomain( 'hybrid-core' );
abfcf47 Complete overhaul of how translations and internationalization is han…
greenshady authored
173
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
174 /* Load theme textdomain. */
e551e81 Updates Hybrid Core's i18n functionality to properly allow themes to …
greenshady authored
175 $hybrid->textdomain_loaded[$parent_textdomain] = load_theme_textdomain( $parent_textdomain );
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
176
9398f0a Addition of child theme textdomain functionality. First pass.
greenshady authored
177 /* Load child theme textdomain. */
e551e81 Updates Hybrid Core's i18n functionality to properly allow themes to …
greenshady authored
178 $hybrid->textdomain_loaded[$child_textdomain] = is_child_theme() ? load_child_theme_textdomain( $child_textdomain ) : false;
9398f0a Addition of child theme textdomain functionality. First pass.
greenshady authored
179
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
180 /* Get the user's locale. */
181 $locale = get_locale();
182
183 /* Locate a locale-specific functions file. */
184 $locale_functions = locate_template( array( "languages/{$locale}.php", "{$locale}.php" ) );
185
186 /* If the locale file exists and is readable, load it. */
187 if ( !empty( $locale_functions ) && is_readable( $locale_functions ) )
188 require_once( $locale_functions );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
189 }
190
191 /**
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
192 * Removes theme supported features from themes in the case that a user has a plugin installed
193 * that handles the functionality.
194 *
195 * @since 1.3.0
196 */
197 function theme_support() {
198
199 /* Remove support for the core SEO component if the WP SEO plugin is installed. */
200 if ( defined( 'WPSEO_VERSION' ) )
201 remove_theme_support( 'hybrid-core-seo' );
202
203 /* Remove support for the the Breadcrumb Trail extension if the plugin is installed. */
204 if ( function_exists( 'breadcrumb_trail' ) )
205 remove_theme_support( 'breadcrumb-trail' );
206
207 /* Remove support for the the Cleaner Gallery extension if the plugin is installed. */
208 if ( function_exists( 'cleaner_gallery' ) )
209 remove_theme_support( 'cleaner-gallery' );
210
211 /* Remove support for the the Get the Image extension if the plugin is installed. */
212 if ( function_exists( 'get_the_image' ) )
213 remove_theme_support( 'get-the-image' );
214 }
215
216 /**
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
217 * Loads the framework functions. Many of these functions are needed to properly run the
218 * framework. Some components are only loaded if the theme supports them.
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
219 *
3594f29 Documentation updates galore.
greenshady authored
220 * @since 0.7.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
221 */
222 function functions() {
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
223
224 /* Load the comments functions. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
225 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'comments.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
226
227 /* Load media-related functions. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
228 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'media.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
229
ab93562 Use the new register_meta() functionality in conjunction with its san…
greenshady authored
230 /* Load the metadata functions. */
231 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'meta.php' );
232
6469db8 Rename the template.php file to utility.php since most of the templat…
greenshady authored
233 /* Load the utility functions. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
234 require_once( trailingslashit( HYBRID_FUNCTIONS ) . 'utility.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
235
446768f Move the settings functions into a separate settings.php file that's …
greenshady authored
236 /* Load the theme settings functions if supported. */
237 require_if_theme_supports( 'hybrid-core-theme-settings', trailingslashit( HYBRID_FUNCTIONS ) . 'settings.php' );
238
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
239 /* Load the menus functions if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
240 require_if_theme_supports( 'hybrid-core-menus', trailingslashit( HYBRID_FUNCTIONS ) . 'menus.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
241
823e961 Inline doc updates.
greenshady authored
242 /* Load the core SEO component if supported. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
243 require_if_theme_supports( 'hybrid-core-seo', trailingslashit( HYBRID_FUNCTIONS ) . 'core-seo.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
244
245 /* Load the shortcodes if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
246 require_if_theme_supports( 'hybrid-core-shortcodes', trailingslashit( HYBRID_FUNCTIONS ) . 'shortcodes.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
247
942ca07 More moving and shuffling of files and functions to clean this thing up.
greenshady authored
248 /* Load the sidebars if supported. */
249 require_if_theme_supports( 'hybrid-core-sidebars', trailingslashit( HYBRID_FUNCTIONS ) . 'sidebars.php' );
250
251 /* Load the widgets if supported. */
252 require_if_theme_supports( 'hybrid-core-widgets', trailingslashit( HYBRID_FUNCTIONS ) . 'widgets.php' );
253
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
254 /* Load the template hierarchy if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
255 require_if_theme_supports( 'hybrid-core-template-hierarchy', trailingslashit( HYBRID_FUNCTIONS ) . 'template-hierarchy.php' );
62f7c4e Better separation of core files and functions and a more logical load…
greenshady authored
256
257 /* Load the deprecated functions if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
258 require_if_theme_supports( 'hybrid-core-deprecated', trailingslashit( HYBRID_FUNCTIONS ) . 'deprecated.php' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
259 }
260
261 /**
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
262 * Load extensions (external projects). Extensions are projects that are included within the
263 * framework but are not a part of it. They are external projects developed outside of the
264 * framework. Themes must use add_theme_support( $extension ) to use a specific extension
265 * within the theme. This should be declared on 'after_setup_theme' no later than a priority of 11.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
266 *
3594f29 Documentation updates galore.
greenshady authored
267 * @since 0.7.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
268 */
269 function extensions() {
270
823e961 Inline doc updates.
greenshady authored
271 /* Load the Breadcrumb Trail extension if supported. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
272 require_if_theme_supports( 'breadcrumb-trail', trailingslashit( HYBRID_EXTENSIONS ) . 'breadcrumb-trail.php' );
9558ada Add the Cleaner Caption extension.
greenshady authored
273
823e961 Inline doc updates.
greenshady authored
274 /* Load the Cleaner Gallery extension if supported. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
275 require_if_theme_supports( 'cleaner-gallery', trailingslashit( HYBRID_EXTENSIONS ) . 'cleaner-gallery.php' );
3b49a36 First pass on adding the Cleaner Gallery extension.
greenshady authored
276
823e961 Inline doc updates.
greenshady authored
277 /* Load the Get the Image extension if supported. */
1d5198a Added the theme_support() method to the Hybrid class. This allows the…
greenshady authored
278 require_if_theme_supports( 'get-the-image', trailingslashit( HYBRID_EXTENSIONS ) . 'get-the-image.php' );
c501bba Don't load the breadcrumb-trail and get-the-image extensions if the p…
greenshady authored
279
280 /* Load the Cleaner Caption extension if supported. */
281 require_if_theme_supports( 'cleaner-caption', trailingslashit( HYBRID_EXTENSIONS ) . 'cleaner-caption.php' );
282
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
283 /* Load the Custom Field Series extension if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
284 require_if_theme_supports( 'custom-field-series', trailingslashit( HYBRID_EXTENSIONS ) . 'custom-field-series.php' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
285
942ca07 More moving and shuffling of files and functions to clean this thing up.
greenshady authored
286 /* Load the Loop Pagination extension if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
287 require_if_theme_supports( 'loop-pagination', trailingslashit( HYBRID_EXTENSIONS ) . 'loop-pagination.php' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
288
289 /* Load the Entry Views extension if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
290 require_if_theme_supports( 'entry-views', trailingslashit( HYBRID_EXTENSIONS ) . 'entry-views.php' );
680a354 Official introduction of the post layouts extension. First pass.
greenshady authored
291
eed5031 Change "Post Layouts" extension to "Theme Layouts."
greenshady authored
292 /* Load the Theme Layouts extension if supported. */
293 require_if_theme_supports( 'theme-layouts', trailingslashit( HYBRID_EXTENSIONS ) . 'theme-layouts.php' );
e674efb Moving more Hybrid theme stuff out of core.
greenshady authored
294
982c613 Post Stylesheets is now officially an extension.
greenshady authored
295 /* Load the Post Stylesheets extension if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
296 require_if_theme_supports( 'post-stylesheets', trailingslashit( HYBRID_EXTENSIONS ) . 'post-stylesheets.php' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
297 }
298
299 /**
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
300 * Load admin files for the framework.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
301 *
3594f29 Documentation updates galore.
greenshady authored
302 * @since 0.7.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
303 */
304 function admin() {
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
305
306 /* Check if in the WordPress admin. */
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
307 if ( is_admin() ) {
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
308
309 /* Load the main admin file. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
310 require_once( trailingslashit( HYBRID_ADMIN ) . 'admin.php' );
1823e75 Better inline documentation for the Hybrid class.
greenshady authored
311
02c9e07 Cleaning up the admin functionality for a better development experience.
greenshady authored
312 /* Load the theme settings feature if supported. */
79459d0 Always use trailingslashit() to add a trailing slash when including f…
greenshady authored
313 require_if_theme_supports( 'hybrid-core-theme-settings', trailingslashit( HYBRID_ADMIN ) . 'theme-settings.php' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
314 }
315 }
316
317 /**
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
318 * Adds the default framework actions and filters.
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
319 *
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
320 * @since 1.0.0
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
321 */
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
322 function default_filters() {
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
323
4ea1316 Only remove bbPress theme compat if theme supports bbPress.
greenshady authored
324 /* Remove bbPress theme compatibility if current theme supports bbPress. */
325 if ( current_theme_supports( 'bbpress' ) )
326 remove_action( 'bbp_init', 'bbp_setup_theme_compat', 8 );
7432e92 Bucket loads of changes. Just playin' around.
greenshady authored
327
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
328 /* Move the WordPress generator to a better priority. */
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
329 remove_action( 'wp_head', 'wp_generator' );
e674efb Moving more Hybrid theme stuff out of core.
greenshady authored
330 add_action( 'wp_head', 'wp_generator', 1 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
331
b2d4785 Move a few actions/filters out of the core Hybrid class into appropri…
greenshady authored
332 /* Add the theme info to the header (lets theme developers give better support). */
333 add_action( 'wp_head', 'hybrid_meta_template', 1 );
977325b Final (hopefully) update of the core Hybrid class to get the method l…
greenshady authored
334
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
335 /* Filter the textdomain mofile to allow child themes to load the parent theme translation. */
fdd14df Finalize on i18n?
greenshady authored
336 add_filter( 'load_textdomain_mofile', 'hybrid_load_textdomain_mofile', 10, 2 );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
337
abfcf47 Complete overhaul of how translations and internationalization is han…
greenshady authored
338 /* Filter text strings for Hybrid Core and extensions so themes can serve up translations. */
339 add_filter( 'gettext', 'hybrid_gettext', 1, 3 );
fdd14df Finalize on i18n?
greenshady authored
340 add_filter( 'gettext', 'hybrid_extensions_gettext', 1, 3 );
998c506 Filter extension textdomains with hybrid_get_textdomains() so that th…
greenshady authored
341
06fef79 Allow shortcodes in text widgets since this was removed from WP 3.3.
greenshady authored
342 /* Make text widgets and term descriptions shortcode aware. */
343 add_filter( 'widget_text', 'do_shortcode' );
0586624 Importing the initial Hybrid Core files and folders.
greenshady authored
344 add_filter( 'term_description', 'do_shortcode' );
345 }
346 }
347
348 ?>
Something went wrong with that request. Please try again.