本文整理汇总了PHP中hybrid_get_prefix函数的典型用法代码示例。如果您正苦于以下问题:PHP hybrid_get_prefix函数的具体用法?PHP hybrid_get_prefix怎么用?PHP hybrid_get_prefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hybrid_get_prefix函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ct_tracks_theme_setup
function ct_tracks_theme_setup()
{
/* Get action/filter hook prefix. */
$prefix = hybrid_get_prefix();
/* Theme-supported features go here. */
add_theme_support('hybrid-core-template-hierarchy');
add_theme_support('loop-pagination');
add_theme_support('cleaner-gallery');
// from WordPress core not theme hybrid
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
register_nav_menus(array('primary' => __('Primary', 'tracks'), 'secondary' => __('Secondary', 'tracks'), 'footer' => __('Footer', 'tracks')));
// adds theme options page
require_once trailingslashit(get_template_directory()) . 'theme-options.php';
// add inc folder files
foreach (glob(trailingslashit(get_template_directory()) . 'inc/*.php') as $filename) {
include $filename;
}
// add license folder files
foreach (glob(trailingslashit(get_template_directory()) . 'licenses/*.php') as $filename) {
include $filename;
}
// add license/functions folder files
foreach (glob(trailingslashit(get_template_directory()) . 'licenses/functions/*.php') as $filename) {
include $filename;
}
// load text domain
load_theme_textdomain('tracks', get_template_directory() . '/languages');
}
示例2: hybrid_register_sidebars
/**
* Registers the default framework dynamic sidebars based on the sidebars the theme has added support
* for using add_theme_support().
*
* @since 0.7.0
* @access private
* @uses register_sidebar() Registers a sidebar with WordPress.
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
* @return void
*/
function hybrid_register_sidebars()
{
/* Get the theme-supported sidebars. */
$supported_sidebars = get_theme_support('hybrid-core-sidebars');
/* If the theme doesn't add support for any sidebars, return. */
if (!is_array($supported_sidebars[0])) {
return;
}
/* Get the available core framework sidebars. */
$core_sidebars = hybrid_get_sidebars();
/* Loop through the supported sidebars. */
foreach ($supported_sidebars[0] as $sidebar) {
/* Make sure the given sidebar is one of the core sidebars. */
if (isset($core_sidebars[$sidebar])) {
/* Set up some default sidebar arguments. */
$defaults = array('before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-wrap widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>');
/* Allow developers to filter the default sidebar arguments. */
$defaults = apply_filters(hybrid_get_prefix() . '_sidebar_defaults', $defaults, $sidebar);
/* Parse the sidebar arguments and defaults. */
$args = wp_parse_args($core_sidebars[$sidebar], $defaults);
/* If no 'id' was given, use the $sidebar variable and sanitize it. */
$args['id'] = isset($args['id']) ? sanitize_key($args['id']) : sanitize_key($sidebar);
/* Allow developers to filter the sidebar arguments. */
$args = apply_filters(hybrid_get_prefix() . '_sidebar_args', $args, $sidebar);
/* Register the sidebar. */
register_sidebar($args);
}
}
}
示例3: Squar_Banner_Item_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function Squar_Banner_Item_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'squar';
$this->textdomain = 'squar';
}
/* Setup URL to Tim Thumb Script*/
$this->timthumb = SQUAR_SCRIPTS_URI . '/thumb.php';
$widget_options = array(
'classname' => 'banner-item',
'description' => esc_html__( 'Adds a banner item to frontpage slider or into the inside page banner area.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '700',
'id_base' => "{$this->prefix}-banner-item", esc_attr__( 'A Banner Item', $this->textdomain )
);
$this->WP_Widget( "{$this->prefix}-banner-item", esc_attr__( 'A Banner Item', $this->textdomain ), $widget_options, $control_options );
}
示例4: Pogidude_Event_Widget
function Pogidude_Event_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'pogidude';
$this->textdomain = 'pogidude';
}
$this->widget_id = 'event-widget';
$widget_options = array(
'classname' => "{$this->prefix}-{$this->widget_id}",
'description' => esc_html__( 'Displays your Events in the sidebar.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-{$this->widget_id}"
);
$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'TM: Event Widget', $this->textdomain ), $widget_options, $control_options );
}
示例5: Pogidude_Twitter_Feed_Widget
function Pogidude_Twitter_Feed_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'pogidude';
$this->textdomain = 'pogidude';
}
$widget_options = array(
'classname' => 'pogidude-twitter-feed',
'description' => esc_html__( 'Add your Twitter feed to your sidebar with this widget.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-twitter-feed"
);
$this->WP_Widget( "{$this->prefix}-twitter-feed", esc_attr__( 'Twitter Stream', $this->textdomain ), $widget_options, $control_options );
}
示例6: Pogidude_Slider_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function Pogidude_Slider_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'pogidude';
$this->textdomain = 'pogidude';
}
//setup widget it
$this->widget_id = 'slider-item';
//setup path to Tim Thumb script
$this->timthumbUrl = trailingslashit( THEMELIB_SCRIPTS_URI ) . 'thumb.php';
$widget_options = array(
'classname' => "{$this->prefix}-{$this->widget_id}",
'description' => esc_html__( 'Adds a slider item. Use on slider widget area.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-{$this->widget_id}"
);
$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'TM: Slider Item', $this->textdomain ), $widget_options, $control_options );
}
示例7: Image_Button_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function Image_Button_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'mobility21';
$this->textdomain = 'mobility21';
}
$widget_options = array(
'classname' => 'image-button',
'description' => esc_html__( 'Displays an image button and can link to a URL when clicked.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '250',
'id_base' => "{$this->prefix}-image-button", esc_attr__( 'Image Button', $this->textdomain )
);
$this->WP_Widget( "{$this->prefix}-image-button", esc_attr__( 'Mobility Image Button', $this->textdomain ), $widget_options, $control_options );
}
示例8: M21_Single_Ad_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function M21_Single_Ad_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'mobility21';
$this->textdomain = 'mobility21';
}
$widget_options = array(
'classname' => 'm21-single-ad',
'description' => esc_html__( 'Place a Mobility21 Partner ad.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '525',
'id_base' => "{$this->prefix}-m21-single-ad", esc_attr__( 'M21 Single Ad', $this->textdomain )
);
$this->WP_Widget( "{$this->prefix}-m21-single-ad", esc_attr__( 'Mobility Single Ad Widget', $this->textdomain ), $widget_options, $control_options );
}
示例9: Widget_Subscribe_Box
function Widget_Subscribe_Box(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'pogidude';
$this->textdomain = 'pogidude';
}
$this->widget_id = 'newsletter-subscribe-box';
$widget_options = array(
'classname' => "{$this->prefix}-{$this->widget_id}",
'description' => esc_html__( 'Add a newsletter subscribe box to your sidebar. Do not use this widget more than once in the same page.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-{$this->widget_id}"
);
$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Newsletter Subscribe', $this->textdomain ), $widget_options, $control_options );
}
示例10: M21_Banner_Item_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function M21_Banner_Item_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'mobility21';
$this->textdomain = 'mobility21';
}
$widget_options = array(
'classname' => 'm21-banner-item',
'description' => esc_html__( 'Adds a banner item to Mobility 21 site frontpage slider or into the inside page banner area.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '700',
'id_base' => "{$this->prefix}-m21-banner-item", esc_attr__( 'M21 Banner Item', $this->textdomain )
);
$this->WP_Widget( "{$this->prefix}-m21-banner-item", esc_attr__( 'Mobility Banner Item', $this->textdomain ), $widget_options, $control_options );
}
示例11: Squar_Feature_Box_Widget
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.1
*/
function Squar_Feature_Box_Widget(){
/* Setup URL to Tim Thumb Script*/
$this->timthumburl = SQUAR_SCRIPTS_URI . '/thumb.php';
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'squar';
$this->textdomain = 'squar';
}
$widget_options = array(
'classname' => 'feature-box',
'description' => esc_html__( 'Displays a feature box with an image which can link to a URL when clicked.', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '525',
'id_base' => "{$this->prefix}-feature-box", esc_attr__( 'Feature Box', $this->textdomain )
);
$this->WP_Widget( "{$this->prefix}-feature-box", esc_attr__( 'A Feature Box', $this->textdomain ), $widget_options, $control_options );
}
示例12: init
/**
* Initializes the theme framework, loads the required files, and calls the
* functions needed to run the theme.
*
* @since 0.7
*/
function init() {
/* Define theme constants. */
$this->constants();
/* Load theme functions. */
$this->functions();
/* Load theme extensions. */
$this->extensions();
/* Load legacy files and functions. */
$this->legacy();
/* Load admin files. */
$this->admin();
/* Theme prefix for creating things such as filter hooks (i.e., "$prefix_hook_name"). */
$this->prefix = hybrid_get_prefix();
/* Load theme textdomain. */
$domain = hybrid_get_textdomain();
$locale = get_locale();
load_textdomain( $domain, locate_template( array( "languages/{$domain}-{$locale}.mo", "{$domain}-{$locale}.mo" ) ) );
/* Initialize the theme's default actions. */
$this->actions();
/* Initialize the theme's default filters. */
$this->filters();
/* Theme init hook. */
do_action( "{$this->prefix}_init" );
}
示例13: Widget_Social_Connect
function Widget_Social_Connect(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'pogidude';
$this->textdomain = 'pogidude';
}
$this->widget_id = 'social-connect';
$widget_options = array(
'classname' => "{$this->prefix}-{$this->widget_id}",
'description' => esc_html__( 'Add social icons to your sidebar', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-{$this->widget_id}"
);
$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Social Connect', $this->textdomain ), $widget_options, $control_options );
}
示例14: Widget_Class_Name_Widget
function Widget_Class_Name_Widget(){
/* Check if Hybrid-core framework is active */
if( class_exists( 'Hybrid' ) ){
/* Set the widget prefix */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_parent_textdomain();
} else {
$this->prefix = 'prefix';
$this->textdomain = 'prefix';
}
$this->widget_id = 'widget-id';
$widget_options = array(
'classname' => "{$this->prefix}-{$this->widget_id}",
'description' => esc_html__( 'Description of the widget', $this->textdomain )
);
$control_options = array(
'height' => '300',
'width' => '240',
'id_base' => "{$this->prefix}-{$this->widget_id}"
);
$this->WP_Widget( "{$this->prefix}-{$this->widget_id}", esc_attr__( 'Widget Name', $this->textdomain ), $widget_options, $control_options );
}
示例15: prototype_theme_setup
/**
* Theme setup function. This function adds support for theme features and defines the default theme
* actions and filters.
*
* @since 0.1.0
*/
function prototype_theme_setup()
{
/* Get action/filter hook prefix. */
$prefix = hybrid_get_prefix();
/* Add theme support for core framework features. */
add_theme_support('hybrid-core-menus', array('primary', 'secondary', 'subsidiary'));
add_theme_support('hybrid-core-sidebars', array('primary', 'secondary', 'header', 'subsidiary', 'after-singular'));
add_theme_support('hybrid-core-widgets');
add_theme_support('hybrid-core-shortcodes');
add_theme_support('hybrid-core-theme-settings', array('about', 'footer'));
add_theme_support('hybrid-core-drop-downs');
add_theme_support('hybrid-core-seo');
add_theme_support('hybrid-core-template-hierarchy');
/* Add theme support for framework extensions. */
add_theme_support('theme-layouts', array('1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c'));
add_theme_support('post-stylesheets');
add_theme_support('dev-stylesheet');
add_theme_support('loop-pagination');
add_theme_support('get-the-image');
add_theme_support('breadcrumb-trail');
add_theme_support('cleaner-gallery');
/* Add theme support for WordPress features. */
add_theme_support('automatic-feed-links');
add_custom_background();
/* Add the search form to the secondary menu. */
add_action("{$prefix}_close_menu_secondary", 'get_search_form');
/* Embed width/height defaults. */
add_filter('embed_defaults', 'prototype_embed_defaults');
/* Filter the sidebar widgets. */
add_filter('sidebars_widgets', 'prototype_disable_sidebars');
add_action('template_redirect', 'prototype_one_column');
/* Set the content width. */
hybrid_set_content_width(600);
}