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; }

Create custom page and custom menu

If I understand you, what you are doing is almost correct. You need add_menu_page instead of add_submenu_page add_action(‘admin_menu’, ‘register_my_custom_submenu_page’); function register_my_custom_submenu_page() { add_menu_page( ‘My Custom Submenu Page’, ‘My Custom Submenu Page’, ‘manage_options’, ‘my-custom-submenu-page’, ‘my_custom_submenu_page_callback’ ); } function my_custom_submenu_page_callback() { echo ‘<h3>My Custom Submenu Page</h3>’; } As far as the “embedded” PHP, you already have it. … Read more

Customize a WP_Posts_List_Table class

Whenever you find apply_filters() or do_action in the core files, you’ll have an entry point. If not, jQuery is never enough. And case it’s not enough, some heavy trickery is always available.

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