Info
- 21 posts
- 6 voices
- Started 5 years ago by drmike
- Latest reply from Null
- This topic is not a support question
Plugin: Using the strike tag
-
- Posted 5 years ago #
Greets:
Is there any reason (ie security?) why not to use the strike tag within out bbpress install?
Thanks,
-drmike -
- Posted 5 years ago #
No reason, it just wasn't added as one of the default tags. A quick plugin should allow it pretty easily though. Let me see how easy it would be to write.....brb
Trent
-
- Posted 5 years ago #
waiting ....
:)
-
- Posted 5 years ago #
Here is a little plugin for allowing strike!
<?php
function allow_strike_as_allowed_tags( $tags ) {
$tags['del'] = array();
return $tags;
}
add_filter( 'bb_allowed_tags', 'allow_strike_as_allowed_tags' );
?>Just save it as allow-strike.php and toss it in your /my-plugins/ folder.
Trent
-
- Posted 5 years ago #
I was wondering how you were going to do this one Trent. <strike> is not valid XHTML is it? Although it still renders properly, at least in FF 1.5.0.9 I think you need to do something like this now:
.strike {
text-decoration: line-through;
}or inline (bad, bad)
style="text-decoration: line-through"Also, I can't remember if the <del> tag is XHTML compliant or not. Maybe you could just change the
striketodeland call it a day? -
- Posted 5 years ago #
IF <del> tag is XHTML compliant, then we should just use that. I didn't even realize the strike tag was not compliant. With all the smart browsers out there now, the entire compliance things bugs me a bit......
Trent
-
- Posted 5 years ago #
I dug around the bb-includes last night and found where the allowed_tags (or whatever it was called) function was and just added it.
I'm using bbpress as a checklist and wanted the tag to mark off stuff when issues were completed.
del? Didn't think of that. Well, they're both in there and Igotta admit XHTML isn't high on my list for a support forum.
Thanks,
-drmikeedit: Could have sworn we had them on the wp.com forums...
-
- Posted 5 years ago #
The plugin I listed above now is using <del> as the tag. Simple enough to change to <strike> if you want that regardless of standards. It is just changing the word! Use at your own discretion as it is an easier solution than constantly changing the core file of formatting-functions.php
Any suggestions on getting this or other tags included using XHTML, please let me know because I would be a bit lost on that issue! Thanks Chrishajer for pointing that out though, I just am XHTML stupid....
Trent
-
- Posted 5 years ago #
Wouldn't that be the allowed tags in WordPress, not bbPress forum though right drmike? ;)
Trent
-
- Posted 5 years ago #
But how to add <strike> AND italic? (I miss italic to in the basic install)
-
- Posted 5 years ago #
Ahh ok, I want them in 1 plugin file though... also think these two should be standard :D
-
- Posted 5 years ago #
This works ok:
<?php function allow_strike_as_allowed_tags( $tags ) { $tags['strike'] = array(); return $tags; } add_filter( 'bb_allowed_tags', 'allow_strike_as_allowed_tags' ); function allow_italic_as_allowed_tags( $tags ) { $tags['i'] = array(); return $tags; } add_filter( 'bb_allowed_tags', 'allow_italic_as_allowed_tags' ); ?> -
- Posted 5 years ago #
Uh, you don't need to create separate functions for each tag! You are only extending the contents of an array.
I use this home-grown plugin for all the extra tags I want to add (edited for readability).
<?php // Allow extra html tags, even depreciated function allow_extra_tags( $tags ) { $tags['a'] = array( 'href' => array(), 'title' => array(), 'rel' => array(), 'target' => array() ); $tags['i'] = array(); $tags['b'] = array(); $tags['del'] = array(); $tags['strike'] = array(); $tags['img'] = array( 'src'=> array(), 'alt' => array(), 'width' => array(), 'height' => array() ); return $tags; } add_filter( 'bb_allowed_tags', 'allow_extra_tags' ); ?>Much simpler and easier to maintain.
-
- Posted 5 years ago #
"But how to add <strike> AND italic? (I miss italic to in the basic install)"
Wha'? Italic is totally there!
Just use<em> </em>That's your basic XHTML compliant italic, just like
<strong>is the compliant bold. They're both in by default.Or did I miss something?!
-
- Posted 5 years ago #
OMG I totaly looked over that
<em>
Yep it works -
- Posted 5 years ago #
This is why the Quicktags plugin is nice - no need to memorise :D
-
- Posted 5 years ago #
Shame there is no demo or image of how it looks like :)
-
- Posted 5 years ago #
No images here, but you can see it on my forum. Here's a thread: http://forums.loinhead.net/topic/the-purty-image-associator/page/2?replies=52
A little CSS styling applied to make them look flat, but I can easily share that. Otherwise they look like grey slightly bulging standard buttons.
-
- Posted 5 years ago #
Thx
-
You must log in to post.