Archive

The most frustrating part till now, the solution what i got, is writing a query which i didn’t liked. So i was searching more of a native wordpress function. Wen i was using wp_update_user with its arguments & i was adding user_login to update my username. Everything was fine but when i tried updating the user_login it used to be the same the day i created the user. So then after looking all over unfortunately there is only one way to do it and which is :

Share with:

Like this:

Hellow Guys,
Wordpress provides a great power to customize most of the things via wordpress, like curd operations on admin menu’s, customizing admin bar (which will be covered in my coming posts).

So today we would work with one of the awesome functionality by wordpress itself, like removing the unwanted menus from admin area. You might be thinking that we could simply hide it why to use the function, correct that’s also the way but remember always do the right way where ever you can.

We just need to call the following function to remove any menu you want to

remove_menu_page( $menu_slug );

$menu_slug is the file name which is called on clicking of the menu, like for user operation wordpress call’s users.php. So if you pass users.php as a “menu slug” then it will remove the entire “Users” menu from admin area. Now you may be wondering that how will i remove the sub menu from the admin area. Simple, just use the following function with the php file name and the parent file name as specified below.

remove_submenu_page( $menu_slug, $submenu_slug )

So say you need to remove some menu’s for author then you may just use the above function’s on admin init. That will make your life more simpler 🙂 … Also do not forget to check the user rights… For details you may visit remove menu & remove sub menu

You can refer to the following screenshot. You can also check the domain from which i am calling. The domains have been changed via host file.
I will be implementing jsonp without getJson method. Hope this will save lot of your time ..

Share with:

Like this:

I know you all be so happy to see the title of the post. Yes there is a solution for adding a redirect after being logout.

Problem:

I was using

echo wp_logout_url( home_url() );

It seems so simple. When we look at the url it works properly with a parameter “redirect_to”. But whenever you try to use that it will always go to default wordpress login page. I researched and found out that domain mapping plugin is stopping it from redirecting. I tried fixing it in domain mapping itself but it was a waste of time .

Solution:

But then wordpress offers amazing power with hooks. Then i found out there is one hook where i could call a function after doing redirect.

add_filter('wp_logout','redirect_me');

This calls the function after deleting the cookie and signing out . So i wrote a function that will check if it has a redirect_to parameter in url then could redirect to destination else will redirect to where it came from. If you don’t want to redirect to HTTP_REFERER then you can always use

home_url()

function redirect_me(){
//if the user has rights of editor then return don't do anything
if(current_user_can('editor')) return;
//get the reffer or you may user home_url() if the "request_to" is not set
$logout_redirect_url = $_SERVER['HTTP_REFERER'];
if(!empty($_REQUEST['redirect_to'])) wp_safe_redirect($_REQUEST['redirect_to']);
else wp_redirect($logout_redirect_url);
exit();
}

Since many days i was wondering to add a dynamic menus that i could insert via plugin. I wanted to insert login and logout buttons into menu bar without editing the template. Then i found out one hook for the wordpress that i could inject my content into menu.

Now the technology has reached the level where you can send kiss over internet to your loved once . So now you don’t have to wait for the loved once to com and meet you for your precious kiss unless you have some other option at home hehehe .

So from this technology you can simulate French Kiss to a gr8 extent,actually i haven’t tried it but i would love to give a try .. 😀 So i am waiting for it to come it to the market hehehe . Thats y i love technology .

There is a hardware required from both the side to do the kissing simulation over the internet .