URL logic problem | WordPress.org

[ad_1]

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 hour, 41 minutes ago by andrewpko.
  • This topic was modified 1 hour, 40 minutes ago by andrewpko.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer