Tag Info

Hot answers tagged

1

Found it! I was missing one custom capability. To the code above, I added this line: $rol->add_cap( 'edit_' . $cap[0] ); It gives the capability edit_ctpsinglename. (edit_pb_publicacion). And now it works just fine. Hope someone find's this useful.


1

Try add_action( 'admin_menu', 'wpse182102_register_my_custom_menu_page' ); function wpse182102_register_my_custom_menu_page() { add_pages_page(null, 'Menu Item Name', 'edit_posts',/* or whatever capability required for this object */ '/post.php?post='.get_page_by_title('Etusivu')->ID.'&action=edit', null, ''); } And change Etusivu to be the ...


1

Use wp-admin/admin.php with an action parameter: <a href="<?php echo esc_url( admin_url( "admin.php?action=wpse_184153_create_page&user_id=$user_id" ) ) ?>">Create Page</a> And then hook onto the event: function wpse_184153_create_page() { $redirect = admin_url( 'users.php' ); if ( ! empty( $_GET['user_id'] ) && ...



Only top voted, non community-wiki answers of a minimum length are eligible