Restrict Admin Capabilities in MultiSite

Editing super admin capabilities is a little different from editing the capabilities of every other role, because there is a slight detour in the way WP checks the current user’s capabilities. This is what you find on capabilities.php on line 864: function has_cap( $cap ) { // (…) // Multisite super admin has all caps … Read more

Sends out email to admin

No need for plugin here are a few lines of code you can modify and paste in your themes functions.php file and you will get a new email whenever a post is published: add_action(‘publish_post’, ‘send_admin_email’); function send_admin_email($post_id){ $to = ‘[email protected]’; $subject=”mail subject here”; $message = “your message here ex: new post published at: “.get_permalink($post_id); wp_mail($to, … Read more

Filter post listing by meta value which is a date

Add a query variable to store the month So first of all it’ll be necessary to create a custom query variable – this will store the month we’re after (in 2012/6) format. I’ll call it custom_month, but its best practise to prefix it to avoid clashes with other plug-ins: add_filter(‘query_vars’, ‘wpse57344_register_query_vars’ ); function wpse57344_register_query_vars( $qvars … Read more

Custom admin email for new user registration

Yes, you can Change email address by using wp_mail function. You can check this how to do this http://www.butlerblog.com/2011/07/14/changing-the-wp_mail-from-address-with-a-plugin/ Use this plugin for user management it supports email address when new user registers https://wordpress.org/plugins/wp-members/ Use this code in your functions.php file. function so174837_registration_email_alert( $user_id ) { $user = get_userdata( $user_id ); $email = $user->user_email; $message … Read more

Modify Admin Bar Link

I’ve not worked with the admin-bar before. However, I found your question interesting and decided to take a look. If you add a function to handle the action hook ‘admin_bar_menu’ and set the priority to be higher than 70, you will have access to the raw admin_bar_menu nodes where you can modify the properties you … Read more

Changing wp login url without .htaccess

I wrote a post about it a few weeks ago WordPress Easy Login URL without htaccess, but if you don’t want to read that, then here is the code in plugin form: <?php /* Plugin Name: Nice Login URL Plugin URI: http://en.bainternet.info Description: Simple plugin to redirect login/register to a nice url Version: 1.0 Author: … Read more