Questions page."; } function add_dashboard_widgets() { wp_add_dashboard_widget('dashboard_widget', 'Questions', 'ccn_dashboard_widget_questions'); } function ccn_login_redirect( $redirect_to, $request, $user ) { //is there a user to check? global $user; if ( isset( $user->roles ) && is_array( $user->roles ) ) { //check for admins if ( in_array( 'administrator', $user->roles ) ) { // redirect them to the default place return $redirect_to; } else { return home_url() . '/questions'; } } else { return $redirect_to; } } function ccn_admin_bar( $wp_admin_bar ){ $args = array( 'id' => 'ccn-questions', 'title' => 'Question List', 'href' => '/questions' ); $wp_admin_bar->add_node( $args ); $args = array( 'id' => 'ccn-question-ask', 'title' => 'Ask Question', 'href' => '/questions/ask' ); $wp_admin_bar->add_node( $args ); }