[wp-trac] [WordPress Trac] #22957: get_boundary_post Only works from a single page

WordPress Trac noreply at wordpress.org
Mon Jun 23 17:11:04 UTC 2025


#22957: get_boundary_post Only works from a single page
-------------------------------------+-----------------------
 Reporter:  pathawks                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:
Component:  Posts, Post Types        |     Version:  2.8
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-test-info  |     Focuses:  template
-------------------------------------+-----------------------

Comment (by devasheeshkaul):

 == Test Report
 === Description
 This report validates whether the indicated patch works as expected.

 Patch tested: https://github.com/WordPress/wordpress-develop/pull/9040

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Chrome 136.0.0.0
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated
 - Plugins:
   * Test Reports 1.2.0

 === Actual Results
 1.  ✅ Issue resolved with patch.

 === Supplemental Artifacts
 Code used for testing:
 {{{#!php
 <?php
 add_action('wp_footer', 'test_boundary_posts');

 function test_boundary_posts() {
     $first_post_array = get_boundary_post(true, '', true);
     $last_post_array = get_boundary_post(true, '', false);

     echo '<div style="padding: 20px;">';
     echo '<h3>Boundary Post Test</h3>';

     if ( ! empty($first_post_array)) {
         $first_post = $first_post_array[0];
         echo '<p>First Post:' . $first_post->post_title . '</p>';
     } else {
         echo '<p>First post not found (NULL or empty result
 returned).</p>';
     }

     if ( ! empty($last_post_array)) {
         $last_post = $last_post_array[0];
         echo '<p>Last Post:' . $last_post->post_title . '</p>';
     } else {
         echo '<p>Last post not found (NULL or empty result
 returned).</p>';
     }

     echo '</div>';
 }
 }}}

 Footer Output: [[Image(https://ibb.co/8Ly0SyXh)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/22957#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list