INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Hiding projects link from contributors dashboard

Hiding projects link from contributors dashboard

(OP)
Is there any way to hide the projects link from the Wordpress dashboard for contributors?

RE: Hiding projects link from contributors dashboard

sure. there is a way to do everything in WP.

but what do you mean by 'project'?

RE: Hiding projects link from contributors dashboard

What is this 'projects link' of which you speak?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: Hiding projects link from contributors dashboard

that has been added by a plugin. you could hide it via another plugin but it would be better to do it natively in the originating plugin.

let us know what the plugin is and we can take a look.

how do you want to determine the hiddenness? ie. what role level? See here for more info about roles: http://codex.wordpress.org/Roles_and_Capabilities

RE: Hiding projects link from contributors dashboard

(OP)
The only plug ins installed and active are Akismet, White Label CMS and Wysija Newsletters, none of which add Projects as far as I know. I had Newsletter installed but that's been removed. Could this have left some sort of legacy?

I don't need to use Projects, so hidden from all levels is fine!

RE: Hiding projects link from contributors dashboard

sure as eggs are eggs there is a plugin that is installed and active that renders the projects menu.

it is possible for a plugin to hide itself from a user of course.

try uploading this as a plugin, activating it and then post back the output that will be in the footer of the admin pages.

CODE

<?php
/*
Plugin Name: Magic Plugin Discoverer
Plugin URI: http://rathercurious.net
Description: discover all loaded plugins and show the menu structure
Version: 0.1.0
Author: jpadie
*/
class jMPD{
	public function __construct(){
		add_action('admin-footer', array($this,'output'));
	}
	public function output(){
		echo '<pre>';
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
		foreach(get_plugins() as $plugin=>$data):
			if(is_active($plugin)):
				echo  "$plugin\tactive\n";
			else:
				echo  "$plugin\tinactive\n";
			endif;
		endforeach;
		global $menu;
		print_r($menu);
		echo '</pre>';
	}
	
}

new jMPD;
?> 

RE: Hiding projects link from contributors dashboard

(OP)
OK, I saved this as index.php, zipped it up, uploaded and installed it. I've deactivated White Label CMS and there's no output at the foot of the admin pages. Have I done something wrong?

RE: Hiding projects link from contributors dashboard

ooops. sorry. the hook name is admin_footer and not admin-footer (underscore, not dash).

RE: Hiding projects link from contributors dashboard

(OP)
It's installed. No errors, but no list either.

RE: Hiding projects link from contributors dashboard

I will have to create an instance to test but I don't think it is possible for there to be no output at all. At the very least the Pre tags will be visible in the source.

RE: Hiding projects link from contributors dashboard

(OP)
Ah! I checked the source with the earlier version, but not this one. Here's the plug-in output:

<tr id='akismet' class='inactive update'><th scope='row' class='check-column'><label class='screen-reader-text' for='checkbox_daab5d2d514cf7d293376be3ded708f0' >Select Akismet</label><input type='checkbox' name='checked[]' value='akismet/akismet.php' id='checkbox_daab5d2d514cf7d293376be3ded708f0' /></th><td class='plugin-title'><strong>Akismet</strong><div class="row-actions visible"><span class='activate'><a href="plugins.php?action=activate&amp;plugin=akismet%2Fakismet.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=bd49002ccd" title="Activate this plugin" class="edit">Activate</a> | </span><span class='edit'><a href="plugin-editor.php?file=akismet/akismet.php" title="Open this file in the Plugin Editor" class="edit">Edit</a> | </span><span class='delete'><a href="plugins.php?action=delete-selected&amp;checked%5B0%5D=akismet%2Fakismet.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=a8941d60f6" title="Delete this plugin" class="delete">Delete</a></span></div></td><td class='column-description desc'>
<div class='plugin-description'><p>Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.</p></div>
<div class='inactive update second plugin-version-author-uri'>Version 2.5.9 | By <a href="http://automattic.com/wordpress-plugins/" title="Visit author homepage">Automattic</a> | <a href="http://akismet.com/?return=true" title="Visit plugin site">Visit plugin site</a></div></td></tr><tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">There is a new version of Akismet available. <a href="http://5.77.45.195/~naswt/wp-admin/plugin-install...." class="thickbox" title="Akismet">View version 3.0.0 details</a> or <a href="http://5.77.45.195/~naswt/wp-admin/update.php?acti...">update now</a>.</div></td></tr><tr id='magic-plugin-discoverer' class='active'><th scope='row' class='check-column'><label class='screen-reader-text' for='checkbox_66bfa608553106365c3cd01e1856c903' >Select Magic Plugin Discoverer</label><input type='checkbox' name='checked[]' value='magic/index.php' id='checkbox_66bfa608553106365c3cd01e1856c903' /></th><td class='plugin-title'><strong>Magic Plugin Discoverer</strong><div class="row-actions visible"><span class='deactivate'><a href="plugins.php?action=deactivate&amp;plugin=magic%2Findex.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=afa832179f" title="Deactivate this plugin">Deactivate</a> | </span><span class='edit'><a href="plugin-editor.php?file=magic/index.php" title="Open this file in the Plugin Editor" class="edit">Edit</a></span></div></td><td class='column-description desc'>
<div class='plugin-description'><p>discover all loaded plugins and show the menu structure</p></div>
<div class='active second plugin-version-author-uri'>Version 0.1.0 | By jpadie | <a href="http://rathercurious.net" title="Visit plugin site">Visit plugin site</a></div></td></tr><tr id='white-label-cms' class='inactive'><th scope='row' class='check-column'><label class='screen-reader-text' for='checkbox_9897912244f3f86294495ca40723a31f' >Select White Label CMS</label><input type='checkbox' name='checked[]' value='white-label-cms/wlcms-plugin.php' id='checkbox_9897912244f3f86294495ca40723a31f' /></th><td class='plugin-title'><strong>White Label CMS</strong><div class="row-actions visible"><span class='activate'><a href="plugins.php?action=activate&amp;plugin=white-label-cms%2Fwlcms-plugin.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=764fe0bb1f" title="Activate this plugin" class="edit">Activate</a> | </span><span class='edit'><a href="plugin-editor.php?file=white-label-cms/wlcms-plugin.php" title="Open this file in the Plugin Editor" class="edit">Edit</a> | </span><span class='delete'><a href="plugins.php?action=delete-selected&amp;checked%5B0%5D=white-label-cms%2Fwlcms-plugin.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=a8941d60f6" title="Delete this plugin" class="delete">Delete</a></span></div></td><td class='column-description desc'>
<div class='plugin-description'><p>A plugin that allows you to brand wordpress CMS as your own</p></div>
<div class='inactive second plugin-version-author-uri'>Version 1.5.2 | By <a href="http://www.videousermanuals.com/?utm_campaign=wlcm..." title="Visit author homepage">www.videousermanuals.com</a>; | <a href="http://www.videousermanuals.com/white-label-cms/?u..." title="Visit plugin site">Visit plugin site</a></div></td></tr><tr id='wysija-newsletters' class='active update'><th scope='row' class='check-column'><label class='screen-reader-text' for='checkbox_d04343a4ac7d7fc1aaa7a53fb0b2feaf' >Select Wysija Newsletters</label><input type='checkbox' name='checked[]' value='wysija-newsletters/index.php' id='checkbox_d04343a4ac7d7fc1aaa7a53fb0b2feaf' /></th><td class='plugin-title'><strong>Wysija Newsletters</strong><div class="row-actions visible"><span class='deactivate'><a href="plugins.php?action=deactivate&amp;plugin=wysija-newsletters%2Findex.php&amp;plugin_status=all&amp;paged=1&amp;s&amp;_wpnonce=19316473ab" title="Deactivate this plugin">Deactivate</a> | </span><span class='edit'><a href="plugin-editor.php?file=wysija-newsletters/index.php" title="Open this file in the Plugin Editor" class="edit">Edit</a></span></div></td><td class='column-description desc'>
<div class='plugin-description'><p>Create and send newsletters. Import and manage your lists. Add subscription forms in widgets, articles and pages. Wysija is a freemium plugin updated regularly with new features.</p></div>
<div class='active update second plugin-version-author-uri'>Version 2.5.9.4 | By <a href="http://www.mailpoet.com/" title="Visit author homepage">Wysija</a> | <a href="http://www.mailpoet.com/" title="Visit plugin site">Visit plugin site</a></div></td></tr><tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">There is a new version of Wysija Newsletters available. <a href="http://5.77.45.195/~naswt/wp-admin/plugin-install...." class="thickbox" title="Wysija Newsletters">View version 2.6.3 details</a> or <a href="http://5.77.45.195/~naswt/wp-admin/update.php?acti...">update now</a>.</div></td></tr>

Not quite sure what to do with it though!!

RE: Hiding projects link from contributors dashboard

umm. that's not it. the output should be in the admin footer!

i fear i mis-remembered one of the wp functions. could you try this instead

CODE

<?php
/*
Plugin Name: Magic Plugin Discoverer
Plugin URI: http://rathercurious.net
Description: discover all loaded plugins and show the menu structure
Version: 0.1.0
Author: jpadie
*/
class jMPD{
	public function __construct(){
		add_action('admin_footer', array($this,'output'));
	}
	public function output(){
		echo '<pre style="background-color:white; color:red;">';
		require_once ABSPATH . 'wp-admin/includes/plugin.php';
		foreach(get_plugins() as $plugin=>$data):
			if(is_plugin_active($plugin)):
				echo  "$plugin\tactive\n";
			else:
				echo  "$plugin\tinactive\n";
			endif;
		endforeach;
		global $menu;
		print_r($menu);
		echo '</pre>';
	}
	
}
ini_set('display_errors',true);error_reporting (E_ALL);
new jMPD;
?> 

RE: Hiding projects link from contributors dashboard

(OP)
Here's the output:

akismet/akismet.php inactive
magic/index.php active
white-label-cms/wlcms-plugin.php inactive
wysija-newsletters/index.php inactive
Array
(
[2] => Array
(
[0] => Dashboard
[1] => read
[2] => index.php
[3] =>
[4] => menu-top menu-top-first menu-icon-dashboard menu-top-last
[5] => menu-dashboard
[6] => none
)

[4] => Array
(
[0] =>
[1] => read
[2] => separator1
[3] =>
[4] => wp-menu-separator
)

[5] => Array
(
[0] => Posts
[1] => edit_posts
[2] => edit.php
[3] =>
[4] => open-if-no-js menu-top menu-icon-post menu-top-first
[5] => menu-posts
[6] => none
)

[10] => Array
(
[0] => Media
[1] => upload_files
[2] => upload.php
[3] =>
[4] => menu-top menu-icon-media
[5] => menu-media
[6] => none
)

[20] => Array
(
[0] => Pages
[1] => edit_pages
[2] => edit.php?post_type=page
[3] =>
[4] => menu-top menu-icon-page
[5] => menu-pages
[6] => none
)

[25] => Array
(
[0] => Comments 0
[1] => edit_posts
[2] => edit-comments.php
[3] =>
[4] => menu-top menu-icon-comments
[5] => menu-comments
[6] => none
)

[26] => Array
(
[0] => Projects
[1] => edit_posts
[2] => edit.php?post_type=project
[3] =>
[4] => menu-top menu-icon-post menu-top-last
[5] => menu-posts-project
[6] => none
)

[59] => Array
(
[0] =>
[1] => read
[2] => separator2
[3] =>
[4] => wp-menu-separator
)

[60] => Array
(
[0] => Appearance
[1] => switch_themes
[2] => themes.php
[3] =>
[4] => menu-top menu-icon-appearance menu-top-first
[5] => menu-appearance
[6] => div
)

[65] => Array
(
[0] => Plugins 2
[1] => activate_plugins
[2] => plugins.php
[3] =>
[4] => menu-top menu-icon-plugins
[5] => menu-plugins
[6] => none
)

[70] => Array
(
[0] => Users
[1] => list_users
[2] => users.php
[3] =>
[4] => menu-top menu-icon-users
[5] => menu-users
[6] => none
)

[75] => Array
(
[0] => Tools
[1] => edit_posts
[2] => tools.php
[3] =>
[4] => menu-top menu-icon-tools
[5] => menu-tools
[6] => none
)

[80] => Array
(
[0] => Settings
[1] => manage_options
[2] => options-general.php
[3] =>
[4] => menu-top menu-icon-settings menu-top-last
[5] => menu-settings
[6] => none
)

)

Doesn't look to be anything else.

RE: Hiding projects link from contributors dashboard

great.

do you have a custom post type called 'projects'?

RE: Hiding projects link from contributors dashboard

if so this plugin code should get rid of it (but not delete the posts)

<?php
/*
Plugin Name: Hide Custom Post Type
Plugin URI: http://rathercurious.net
Description: what it says on the tin
Version: 0.1.0
Author: jpadie
*/
class jCPTH{
public function __construct(){
add_action('init', array($this,'hide'));
}
public function hide(){
global $wp_post_types;
foreach(array('project','Project') as $c):
if(isset($wp_post_types[$c]))unset($wp_post_types[$c]);
endforeach;
}
}
new jCPTH;
?>

RE: Hiding projects link from contributors dashboard

(OP)
Give up your day job!!! clown

You really know your stuff. I wouldn't like to come up against you in court - not that I'm a bad boy!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close