Skip to content

Conversation

@Antonio-Laguna
Copy link
Member

Description of the Change

Ensures that titles are stripped of HTML before being rendered. I chose this approach vs using dangerouslySetInnerHTML because you can pass components to take care of rendering some things, and I thought it made sense to have this be a global fix. Furthermore, that extra HTML might make sense in a rendering scenario, but probably not for a content picker.

Closes #384

How to test the Change

Add a filter to plugin.php under example such as this one:

add_filter( 'the_title', function ( $title ) {
	return '<span>' . $title . '</span>';
} );

Launch the dev environment and insert Content Picker into the default post.

Before

SCR-20260109-izmz SCR-20260109-iznz SCR-20260109-izov

After

SCR-20260109-iyqx SCR-20260109-iytg SCR-20260109-iysl

Changelog Entry

Fixed – Stripped HTML from post titles before rendering in the Content Picker to prevent unintended markup and ensure consistent display.

Checklist:

@fabiankaegy
Copy link
Member

I'm about to merge #373 which I think also solves this problem

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The content picker display html code as title for some edge cases

2 participants