About Dereck Bester

{---CodeR---}

Phonetic Alphabet Tables

NATO Phonetic Alphabet

Useful for spelling words and names over the phone.

Letter phonetic letter
A Alpha
B Bravo
C Charlie
D Delta
E Echo
F Foxtrot
G Golf
H Hotel
I India
J Juliet
K Kilo
L Lima
M Mike
N November
O Oscar
P Papa
Q Quebec
R Romeo
S Sierra
T Tango
U Uniform
V Victor
W Whiskey
X X-ray
Y Yankee
Z Zulu
Did you like this? Share it:

Hacking the menu in WordPress Dashboard

I have been working on a new prject the last week. While I did some research I came across this awesome WordPress feature. In this post, I am going to show how you can easily remove menus and submenu links from WordPress dashboard, and also how to order them in the way you want in WordPress 3.1+.

Remove Menu Page Links

WordPress 3.1+ comes with a built-in function that allows quick and easy removal of any of the default menus from the dashboard.

This is the complete list of default menu pages:

function delete_menu_items() {
		remove_menu_page('index.php'); // Dashboard
		remove_menu_page('edit.php'); // Posts
		remove_menu_page('upload.php'); // Media
		remove_menu_page('link-manager.php'); // Links
		remove_menu_page('edit.php?post_type=page'); // Pages
		remove_menu_page('edit-comments.php'); // Comments
		remove_menu_page('themes.php'); // Appearance
		remove_menu_page('plugins.php'); // Plugins
		remove_menu_page('users.php'); // Users
		remove_menu_page('tools.php'); // Tools
		remove_menu_page('options-general.php'); // Settings
}
add_action( 'admin_init', 'delete_menu_items' );

Keep the one’s you want to remove and add the code to the theme’s functions.php file.

Remove Menu Page Links Based on Roles
You can also remove menu pages for users based on roles. The below code will remove the Tools and Settings links only for Editors:

function delete_menu_items() {
	if ( current_user_can( 'editor' )) {
		remove_menu_page('tools.php'); <strong>// Tools</strong>
		remove_menu_page('options-general.php'); <strong>// Settings</strong>
	}
}
add_action( 'admin_init', 'delete_menu_items' );

Remove Submenu Page Links

WordPress also lets you remove submenu links from a menu.

To remove a submenu page, you need to include both the menu and submenu slug in the function.
Below code will remove the Widgets and theme Editor link, found under the Appearance menu. You can get a preview of it in the above image.

function delete_submenu_items() {
		remove_submenu_page( 'themes.php', 'widgets.php' );
		remove_submenu_page( 'themes.php', 'theme-editor.php');
}
add_action( 'admin_init', 'delete_submenu_items' );

Remove Submenu Page Links Based on Roles
Submenus can also be removed based on user role. This will remove the theme Editor link only for Editors.

function delete_submenu_items() {
	if ( current_user_can( 'editor' )) {
		remove_submenu_page( 'themes.php', 'theme-editor.php');
	}
}
add_action( 'admin_init', 'delete_submenu_items' );

Reorder Menu Links

Now that you only have the links you need in the menu, they can also be ordered the way you want.

This is the default order of menu links:

function custom_menu_order($menu_ord) {
	if (!$menu_ord) return true;
	return array(
		'index.php', <strong>// Dashboard</strong>
		'edit.php', <strong>// Posts</strong>
		'upload.php', <strong>// Media</strong>
		'link-manager.php', <strong>// Links</strong>
		'edit.php?post_type=page', <strong>// Pages</strong>
		'edit-comments.php', <strong>// Comments</strong>
		'themes.php', <strong>// Appearance</strong>
		'plugins.php', <strong>// Plugins</strong>
		'users.php', <strong>// Users</strong>
		'tools.php', <strong>// Tools</strong>
		'options-general.php' <strong>// Settings</strong>
	);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');

Organize the menu in the order you want and add the code to your theme’s functions.php file. Don’t add those menu links which you don’t want to order. They will still appear but as per the default layout.

Did you like this? Share it:

Fax to Email

As you know not everyone’s got email addresses yet, but a lot of people still use fax. This could be a problem at times, because people maybe want to send you a fax, but you can’t receive it as you might not have a fax machine. You might not want to spend the cash on all the equipment. Here’s a nice little service that you could use. Easy and simple to set up.

All you have to do is simply go to the following web url : http://www.faxtoemail.co.za/

Just enter your email address, comfirm it and click submit. It will take you to a screen just thanking you for signing up. The next step is to check your email address. You’re almost done! All you have to do now is to confirm your registration. In the received mail either click on the the green confirm button or click the url underneath it. That will take you to a new screen and give you your Fax number followed by your username(email) and password(randomly generated). To login to your account simply go to: http://myaccount.faxfx.net/

You are now ready to get faxes delivered straight to your email inbox!

Did you like this? Share it: