Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcodes not expanded in term_description #196

Closed
bobbingwide opened this issue Feb 4, 2022 · 5 comments
Closed

Shortcodes not expanded in term_description #196

bobbingwide opened this issue Feb 4, 2022 · 5 comments

Comments

@bobbingwide
Copy link
Owner

Since updating to WordPress 5.9, URLs such as this one https://fernsofmacaronesia.org.uk/islands/azores/ no longer display the image attached to the taxonomy description and the [caption] shortcode is not expanded.

Why not?

Problem determination

  • I can't reproduce in my local copy since it's a long way behind
  • Attempt to reproduce in cwiccer using: WordPress 5.9, ThisIs..., Category taxonomy eg s.b/cwiccer/category/blocks/
  • Attempt to reproduce in another local installation using: WordPress 5.9, Twenty Sixteen theme and the Category taxonomy
@bobbingwide
Copy link
Owner Author

Attempt to reproduce in cwiccer using: WordPress 5.9, ThisIs..., Category taxonomy eg s.b/cwiccer/category/blocks/

I had no problem using oik shortcodes and the term-description block.

@bobbingwide
Copy link
Owner Author

oik shortcodes weren't expanded with Twenty Sixteen, but were with ThisIs...
which includes the following code in functions.php.

do_action( "oik_add_shortcodes" );

@bobbingwide
Copy link
Owner Author

bobbingwide commented Feb 4, 2022

Explanation

In the live site for FOM, Yoast SEO was not activated.
When Yoast SEO is activated.

  1. The Edit Category admin page is enhanced. The Description field is displayed using TinyMCE, supportin an Add Media button and Visual and Text display modes.
  2. It adds support for shortcode expansion

The following hooks are attached to the term_description filter.

: 10   wptexturize;1 convert_chars;1 wpautop;1 shortcode_unautop;1 Yoast\WP\SEO\Integrations\Front_End\Category_Term_Description::add_shortcode_support;1

Yoast SEO adds its hook to both category_description and term_description.

@bobbingwide
Copy link
Owner Author

Now that Andrew's problem's been resolved I'm going to transfer this issue to oik.
It needs to hook into term_description using the same logic as for the_content

 add_filter( 'term_description', 'oik_do_shortcode', 0 );

does it also need to add

add_filter( 'the_excerpt', 'do_shortcode' );

when Yoast SEO isn't active?

@bobbingwide bobbingwide transferred this issue from bobbingwide/bobbingwide Feb 4, 2022
@bobbingwide bobbingwide changed the title Ferns of Macaronesia Islands archive no longer showing the image from the category description Shortcodes not expanded in term_description Feb 4, 2022
@bobbingwide
Copy link
Owner Author

Developed for oik v4.6.0, released in oik v4.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant