WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins

It didn’t say in the API docs on the Yoast SEO plugin site what the ID was and I don’t have a copy of Yoast at installed at disposal, but according to yoas-plugin-dir/admin/class-metabox.php line 144, the meta_box registered is; add_meta_box( ‘wpseo_meta’, …etc ); … Which is hooked onto add_meta_boxes hook on line 32 of the … Read more

Check IF is a “single product page” and Check the “role” for a Redirect

Here is the result that works, I put in the condition : is_product() to check if is a single product page. And I changed in the add_action() : admin_init by wp function cm_redirect_users_by_role() { $current_user = wp_get_current_user(); $role_name = $current_user->roles[0]; if ( is_product() ){ if ( $role_name !== ‘customer’ && $role_name !== ‘shop_manager’ && $role_name … Read more

what’s the meaning of the field wp_capabilities in table wp_usermeta

The wp_capabilities saves the value as serilized array, you can try it in your php or for this example here: http://blog.tanist.co.uk/files/unserialize/. The Code: a:1:{s:13:”administrator”;b:1;} Is: Array ( [administrator] => 1 ) Meaning the user is an administrator. You can add new roles to the database by running the function add_role, and only run it once!

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