| @@ -132,37 +132,23 @@ | ||
| 132 | 132 | global $post, $wp_query; |
| 133 | 133 | |
| 134 | 134 | // Post not preview |
| 135 | 135 | if ( ! isset( $_REQUEST['preview'] ) ) { |
| 136 | - $posts = apply_filters_ref_array( | |
| 137 | - 'the_posts', | |
| 138 | - array( | |
| 139 | - array( get_post( $this->get_id() ) ), | |
| 140 | - &$wp_query, | |
| 141 | - ) | |
| 142 | - ); | |
| 143 | - | |
| 144 | 136 | // Fix style, js if content is WP Bakery |
| 145 | 137 | if ( class_exists( 'WPBMap' ) && method_exists( 'WPBMap', 'addAllMappedShortcodes' ) ) { |
| 146 | 138 | WPBMap::addAllMappedShortcodes(); |
| 147 | 139 | } |
| 148 | 140 | |
| 149 | - if ( $posts ) { | |
| 150 | - $post = $posts[0]; | |
| 151 | - } | |
| 141 | + $post = get_post( $this->get_id() ); | |
| 152 | 142 | |
| 153 | 143 | setup_postdata( $post ); |
| 154 | - $content_post = get_the_content(); | |
| 155 | - $content_post = apply_filters( 'the_content', $content_post ); | |
| 156 | - $content_post = str_replace( ']]>', ']]>', $content_post ); | |
| 157 | - $this->_content = $content_post; | |
| 158 | - wp_reset_postdata(); | |
| 159 | - } else { // Post is previewd | |
| 160 | - $content_post = get_the_content(); | |
| 161 | - $content_post = apply_filters( 'the_content', $content_post ); | |
| 162 | - $content_post = str_replace( ']]>', ']]>', $content_post ); | |
| 163 | - $this->_content = $content_post; | |
| 164 | 144 | } |
| 145 | + | |
| 146 | + $content_post = get_the_content(); | |
| 147 | + $content_post = apply_filters( 'the_content', $content_post ); | |
| 148 | + $content_post = str_replace( ']]>', ']]>', $content_post ); | |
| 149 | + $this->_content = $content_post; | |
| 150 | + wp_reset_postdata(); | |
| 165 | 151 | } |
| 166 | 152 | } else { |
| 167 | 153 | $content = get_post_field( 'post_content', $this->get_id() ); |
| 168 | 154 | if ( $length > 1 ) { |