• Resolved andrewpko

    (@andrewpko)


    Hello. I found that url logic don`t work. In your script(/includes/conditional-logic/class-wpcode-conditional-page.php) I found function which return URL to compare. And it return nothing. $wp in this function is empty. print_r($wp) in this function return nothing.

    public function get_page_url() {
    return isset( $wp->request ) ? trailingslashit( home_url( $wp->request ) ) : '';
    }

    I changed this function this way and its work fine:

    public function get_page_url() {
    return isset( $wp->request ) ? trailingslashit( home_url( $wp->request ) ) : $_SERVER['REQUEST_URI'];
    }

    Is there more proper way to solve this problem? Maybe you can make update?

    • This topic was modified 1 year, 8 months ago by andrewpko.
    • This topic was modified 1 year, 8 months ago by andrewpko.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @andrewpko,

    From what you are describing it sounds like you are trying to run the snippet conditional logic before the $wp object has been loaded.

    Thank you for you detailed suggestion – we will look into adding the request_uri as a fallback for the next release.

    Thread Starter andrewpko

    (@andrewpko)

    Thanks for answer. How can I run snippet conditional logic after the $wp object has been loaded? I use autoload, frontend only.

    • This reply was modified 1 year, 8 months ago by andrewpko.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘URL logic problem’ is closed to new replies.