Moin, ich habe folgenden Code
PHP
public function createResults( $offset ) { $get_posts = new WP_Query; $q = $this->search_string; //Is Poterstemmer Active? if ( read_option( 'sfs_is_stemmer' ) ) { $stemmer = new PorterStemmer(); $q = $stemmer->Stem( $q ); } $args = array( 'post_type' => read_option( 'sfs_search_in' ), 'post_status' => 'publish', 'post__not_in' => get_option('__protected_posts'), 'order' => read_option( 'sfs_search_order' ), 'offset' => $offset, 'order_by' => read_option( 'sfs_order_by' ), 'posts_per_page' => read_option( 'sfs_result_limit' ), 's' => $q ); $posts = $get_posts->query( $args ); //$this->results = $posts; if ( ! $get_posts->post_count ) { wp_send_json_error( array( 'noresults' => true ) ); } foreach ( $posts as $post ) { //This Makes everything fucking slow /* if ( $post->post_password == 'enter' ) { return; }*/ $this->results[] = array( 'id' => $post->ID, 'guid' => get_permalink( $post->ID ), 'title' => $post->post_title, 'thumbnail' => $this->add_thumbnail( $post->ID ), 'author' => $this->add_author( $post->post_author ), 'date' => date_i18n( get_option( 'date_format' ), strtotime( $post->post_date ) ), //Generate the Content //Todo: needs some changes later 'content' => strip_tags( $post->post_content ), //Generate the Comments 'comment_count' => $this->sfs_add_comments( $post->ID ) ); } wp_reset_postdata(); wp_send_json_success( $this->results ); }
Hier noch mal sauber http://laravel.io/bin/W498m#15,33-35 ich habe keine Ahnung an was es liegt ich habe Chrome in anderen Foren habe ich keine Probleme damit...
Bei Line: 15
Versuche ich das ganze zu Excluden das was da jetzt steht habe ich irgendwo gefunden aber funktioniert nicht.
das bei Line: 33-35 funktioniert zwar aber macht alles verdammt langsam. //e ich merke gerade das diese Abfrage totaler quatsch ist habe die komplett entfernt
hat jemand ne idee wie ich da die Passwort Protected post/cpt/pages entfernen kann?
gruss und danke