'widget_bp_core_sitewide_messages buddypress widget', 'description' => __( 'Display Sitewide Notices posted by the site administrator', 'buddypress' ), 'customize_selective_refresh' => true, 'show_instance_in_rest' => true, ) ); } /** * 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; ?>
Widgets. * * @see WP_Widget::form() for a description of parameters. * * @param array $instance See {@WP_Widget::form()}. */ public function form( $instance ) { $instance = bp_parse_args( (array) $instance, array( 'title' => '', ) ); $title = strip_tags( $instance['title'] ); ?>