• Resolved Josh

    (@joshguss)


    Hello-

    I have followed the Documentation to create a variety of custom endpoints. I was wondering how I could go about querying the current endpoint in order to conditionally display content.

    In looking through the plugin code I notice UR()->query->get_current_endpoint and was hoping to use this to extract endpoint and conditionally display content as needed but while trying to use this it is just returning an empty string.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @joshguss,

    Regarding your query, if you want to display the contents conditionally then we have a feature for that. It’s called Content Restriction. With this feature, you can restrict your content of the site. Please refer this doc to learn more about it: https://docs.wpeverest.com/user-registration/docs/user-registration-content-restriction-advanced/

    I hope it helps.
    Regards!

    Thread Starter Josh

    (@joshguss)

    Hey @sharmadpk03,

    I am needing to handle this in code within the theme as opposed to through another plugin. Is there any kind of developer documentation with a list of available hooks/actions/filters/functions that we could use? Was hoping to be able to do something like:

    $endpoint = UR()->query->get_current_endpoint;
    
    if ( $endpoint = 'custom-endpoint-1' ) {
      // do something for custom-endpoint-1
    } elseif ( $endpoint = 'custom-endpoint-2' ) {
      // do something for custom-endpoint-2
    } else {
      // do something else
    }

    Hi @joshguss,

    Sorry, but we do not have developer documentation as of now. We are working on it though. We will be publishing the developer docs in near future.
    We will let you know once the docs are published.

    Regards!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to query custom current endpoint?’ is closed to new replies.