Send Notifications to All Admins

Is there a nice little filter that someone knows about where I can hook into notifications and send the notification to each / every administrator? There is : comment_post Runs just after a comment is saved in the database. Action function arguments: comment ID, approval status (“spam”, or 0/1 for disapproved/approved). http://codex.wordpress.org/Plugin_API/Action_Reference#Comment.2C_Ping.2C_and_Trackback_Actions And user_register which… … Read more

Add custom column to Users admin panel with Types user custom fields?

To fix the error, you can do something like this: function new_modify_user_table_row( $val, $column_name, $user_id ) { $user = get_userdata( $user_id ); switch ($column_name) { case ‘les-non-specialistes’ : return get_the_author_meta( ‘les-non-specialistes’, $user_id ); break; case ‘specialistes’ : return ”; break; default: } return $val; //<– Changed } Regarding the date, which date are you looking … Read more

How to test for Super Admin

I got it to work as follows — in mu-plugins directory, my superAdmin.php script looks like this: <?php function check_for_superAdmin($user_login, $user) { $current_user = get_userdatabylogin($user_login); if ( is_super_admin( $current_user->ID ) ) { // do these things } else { // do other things } } add_action( ‘wp_login’, ‘check_for_superAdmin’, 10, 2 ); ?> Hope this helps … Read more

How to set CORS header?

Fixed it by adding Header set Access-Control-Allow-Origin “*” in apache2.conf: <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted Header set Access-Control-Allow-Origin “*” </Directory>

dynamic_sidebar() returns false in admin section

Yes, you have to make sure to hook this function at some point after the sidebars are registered. It’s not quite explained, but implied in the codex that this function dynamic_sidebar( $index ) expects them to be registered and loaded as registered by the time it runs. Otherwise, it won’t have anything to match the … Read more

Is there a way to have admins that are logged in to wordpress not have to enter the password for password protected pages while browsing the website?

Since 4.7 you can filter the post_password_required function: function my_admins_dont_need_password( $required ) { if ( current_user_can( ‘manage_options’ ) ) { $required = false; } return $required; } add_filter( ‘post_password_required’, ‘my_admins_dont_need_password’ ); Replace manage_options with whatever capability you want to use to allow users to skip the password form.