__( 'Front End PM Menu Widget', 'front-end-pm' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } echo '
'; echo $args['after_widget']; } /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { $title = isset( $instance['title'] ) ? $instance['title'] : __( 'FEP Menu Widget', 'front-end-pm' ); ?>__( 'Front End PM Text Widget', 'front-end-pm' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { global $user_ID; echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title']; } $show_messagebox = isset( $instance['show_messagebox'] ) ? $instance['show_messagebox'] : false; $show_announcement = isset( $instance['show_announcement'] ) ? $instance['show_announcement'] : false; if ( $show_messagebox || $show_announcement ) { echo __( 'Welcome', 'front-end-pm' ) . ' ' . fep_user_name( $user_ID ). '
id="get_field_id( 'show_messagebox' ); ?>" name="get_field_name( 'show_messagebox' ); ?>" value="1"/>
id="get_field_id( 'show_announcement' ); ?>" name="get_field_name( 'show_announcement' ); ?>" value="1"/>
__( 'Front End PM Empty Widget', 'front-end-pm' ), ) // Args ); } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { echo $args['before_widget']; if ( ! empty( $instance['title'] ) ) { echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title']; } $show_help = isset( $instance['show_help'] ) ? $instance['show_help'] : false; if ( $show_help ) { _e( 'Useadd_action( \'fep_empty_widget_' . $this->number . '\', \'your_function\' ); to hook to ONLY this widget where \'your_function\' is your callback function.', 'front-end-pm' );
_e( 'add_action(\'fep_empty_widget\', \'your_function\' ); to hook to all FEP Empty widget where \'your_function\' is your callback function', 'front-end-pm' );
}
do_action( 'fep_empty_widget_' . $this->number );
do_action( 'fep_empty_widget' );
echo $args['after_widget'];
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*/
public function form( $instance ) {
$title = isset( $instance['title'] ) ? $instance['title'] : __( 'FEP Empty Widget', 'front-end-pm' );
$show_help = isset( $instance['show_help'] ) ? $instance['show_help'] : false;
?>
id="get_field_id( 'show_help' ); ?>" name="get_field_name( 'show_help' ); ?>" value="1"/>