[wp-trac] [WordPress Trac] #60395: Filtering posts by open ping_status returns posts with closed ping_status

WordPress Trac noreply at wordpress.org
Wed Jan 31 07:06:00 UTC 2024


#60395: Filtering posts by open ping_status returns posts with closed ping_status
-------------------------------+-----------------------------
 Reporter:  jamieburchell      |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  6.4.2
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 CLI command {{{wp post --ping_status=open}}} returns published sticky
 posts with a {{{ping_status}}} of {{{closed}}}.

 {{{
 wp post list --ping_status=open
 --fields=ID,post_status,post_type,ping_status
 +------+-------------+-----------+-------------+
 | ID   | post_status | post_type | ping_status |
 +------+-------------+-----------+-------------+
 | 2521 | publish     | post      | closed      |
 | 2508 | publish     | post      | closed      |
 +------+-------------+-----------+-------------+
 }}}

 The same command with a different output format yields no results:

 {{{
 wp post list --ping_status=open --format=ids
 (no output)
 }}}

 Setting an arbitrary {{{ping_status}}} still returns results;

 {{{
 wp post list --ping_status=foobar
 --fields=ID,post_status,post_type,ping_status
 +------+-------------+-----------+-------------+
 | ID   | post_status | post_type | ping_status |
 +------+-------------+-----------+-------------+
 | 2521 | publish     | post      | closed      |
 | 2508 | publish     | post      | closed      |
 +------+-------------+-----------+-------------+
 }}}

 The command should return no results as there are no posts with
 {{{ping_status}}} of {{{open}}}. At the very least, the results output
 should be consistent regardless of format.

 Environment

 {{{
 OS:     Linux 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Wed Nov 29 18:55:19 UTC
 2023 x86_64
 Shell:  /bin/bash
 PHP binary:     /usr/bin/php
 PHP version:    8.1.27
 php.ini used:   /etc/php.ini
 MySQL binary:   /bin/mysql
 MySQL version:  mysql  Ver 15.1 Distrib 10.5.22-MariaDB, for Linux
 (x86_64) using  EditLine wrapper
 SQL modes:
 WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
 WP-CLI vendor dir:      phar://wp-cli.phar/vendor
 WP_CLI phar path:       /var/www
 WP-CLI packages dir:
 WP-CLI cache dir:       /home/deploy/.wp-cli/cache
 WP-CLI global config:
 WP-CLI project config:  /var/www/wp-cli.yml
 WP-CLI version: 2.9.0
 }}}

 GitHub issue:

 https://github.com/wp-cli/entity-command/issues/453

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60395>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list