1669 | | $this->queried_object = get_page_by_path($qv['pagename']); |
1670 | | if ( !empty($this->queried_object) ) |
| 1669 | $this->queried_object = get_page_by_path( $qv['pagename'] ); |
| 1670 | |
| 1671 | if ( $this->queried_object && 'attachment' == $this->queried_object->post_type ) { |
| 1672 | if ( preg_match( "/^[^%]*%(?:postname)%/", get_option( 'permalink_structure' ) ) ) { |
| 1673 | // See if we also have a post with the same slug |
| 1674 | $post = get_page_by_path( $qv['pagename'], OBJECT, 'post' ); |
| 1675 | if ( $post ) { |
| 1676 | $this->queried_object = $post; |
| 1677 | $this->is_page = false; |
| 1678 | } |
| 1679 | } |
| 1680 | } |
| 1681 | |
| 1682 | if ( $this->queried_object ) |