Skip to content

Removed filter that runs do_shortcode on category descriptions in admin#10072

Merged
dutchmartin merged 5 commits intotrunkfrom
8262-do-not-run-shortcodes-on-category-descriptions
Jul 2, 2018
Merged

Removed filter that runs do_shortcode on category descriptions in admin#10072
dutchmartin merged 5 commits intotrunkfrom
8262-do-not-run-shortcodes-on-category-descriptions

Conversation

@Dieterrr
Copy link
Copy Markdown
Contributor

@Dieterrr Dieterrr commented Jun 19, 2018

Summary

This PR can be summarized in the following changelog entry:

  • Fixes UI issue that happend when do_shortcode was run on category descriptions in the admin list. Additionally, fixed rendering of shortcodes in category descriptions on the frontend.

Relevant technical choices:

  • Moved both the method and the filter calling custom_category_descriptions_add_shortcode_support from from the admin to the frontend, so it's called in the right place.
  • Deprecated custom_category_descriptions_add_shortcode_support in class-taxonomy.php instead of removing it since it is public.

Test instructions

This PR can be tested by following these steps:

  • Go to Posts->Categories, see the category descriptions on the right side.
  • Add a category with shortcodes in the description, for example a [gallery], and note how this results in images in the description fields.
  • Make sure you assign this category to at least one post.
  • Click "View" under your category with shortcodes and see the shortcodes shown as plain text on the front page.
  • Check out this branch and see the the images/videos disappear and the shortcodes are shown as plain text in the admin. When you visit the category page on the front end the shortcodes are rendered instead of shown as plain text.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #8262

@andizer
Copy link
Copy Markdown
Contributor

andizer commented Jun 19, 2018

Please deprecate custom_category_descriptions_add_shortcode_support if it isn't needed anymore!

@Dieterrr
Copy link
Copy Markdown
Contributor Author

Updated the description of the PR as some of the functionality has changed.

Copy link
Copy Markdown

@dutchmartin dutchmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR done 👍

@dutchmartin
Copy link
Copy Markdown

Acceptance done 👍

@dutchmartin dutchmartin added this to the 7.8 milestone Jul 2, 2018
@dutchmartin dutchmartin merged commit 6f1059f into trunk Jul 2, 2018
@dutchmartin dutchmartin deleted the 8262-do-not-run-shortcodes-on-category-descriptions branch July 2, 2018 13:23
@dutchmartin dutchmartin modified the milestones: 7.8, 7.9 Jul 3, 2018
@dutchmartin dutchmartin self-assigned this Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shouldn't run do_shortcode on category descriptions on admin list

3 participants