', $after = '', $echo = true ) { if ( ! is_user_logged_in() ) { if ( get_option( 'users_can_register' ) ) { $link = $before . '' . __( 'Register' ) . '' . $after; } else { $link = ''; } } else { $link = ''; } /** * Filters the HTML link to the Registration or Admin page. * * Users are sent to the admin page if logged-in, or the registration page * if enabled and logged-out. * * @since 1.5.0 * * @param string $link The HTML code for the link to the Registration or Admin page. */ $link = apply_filters( 'register', $link ); if ( $echo ) { echo $link; } else { return $link; } } // Creating the widget class agg_widget_meta extends WP_Widget { function __construct() { parent::__construct( // Base ID of your widget 'agg_widget_meta', // Widget name will appear in UI __('Aggregator Logint', 'agg_widget_domain'), // Widget description array( 'description' => __( 'Register, Login, Logout', 'agg_widget_domain' ), ) ); } // Creating widget front-end public function widget( $args, $instance ) { $title = ! empty( $instance['title'] ) ? $instance['title'] : __( 'Aggregator Meta' ); /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); /** before and after widget arguments are defined by themes */ echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } ?>