30c21d2031
This changeset introduces `$post` parameters to `get_the_content()` and `wp_trim_excerpt()`. When a `$post` object is passed to one of these functions, the functions will operate on the data from that object, rather than from the post globals (`$authordata`, `$page`, etc). This ensures that the functions work in a predictable manner when used outside of the regular post loop. The global-mismatch problem is surfaced in cases where `get_the_excerpt()` is called outside of the post loop, on posts that don't have a defined excerpt. In these cases, the post globals - used to generate a fallback excerpt - may refer to the incorrect object, resulting in PHP notices or other unpredictable behavior. See #36934 for a related issue. Props spacedmonkey, kraftbj, Shital Patel. Fixes #42814. git-svn-id: https://develop.svn.wordpress.org/trunk@44941 602fd350-edb4-49c9-b593-d223f7449a82 |
||
---|---|---|
src | ||
tests | ||
tools | ||
.editorconfig | ||
.gitignore | ||
.jshintrc | ||
.npmrc | ||
.nvmrc | ||
.travis.yml | ||
appveyor.yml | ||
composer.json | ||
composer.lock | ||
Gruntfile.js | ||
jsdoc.conf.json | ||
package-lock.json | ||
package.json | ||
phpcs.xml.dist | ||
phpunit.xml.dist | ||
webpack.config.js | ||
wp-cli.yml | ||
wp-config-sample.php | ||
wp-tests-config-sample.php |