[wp-trac] [WordPress Trac] #36344: Improvement for: post_parent__not_in in line 2772. could not use post__not_in as a parameter in a string.
WordPress Trac
noreply at wordpress.org
Sat Mar 26 08:04:51 UTC 2016
#36344: Improvement for: post_parent__not_in in line 2772. could not use
post__not_in as a parameter in a string.
-------------------------+-----------------------------
Reporter: tavo962 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.4.2
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Improvement for: '''post-parent-not-in''' in line '''2772'''. could not
use '''post--not-in''' as a parameter in a string.
'''File:''' wp-includes/query.php
'''Line:''' 2772
'''Type:''' Enhancement
Example:
if the following query is run it does not work without the improvement
{{{
query_posts(
'post__not_in=2&post_status=publish&posts_per_page=15&paged=1' );
}}}
'''URL GitHub:''' [https://github.com/WordPress/WordPress/pull/192]
'''Remove:'''
{{{
$post_parent__not_in = implode( ',', array_map( 'absint',
$q['post_parent__not_in'] ) );
}}}
'''Add:'''
{{{
$post_parent__not_in = implode( ',', array_map( 'absint', is_string(
$q['post_parent__not_in'] ) ? explode( ',', $q['post_parent__not_in'] ) :
$q['post_parent__not_in'] ) );
}}}
Greetings from Mexico.
Best regards
Gustavo Martínez
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36344>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list