Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>this script cover all the aspects of the question, read the code comments for further explanation.</p> <pre><code>&lt;?php /** * this make sure the public user where redirected * to home instead of profile page */ function redirect_user_to($redirect_to, $request, $user) { global $user; if ($user-&gt;user_login == 'public') { return home_url(); } else { return home_url("/wp-admin/"); } } add_filter('login_redirect', 'redirect_user_to', 10, 3); /** * this remove the profile links from * the top nav menu */ function remove_edit_profile() { global $wp_admin_bar, $current_user; get_currentuserinfo(); if ($current_user-&gt;user_login == 'public') { $wp_admin_bar-&gt;remove_menu('edit-profile'); $wp_admin_bar-&gt;remove_menu('my-account-with-avatar'); $wp_admin_bar-&gt;remove_menu('my-account'); } } add_action('wp_before_admin_bar_render', 'remove_edit_profile', 0); /** * this remove the "Site Admin" link from * the WP meta widget, usually placed in * the side bar. */ function my_unregister_widgets() { unregister_widget('WP_Widget_Meta'); register_widget('MY_Widget_Meta'); } add_action('widgets_init', 'my_unregister_widgets'); class MY_Widget_Meta extends WP_Widget { function MY_Widget_Meta() { $widget_ops = array( 'classname' =&gt; 'widget_meta', 'description' =&gt; __("Log in/out, admin, feed and WordPress links"), ); $this-&gt;WP_Widget('meta', __('Meta'), $widget_ops); } function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Meta') : $instance['title']); echo $before_widget; if ($title) { echo $before_title.$title.$after_title; } ?&gt; &lt;ul&gt; &lt;?php global $current_user; get_currentuserinfo(); if ($current_user-&gt;user_login == 'public') { } else { wp_register(); } ?&gt; &lt;li&gt; &lt;?php wp_loginout();?&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="&lt;?php bloginfo('rss2_url');?&gt;" title="&lt;?php echo esc_attr(__('Syndicate this site using RSS 2.0'));?&gt;"&gt; &lt;?php _e('Entries &lt;abbr title="Really Simple Syndication"&gt;RSS&lt;/abbr&gt;');?&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="&lt;?php bloginfo('comments_rss2_url');?&gt;" title="&lt;?php echo esc_attr(__('The latest comments to all posts in RSS'));?&gt;"&gt; &lt;?php _e('Comments &lt;abbr title="Really Simple Syndication"&gt;RSS&lt;/abbr&gt;');?&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="http://wordpress.org/" title="&lt;?php echo esc_attr(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.'));?&gt;"&gt;WordPress.org&lt;/a&gt; &lt;/li&gt; &lt;?php wp_meta();?&gt; &lt;/ul&gt; &lt;?php echo $after_widget; } } /** * this prevent from non authorized user ( public ) * to pointing to the profile page by writing into * the address bar. */ function force_profile_redirect() { global $pagenow, $current_user; if (strtolower($current_user-&gt;user_login) == 'public') { wp_redirect(home_url()); } } add_action('admin_init', 'force_profile_redirect'); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload