Commit 104b410b authored by Erick Hitter's avatar Erick Hitter

If WordPress determines the request is a 404, such as when a user who can't...

If WordPress determines the request is a 404, such as when a user who can't read a specific privately-published posts attempts to do so, prevent plugin from acting by setting `is_print()` to false.

See https://github.com/ethitter/WP-Print-Friendly/pull/4.
parent 5aafb5f7
......@@ -164,12 +164,15 @@ class wp_print_friendly {
/**
* Determine if print template is being requested.
*
* If WordPress determined this request is a 404, do nothing and let the main theme handle things.
*
* @global $wp_query
* @uses is_404()
* @return bool
*/
public function is_print() {
global $wp_query;
return is_array( $wp_query->query ) && array_key_exists( $this->query_var, $wp_query->query );
return is_array( $wp_query->query ) && array_key_exists( $this->query_var, $wp_query->query ) && ! is_404();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment