Change base URL of pages created by certain users

Currently on wordpress all pages are created under the base URL ({PAGE}). Currently I am aware you can change the permalink of posts to{author}/{POST} but can this also be done for pages?

On my site I have a main user ‘admin’ using id ‘1’ and user profiles set as{author}

If possible I’d like all pages created by ‘admin’ to be set as{PAGE}
With pages created by other users set to{author}/{PAGE}

The only code i have in place in regards to permalinks is included below incase this will cause any issues.

function change_author_permalinks() {

    global $wp_rewrite;

    // Change the value of the author permalink base to whatever you want here
    $wp_rewrite->author_base = 'members';



Solutions Collecting From Web of "Change base URL of pages created by certain users"