本文整理汇总了PHP中wp_widget_description函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_widget_description函数的具体用法?PHP wp_widget_description怎么用?PHP wp_widget_description使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_widget_description函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_list_widgets
//.........这里部分代码省略.........
}
$widget_control_template = $sidebar_args['before_widget'] . $widget_control_template . $sidebar_args['after_widget'];
$no_widgets_shown = false;
if ('all' != $show && $sidebar_args['_widget_title']) {
$widget_title = $sidebar_args['_widget_title'];
} else {
$widget_title = $widget['name'];
}
?>
<li id="widget-list-item-<?php
echo attribute_escape($widget['id']);
?>
" class="widget-list-item">
<h4 class="widget-title widget-draggable">
<span><?php
echo $widget_title;
?>
</span>
<?php
if ('add' == $action) {
?>
<a class="widget-action widget-control-add" href="<?php
echo $add_url;
?>
"><?php
_e('Add');
?>
</a>
<?php
} elseif ('edit' == $action) {
// We echo a hidden edit link for the sake of the JS. Edit links are shown (needlessly?) after a widget is added.
?>
<a class="widget-action widget-control-edit" href="<?php
echo $edit_url;
?>
" style="display: none;"><?php
_e('Edit');
?>
</a>
<?php
}
?>
<br class="clear" />
</h4>
<ul id="widget-control-info-<?php
echo $widget['id'];
?>
" class="widget-control-info">
<?php
echo $widget_control_template;
?>
</ul>
<?php
if ('add' == $action) {
?>
<?php
}
?>
<div class="widget-description">
<?php
echo ($widget_description = wp_widget_description($widget_id)) ? $widget_description : ' ';
?>
</div>
<br class="clear" />
</li>
<?php
}
if ($no_widgets_shown) {
?>
<li><?php
_e('No matching widgets');
?>
</li>
<?php
}
?>
</ul>
<?php
}
示例2: dw_display_widgets
function dw_display_widgets($s, $number)
{
$instance = !empty($s['widget-' . $s['id_base']]) ? array_shift($s['widget-' . $s['id_base']]) : array();
$widget = $this->dw_get_widgets($s['id_base'], $number);
?>
<?php
if ($widget) {
?>
<div id="<?php
echo esc_attr($s['widget-id']);
?>
" class="widget">
<div class="widget-top">
<div class="widget-title-action">
<a class="widget-action hide-if-no-js" href="#available-widgets"></a>
<a class="widget-control-edit hide-if-js" href="<?php
echo esc_url(add_query_arg($query_arg));
?>
">
<span class="edit"><?php
_ex('Edit', 'widget');
?>
</span>
<span class="add"><?php
_ex('Add', 'widget');
?>
</span>
<span class="screen-reader-text"><?php
echo $widget->name;
?>
</span>
</a>
</div>
<div class="widget-title"><h4><?php
echo $widget->name;
?>
<span class="in-widget-title"></span></h4></div>
</div>
<div class="widget-inside">
<div class="widget-content">
<?php
if (isset($s['id_base'])) {
$widget->form($instance);
} else {
echo "\t\t<p>" . __('There are no options for this widget.', 'dw_minion') . "</p>\n";
}
?>
</div>
<input data-dw="true" type="hidden" name="widget-id" class="widget-id" value="<?php
echo esc_attr($s['widget-id']);
?>
" />
<input data-dw="true" type="hidden" name="id_base" class="id_base" value="<?php
echo esc_attr($s['id_base']);
?>
" />
<input data-dw="true" type="hidden" name="widget-width" class="widget-width" value="<?php
echo esc_attr($s['widget-width']);
?>
">
<div class="widget-control-actions">
<div class="alignleft">
<a class="widget-control-remove" href="#remove"><?php
_e('Delete', 'dw_minion');
?>
</a> |
<a class="widget-control-close" href="#close"><?php
_e('Close', 'dw_minion');
?>
</a>
</div>
<div class="alignright widget-control-noform">
<?php
submit_button(__('Save', 'dw_minion'), 'button-primary widget-control-save right', 'savewidget', false, array('id' => 'widget-' . esc_attr($s['widget-id']) . '-savewidget'));
?>
<span class="spinner"></span>
</div>
<br class="clear" />
</div>
</div>
<div class="widget-description"><?php
echo ($widget_description = wp_widget_description($widget_id)) ? "{$widget_description}\n" : "{$widget_title}\n";
?>
</div>
</div>
<?php
}
?>
<?php
}
示例3: wp_widget_control
//.........这里部分代码省略.........
echo $sidebar_args['before_widget'];
?>
<div class="widget-top">
<div class="widget-title-action">
<a class="widget-action hide-if-no-js" href="#available-widgets"></a>
<a class="widget-control-edit hide-if-js" href="<?php
echo esc_url(add_query_arg($query_arg));
?>
"><span class="edit"><?php
_e('Edit');
?>
</span><span class="add"><?php
_e('Add');
?>
</span></a>
</div>
<div class="widget-title"><h4><?php
echo $widget_title;
?>
<span class="in-widget-title"></span></h4></div>
</div>
<div class="widget-inside">
<form action="" method="post">
<div class="widget-content">
<?php
if (isset($control['callback'])) {
$has_form = call_user_func_array($control['callback'], $control['params']);
} else {
echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n";
}
?>
</div>
<input type="hidden" name="widget-id" class="widget-id" value="<?php
echo esc_attr($id_format);
?>
" />
<input type="hidden" name="id_base" class="id_base" value="<?php
echo esc_attr($id_base);
?>
" />
<input type="hidden" name="widget-width" class="widget-width" value="<?php
echo esc_attr($control['width']);
?>
" />
<input type="hidden" name="widget-height" class="widget-height" value="<?php
echo esc_attr($control['height']);
?>
" />
<input type="hidden" name="widget_number" class="widget_number" value="<?php
echo esc_attr($widget_number);
?>
" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php
echo esc_attr($multi_number);
?>
" />
<input type="hidden" name="add_new" class="add_new" value="<?php
echo esc_attr($add_new);
?>
" />
<div class="widget-control-actions">
<div class="alignleft">
<a class="widget-control-remove" href="#remove"><?php
_e('Remove');
?>
</a> |
<a class="widget-control-close" href="#close"><?php
_e('Close');
?>
</a>
</div>
<?php
if ('noform' !== $has_form) {
?>
<div class="alignright">
<img src="images/wpspin_light.gif" class="ajax-feedback " title="" alt="" />
<input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php
esc_attr_e('Save');
?>
" />
</div>
<?php
}
?>
<br class="clear" />
</div>
</form>
</div>
<div class="widget-description">
<?php
echo ($widget_description = wp_widget_description($widget_id)) ? "{$widget_description}\n" : "{$widget_title}\n";
?>
</div>
<?php
echo $sidebar_args['after_widget'];
return $sidebar_args;
}