Merge pull request 'WP PLUGIN ソート対象拡張' (#6) from 修正_カスタム分類の並べ替えにカスタム投稿を追加 into master
Reviewed-on: https://develop.n-k-y.net/repo/WP_PLUGIN/POST_ORDER_BY_ARCHIVE/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
@@ -161,13 +161,16 @@ value="' . $sort_num . '">
|
||||
}
|
||||
|
||||
private static function get_sort_post_list( $tax_id, $search_param, $tax_name ): array {
|
||||
$args = array(
|
||||
$post_types = array( 'post' );
|
||||
$custom_post_types = array_values( get_post_types( array( 'public' => true, '_builtin' => false ) ) );
|
||||
$args = array(
|
||||
'post_type' => array_merge( $post_types, $custom_post_types ),
|
||||
'post_status' => array( 'publish', 'draft' ),
|
||||
'posts_per_page' => - 1,
|
||||
'orderby' => 'meta_value_num',
|
||||
'order' => 'ASC',
|
||||
);
|
||||
$meta_key = '_apop_post_' . self::create_post_sort_key( $tax_name, $search_param ) . '_' . $tax_id;
|
||||
$meta_key = '_apop_post_' . self::create_post_sort_key( $tax_name, $search_param ) . '_' . $tax_id;
|
||||
self::create_sort_post_list_meta_query( $args, $meta_key );
|
||||
self::create_post_tax_query( $args, $search_param, $tax_name, $tax_id );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user