Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-inclu...
File: class-wp-query.php
$search_orderby = apply_filters( 'posts_search_orderby', $search_orderby, $this );
[2500] Fix | Delete
}
[2501] Fix | Delete
[2502] Fix | Delete
if ( $search_orderby ) {
[2503] Fix | Delete
$orderby = $orderby ? $search_orderby . ', ' . $orderby : $search_orderby;
[2504] Fix | Delete
}
[2505] Fix | Delete
}
[2506] Fix | Delete
[2507] Fix | Delete
if ( is_array( $post_type ) && count( $post_type ) > 1 ) {
[2508] Fix | Delete
$post_type_cap = 'multiple_post_type';
[2509] Fix | Delete
} else {
[2510] Fix | Delete
if ( is_array( $post_type ) ) {
[2511] Fix | Delete
$post_type = reset( $post_type );
[2512] Fix | Delete
}
[2513] Fix | Delete
$post_type_object = get_post_type_object( $post_type );
[2514] Fix | Delete
if ( empty( $post_type_object ) ) {
[2515] Fix | Delete
$post_type_cap = $post_type;
[2516] Fix | Delete
}
[2517] Fix | Delete
}
[2518] Fix | Delete
[2519] Fix | Delete
if ( isset( $q['post_password'] ) ) {
[2520] Fix | Delete
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_password = %s", $q['post_password'] );
[2521] Fix | Delete
if ( empty( $q['perm'] ) ) {
[2522] Fix | Delete
$q['perm'] = 'readable';
[2523] Fix | Delete
}
[2524] Fix | Delete
} elseif ( isset( $q['has_password'] ) ) {
[2525] Fix | Delete
$where .= sprintf( " AND {$wpdb->posts}.post_password %s ''", $q['has_password'] ? '!=' : '=' );
[2526] Fix | Delete
}
[2527] Fix | Delete
[2528] Fix | Delete
if ( ! empty( $q['comment_status'] ) ) {
[2529] Fix | Delete
$where .= $wpdb->prepare( " AND {$wpdb->posts}.comment_status = %s ", $q['comment_status'] );
[2530] Fix | Delete
}
[2531] Fix | Delete
[2532] Fix | Delete
if ( ! empty( $q['ping_status'] ) ) {
[2533] Fix | Delete
$where .= $wpdb->prepare( " AND {$wpdb->posts}.ping_status = %s ", $q['ping_status'] );
[2534] Fix | Delete
}
[2535] Fix | Delete
[2536] Fix | Delete
$skip_post_status = false;
[2537] Fix | Delete
if ( 'any' === $post_type ) {
[2538] Fix | Delete
$in_search_post_types = get_post_types( array( 'exclude_from_search' => false ) );
[2539] Fix | Delete
if ( empty( $in_search_post_types ) ) {
[2540] Fix | Delete
$post_type_where = ' AND 1=0 ';
[2541] Fix | Delete
$skip_post_status = true;
[2542] Fix | Delete
} else {
[2543] Fix | Delete
$post_type_where = " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
[2544] Fix | Delete
}
[2545] Fix | Delete
} elseif ( ! empty( $post_type ) && is_array( $post_type ) ) {
[2546] Fix | Delete
// Sort post types to ensure same cache key generation.
[2547] Fix | Delete
sort( $post_type );
[2548] Fix | Delete
$post_type_where = " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", esc_sql( $post_type ) ) . "')";
[2549] Fix | Delete
} elseif ( ! empty( $post_type ) ) {
[2550] Fix | Delete
$post_type_where = $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
[2551] Fix | Delete
$post_type_object = get_post_type_object( $post_type );
[2552] Fix | Delete
} elseif ( $this->is_attachment ) {
[2553] Fix | Delete
$post_type_where = " AND {$wpdb->posts}.post_type = 'attachment'";
[2554] Fix | Delete
$post_type_object = get_post_type_object( 'attachment' );
[2555] Fix | Delete
} elseif ( $this->is_page ) {
[2556] Fix | Delete
$post_type_where = " AND {$wpdb->posts}.post_type = 'page'";
[2557] Fix | Delete
$post_type_object = get_post_type_object( 'page' );
[2558] Fix | Delete
} else {
[2559] Fix | Delete
$post_type_where = " AND {$wpdb->posts}.post_type = 'post'";
[2560] Fix | Delete
$post_type_object = get_post_type_object( 'post' );
[2561] Fix | Delete
}
[2562] Fix | Delete
[2563] Fix | Delete
$edit_cap = 'edit_post';
[2564] Fix | Delete
$read_cap = 'read_post';
[2565] Fix | Delete
[2566] Fix | Delete
if ( ! empty( $post_type_object ) ) {
[2567] Fix | Delete
$edit_others_cap = $post_type_object->cap->edit_others_posts;
[2568] Fix | Delete
$read_private_cap = $post_type_object->cap->read_private_posts;
[2569] Fix | Delete
} else {
[2570] Fix | Delete
$edit_others_cap = 'edit_others_' . $post_type_cap . 's';
[2571] Fix | Delete
$read_private_cap = 'read_private_' . $post_type_cap . 's';
[2572] Fix | Delete
}
[2573] Fix | Delete
[2574] Fix | Delete
$user_id = get_current_user_id();
[2575] Fix | Delete
[2576] Fix | Delete
$q_status = array();
[2577] Fix | Delete
if ( $skip_post_status ) {
[2578] Fix | Delete
$where .= $post_type_where;
[2579] Fix | Delete
} elseif ( ! empty( $q['post_status'] ) ) {
[2580] Fix | Delete
[2581] Fix | Delete
$where .= $post_type_where;
[2582] Fix | Delete
[2583] Fix | Delete
$statuswheres = array();
[2584] Fix | Delete
$q_status = $q['post_status'];
[2585] Fix | Delete
if ( ! is_array( $q_status ) ) {
[2586] Fix | Delete
$q_status = explode( ',', $q_status );
[2587] Fix | Delete
}
[2588] Fix | Delete
$r_status = array();
[2589] Fix | Delete
$p_status = array();
[2590] Fix | Delete
$e_status = array();
[2591] Fix | Delete
if ( in_array( 'any', $q_status, true ) ) {
[2592] Fix | Delete
foreach ( get_post_stati( array( 'exclude_from_search' => true ) ) as $status ) {
[2593] Fix | Delete
if ( ! in_array( $status, $q_status, true ) ) {
[2594] Fix | Delete
$e_status[] = "{$wpdb->posts}.post_status <> '$status'";
[2595] Fix | Delete
}
[2596] Fix | Delete
}
[2597] Fix | Delete
} else {
[2598] Fix | Delete
foreach ( get_post_stati() as $status ) {
[2599] Fix | Delete
if ( in_array( $status, $q_status, true ) ) {
[2600] Fix | Delete
if ( 'private' === $status ) {
[2601] Fix | Delete
$p_status[] = "{$wpdb->posts}.post_status = '$status'";
[2602] Fix | Delete
} else {
[2603] Fix | Delete
$r_status[] = "{$wpdb->posts}.post_status = '$status'";
[2604] Fix | Delete
}
[2605] Fix | Delete
}
[2606] Fix | Delete
}
[2607] Fix | Delete
}
[2608] Fix | Delete
[2609] Fix | Delete
if ( empty( $q['perm'] ) || 'readable' !== $q['perm'] ) {
[2610] Fix | Delete
$r_status = array_merge( $r_status, $p_status );
[2611] Fix | Delete
unset( $p_status );
[2612] Fix | Delete
}
[2613] Fix | Delete
[2614] Fix | Delete
if ( ! empty( $e_status ) ) {
[2615] Fix | Delete
$statuswheres[] = '(' . implode( ' AND ', $e_status ) . ')';
[2616] Fix | Delete
}
[2617] Fix | Delete
if ( ! empty( $r_status ) ) {
[2618] Fix | Delete
if ( ! empty( $q['perm'] ) && 'editable' === $q['perm'] && ! current_user_can( $edit_others_cap ) ) {
[2619] Fix | Delete
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $r_status ) . '))';
[2620] Fix | Delete
} else {
[2621] Fix | Delete
$statuswheres[] = '(' . implode( ' OR ', $r_status ) . ')';
[2622] Fix | Delete
}
[2623] Fix | Delete
}
[2624] Fix | Delete
if ( ! empty( $p_status ) ) {
[2625] Fix | Delete
if ( ! empty( $q['perm'] ) && 'readable' === $q['perm'] && ! current_user_can( $read_private_cap ) ) {
[2626] Fix | Delete
$statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $p_status ) . '))';
[2627] Fix | Delete
} else {
[2628] Fix | Delete
$statuswheres[] = '(' . implode( ' OR ', $p_status ) . ')';
[2629] Fix | Delete
}
[2630] Fix | Delete
}
[2631] Fix | Delete
if ( $post_status_join ) {
[2632] Fix | Delete
$join .= " LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) ";
[2633] Fix | Delete
foreach ( $statuswheres as $index => $statuswhere ) {
[2634] Fix | Delete
$statuswheres[ $index ] = "($statuswhere OR ({$wpdb->posts}.post_status = 'inherit' AND " . str_replace( $wpdb->posts, 'p2', $statuswhere ) . '))';
[2635] Fix | Delete
}
[2636] Fix | Delete
}
[2637] Fix | Delete
$where_status = implode( ' OR ', $statuswheres );
[2638] Fix | Delete
if ( ! empty( $where_status ) ) {
[2639] Fix | Delete
$where .= " AND ($where_status)";
[2640] Fix | Delete
}
[2641] Fix | Delete
} elseif ( ! $this->is_singular ) {
[2642] Fix | Delete
if ( 'any' === $post_type ) {
[2643] Fix | Delete
$queried_post_types = get_post_types( array( 'exclude_from_search' => false ) );
[2644] Fix | Delete
} elseif ( is_array( $post_type ) ) {
[2645] Fix | Delete
$queried_post_types = $post_type;
[2646] Fix | Delete
} elseif ( ! empty( $post_type ) ) {
[2647] Fix | Delete
$queried_post_types = array( $post_type );
[2648] Fix | Delete
} else {
[2649] Fix | Delete
$queried_post_types = array( 'post' );
[2650] Fix | Delete
}
[2651] Fix | Delete
[2652] Fix | Delete
if ( ! empty( $queried_post_types ) ) {
[2653] Fix | Delete
sort( $queried_post_types );
[2654] Fix | Delete
$status_type_clauses = array();
[2655] Fix | Delete
[2656] Fix | Delete
foreach ( $queried_post_types as $queried_post_type ) {
[2657] Fix | Delete
[2658] Fix | Delete
$queried_post_type_object = get_post_type_object( $queried_post_type );
[2659] Fix | Delete
[2660] Fix | Delete
$type_where = '(' . $wpdb->prepare( "{$wpdb->posts}.post_type = %s AND (", $queried_post_type );
[2661] Fix | Delete
[2662] Fix | Delete
// Public statuses.
[2663] Fix | Delete
$public_statuses = get_post_stati( array( 'public' => true ) );
[2664] Fix | Delete
$status_clauses = array();
[2665] Fix | Delete
foreach ( $public_statuses as $public_status ) {
[2666] Fix | Delete
$status_clauses[] = "{$wpdb->posts}.post_status = '$public_status'";
[2667] Fix | Delete
}
[2668] Fix | Delete
$type_where .= implode( ' OR ', $status_clauses );
[2669] Fix | Delete
[2670] Fix | Delete
// Add protected states that should show in the admin all list.
[2671] Fix | Delete
if ( $this->is_admin ) {
[2672] Fix | Delete
$admin_all_statuses = get_post_stati(
[2673] Fix | Delete
array(
[2674] Fix | Delete
'protected' => true,
[2675] Fix | Delete
'show_in_admin_all_list' => true,
[2676] Fix | Delete
)
[2677] Fix | Delete
);
[2678] Fix | Delete
foreach ( $admin_all_statuses as $admin_all_status ) {
[2679] Fix | Delete
$type_where .= " OR {$wpdb->posts}.post_status = '$admin_all_status'";
[2680] Fix | Delete
}
[2681] Fix | Delete
}
[2682] Fix | Delete
[2683] Fix | Delete
// Add private states that are visible to current user.
[2684] Fix | Delete
if ( is_user_logged_in() && $queried_post_type_object instanceof WP_Post_Type ) {
[2685] Fix | Delete
$read_private_cap = $queried_post_type_object->cap->read_private_posts;
[2686] Fix | Delete
$private_statuses = get_post_stati( array( 'private' => true ) );
[2687] Fix | Delete
foreach ( $private_statuses as $private_status ) {
[2688] Fix | Delete
$type_where .= current_user_can( $read_private_cap ) ? " \nOR {$wpdb->posts}.post_status = '$private_status'" : " \nOR ({$wpdb->posts}.post_author = $user_id AND {$wpdb->posts}.post_status = '$private_status')";
[2689] Fix | Delete
}
[2690] Fix | Delete
}
[2691] Fix | Delete
[2692] Fix | Delete
$type_where .= '))';
[2693] Fix | Delete
[2694] Fix | Delete
$status_type_clauses[] = $type_where;
[2695] Fix | Delete
}
[2696] Fix | Delete
[2697] Fix | Delete
if ( ! empty( $status_type_clauses ) ) {
[2698] Fix | Delete
$where .= ' AND (' . implode( ' OR ', $status_type_clauses ) . ')';
[2699] Fix | Delete
}
[2700] Fix | Delete
} else {
[2701] Fix | Delete
$where .= ' AND 1=0 ';
[2702] Fix | Delete
}
[2703] Fix | Delete
} else {
[2704] Fix | Delete
$where .= $post_type_where;
[2705] Fix | Delete
}
[2706] Fix | Delete
[2707] Fix | Delete
/*
[2708] Fix | Delete
* Apply filters on where and join prior to paging so that any
[2709] Fix | Delete
* manipulations to them are reflected in the paging by day queries.
[2710] Fix | Delete
*/
[2711] Fix | Delete
if ( ! $q['suppress_filters'] ) {
[2712] Fix | Delete
/**
[2713] Fix | Delete
* Filters the WHERE clause of the query.
[2714] Fix | Delete
*
[2715] Fix | Delete
* @since 1.5.0
[2716] Fix | Delete
*
[2717] Fix | Delete
* @param string $where The WHERE clause of the query.
[2718] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2719] Fix | Delete
*/
[2720] Fix | Delete
$where = apply_filters_ref_array( 'posts_where', array( $where, &$this ) );
[2721] Fix | Delete
[2722] Fix | Delete
/**
[2723] Fix | Delete
* Filters the JOIN clause of the query.
[2724] Fix | Delete
*
[2725] Fix | Delete
* @since 1.5.0
[2726] Fix | Delete
*
[2727] Fix | Delete
* @param string $join The JOIN clause of the query.
[2728] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2729] Fix | Delete
*/
[2730] Fix | Delete
$join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) );
[2731] Fix | Delete
}
[2732] Fix | Delete
[2733] Fix | Delete
// Paging.
[2734] Fix | Delete
if ( empty( $q['nopaging'] ) && ! $this->is_singular ) {
[2735] Fix | Delete
$page = absint( $q['paged'] );
[2736] Fix | Delete
if ( ! $page ) {
[2737] Fix | Delete
$page = 1;
[2738] Fix | Delete
}
[2739] Fix | Delete
[2740] Fix | Delete
// If 'offset' is provided, it takes precedence over 'paged'.
[2741] Fix | Delete
if ( isset( $q['offset'] ) && is_numeric( $q['offset'] ) ) {
[2742] Fix | Delete
$q['offset'] = absint( $q['offset'] );
[2743] Fix | Delete
$pgstrt = $q['offset'] . ', ';
[2744] Fix | Delete
} else {
[2745] Fix | Delete
$pgstrt = absint( ( $page - 1 ) * $q['posts_per_page'] ) . ', ';
[2746] Fix | Delete
}
[2747] Fix | Delete
$limits = 'LIMIT ' . $pgstrt . $q['posts_per_page'];
[2748] Fix | Delete
}
[2749] Fix | Delete
[2750] Fix | Delete
// Comments feeds.
[2751] Fix | Delete
if ( $this->is_comment_feed && ! $this->is_singular ) {
[2752] Fix | Delete
if ( $this->is_archive || $this->is_search ) {
[2753] Fix | Delete
$cjoin = "JOIN {$wpdb->posts} ON ( {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID ) $join ";
[2754] Fix | Delete
$cwhere = "WHERE comment_approved = '1' $where";
[2755] Fix | Delete
$cgroupby = "{$wpdb->comments}.comment_id";
[2756] Fix | Delete
} else { // Other non-singular, e.g. front.
[2757] Fix | Delete
$cjoin = "JOIN {$wpdb->posts} ON ( {$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID )";
[2758] Fix | Delete
$cwhere = "WHERE ( post_status = 'publish' OR ( post_status = 'inherit' AND post_type = 'attachment' ) ) AND comment_approved = '1'";
[2759] Fix | Delete
$cgroupby = '';
[2760] Fix | Delete
}
[2761] Fix | Delete
[2762] Fix | Delete
if ( ! $q['suppress_filters'] ) {
[2763] Fix | Delete
/**
[2764] Fix | Delete
* Filters the JOIN clause of the comments feed query before sending.
[2765] Fix | Delete
*
[2766] Fix | Delete
* @since 2.2.0
[2767] Fix | Delete
*
[2768] Fix | Delete
* @param string $cjoin The JOIN clause of the query.
[2769] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2770] Fix | Delete
*/
[2771] Fix | Delete
$cjoin = apply_filters_ref_array( 'comment_feed_join', array( $cjoin, &$this ) );
[2772] Fix | Delete
[2773] Fix | Delete
/**
[2774] Fix | Delete
* Filters the WHERE clause of the comments feed query before sending.
[2775] Fix | Delete
*
[2776] Fix | Delete
* @since 2.2.0
[2777] Fix | Delete
*
[2778] Fix | Delete
* @param string $cwhere The WHERE clause of the query.
[2779] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2780] Fix | Delete
*/
[2781] Fix | Delete
$cwhere = apply_filters_ref_array( 'comment_feed_where', array( $cwhere, &$this ) );
[2782] Fix | Delete
[2783] Fix | Delete
/**
[2784] Fix | Delete
* Filters the GROUP BY clause of the comments feed query before sending.
[2785] Fix | Delete
*
[2786] Fix | Delete
* @since 2.2.0
[2787] Fix | Delete
*
[2788] Fix | Delete
* @param string $cgroupby The GROUP BY clause of the query.
[2789] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2790] Fix | Delete
*/
[2791] Fix | Delete
$cgroupby = apply_filters_ref_array( 'comment_feed_groupby', array( $cgroupby, &$this ) );
[2792] Fix | Delete
[2793] Fix | Delete
/**
[2794] Fix | Delete
* Filters the ORDER BY clause of the comments feed query before sending.
[2795] Fix | Delete
*
[2796] Fix | Delete
* @since 2.8.0
[2797] Fix | Delete
*
[2798] Fix | Delete
* @param string $corderby The ORDER BY clause of the query.
[2799] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2800] Fix | Delete
*/
[2801] Fix | Delete
$corderby = apply_filters_ref_array( 'comment_feed_orderby', array( 'comment_date_gmt DESC', &$this ) );
[2802] Fix | Delete
[2803] Fix | Delete
/**
[2804] Fix | Delete
* Filters the LIMIT clause of the comments feed query before sending.
[2805] Fix | Delete
*
[2806] Fix | Delete
* @since 2.8.0
[2807] Fix | Delete
*
[2808] Fix | Delete
* @param string $climits The JOIN clause of the query.
[2809] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2810] Fix | Delete
*/
[2811] Fix | Delete
$climits = apply_filters_ref_array( 'comment_feed_limits', array( 'LIMIT ' . get_option( 'posts_per_rss' ), &$this ) );
[2812] Fix | Delete
}
[2813] Fix | Delete
[2814] Fix | Delete
$cgroupby = ( ! empty( $cgroupby ) ) ? 'GROUP BY ' . $cgroupby : '';
[2815] Fix | Delete
$corderby = ( ! empty( $corderby ) ) ? 'ORDER BY ' . $corderby : '';
[2816] Fix | Delete
$climits = ( ! empty( $climits ) ) ? $climits : '';
[2817] Fix | Delete
[2818] Fix | Delete
$comments_request = "SELECT $distinct {$wpdb->comments}.comment_ID FROM {$wpdb->comments} $cjoin $cwhere $cgroupby $corderby $climits";
[2819] Fix | Delete
[2820] Fix | Delete
$key = md5( $comments_request );
[2821] Fix | Delete
$last_changed = wp_cache_get_last_changed( 'comment' ) . ':' . wp_cache_get_last_changed( 'posts' );
[2822] Fix | Delete
[2823] Fix | Delete
$cache_key = "comment_feed:$key:$last_changed";
[2824] Fix | Delete
$comment_ids = wp_cache_get( $cache_key, 'comment-queries' );
[2825] Fix | Delete
if ( false === $comment_ids ) {
[2826] Fix | Delete
$comment_ids = $wpdb->get_col( $comments_request );
[2827] Fix | Delete
wp_cache_add( $cache_key, $comment_ids, 'comment-queries' );
[2828] Fix | Delete
}
[2829] Fix | Delete
_prime_comment_caches( $comment_ids );
[2830] Fix | Delete
[2831] Fix | Delete
// Convert to WP_Comment.
[2832] Fix | Delete
/** @var WP_Comment[] */
[2833] Fix | Delete
$this->comments = array_map( 'get_comment', $comment_ids );
[2834] Fix | Delete
$this->comment_count = count( $this->comments );
[2835] Fix | Delete
[2836] Fix | Delete
$post_ids = array();
[2837] Fix | Delete
[2838] Fix | Delete
foreach ( $this->comments as $comment ) {
[2839] Fix | Delete
$post_ids[] = (int) $comment->comment_post_ID;
[2840] Fix | Delete
}
[2841] Fix | Delete
[2842] Fix | Delete
$post_ids = implode( ',', $post_ids );
[2843] Fix | Delete
$join = '';
[2844] Fix | Delete
if ( $post_ids ) {
[2845] Fix | Delete
$where = "AND {$wpdb->posts}.ID IN ($post_ids) ";
[2846] Fix | Delete
} else {
[2847] Fix | Delete
$where = 'AND 0';
[2848] Fix | Delete
}
[2849] Fix | Delete
}
[2850] Fix | Delete
[2851] Fix | Delete
$pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
[2852] Fix | Delete
[2853] Fix | Delete
/*
[2854] Fix | Delete
* Apply post-paging filters on where and join. Only plugins that
[2855] Fix | Delete
* manipulate paging queries should use these hooks.
[2856] Fix | Delete
*/
[2857] Fix | Delete
if ( ! $q['suppress_filters'] ) {
[2858] Fix | Delete
/**
[2859] Fix | Delete
* Filters the WHERE clause of the query.
[2860] Fix | Delete
*
[2861] Fix | Delete
* Specifically for manipulating paging queries.
[2862] Fix | Delete
*
[2863] Fix | Delete
* @since 1.5.0
[2864] Fix | Delete
*
[2865] Fix | Delete
* @param string $where The WHERE clause of the query.
[2866] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2867] Fix | Delete
*/
[2868] Fix | Delete
$where = apply_filters_ref_array( 'posts_where_paged', array( $where, &$this ) );
[2869] Fix | Delete
[2870] Fix | Delete
/**
[2871] Fix | Delete
* Filters the GROUP BY clause of the query.
[2872] Fix | Delete
*
[2873] Fix | Delete
* @since 2.0.0
[2874] Fix | Delete
*
[2875] Fix | Delete
* @param string $groupby The GROUP BY clause of the query.
[2876] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2877] Fix | Delete
*/
[2878] Fix | Delete
$groupby = apply_filters_ref_array( 'posts_groupby', array( $groupby, &$this ) );
[2879] Fix | Delete
[2880] Fix | Delete
/**
[2881] Fix | Delete
* Filters the JOIN clause of the query.
[2882] Fix | Delete
*
[2883] Fix | Delete
* Specifically for manipulating paging queries.
[2884] Fix | Delete
*
[2885] Fix | Delete
* @since 1.5.0
[2886] Fix | Delete
*
[2887] Fix | Delete
* @param string $join The JOIN clause of the query.
[2888] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2889] Fix | Delete
*/
[2890] Fix | Delete
$join = apply_filters_ref_array( 'posts_join_paged', array( $join, &$this ) );
[2891] Fix | Delete
[2892] Fix | Delete
/**
[2893] Fix | Delete
* Filters the ORDER BY clause of the query.
[2894] Fix | Delete
*
[2895] Fix | Delete
* @since 1.5.1
[2896] Fix | Delete
*
[2897] Fix | Delete
* @param string $orderby The ORDER BY clause of the query.
[2898] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2899] Fix | Delete
*/
[2900] Fix | Delete
$orderby = apply_filters_ref_array( 'posts_orderby', array( $orderby, &$this ) );
[2901] Fix | Delete
[2902] Fix | Delete
/**
[2903] Fix | Delete
* Filters the DISTINCT clause of the query.
[2904] Fix | Delete
*
[2905] Fix | Delete
* @since 2.1.0
[2906] Fix | Delete
*
[2907] Fix | Delete
* @param string $distinct The DISTINCT clause of the query.
[2908] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2909] Fix | Delete
*/
[2910] Fix | Delete
$distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );
[2911] Fix | Delete
[2912] Fix | Delete
/**
[2913] Fix | Delete
* Filters the LIMIT clause of the query.
[2914] Fix | Delete
*
[2915] Fix | Delete
* @since 2.1.0
[2916] Fix | Delete
*
[2917] Fix | Delete
* @param string $limits The LIMIT clause of the query.
[2918] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2919] Fix | Delete
*/
[2920] Fix | Delete
$limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) );
[2921] Fix | Delete
[2922] Fix | Delete
/**
[2923] Fix | Delete
* Filters the SELECT clause of the query.
[2924] Fix | Delete
*
[2925] Fix | Delete
* @since 2.1.0
[2926] Fix | Delete
*
[2927] Fix | Delete
* @param string $fields The SELECT clause of the query.
[2928] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2929] Fix | Delete
*/
[2930] Fix | Delete
$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
[2931] Fix | Delete
[2932] Fix | Delete
/**
[2933] Fix | Delete
* Filters all query clauses at once, for convenience.
[2934] Fix | Delete
*
[2935] Fix | Delete
* Covers the WHERE, GROUP BY, JOIN, ORDER BY, DISTINCT,
[2936] Fix | Delete
* fields (SELECT), and LIMIT clauses.
[2937] Fix | Delete
*
[2938] Fix | Delete
* @since 3.1.0
[2939] Fix | Delete
*
[2940] Fix | Delete
* @param string[] $clauses {
[2941] Fix | Delete
* Associative array of the clauses for the query.
[2942] Fix | Delete
*
[2943] Fix | Delete
* @type string $where The WHERE clause of the query.
[2944] Fix | Delete
* @type string $groupby The GROUP BY clause of the query.
[2945] Fix | Delete
* @type string $join The JOIN clause of the query.
[2946] Fix | Delete
* @type string $orderby The ORDER BY clause of the query.
[2947] Fix | Delete
* @type string $distinct The DISTINCT clause of the query.
[2948] Fix | Delete
* @type string $fields The SELECT clause of the query.
[2949] Fix | Delete
* @type string $limits The LIMIT clause of the query.
[2950] Fix | Delete
* }
[2951] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2952] Fix | Delete
*/
[2953] Fix | Delete
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
[2954] Fix | Delete
[2955] Fix | Delete
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
[2956] Fix | Delete
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
[2957] Fix | Delete
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
[2958] Fix | Delete
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
[2959] Fix | Delete
$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
[2960] Fix | Delete
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
[2961] Fix | Delete
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
[2962] Fix | Delete
}
[2963] Fix | Delete
[2964] Fix | Delete
/**
[2965] Fix | Delete
* Fires to announce the query's current selection parameters.
[2966] Fix | Delete
*
[2967] Fix | Delete
* For use by caching plugins.
[2968] Fix | Delete
*
[2969] Fix | Delete
* @since 2.3.0
[2970] Fix | Delete
*
[2971] Fix | Delete
* @param string $selection The assembled selection query.
[2972] Fix | Delete
*/
[2973] Fix | Delete
do_action( 'posts_selection', $where . $groupby . $orderby . $limits . $join );
[2974] Fix | Delete
[2975] Fix | Delete
/*
[2976] Fix | Delete
* Filters again for the benefit of caching plugins.
[2977] Fix | Delete
* Regular plugins should use the hooks above.
[2978] Fix | Delete
*/
[2979] Fix | Delete
if ( ! $q['suppress_filters'] ) {
[2980] Fix | Delete
/**
[2981] Fix | Delete
* Filters the WHERE clause of the query.
[2982] Fix | Delete
*
[2983] Fix | Delete
* For use by caching plugins.
[2984] Fix | Delete
*
[2985] Fix | Delete
* @since 2.5.0
[2986] Fix | Delete
*
[2987] Fix | Delete
* @param string $where The WHERE clause of the query.
[2988] Fix | Delete
* @param WP_Query $query The WP_Query instance (passed by reference).
[2989] Fix | Delete
*/
[2990] Fix | Delete
$where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
[2991] Fix | Delete
[2992] Fix | Delete
/**
[2993] Fix | Delete
* Filters the GROUP BY clause of the query.
[2994] Fix | Delete
*
[2995] Fix | Delete
* For use by caching plugins.
[2996] Fix | Delete
*
[2997] Fix | Delete
* @since 2.5.0
[2998] Fix | Delete
*
[2999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function