WP 6.5 evaluating function
-
HI there – In previous WP versions, the code block that follows returned the content of a post with my slight customizations when using the shortcode within a post or template. I have several similar functions that I use, but this is the simplest to share for sake of the example.
function generate_custom_post($customtext) { global $post; if ( '' == $customtext ) { $customtext = get_the_content(''); $customtext = apply_filters('the_content', $customtext); } return $customtext; } add_shortcode( 'custom_post', 'generate_custom_post' );In WP 6.5, when using the shortcode within a post it simply returns the string “Array”. I have disabled all plugins and activated the default theme and the problem persists. Is there something about the way 6.5 would evaluate this that’s different? Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘WP 6.5 evaluating function’ is closed to new replies.