Send Admin Emails to Multiple Email Addresses
Try this: update_option( ‘admin_email’, ‘[email protected], [email protected]’ ); Note that the value is a string; open and close quotes only!
Try this: update_option( ‘admin_email’, ‘[email protected], [email protected]’ ); Note that the value is a string; open and close quotes only!
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
Yep, pointless. admin_init only fires in admin area (and couple more files related to AJAX functionality) so additional is_admin() check is not necessary. It often comes up in examples for hooks that fire both on front-end and admin area.
You can combine add_action() and an is_admin() check: ! is_admin() and add_action( ‘init’, ‘my_custom_callback’ ); Now the callback function will run on front-end only.
If the setting in question is $setting, and is a checkbox type, you validate it like so: <?php $valid_input[$setting] = ( isset( $input[$setting] ) && true == $input[$setting] ? true : false ); ?> In this case, $input is the form data passed to the validation callback, where $input is an array-of-arrays. The validation method … Read more
I just run in the same error when adding extra columns to the default post types. The offending line was the $pagenow check. Quick Edit uses admin-ajax.php so it doesn’t renders the custom columns when it’s done. This doesn’t work: if( ‘edit.php’ == $pagenow && is_admin() ) { add_action( ‘admin_init’, array( $this, ‘init_id_column’ ), 999 … Read more
The HTML echo ‘<div id=”screen-meta-links”>’; echo ‘ <div id=”contextual-help-link-wrap” class=”hide-if-no-js screen-meta-toggle”>’; echo ‘ <a href=”#” id=”your-own-button” class=”show-settings”>Text for your button</a>’; echo ‘ </div>’; echo ‘</div>’; echo ‘<br style=”clera:both” />’; echo ‘<div id=”your-button-content” class=”your-button-hide”>’; // your content goes here echo ‘</div>’; And you need some custom JavaScript jQuery(document).ready( function($){ $( ‘.your-button-hide’ ).each( function(e){ $( this ).hide(); … Read more
If you’re using multisite, there’s a plugin you can network activate to disable the welcome panel on all new sites. It’s aptly named “Hide Welcome Panel for Multisite.” If you just want to do this for a typical (single site) installation, it’s also pretty easy. The welcome screen is shown for a user if a … Read more
There is a global variable called … $user_id available on that page. Always. From user-edit.php: $user_id = (int) $user_id; $current_user = wp_get_current_user(); if ( ! defined( ‘IS_PROFILE_PAGE’ ) ) define( ‘IS_PROFILE_PAGE’, ( $user_id == $current_user->ID ) ); if ( ! $user_id && IS_PROFILE_PAGE ) $user_id = $current_user->ID; elseif ( ! $user_id && ! IS_PROFILE_PAGE ) … Read more
Update: reading mike’s answer again got me thinking that you can add a new capability to a role and use that as you removal condition, so: // first add your role the capability like so // get the “author” role object $role = get_role( ‘administrator’ ); // add “see_all_menus” to this role object $role->add_cap( ‘see_all_menus’ … Read more