Problem using role_has_cap hook

I finally figured it out: To start with, I was using the wrong hook. I should have been using user_has_cap hook instead, which is what actually has a chance of being called when using current_user_can(). But second, and most important of all, I was seeing the page while logged-in as super_admin, which didn’t trigger the … Read more

How to use do_action_ref_array?

I haven’t tested this yet but somebody suggested this: add_action( ‘bookly_validate_custom_field’, function ( \stdClass $field, &$errors, $cart_key, \stdClass $field_info ) { // Validation by custom_field id switch ( $field->id ) { case ‘id_value’: if ( /*$invalid == */ true ) { $errors[‘custom_fields’][ $cart_key ][ $field->id ] = __( ‘Invalid’, ‘bookly’ ); } break; } }, … Read more

Stuck in redirect loop after using wp_login action

After a lot of messing around it turned out that the culprit was the plugin WPML. I’m sketchy on the exact reasons as to why it caused the redirect loop, but it had to do with some unusual settings I was using because I was trying to work around another WPML problem. In other words … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)