• Our group has a site with a menu link to a “join us” page – but there will be times when we need the “join us” link to go instead to a page that says “sorry there is a waiting list”.
    That change may at times need to be made by a non-wp user.

    Is there a simple way that can be achieved so the non-geek doesnt break the site?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Someone who makes this change really needs to be an authenticated user somehow. By them not being a WP user likely makes security even worse than you’d have by adding WP users. This user doesn’t need full capabilities, it’s possible to create a custom capability so specific users can make this change yet not be able to do anything else.

    The most user friendly way to do this will take more coding work. The solution that’s not so user friendly, but does not involve any coding, is to swap page slugs back and forth. Because you cannot have duplicate slugs, this requires changing slugs 3 times to make one swap.

    A better solution which requires coding involves having template or short code display a banner wait list notice based on some criteria such as the status of a custom field checkbox. Checkbox fields can be added to a post via a custom field plugin, but I expect the template/short code needs to be bespoke. It’s relatively simple though. If the box is unchecked, act like a normal template and show the page. If it’s checked, insert the banner notice into normal output.

    That said, it’s not conceptually much different than many of the cookie notice banners you see on various sites. Perhaps a cookie notice plugin could be adapted to show a wait list banner instead. The principal difference is the notice should only appear on one page and be easily toggled on or off.

    Thread Starter john errington

    (@john-errington)

    Sorry if my wording was unclear; they can be authenticated as an administrator for the site, so they can make changes; – but they will most likely not be very IT literate or have any real experience with wordpress.

    “it’s possible to create a custom capability so specific users can make this change yet not be able to do anything else.” sounds good.

    Moderator bcworkz

    (@bcworkz)

    Custom capability will likely involve bespoke meta box code since the usual custom field plugins assume standard WP capabilities. You can at least use a roles and capabilities plugin to assign a custom role with the capability. Or for completely bespoke, add a checkbox to user profiles which can only be altered by admins. The checkbox assigns a capability to individual users regardless of their role.

    The meta box then disables its checkbox field on the post edit screen when the capability is lacking. Otherwise it’s the “better solution” described previously. If users do not have edit others posts capability, the post checkbox needs to update its value through the REST API since users cannot otherwise update posts.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘switch link between two pages’ is closed to new replies.