-
-
Save stephenharris/6078242 to your computer and use it in GitHub Desktop.
<?php | |
function myprefix_kses_allowed_tags($input){ | |
return array_merge( $input, array( | |
// paragraphs | |
'p' => array( | |
'style' => array() | |
), | |
'span' => array( | |
'style' => array() | |
), | |
// Links | |
'a' => array( | |
'href' => array(), | |
'title' => array(), | |
'rel' => array() | |
), | |
// Quotes | |
'blockquote' => array( | |
'cite' => array() | |
), | |
// Code | |
'code' => array(), | |
'pre' => array(), | |
// Formatting | |
'em' => array(), | |
'strong' => array(), | |
'del' => array( 'datetime' => true, ), | |
// Lists | |
'ul' => array(), | |
'ol' => array( 'start' => true, ), | |
'li' => array(), | |
// Images | |
'img' => array( | |
'src' => true, | |
'border' => true, | |
'alt' => true, | |
'height' => true, | |
'width' => true, | |
) | |
)); | |
} | |
add_filter( 'bbp_kses_allowed_tags', 'myprefix_kses_allowed_tags', 999, 1 ); | |
?> |
Mmm.... For no.2 have you checked the actual HTML - it could be bullet points without the styling (At least, I recall having to tweak bbPress' css). On a test site everything rendered correctly (for admin / author ).
- Yup, can confirm an issue with editing posts - will need to look into it, but seems like the paragraph tags are stripped, before HTML is converted into markdown (?). At least lsits s So when you edit it you're not seeing the appropriate markdown - and hence re-saving (4) will save those errors to the database.
(Editing from the admin doesn't produce these errors, so maybe bbPress is doing something somewhere to the post content when editing it from the frontend.)
I'll try and take a proper look at this over the weekend. I do take on freelance work, but this is a plug-in I actively use and (try to) maintain. So if you want to buy me a beer, you can, but there's obligation :).
How can I add support for videos?
See:
https://bbpress.org/forums/topic/extra-tags-to-add-to-list-for-videos/#post-205701
I added:
'video' => array(
'controls' => true,
'width' => true,
'height' => true,
),
'source' => array(
'src' => true
)
But it is not right. The source
inner component gets stripped.
Ooooh that helped =). So the paragraph tags thing is solved, but other stuff is kinda out of whack.
Here's a series of steps:
e.g. Three list items turned into to paragraphs, HTML stripped
What's cool is that WP-Markdown in the normal blog comments area of WordPress works perfectly:
So it's possible!
If you have time to work on this, I'd be happy to pay your freelance rate if you do that kinda thing. And of course have it just go into the open source plugin.