WordPress.org

Ready to get started?Download WordPress

Forums

Author dashboard (10 posts)

  1. Geoserv
    Member
    Posted 6 years ago #

    I am using the latest version, 2.5, is it possible to change what a "Contributor" sees on his/her dashboard?

    I only want them to be able to post and edit their own posts.

    Currently that have the following tabs:
    Write
    Manage
    Comments

    In manage and comments, they can see posts and comments but can't do anything with them, so I would like to remove these from their dashboard.

    I found a post regarding this, but I don't think it will apply to the latest version.

    Anyone able to help?

    Thanks.

  2. Pinoy.ca
    Member
    Posted 6 years ago #

    Where's the post you found regarding this?

  3. Geoserv
    Member
    Posted 6 years ago #

    Heres the post that I thought would solve it:

    http://wordpress.org/support/topic/147678?replies=11

    but the lines that were mentioned in it, aren't in the 2.5 version.

  4. Pinoy.ca
    Member
    Posted 6 years ago #

    I'm afraid those changes only hide the menu choices or the clickable link. Disabling menu choices to disable functionality only works for desktop computer programs, not http computer programs -- On the web a user can manipulate the URL directly.

    Until wordpress blocks contributor access to comments, I'm using something along the lines of

    function restrict_dashboard_screens() {
    	global $user_level;
    	if ( ((strpos($_SERVER['SCRIPT_NAME'], 'wp-admin/edit-comments.php')) or (strpos($_SERVER['SCRIPT_NAME'], 'wp-admin/comment.php')))) {
    		if ($user_level < 2) {
    			echo "<div class='wrap'><h2>Restricted area</h2></div>";
    			die();
    		}
    	}
    }
    add_action('init', 'restrict_dashboard_screens');

    Send me an ecard if this helps you out. :)

  5. Geoserv
    Member
    Posted 6 years ago #

    Didn't make any difference, heres my wp-admin/index.php file:

    <?php

    require_once('admin.php');

    require_once(ABSPATH . 'wp-admin/includes/dashboard.php');

    wp_dashboard_setup();

    function index_js() {
    ?>
    <script type="text/javascript">
    jQuery(function() {
    jQuery('#dashboard_incoming_links div.dashboard-widget-content').not( '.dashboard-widget-control' ).find( '.widget-loading' ).parent().load('index-extra.php?jax=incominglinks');
    jQuery('#dashboard_primary div.dashboard-widget-content').not( '.dashboard-widget-control' ).find( '.widget-loading' ).parent().load('index-extra.php?jax=devnews');
    jQuery('#dashboard_secondary div.dashboard-widget-content').not( '.dashboard-widget-control' ).find( '.widget-loading' ).parent().load('index-extra.php?jax=planetnews');
    jQuery('#dashboard_plugins div.dashboard-widget-content').not( '.dashboard-widget-control' ).find( '.widget-loading' ).parent().load('index-extra.php?jax=plugins');
    });
    </script>
    <?php
    }
    add_action( 'admin_head', 'index_js' );

    function index_css() {
    wp_admin_css( 'css/dashboard' );
    }
    add_action( 'admin_head', 'index_css' );

    wp_enqueue_script( 'jquery' );

    $title = __('Dashboard');
    $parent_file = 'index.php';
    require_once('admin-header.php');

    $today = current_time('mysql', 1);

    function restrict_dashboard_screens() {
    global $user_level;
    if ( ((strpos($_SERVER['SCRIPT_NAME'], 'wp-admin/edit-comments.php')) or (strpos($_SERVER['SCRIPT_NAME'], 'wp-admin/comment.php')))) {
    if ($user_level < 2) {
    echo "<div class='wrap'><h2>Restricted area</h2></div>";
    die();
    }
    }
    }
    add_action('init', 'restrict_dashboard_screens');
    ?>

    <div class="wrap">

    <h2><?php _e('Dashboard'); ?></h2>

    <div id="rightnow">
    <h3 class="reallynow">
    <span><?php _e('Right Now'); ?></span>

    <?php if ( $can_edit_posts = current_user_can( 'edit_posts' ) ) : ?>
    <?php _e('Write a New Post'); ?>
    <?php endif; if ( $can_edit_pages = current_user_can( 'edit_pages' ) ) : ?>
    <?php _e('Write a New Page'); ?>
    <?php endif; ?>
    <br class="clear" />
    </h3>

    <?php
    $num_posts = wp_count_posts( 'post' );
    $num_pages = wp_count_posts( 'page' );

    $num_cats = wp_count_terms('category');

    $num_tags = wp_count_terms('post_tag');

    $post_type_texts = array();

    if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are. Just unlink if !current_user_can
    $post_text = sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) );
    $post_type_texts[] = $can_edit_posts ? "$post_text" : $post_text;
    }
    if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can
    $post_type_texts[] = ''.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'';
    }
    if ( $can_edit_posts && !empty($num_posts->draft) ) {
    $post_type_texts[] = ''.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'';
    }
    if ( $can_edit_posts && !empty($num_posts->future) ) {
    $post_type_texts[] = ''.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'';
    }

    if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) {
    $pending_text = sprintf( __ngettext( 'There is %2$s post pending your review.', 'There are %2$s posts pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) );
    } else {
    $pending_text = '';
    }

    $cats_text = sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) );
    $tags_text = sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) );
    if ( current_user_can( 'manage_categories' ) ) {
    $cats_text = "$cats_text";
    $tags_text = "$tags_text";
    }

    $post_type_text = implode(', ', $post_type_texts);

    // There is always a category
    $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s' ), $post_type_text, $cats_text, $tags_text, $pending_text );
    $sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text );

    ?>
    <p class="youhave"><?php echo $sentence; ?></p>
    <?php
    $ct = current_theme_info();
    $sidebars_widgets = wp_get_sidebars_widgets();
    $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) );
    $widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets );
    if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
    $widgets_text = "$widgets_text";
    ?>
    <p class="youare">
    <?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
    <?php if ( $can_switch_themes ) : ?>
    <?php _e('Change Theme'); ?>
    <?php endif; ?>
    <?php update_right_now_message(); ?>
    </p>

    <?php do_action( 'rightnow_end' ); ?>
    <?php do_action( 'activity_box_end' ); ?>
    </div><!-- rightnow -->

    <br class="clear" />

    <div id="dashboard-widgets-wrap">

    <?php wp_dashboard(); ?>

    </div><!-- dashboard-widgets-wrap -->

    </div><!-- wrap -->

    <?php require('./admin-footer.php'); ?>

    I have bolded the code I entered.

  6. asamuels
    Member
    Posted 5 years ago #

    Using wordpress 2.5 and I am wanting to achieve the same thing. I am using Dashboard Widget Manager

    The problem is that we do not want contributors to see anything other than the 'Write tab' no 'comments' or 'manage' and a dashboard which only shows their completed number of posts and drafts.

    Run in conjunction with the Role Manager plugin as our blog is being run by admins with many contributors. The role manager plugin allows 'edit posts' but this encompasses managing posts also not just write only. An option to disable 'viewing' comments or overall blog items would be ideal.

    I am also creating attempting to build a customised 'Write Panel' with the Freshout Custom Write Panel Plugin so they have a custom write post page which only shows specific write boxes that I want them to fill in.

    In an ideal world contributors should be able to submit posts in a specific format and view and edit only comments which relate to their posts made and not view any other aspects related to the blog. A bit like a press release contribution.

    Has anyone achieved this functionality currently with wordpress 2.5?

  7. alfredogorga
    Member
    Posted 5 years ago #

    Basically I'm interested in the same: contributors only seeing a customized write panel, nothing else.

    Has anyone achieved this? Does anyones have any clue on how to do it?

    Thanks a lot in advance !!!

  8. slobizman
    Member
    Posted 5 years ago #

    Same here, along with what looks like dozens of people wanting this function. Someone should write a plugin.

  9. slobizman
    Member
    Posted 5 years ago #

    I've got the answer!

    Use the plugin KISS CMS Admin. The plugin does extra stuff besides removing the Manage Comments from non-admins, but all you need to do is comment the following lines as so:

    //        foreach ($unwanted_post_submenu as $i) unset($submenu['post-new.php'][$i]);
    //        foreach ($unwanted_edit_submenu as $i) unset($submenu['edit.php'][$i]);

    The plus the IGW Hide Dashboard is a great solution for lower level authors.

  10. vegthrea
    Member
    Posted 5 years ago #

    For any one following delete 5, // Remove change posts to allow users to edit posts. You can combine with manage only yours posts if you only want users to be able to edit their posts.

    These seem like such basic things to me I'm surprised it took me so long to accomplish this on WordPress. I've been using Drupal for sometime now and although much harder to get used to it def is more customizable

Topic Closed

This topic has been closed to new replies.

About this Topic