• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP the_widget函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中the_widget函数的典型用法代码示例。如果您正苦于以下问题:PHP the_widget函数的具体用法?PHP the_widget怎么用?PHP the_widget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了the_widget函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: dt_print_widget_recent_photos

function dt_print_widget_recent_photos($atts)
{
    extract(shortcode_atts(array('ppp' => 6, 'title' => '', 'column' => 'half', 'orderby' => 'date', 'order' => 'DESC', 'only' => '', 'except' => ''), $atts));
    $title = strip_tags($title);
    $ppp = absint($ppp);
    $order = DT_latest_photo_Widget::dt_sanitize_enum($order, DT_latest_photo_Widget::$order_reference);
    $orderby = DT_latest_photo_Widget::dt_sanitize_enum($orderby, array_keys(DT_latest_photo_Widget::$orderby_reference));
    $args = array('before_widget' => '<div class="' . esc_attr($column) . '">', 'after_widget' => '</div>', 'before_title' => '<h2>', 'after_title' => '</h2>');
    $select = 'all';
    $cats = array();
    if ($except) {
        $select = 'except';
        $cats = array_map('trim', explode(',', $except));
    }
    if ($only) {
        $select = 'only';
        $cats = array_map('trim', explode(',', $only));
    }
    $params = array('title' => $title, 'show' => $ppp, 'order' => $order, 'orderby' => $orderby, 'select' => $select);
    if ($cats) {
        $params['cats'] = $cats;
    }
    ob_start();
    the_widget('DT_latest_photo_Widget', $params, $args);
    $output = ob_get_clean();
    return $output;
}
开发者ID:mnjit,项目名称:aa-global,代码行数:27,代码来源:functions.php


示例2: WidgetShortcode

 /**
  * Ausgabe eines Windgets
  *
  * Gibt per Shortcode ein Widget aus. Wenn das Widget parameter auswertet,
  * koennen diese uebergeben werden. Um z.B. das Kalender Widget mit "Hello, World!" als
  * Titel per Shortcode aufzurufen ist folgender Aufruf  noetig.
  * <code>
  * [widget name="Kalender" instance="title=Hello,World!"]
  * [widget classname="Calendar" instance="title=Hello,World!"]
  * </code>
  *
  * @param array $atts
  * @return string
  */
 public static function WidgetShortcode(array $atts)
 {
     global $wp_registered_widgets;
     $back = '';
     $widget_class = '';
     extract(shortcode_atts(array('name' => '', 'instance' => '', 'classname' => ''), $atts));
     $instance = html_entity_decode($instance);
     if ($name != '') {
         // Nun den Klassennamen des Widgets ermitteln, die Funktion the_widget erwartet den
         // Klassennamen des Widgets als Parameter.
         foreach ($wp_registered_widgets as $widget) {
             if ($widget['name'] == $name) {
                 $widget_class = get_class($widget['callback'][0]);
                 continue;
             }
         }
     } elseif ($classname != '') {
         foreach ($wp_registered_widgets as $widget) {
             if (get_class($widget['callback'][0]) == $classname) {
                 $widget_class = $classname;
                 continue;
             }
         }
     }
     if ($widget_class != '') {
         $back = "<div id='" . str_replace(" ", "_", $name) . "' class='widget_shortcode'>";
         ob_start();
         the_widget($widget_class, $instance);
         $back .= ob_get_contents();
         ob_end_clean();
         $back .= "</div>";
     }
     return $back;
 }
开发者ID:sydneyDAD,项目名称:cardguys.com,代码行数:48,代码来源:class-widget-or-sidebar-per-shortcode.php


示例3: postmatic_widget

 /**
  * Get Postmatic subscribe widget.
  *
  * @since 0.0.5
  *
  * @return string
  */
 public static function postmatic_widget()
 {
     $attributes = array('title' => __('Subscribe to Comments Via Email', 'epoch'), 'collect_name' => true, 'template_path' => null);
     ob_start();
     the_widget('Prompt_Subscribe_Widget', $attributes);
     return ob_get_clean();
 }
开发者ID:rpkoller,项目名称:epoch,代码行数:14,代码来源:layout.php


示例4: siteorigin_panels_legacy_widget_migration

/**
 * Go through all the old PB widgets and change them into far better visual editor widgets
 *
 * @param array $panels_data
 *
 * @return array
 */
function siteorigin_panels_legacy_widget_migration($panels_data)
{
    if (!empty($panels_data['widgets']) && is_array($panels_data['widgets'])) {
        foreach ($panels_data['widgets'] as &$widget) {
            switch ($widget['panels_info']['class']) {
                case 'SiteOrigin_Panels_Widgets_Gallery':
                    $shortcode = '[gallery ';
                    if (!empty($widget['ids'])) {
                        $shortcode .= 'ids="' . esc_attr($widget['ids']) . '" ';
                    }
                    $shortcode = trim($shortcode) . ']';
                    $widget = array('title' => '', 'filter' => '1', 'type' => 'visual', 'text' => $shortcode, 'panels_info' => $widget['panels_info']);
                    $widget['panels_info']['class'] = 'SiteOrigin_Widget_Editor_Widget';
                    break;
                case 'SiteOrigin_Panels_Widgets_Image':
                    if (class_exists('SiteOrigin_Panels_Widgets_Image')) {
                        ob_start();
                        the_widget('SiteOrigin_Panels_Widgets_Image', $widget, array('before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''));
                        $widget = array('title' => '', 'filter' => '1', 'type' => 'visual', 'text' => ob_get_clean(), 'panels_info' => $widget['panels_info']);
                        $widget['panels_info']['class'] = 'SiteOrigin_Widget_Editor_Widget';
                    }
                    break;
            }
        }
    }
    return $panels_data;
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:34,代码来源:migration.php


示例5: displayWidget

 public static function displayWidget($instance = [], array $params = [])
 {
     if (is_string($instance)) {
         $instance = json_decode($instance, true);
     }
     if (!isset($instance['type']) || $instance['type'] !== 'widget' || !isset($instance['widget']) || !isset($instance['options'])) {
         return null;
     }
     $options = $instance['options'];
     $widgetClass = static::getWidgetClass($instance['widget']);
     if (!$widgetClass) {
         return '';
     }
     $id = static::displayWidgetId(true);
     $args = static::getWidgetChrome($widgetClass, $params['chrome']);
     ob_start();
     \the_widget($widgetClass, $options['widget'], $args);
     $html = ob_get_clean();
     if (trim($html)) {
         /** @var Theme $theme */
         $theme = static::gantry()['theme'];
         $theme->wordpress(true);
     }
     return $html;
 }
开发者ID:nmsde,项目名称:gantry5,代码行数:25,代码来源:Widgets.php


示例6: storefront_header_cart

    function storefront_header_cart()
    {
        if (is_woocommerce_activated()) {
            if (is_cart()) {
                $class = 'current-menu-item';
            } else {
                $class = '';
            }
            ?>
            <ul class="site-header-cart menu">
                <li class="<?php 
            echo esc_attr($class);
            ?>
">
                    <?php 
            storefront_cart_link();
            ?>
                </li>
                <li>
                    <?php 
            the_widget('WC_Widget_Cart', 'title=');
            ?>
                </li>
            </ul>
            <?php 
        }
    }
开发者ID:alexgomes09,项目名称:topshop,代码行数:27,代码来源:template-tags.php


示例7: storefront_header_cart

    function storefront_header_cart()
    {
        if (is_woocommerce_activated()) {
            if (is_cart()) {
                $class = 'current-menu-item';
            } else {
                $class = '';
            }
            ?>
		<ul class="site-header-cart menu">
			<li class="<?php 
            echo esc_attr($class);
            ?>
">
				<?php 
            storefront_cart_link();
            ?>
			</li>
			<li>
				<?php 
            the_widget('WC_Widget_Cart', 'title=');
            ?>
			</li>
		</ul>
		<div class="social-icons">
			<a href="http://instagram.com/homeboyadvance" class="icon-instagram" target="_blank"></a>
			<a href="http://facebook.com/homeboyadvance" class="icon-facebook" target="_blank"></a>
			<a href="http://twitter.com/homeboyadvance" class="icon-twitter" target="_blank"></a>
		</div>
		<?php 
        }
    }
开发者ID:kn0wbody,项目名称:homeboyadvance_storefront,代码行数:32,代码来源:template-tags.php


示例8: sandwich_jetpack_subscriptions_widget_shortcode

function sandwich_jetpack_subscriptions_widget_shortcode($attr, $content)
{
    if (!class_exists('Jetpack_Subscriptions_Widget')) {
        return '';
    }
    $attr = wp_parse_args($attr, array('title' => __('Display WordPress Posts', 'jetpack'), 'subscribe_text' => __('Enter your email address to subscribe to this blog and receive notifications of new posts by email.', 'jetpack'), 'subscribe_logged_in' => __('Click to subscribe to this blog and receive notifications of new posts by email.', 'jetpack'), 'subscribe_placeholder' => __('Email Address', 'jetpack'), 'subscribe_button' => __('Subscribe', 'jetpack'), 'show_subscribers_total' => false, 'hide_title' => false));
    $attr['show_subscribers_total'] = $attr['show_subscribers_total'] === 'true' || $attr['show_subscribers_total'] === true ? true : false;
    $hideTitleClass = '';
    if ($attr['hide_title']) {
        $hideTitleClass = 'hide_title';
    }
    ob_start();
    ?>
	<div class="sandwich <?php 
    echo $hideTitleClass;
    ?>
">
		<?php 
    the_widget('Jetpack_Subscriptions_Widget', $attr);
    ?>
	</div>
	
	<?php 
    return ob_get_clean();
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:25,代码来源:widget-jetpack-subscriptions.php


示例9: _hw_awc_feature_widget_content_shortcode

/**
 * @shortcode hw_widget_content shortcode to display any widget content
 * @param $prop
 * @param $content
 */
function _hw_awc_feature_widget_content_shortcode($prop, $content)
{
    $args = array('widget' => '', 'sidebar' => '', 'params_config' => '', 'skin' => 'skin_default');
    $d = shortcode_atts($args, $prop);
    extract($d);
    //valid
    if (empty($widget)) {
        return;
    }
    global $wp_registered_sidebars;
    global $wp_registered_widgets;
    //default sidebar params
    $sidebar_params = array('before_title' => '', 'after_title' => '', 'before_widget' => '', 'after_widget' => '');
    if (!empty($sidebar) && !empty($skin) && isset($wp_registered_sidebars[$sidebar])) {
        $sidebar_params = HW_AWC::apply_sidebar_skin($sidebar, $skin, array('widget_id' => 'hw-shortcode-widget', 'classname' => strtolower($widget) . ' hw-awc-override'));
    }
    //get widget instance by saved widget config
    if (!empty($params_config) && is_numeric($params_config)) {
        $config = AWC_WidgetFeature_saveconfig::get_widget_setting($params_config);
        if ($config) {
            $widget_params = AWC_WidgetFeature_saveconfig::decode_config($config->setting);
        }
    }
    if (isset($widget) && class_exists($widget, false) && !empty($widget_params)) {
        //display widget content
        the_widget($widget, $widget_params, $sidebar_params);
    }
}
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:33,代码来源:shortcode.php


示例10: ufandshands_widget_shortcode

function ufandshands_widget_shortcode($atts)
{
    global $wp_widget_factory;
    extract(shortcode_atts(array('widget_name' => FALSE, 'title' => '', 'numberofposts' => '3', 'showexcerpt' => 1, 'showthumbnails' => 1, 'showdate' => 1, 'showrssicon' => 1, 'specific_category_id' => ''), $atts));
    $widget_name = wp_specialchars($widget_name);
    if (!is_a($wp_widget_factory->widgets[$widget_name], 'WP_Widget')) {
        $wp_class = 'WP_Widget_' . ucwords(strtolower($class));
        if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')) {
            return '<p>' . sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct"), '<strong>' . $class . '</strong>') . '</p>';
        } else {
            $class = $wp_class;
        }
    }
    $instance = '&title=' . $title;
    $instance .= '&numberofposts=' . $numberofposts;
    $instance .= '&showexcerpt=' . $showexcerpt;
    $instance .= '&showthumbnails=' . $showthumbnails;
    $instance .= '&showdate=' . $showdate;
    $instance .= '&showrssicon=' . $showrssicon;
    $instance .= '&specific_category_id=' . $specific_category_id;
    // $instance .= '&='.$;
    ob_start();
    the_widget($widget_name, $instance, array('widget_id' => 'arbitrary-instance-' . $id, 'before_widget' => '<div class="widget_body">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:sezj,项目名称:ufl-template-responsive,代码行数:27,代码来源:shortcodes.php


示例11: do_widget

/**
 * Displays a widget
 *
 * @param mixed args
 * @since 0.2
 * @return string widget output
 */
function do_widget($args)
{
    global $_wp_sidebars_widgets, $wp_registered_widgets, $wp_registered_sidebars;
    extract(shortcode_atts(array('id' => '', 'title' => true, 'before_widget' => '', 'before_title' => '', 'after_title' => '', 'after_widget' => ''), $args));
    if (empty($id) || !isset($wp_registered_widgets[$id])) {
        return;
    }
    // get the widget instance options
    preg_match('/(\\d+)/', $id, $number);
    $options = get_option($wp_registered_widgets[$id]['callback'][0]->option_name);
    $instance = $options[$number[0]];
    $class = get_class($wp_registered_widgets[$id]['callback'][0]);
    // maybe the widget is removed or deregistered
    if (!$instance || !$class) {
        return;
    }
    // set this title to something arbitrary so we can remove it later on
    if ($title == false) {
        $args['before_title'] = '<div class="wsh-title">';
        $args['after_title'] = '</div>';
    }
    ob_start();
    the_widget($class, $instance, $args);
    $content = ob_get_clean();
    if ($title == false) {
        $content = preg_replace('/<div class="wsh-title">(.*?)<\\/div>/', '', $content);
    }
    if ($echo !== true) {
        return $content;
    }
    echo $content;
}
开发者ID:roycocup,项目名称:enclothed,代码行数:39,代码来源:init.php


示例12: my_shortcode_widget

/** widget
  * Objective:
  *		1.Used to add widgets in content area.
**/
function my_shortcode_widget($attrs)
{
    global $wp_widget_factory;
    extract(shortcode_atts(array('widget_name' => FALSE, 'widget_class_name' => FALSE), $attrs));
    foreach ($attrs as $key => $value) {
        switch ($key) {
            case 'exclude_replies':
            case 'time':
            case 'display_avatar':
                $instance[$key] = $value == "yes" ? $value : NULL;
                break;
            default:
                $instance[$key] = $value;
                break;
        }
    }
    $instance = array_filter($instance);
    $widget_name = esc_html($widget_name);
    if (!is_a($wp_widget_factory->widgets[$widget_name], 'WP_Widget')) {
        $wp_class = 'WP_Widget_' . ucwords(strtolower($class));
        if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')) {
            return '<p>' . sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct", 'dt_delicate'), '<strong>' . $class . '</strong>') . '</p>';
        } else {
            $class = $wp_class;
        }
    }
    ob_start();
    the_widget($widget_name, $instance, array('before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''));
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:jgabrielfreitas,项目名称:MultipagosTestesAPP,代码行数:36,代码来源:widgets.php


示例13: most_shared_posts_shortcode_widget_placer

function most_shared_posts_shortcode_widget_placer($atts)
{
    extract(shortcode_atts(array('title' => 'Most Shared Posts', 'num_posts' => '5', 'max_month_age' => '24'), $atts));
    $widget_instance = array('title' => $title, 'recency_limit_unit' => 'months', 'recency_limit_number' => $max_month_age, 'number_of_posts_to_list' => $num_posts);
    $args = array();
    the_widget('Most_Shared_Posts', $widget_instance, $args);
}
开发者ID:ahsaeldin,项目名称:projects,代码行数:7,代码来源:msp-front.php


示例14: sandwich_tag_cloud_widget_shortcode

function sandwich_tag_cloud_widget_shortcode($attr, $content)
{
    $default = '';
    foreach (get_taxonomies() as $taxonomy) {
        $tax = get_taxonomy($taxonomy);
        if (!$tax->show_tagcloud || empty($tax->labels->name)) {
            continue;
        }
        $default = esc_attr($taxonomy);
        break;
    }
    $attr = wp_parse_args($attr, array('title' => __('Tag Cloud', 'pbsandwich'), 'taxonomy' => $default, 'hide_title' => false));
    $hideTitleClass = '';
    if ($attr['hide_title']) {
        $hideTitleClass = 'hide_title';
    }
    ob_start();
    ?>
	<div class="sandwich <?php 
    echo $hideTitleClass;
    ?>
">
		<?php 
    the_widget('WP_Widget_Tag_Cloud', $attr);
    ?>
	</div>
	
	<?php 
    return ob_get_clean();
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:30,代码来源:widget-tag-cloud.php


示例15: sandwich_jetpack_gravatar_profile_widget_shortcode

function sandwich_jetpack_gravatar_profile_widget_shortcode($attr, $content)
{
    if (!class_exists('Jetpack_Gravatar_Profile_Widget')) {
        return '';
    }
    $attr = wp_parse_args($attr, array('title' => __('Gravatar Profile', 'jetpack'), 'email_user' => '-1', 'email' => 5, 'show_personal_links' => false, 'show_account_links' => false, 'hide_title' => false));
    // In the Jetpack widget, if email_user is -1, the email inputted is used. If the email_user is a user_id, then the email of that user
    // is used. We do that directly from here
    if ($attr['email_user'] != -1) {
        $attr['email'] = $attr['email_user'];
    }
    $attr['show_personal_links'] = $attr['show_personal_links'] === 'true' || $attr['show_personal_links'] === true ? true : false;
    $attr['show_account_links'] = $attr['show_account_links'] === 'true' || $attr['show_account_links'] === true ? true : false;
    $hideTitleClass = '';
    if ($attr['hide_title']) {
        $hideTitleClass = 'hide_title';
    }
    ob_start();
    ?>
	<div class="sandwich <?php 
    echo $hideTitleClass;
    ?>
">
		<?php 
    the_widget('Jetpack_Gravatar_Profile_Widget', $attr);
    ?>
	</div>
	
	<?php 
    return ob_get_clean();
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:31,代码来源:widget-jetpack-gravatar-profile.php


示例16: apanel_gateways_html

 public function apanel_gateways_html($atts, $content)
 {
     //        global $wp_widget_factory;
     //
     //        extract(shortcode_atts(array(
     //            'widget_name' => FALSE
     //        ), $atts));
     //
     //        $widget_name = wp_specialchars($widget_name);
     //
     //        if (!is_a($wp_widget_factory->widgets[$widget_name], 'WP_Widget')):
     //            $wp_class = 'WP_Widget_'.ucwords(strtolower($class));
     //
     //            if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')):
     //                return '<p>'.sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct"),'<strong>'.$class.'</strong>').'</p>';
     //            else:
     //                $class = $wp_class;
     //            endif;
     //        endif;
     $widget_name = wp_specialchars('Skc_Apanel_Gateways_Widget');
     ob_start();
     the_widget($widget_name, $instance, array('widget_id' => 'arbitrary-instance-' . $id, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => ''));
     $output = ob_get_contents();
     ob_end_clean();
     return $output;
 }
开发者ID:Krakt,项目名称:skc-plugin,代码行数:26,代码来源:apanelgateways.php


示例17: sandwich_jetpack_display_wordpress_posts_widget_shortcode

function sandwich_jetpack_display_wordpress_posts_widget_shortcode($attr, $content)
{
    if (!class_exists('Jetpack_Display_Posts_Widget')) {
        return '';
    }
    $attr = wp_parse_args($attr, array('title' => __('Display WordPress Posts', 'jetpack'), 'url' => '', 'number_of_posts' => 5, 'featured_image' => false, 'show_excerpts' => false, 'hide_title' => false));
    $attr['featured_image'] = $attr['featured_image'] === 'true' || $attr['featured_image'] === true ? true : false;
    $attr['show_excerpts'] = $attr['show_excerpts'] === 'true' || $attr['show_excerpts'] === true ? true : false;
    $hideTitleClass = '';
    if ($attr['hide_title']) {
        $hideTitleClass = 'hide_title';
    }
    ob_start();
    ?>
	<div class="sandwich <?php 
    echo $hideTitleClass;
    ?>
">
		<?php 
    the_widget('Jetpack_Display_Posts_Widget', $attr);
    ?>
	</div>
	
	<?php 
    return ob_get_clean();
}
开发者ID:bruno-barros,项目名称:w.eloquent.light,代码行数:26,代码来源:widget-jetpack-display-wordpress-posts.php


示例18: mystique_widget

function mystique_widget($atts)
{
    global $wp_widget_factory;
    extract(shortcode_atts(array('class' => FALSE), $atts));
    ob_start();
    $class = wp_specialchars($class);
    if (!is_a($wp_widget_factory->widgets[$class], 'WP_Widget')) {
        $wp_class = 'WP_Widget_' . ucwords(strtolower($class));
        if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')) {
            return '<p class="error">' . sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct", "mystique"), '<strong>' . $class . '</strong>') . '</p>';
        } else {
            $class = $wp_class;
        }
    }
    $instance = array();
    // other attributes
    foreach ($atts as $att => $val) {
        if ($att != "class") {
            $instance[wp_specialchars($att)] = wp_specialchars($val);
        }
    }
    $id = $class;
    $classname = $wp_widget_factory->widgets[$class]->widget_options['classname'];
    if (!$classname) {
        $classname = $id;
    }
    if (isset($instance['widget_id'])) {
        $id = $instance['widget_id'];
    }
    the_widget($class, $instance, array('widget_id' => 'arbitrary-instance-' . $id, 'before_widget' => '<div class="arbitrary-block block-' . $classname . '">', 'after_widget' => '</div>', 'before_title' => '<h2 class="title">', 'after_title' => '</h2>'));
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:howardlei82,项目名称:IGSM-Website,代码行数:34,代码来源:shortcodes.php


示例19: shortcode

 public function shortcode($atts, $content = null)
 {
     extract(shortcode_atts(array('message_height' => '6', 'fields' => 'name,email,telephone,message', 'required' => 'name,email,message', 'button_size' => 'medium', 'button_title' => 'Send message'), $atts));
     if (!class_exists('Presscore_Inc_Widgets_ContactForm')) {
         return '';
     }
     $message_height = absint($message_height);
     $button_size = in_array($button_size, array('small', 'medium', 'big')) ? $button_size : 'medium';
     switch ($button_size) {
         case 'small':
             $clean_button_size = 's';
             break;
         case 'big':
             $clean_button_size = 'l';
             break;
         default:
             $clean_button_size = 'm';
     }
     $button_title = $button_title ? esc_html($button_title) : 'Send message';
     $required = array_map('trim', explode(',', $required));
     $fields = array_map('trim', explode(',', $fields));
     $clear_fields = array();
     foreach ($fields as $field) {
         if (!isset(Presscore_Inc_Widgets_ContactForm::$fields_list[$field])) {
             continue;
         }
         $clear_fields[$field] = array('on' => true, 'required' => in_array($field, $required));
     }
     $widget_args = array('before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '');
     $widget_params = array('title' => '', 'fields' => $clear_fields, 'text' => '', 'msg_height' => $message_height, 'button_size' => $clean_button_size, 'button_title' => $button_title);
     ob_start();
     the_widget('Presscore_Inc_Widgets_ContactForm', $widget_params, $widget_args);
     $output = ob_get_clean();
     return $output;
 }
开发者ID:noman90rauf,项目名称:wp-content,代码行数:35,代码来源:contact-form.php


示例20: jj_ngg_jquery_carousel_shortcode_handler

function jj_ngg_jquery_carousel_shortcode_handler($atts)
{
    $instance = array();
    foreach ($atts as $att => $val) {
        $instance[wp_specialchars($att)] = wp_specialchars($val);
    }
    // Set defaults
    if (WPJJNGGJ_CAROUSEL_use_default($instance, 'html_id')) {
        $instance['html_id'] = 'jcarousel';
    }
    if (WPJJNGGJ_CAROUSEL_use_default($instance, 'order')) {
        $instance['order'] = 'random';
    }
    if (WPJJNGGJ_CAROUSEL_use_default($instance, 'scroll')) {
        $instance['scroll'] = '1';
    }
    if (WPJJNGGJ_CAROUSEL_use_default($instance, 'visible')) {
        $instance['visible'] = '1';
    }
    if (WPJJNGGJ_CAROUSEL_use_default($instance, 'wrap')) {
        $instance['wrap'] = 'circular';
    }
    $instance['shortcode'] = '1';
    ob_start();
    the_widget("JJ_NGG_JQuery_Carousel", $instance, array());
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
开发者ID:blocher,项目名称:oneholyname,代码行数:29,代码来源:functions.php



注:本文中的the_widget函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP thematic_abovepost函数代码示例发布时间:2022-05-23
下一篇:
PHP the_views函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap