Search Results for 'code'
-
Search Results
-
Would it be possible to create share functionality for each replies like
(Jaa = share).
I would try it myself and give some code to add, if I would get some advice how to do it.
This is a nightmare from what i can see unless you use the TEXT editor and the CODE tag ONLY.
If I insert some sample XSL script into CODE blocks. Example:
<xsl:choose> <xsl:when test="@ItemPosition='1' and Assistant!=''"> <xsl:text><span style="background-color: #ffff00;">1st:</span> </xsl:text> </xsl:when> <xsl:when test="@ItemPosition='2'"> <xsl:text><span style="background-color: #ffff00;">2nd:</span> </xsl:text> </xsl:when> <xsl:when test="@ItemPosition='3'"> <xsl:text><span style="background-color: #ffff00;">3rd:</span> </xsl:text> </xsl:when> </xsl:choose>I can edit it to my hearts content. But if I use the TinyMCE edit to edit this post (with the TinYMCE editor being the default at the moment I edit) it strips all the XSL syntax.
Now, I realise that I can add a load of XSL tags into my custom functions.php class to permit these syntax words but that will be a nightmare. XSL has a lot of syntax. Is there really no standard (TinyMCE compatible) where we can insert code snippets and they look correct to the user and still be editable afterwards in either editor?
I created a new topic today:
It is a private forum post. I used TinyMCE editor and it has:
– Paragraphs
– Table
– Background colour
– Code snippets
– Heading 3I hit “Submit” and the topic looks good.
I click “EDIT” and alot of all the underlaying HTML is stripped.
So I hit BACK in my browser. I set the default editor as TEXT and then I clicked EDIT and this time the whole text showed in the TEXT editor.
Why did the TinyMCE editor strip the content?
I am using:
– WordPress 5.3 (it uses TinyMCE 4.9.6 internally)
– bbp Style Pack
– TinyMCE ADvanced
– Advanced TinyMCE ConfigurationI seem to recall I used to have the same problem in general in Wordress when editing posts that had code in them would show funny. I really don’t know enough about the mechanics of the whole system to know where to look or who to direct the issue towards.
If anyone can replicate this problem or can direct me to a resolution I would be grateful. Thank you.
So I am using this extra function so that extra HTML tags are not stripped for non-admin users:
add_filter( 'bbp_kses_allowed_tags', 'ntwb_bbpress_custom_kses_allowed_tags' ); function ntwb_bbpress_custom_kses_allowed_tags() { return array( // Links 'a' => array( 'class' => true, 'href' => true, 'title' => true, 'rel' => true, 'class' => true, 'target' => true, ), // Quotes 'blockquote' => array( 'cite' => true, ), // Div 'div' => array( 'class' => true, ), // Span 'span' => array( 'class' => true, 'style' => true, ), // Paragraph 'p' => array( 'dir' => true, 'style' => true, ), // Code 'code' => array(), 'pre' => array( 'class' => true, ), // Formatting 'em' => array(), 'strong' => array(), 'del' => array( 'datetime' => true, ), // Lists 'ul' => array(), 'ol' => array( 'start' => true, ), 'li' => array(), // Images 'img' => array( 'class' => true, 'src' => true, 'border' => true, 'alt' => true, 'height' => true, 'width' => true, ), // Tables 'table' => array( 'align' => true, 'bgcolor' => true, 'border' => true, ), 'tbody' => array( 'align' => true, 'valign' => true, ), 'td' => array( 'align' => true, 'valign' => true, ), 'tfoot' => array( 'align' => true, 'valign' => true, ), 'th' => array( 'align' => true, 'valign' => true, ), 'thead' => array( 'align' => true, 'valign' => true, ), 'tr' => array( 'align' => true, 'valign' => true, ), 'video' => array( 'controls' => true, 'width' => true, 'height' => true, 'source' => array( 'src' => true, 'type' => true ) ) ); } // ==============================================================Notice the section at the end for videos? This is the issue. These videos are inserted using the TinyMCE Video plugin. Once it is inserted it looks something like this:
<video controls="controls" width="300" height="150"> <source src="https://www.publictalksoftware.co.uk/videos/forum/pts-test-video.mp4" type="video/mp4" /></video>The problem is that for a non-admin user the < and /> wrapped around the source tag is getting escaped. Thus the syntax is not correct and the video module will not play.
Robin suggested I switch off moderation:
add_filter( 'bbp_bypass_check_for_moderation', '__return_true' );
And to try removing this filter:remove_filter( 'bbp_new_reply_pre_content', 'bbp_filter_kses', 30 );But i can’t get it to work. The only way to insert one of these videos is if a admin user does it so that the escaping of the source tag does not happen.
Can this be resolved?
It is not a bug with the TinyMCE Video plugin. It is a bug only with non admin users inserting the videos. I assumed BBPress is escaping the inner content. Anyone got any ideas?
Thanks.
Hi there!
I’m trying to get a bbpress forum set up on my site, and while we’ve got the majority of it set up the way we’d like, there’s an issue when someone tries to access the forum via mobile/smartphone.
The reply box seems to overflow over the edge of the screen, such as in this picture:

I tried to adjust the width of the bbpress-topic-form using the Custom CSS on my theme, but while this seems to work for narrow browser windows on desktop, the mobile view remains the same as it does in the picture above.
For reference, this was the code I was trying:
@media only screen and (max-width: 600px) { #new-topic-0.bbp-topic-form{ width: 50%; } }I was wondering if anyone had any ideas on what might be going on here? I’m running the Gridmag theme (not pro) at the minute, could that be causing a conflict?