[wp-trac] [WordPress Trac] #21797: get_the_excerpt() causing PHP notices. Undefined variable $post and Trying to get property of non object
WordPress Trac
wp-trac at lists.automattic.com
Wed Sep 5 01:36:04 UTC 2012
#21797: get_the_excerpt() causing PHP notices. Undefined variable $post and Trying
to get property of non object
------------------------------+-----------------------------
Reporter: c3mdigital | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version: trunk
Severity: minor | Keywords: has-patch
------------------------------+-----------------------------
In 21759 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
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21797>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list