You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This setup_postdata() call in this function should not be necessary and should be removed (assuming that doing so doesn't result in breakage).
Why it's Important
This line was originally added after reading this in the documentation for get_the_excerpt(): https://developer.wordpress.org/reference/functions/get_the_excerpt/#comment-content-2457 However, this comment is out of date--as of WP 5.2, get_the_excerpt() and wp_trim_excerpt() pass along the $post variable to get_the_content() when no excerpt is defined, eliminating the need for handling global post data manually. Additionally, it doesn't look like setup_postdata() sets up a global $post object to begin with, so calling setup_postdata() is not accomplishing its intended goal anyway.
Alternatives
n/a
Possible Implementation
Remove it and test.
Additional context
n/a
The text was updated successfully, but these errors were encountered:
Description
UCF-WordPress-Theme/includes/utilities.php
Lines 78 to 102 in 221fc73
This
setup_postdata()
call in this function should not be necessary and should be removed (assuming that doing so doesn't result in breakage).Why it's Important
This line was originally added after reading this in the documentation for
get_the_excerpt()
: https://developer.wordpress.org/reference/functions/get_the_excerpt/#comment-content-2457 However, this comment is out of date--as of WP 5.2,get_the_excerpt()
andwp_trim_excerpt()
pass along the$post
variable toget_the_content()
when no excerpt is defined, eliminating the need for handling global post data manually. Additionally, it doesn't look likesetup_postdata()
sets up a global$post
object to begin with, so callingsetup_postdata()
is not accomplishing its intended goal anyway.Alternatives
n/a
Possible Implementation
Remove it and test.
Additional context
n/a
The text was updated successfully, but these errors were encountered: