Function Reference: geodir_loginwidget_output
Summary
Generates login box HTML.
Global Values
- $current_user
- (object) (required) Current user object.
- Default: None
Package
GeoDirectory
Parameters
- $args
- (array|string) (required) Display arguments including before_title, after_title, before_widget, and after_widget.
- Default: None
- $instance
- (array|string) (required) The settings for the particular instance of the widget.
- Default: None
Change Log
Since: 1.0.0
Actions
‘geodir_after_loginwidget_form_logged_in’ [Line: 3537]
Filters
‘geodir_dashboard_link_add_listing’ [Line: 3399]
‘geodir_dashboard_label_add_listing’ [Line: 3400]
‘gd_dash_fav_author_link’ [Line: 3432]
‘geodir_dashboard_link_favorite_listing’ [Line: 3452]
‘gd_dash_listing_author_link’ [Line: 3483]
‘geodir_dashboard_link_my_listing’ [Line: 3500]
‘geodir_dashboard_links’ [Line: 3529]
Source File
geodir_loginwidget_output() is located in geodirectory-functions/general_functions.php [Line: 3343]
Source Code
function geodir_loginwidget_output( $args = '', $instance = '' ) { //print_r($args); //print_r($instance); // prints the widget extract( $args, EXTR_SKIP ); /** This filter is documented in geodirectory_widgets.php */ $title = empty( $instance['title'] ) ? __( 'My Dashboard', 'geodirectory' ) : apply_filters( 'my_dashboard_widget_title', __( $instance['title'], 'geodirectory' ) ); echo $before_widget; echo $before_title . $title . $after_title; // global $gd_session; // print_r($gd_session); // print_r($_SESSION); if ( is_user_logged_in() ) { global $current_user; $author_link = get_author_posts_url( $current_user->data->ID ); $author_link = geodir_getlink( $author_link, array( 'geodir_dashbord' => 'true' ), false ); echo '
- ';
ob_start();
?>
- $postobj ) { if ( in_array( $key, $show_add_listing_post_types_main_nav ) ) { if ( $add_link = geodir_get_addlisting_link( $key ) ) { $name = $postobj->labels->name; $selected = ''; if ( geodir_get_current_posttype() == $key && geodir_is_page( 'add-listing' ) ) { $selected = 'selected="selected"'; } /** * Filter add listing link. * * @since 1.0.0 * * @param string $add_link Add listing link. * @param string $key Add listing array key. * @param int $current_user ->ID Current user ID. */ $add_link = apply_filters( 'geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID ); $name = apply_filters( 'geodir_dashboard_label_add_listing', $name, $key, $current_user->ID ); $addlisting_links .= ''; } } } if ( $addlisting_links != '' ) { ?> $postobj ) { if ( in_array( $key, $show_favorite_link_user_dashboard ) && array_key_exists( $key, $user_favourite ) ) { $name = $postobj->labels->name; $fav_author_link = apply_filters('gd_dash_fav_author_link', $author_link, $current_user->data->ID); $post_type_link = geodir_getlink( $fav_author_link, array( 'stype' => $key, 'list' => 'favourite' ), false ); $selected = ''; if ( isset( $_REQUEST['list'] ) && $_REQUEST['list'] == 'favourite' && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key && isset( $_REQUEST['geodir_dashbord'] ) ) { $selected = 'selected="selected"'; } /** * Filter favorite listing link. * * @since 1.0.0 * * @param string $post_type_link Favorite listing link. * @param string $key Favorite listing array key. * @param int $current_user ->ID Current user ID. */ $post_type_link = apply_filters( 'geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID ); $favourite_links .= ''; } } if ( $favourite_links != '' ) { ?>
- $postobj ) { if ( in_array( $key, $show_listing_link_user_dashboard ) && array_key_exists( $key, $user_listing ) ) { $name = $postobj->labels->name; $listing_author_link = apply_filters('gd_dash_listing_author_link', $author_link, $current_user->data->ID); $listing_link = geodir_getlink( $listing_author_link, array( 'stype' => $key ), false ); $selected = ''; if ( ! isset( $_REQUEST['list'] ) && isset( $_REQUEST['geodir_dashbord'] ) && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key ) { $selected = 'selected="selected"'; } /** * Filter my listing link. * * @since 1.0.0 * * @param string $listing_link My listing link. * @param string $key My listing array key. * @param int $current_user ->ID Current user ID. */ $listing_link = apply_filters( 'geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID ); $listing_links .= ''; } } if ( $listing_links != '' ) { ?>
- '; /** * Called after the loginwidget form for logged in users. * * @since 1.6.6 */ do_action( 'geodir_after_loginwidget_form_logged_in' ); } else { ?>