Opened 12 years ago
Closed 12 years ago
#21797 closed defect (bug) (fixed)
get_the_excerpt() causing PHP notices. Undefined variable $post and Trying to get property of non object
Reported by: | c3mdigital | Owned by: | ryan |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | major | Version: | 3.5 |
Component: | Warnings/Notices | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
In r21759 calling the_excerpt() generates 2 PHP Notices. See call stacks below.
Patch adds $post = get_post(); to get_the_excerpt();
Notice: Undefined variable: post in /Users/chris/Sites/wp-trunk/wp-includes/post-template.php on line 268 Call Stack # Time Memory Function Location 1 0.0002 231808 {main}( ) ../index.php:0 2 0.0003 235024 require( '/Users/chris/Sites/wp-trunk/wp-blog-header.php' ) ../index.php:17 3 0.2340 13729696 require_once( '/Users/chris/Sites/wp-trunk/wp-includes/template-loader.php' ) ../wp-blog-header.php:16 4 0.2351 13741520 include( '/Users/chris/Sites/wp-trunk/wp-content/themes/wp-unframework/index.php' ) ../template-loader.php:43 5 0.2578 13820544 Wpu_Functions::post_content( ) ../index.php:18 6 0.2640 13833392 get_the_excerpt( ) ../functions.php:166
Notice: Trying to get property of non-object in /Users/chris/Sites/wp-trunk/wp-includes/post-template.php on line 268 Call Stack # Time Memory Function Location 1 0.0002 231808 {main}( ) ../index.php:0 2 0.0003 235024 require( '/Users/chris/Sites/wp-trunk/wp-blog-header.php' ) ../index.php:17 3 0.2340 13729696 require_once( '/Users/chris/Sites/wp-trunk/wp-includes/template-loader.php' ) ../wp-blog-header.php:16 4 0.2351 13741520 include( '/Users/chris/Sites/wp-trunk/wp-content/themes/wp-unframework/index.php' ) ../template-loader.php:43 5 0.2838 13839360 Wpu_Functions::post_content( ) ../index.php:18 6 0.2839 13839504 get_the_excerpt( ) ../functions.php:166
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Related: [21735] (for #21309).