Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ddfbc09f88
Fetching contributors…

Cannot retrieve contributors at this time

file 113 lines (89 sloc) 3.869 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
<?php
/**
* Sets up the core framework's widgets and unregisters some of the default WordPress widgets if the
* theme supports this feature. The framework's widgets are meant to extend the default WordPress
* widgets by giving users highly-customizable widget settings. A theme must register support for the
* 'hybrid-core-widgets' feature to use the framework widgets.
*
* @package HybridCore
* @subpackage Functions
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2008 - 2012, Justin Tadlock
* @link http://themehybrid.com/hybrid-core
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

/* Unregister WP widgets. */
add_action( 'widgets_init', 'hybrid_unregister_widgets' );

/* Register Hybrid widgets. */
add_action( 'widgets_init', 'hybrid_register_widgets' );

/**
* Registers the core frameworks widgets. These widgets typically overwrite the equivalent default WordPress
* widget by extending the available options of the widget.
*
* @since 0.6.0
* @access private
* @uses register_widget() Registers individual widgets with WordPress
* @link http://codex.wordpress.org/Function_Reference/register_widget
* @return void
*/
function hybrid_register_widgets() {

/* Load the archives widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-archives.php' );

/* Load the authors widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-authors.php' );

/* Load the bookmarks widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-bookmarks.php' );

/* Load the calendar widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-calendar.php' );

/* Load the categories widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-categories.php' );

/* Load the nav menu widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-nav-menu.php' );

/* Load the pages widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-pages.php' );

/* Load the search widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-search.php' );

/* Load the tags widget class. */
require_once( trailingslashit( HYBRID_CLASSES ) . 'widget-tags.php' );

/* Register the archives widget. */
register_widget( 'Hybrid_Widget_Archives' );

/* Register the authors widget. */
register_widget( 'Hybrid_Widget_Authors' );

/* Register the bookmarks widget. */
register_widget( 'Hybrid_Widget_Bookmarks' );

/* Register the calendar widget. */
register_widget( 'Hybrid_Widget_Calendar' );

/* Register the categories widget. */
register_widget( 'Hybrid_Widget_Categories' );

/* Register the nav menu widget. */
register_widget( 'Hybrid_Widget_Nav_Menu' );

/* Register the pages widget. */
register_widget( 'Hybrid_Widget_Pages' );

/* Register the search widget. */
register_widget( 'Hybrid_Widget_Search' );

/* Register the tags widget. */
register_widget( 'Hybrid_Widget_Tags' );
}

/**
* Unregister default WordPress widgets that are replaced by the framework's widgets. Widgets that
* aren't replaced by the framework widgets are not unregistered.
*
* @since 0.3.2
* @access private
* @uses unregister_widget() Unregisters a registered widget.
* @link http://codex.wordpress.org/Function_Reference/unregister_widget
* @return void
*/
function hybrid_unregister_widgets() {

/* Unregister the default WordPress widgets. */
unregister_widget( 'WP_Widget_Archives' );
unregister_widget( 'WP_Widget_Calendar' );
unregister_widget( 'WP_Widget_Categories' );
unregister_widget( 'WP_Widget_Links' );
unregister_widget( 'WP_Nav_Menu_Widget' );
unregister_widget( 'WP_Widget_Pages' );
unregister_widget( 'WP_Widget_Recent_Posts' );
unregister_widget( 'WP_Widget_Search' );
unregister_widget( 'WP_Widget_Tag_Cloud' );
}

?>
Something went wrong with that request. Please try again.