wp_post not working, keeps redirecting to posts page

Because you want to run JS code, using WordPress post action handler will not give you the solution. You will need to use ajax for that. I have created a small example you can copy/paste. <form method=”post” class=”myform”> <input type=”hidden” name=”action” value=”add_foobar”> <input type=”hidden” name=”data” value=”foobarid”> <input type=”submit” value=”Submit”> </form> For our form I removed … Read more

How to check if a user is in a specific role?

If you only need this for current user current_user_can() accepts both roles and capabilities. UPDATE: Passing a role name to current_user_can() is no longer guaranteed to work correctly (see #22624). Instead, you may wish to check user role: $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { //The user has the “author” … Read more

Line-height of text in wp-admin

This is the CSS you will need: * { line-height: 1.6; } You could add this at “Customize” -> “Additional CSS” but notice that this will affect all elements because of the “*”. You can see more selectors here, for example if you only want it to affect the content of posts, you would do: … Read more

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