本文整理汇总了PHP中bp_message_get_notices函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_message_get_notices函数的具体用法?PHP bp_message_get_notices怎么用?PHP bp_message_get_notices使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_message_get_notices函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* Render the widget.
*
* @see WP_Widget::widget() for a description of parameters.
*
* @param array $args See {@WP_Widget::widget()}.
* @param array $args See {@WP_Widget::widget()}.
*/
public function widget($args, $instance)
{
if (!is_user_logged_in()) {
return;
}
// Don't display the widget if there are no Notices to show
$notices = BP_Messages_Notice::get_active();
if (empty($notices)) {
return;
}
extract($args);
$title = !empty($instance['title']) ? $instance['title'] : '';
$title = apply_filters('widget_title', $title, $instance);
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<div class="bp-site-wide-message">
<?php
bp_message_get_notices();
?>
</div>
<?php
echo $after_widget;
}
示例2: widget
/**
* Render the widget.
*
* @see WP_Widget::widget() for a description of parameters.
*
* @param array $args See {@WP_Widget::widget()}.
* @param array $instance See {@WP_Widget::widget()}.
*/
public function widget($args, $instance)
{
if (!is_user_logged_in()) {
return;
}
// Don't display the widget if there are no Notices to show
$notices = BP_Messages_Notice::get_active();
if (empty($notices)) {
return;
}
extract($args);
$title = !empty($instance['title']) ? $instance['title'] : '';
/**
* Filters the title of the Messages widget.
*
* @since 1.9.0
* @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
*
* @param string $title The widget title.
* @param array $instance The settings for the particular instance of the widget.
* @param string $id_base Root ID for all widgets of this type.
*/
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<div class="bp-site-wide-message">
<?php
bp_message_get_notices();
?>
</div>
<?php
echo $after_widget;
}
示例3: shortcode_bp_notices
function shortcode_bp_notices($atts, $content = null)
{
if (bp_plugin_is_active()) {
if (function_exists('bp_message_get_notices') && is_user_logged_in()) {
// turn on output buffering to capture output
ob_start();
// output the notice (stupid BP echo's and no option for return)
bp_message_get_notices();
/* Site wide notices to all users */
// get ouwtput content
$content = ob_get_clean();
// return the content
return '<div class="bp-notices">' . $content . '</div>';
}
}
}
示例4: do_action
</a>
<?php
do_action('bp_sidebar_me');
?>
<?php
do_action('bp_after_sidebar_me');
?>
<?php
if (function_exists('bp_message_get_notices')) {
?>
<?php
bp_message_get_notices();
/* Site wide notices to all users */
?>
<?php
}
?>
<?php
} else {
?>
<?php
do_action('bp_before_sidebar_login_form');
?>
<p id="login-text">
示例5: cc_login_widget
/**
* buddypress login widget
*
* @package Custom Community
* @since 1.8.3
*/
function cc_login_widget()
{
?>
<?php
global $cap;
?>
<?php
do_action('bp_inside_before_sidebar');
?>
<?php
if (is_user_logged_in()) {
?>
<?php
do_action('bp_before_sidebar_me');
?>
<div class="widget">
<div id="sidebar-me">
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('type=thumb&width=40&height=40');
?>
</a>
<h4><?php
echo bp_core_get_userlink(bp_loggedin_user_id());
?>
</h4>
<a class="button logout" href="<?php
echo wp_logout_url(bp_get_root_domain());
?>
"><?php
_e('Log Out', 'cc');
?>
</a>
<?php
do_action('bp_sidebar_me');
?>
</div>
</div>
<?php
do_action('bp_after_sidebar_me');
?>
<?php
if (function_exists('bp_message_get_notices')) {
?>
<?php
bp_message_get_notices();
/* Site wide notices to all users */
?>
<?php
}
?>
<?php
} else {
?>
<?php
do_action('bp_before_sidebar_login_form');
?>
<div class="widget">
<p id="login-text">
<?php
if (!$cap->bp_login_sidebar_text) {
?>
<?php
_e('To start connecting please log in first.', 'cc');
?>
<?php
} else {
?>
<?php
echo $cap->bp_login_sidebar_text;
?>
<?php
}
?>
<?php
if (bp_get_signup_allowed()) {
?>
<?php
printf(__(' You can also <a href="%s" title="Create an account">create an account</a>.', 'cc'), site_url(BP_REGISTER_SLUG . '/'));
?>
<?php
}
?>
</p>
//.........这里部分代码省略.........
示例6: sitewide_notices
/**
* Outputs sitewide notices markup in the footer.
*
* @since BuddyPress (1.7)
*
* @see https://buddypress.trac.wordpress.org/ticket/4802
*/
public function sitewide_notices()
{
// Do not show notices if user is not logged in
if (!is_user_logged_in()) {
return;
}
// add a class to determine if the admin bar is on or not
$class = did_action('admin_bar_menu') ? 'admin-bar-on' : 'admin-bar-off';
echo '<div id="sitewide-notice" class="' . $class . '">';
bp_message_get_notices();
echo '</div>';
}
示例7: widget
function widget($args, $instance)
{
if (!parent::widget($args, $instance)) {
return;
}
extract($args);
echo $before_widget;
$title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : false);
if ($title) {
echo $before_title, $title, $after_title;
}
?>
<?php
if (is_user_logged_in()) {
?>
<?php
do_action('bp_before_sidebar_me');
?>
<div id="sidebar-me" class="widget clearfix">
<h3 class="widget-title">Welcome <?php
echo bp_core_get_userlink(bp_loggedin_user_id());
?>
</h3>
<a href="<?php
echo bp_loggedin_user_domain();
?>
">
<?php
bp_loggedin_user_avatar('type=thumb&width=40&height=40');
?>
</a>
<a class="button logout" href="<?php
echo wp_logout_url(wp_guess_url());
?>
"><?php
_e('Log Out', 'buddypress');
?>
</a>
<?php
do_action('bp_sidebar_me');
?>
</div>
<?php
do_action('bp_after_sidebar_me');
?>
<?php
if (bp_is_active('messages')) {
?>
<?php
bp_message_get_notices();
/* Site wide notices to all users */
?>
<?php
}
?>
<?php
} else {
?>
<?php
do_action('bp_before_sidebar_login_form');
?>
<?php
if (bp_get_signup_allowed()) {
?>
<p id="login-text">
<?php
printf(__('<a href="%s" title="Create account" class="btn btn-primary btn-large">Create account to join community</a>', 'buddypress'), bp_get_signup_page());
?>
</p>
<?php
}
?>
<form name="login-form" id="sidebar-login-form" class="standard-form widget" action="<?php
echo site_url('wp-login.php', 'login_post');
?>
" method="post">
<h3 class="widget-title"><?php
_e('Login', 'bre-bootstrap-ecommerce');
?>
</h3>
<label><?php
_e('Username', 'buddypress');
?>
<br />
<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php
//.........这里部分代码省略.........
示例8: message_notices
/**
* Add wrapper around message notices
*/
public function message_notices()
{
// render notification box
?>
<div class="top-notification-box">
<?php
if (is_user_logged_in() && bp_is_active('messages')) {
bp_message_get_notices();
}
?>
</div><?php
}
示例9: bp_loggedin_user_domain
<div id="sidebar-me">
<a href="<?php echo bp_loggedin_user_domain() ?>">
<?php bp_loggedin_user_avatar( 'type=thumb&width=40&height=40' ) ?>
</a>
<h4><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></h4>
<a class="button logout" href="<?php echo wp_logout_url( bp_get_root_domain() ) ?>"><?php _e( 'Log Out', 'buddypress' ) ?></a>
<?php do_action( 'bp_sidebar_me' ) ?>
</div>
<?php do_action( 'bp_after_sidebar_me' ) ?>
<?php if ( function_exists( 'bp_message_get_notices' ) ) : ?>
<?php bp_message_get_notices(); /* Site wide notices to all users */ ?>
<?php endif; ?>
<?php else : ?>
<?php do_action( 'bp_before_sidebar_login_form' ) ?>
<p id="login-text">
<?php _e( 'To start connecting please log in first.', 'buddypress' ) ?>
<?php if ( bp_get_signup_allowed() ) : ?>
<?php printf( __( ' You can also <a href="%s" title="Create an account">create an account</a>.', 'buddypress' ), site_url( BP_REGISTER_SLUG . '/' ) ) ?>
<?php endif; ?>
</p>
<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
<label><?php _e( 'Username', 'buddypress' ) ?><br />