Capability to read/edit page in wp-admin only for administrators

Thanks brasofilo! add_action( ‘pre_get_posts’, ‘hide_pages_to_user_except_admins’ ); function hide_pages_to_user_except_admins( $query ) { if( !is_admin() ) return $query; global $pagenow; $pages = array(‘201′,’38’,’99’); //page ids if( ‘edit.php’ == $pagenow && ( get_query_var(‘post_type’) && ‘page’ == get_query_var(‘post_type’) ) ) $query->set( ‘post__not_in’, $pages ); return $query; }

Is there a way of retrieving the core WP capabilities?

As said in comment above is more easy remove the added capabilities. Below, as example, a simple implementation: class MyAwesomePlugin { static $capabilities = array(‘a_cap’=> true, ‘another_one’=> true, ‘third_cap’=> true); static $custom_roles = array(‘one_role’ => ‘One Role’, ‘second_role’ => ‘Second Role’); static $core_roles = array(‘administrator’, ‘editor’, ‘author’); static function install() { // add custom capabilities … Read more

Can’t create new Pods pages

I found the problem. There was a line of code that was deleting all posts as soon they were created. It may seems slly but it was wanted, I’m building a really custom app based on wordpress… Simply I forgot that this would cancel many other things that pods saves as post, like pods pages … Read more

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