• On the plugin screenshot of how a ruleset is creates one sees some conditional settings on the right such as:
    Post Type: [ Any ? ], Querystring, Referrer, User Agent.

    Is it possible to perform find/replace operation based on any of these conditions:
    – User is [ Anonymous | Logged in ]
    or more fine grained:
    – User role: [ ] Admin [ ] Editor [ ] Subscriber [ ] None (=Anonymous)
    Note: If no role is selected the operation is performed for any request!

    If not yet possible, would you consider it for implementation?

    My use case: Portfolio with work for companies which are ok with showing selected assets/projects but due to business discretion don’t want to be mentioned by name or have incoming links from my site.

    So my project index and various project pages like:
    /projects/ /projects/a/ /projects/b/ ... /projects/x/

    Link to companies pages with abstracted names (in slug and title) like:

    /companies/european-car-manufacturer/
    /companies/international-chemical-corporation/
    /companies/regional-bank/
    

    Interested parties get a login and with this can see the full company pages (with the full name and more details).

    So for logged in users I would perform these replacements:

    <a href="/companies/european-car-manufacturer/">European Car Manufacturer</a>
    ? <a href="/companies/citroen/">Citroen</a>
    

    And the real company pages like /companies/citroen get their visibility set to hidden (core WordPress feature) so even a direct URL input would enforce a login then.

    • This topic was modified 3 years, 1 month ago by abitofmind.
Viewing 1 replies (of 1 total)
  • Thread Starter abitofmind

    (@abitofmind)

    The concept could even be slightly adapted:

    If the content of /companies/european-car-manufacturer/ and /companies/citroen differ only in the explicit name (in TITLE and H1) and not significantly in content (i.e. images, closer description of the business relationship, etc)…

    … then incoming links keep the href and only change the label like:

    <a href="/companies/european-car-manufacturer/">European Car Manufacturer</a>
    ? <a href="/companies/european-car-manufacturer/">Citroen</a>

    … and at the “one company page type for all visitors” like /companies/european-car-manufacturer/ simply use the regex to find/replace in TITLE and H1 like this:

    <([title|h1])>;European Car Manufacturer</([title|h1])>
    ? <$1>Citroen</$2>
    • This reply was modified 3 years, 1 month ago by abitofmind.
    • This reply was modified 3 years, 1 month ago by abitofmind.
    • This reply was modified 3 years, 1 month ago by abitofmind.
Viewing 1 replies (of 1 total)
  • The topic ‘Conditional find and replace based on logged-in status or user role?’ is closed to new replies.