Forum Replies Created
-
In reply to: bbPress Editor – Text Formatting Not Saving?
Alright so i came up with this function:
/* Allowed Tags */
add_action(‘init’, ‘my_html_tags_code’, 10);
function my_html_tags_code() {
define(‘CUSTOM_TAGS’, true);
global $allowedtags;
$allowedtags = array(
‘address’ => array(),
‘a’ => array(
‘class’ => true,
‘href’ => true,
‘id’ => true,
‘title’ => true,
‘rel’ => true,
‘rev’ => true,
‘name’ => true,
‘target’ => true,
),
‘abbr’ => array(
‘class’ => true,
‘title’ => true,
),
‘acronym’ => array(
‘title’ => true,
),
‘article’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘aside’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘b’ => array(),
‘big’ => array(),
‘blockquote’ => array(
‘id’ => true,
‘cite’ => true,
‘class’ => true,
‘lang’ => true,
‘xml:lang’ => true,
),
‘br’ => array (
‘class’ => true,
),
‘button’ => array(
‘disabled’ => true,
‘name’ => true,
‘type’ => true,
‘value’ => true,
),
‘caption’ => array(
‘align’ => true,
‘class’ => true,
),
‘cite’ => array (
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘title’ => true,
),
‘code’ => array (
‘style’ => true,
),
‘col’ => array(
‘align’ => true,
‘char’ => true,
‘charoff’ => true,
‘span’ => true,
‘dir’ => true,
‘style’ => true,
‘valign’ => true,
‘width’ => true,
),
‘del’ => array(
‘datetime’ => true,
),
‘dd’ => array(),
‘details’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘open’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘div’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘dl’ => array(),
‘dt’ => array(),
’em’ => array(),
‘fieldset’ => array(),
‘figure’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘figcaption’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘font’ => array(
‘color’ => true,
‘face’ => true,
‘size’ => true,
),
‘footer’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘form’ => array(
‘action’ => true,
‘accept’ => true,
‘accept-charset’ => true,
‘enctype’ => true,
‘method’ => true,
‘name’ => true,
‘target’ => true,
),
‘h1’ => array(
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘h2’ => array (
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘h3’ => array (
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘h4’ => array (
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘h5’ => array (
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘h6’ => array (
‘align’ => true,
‘class’ => true,
‘id’ => true,
‘style’ => true,
),
‘header’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘hgroup’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘hr’ => array (
‘align’ => true,
‘class’ => true,
‘noshade’ => true,
‘size’ => true,
‘width’ => true,
),
‘i’ => array(),
‘img’ => array(
‘alt’ => true,
‘align’ => true,
‘border’ => true,
‘class’ => true,
‘height’ => true,
‘hspace’ => true,
‘longdesc’ => true,
‘vspace’ => true,
‘src’ => true,
‘style’ => true,
‘width’ => true,
),
‘ins’ => array(
‘datetime’ => true,
‘cite’ => true,
),
‘kbd’ => array(),
‘label’ => array(
‘for’ => true,
),
‘legend’ => array(
‘align’ => true,
),
‘li’ => array (
‘align’ => true,
‘class’ => true,
),
‘menu’ => array (
‘class’ => true,
‘style’ => true,
‘type’ => true,
),
‘nav’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘p’ => array(
‘class’ => true,
‘align’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘pre’ => array(
‘style’ => true,
‘width’ => true,
),
‘q’ => array(
‘cite’ => true,
),
‘s’ => array(),
‘span’ => array (
‘class’ => true,
‘dir’ => true,
‘align’ => true,
‘lang’ => true,
‘style’ => true,
‘title’ => true,
‘xml:lang’ => true,
),
‘section’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘strike’ => array(),
‘strong’ => array(),
‘sub’ => array(),
‘summary’ => array(
‘align’ => true,
‘class’ => true,
‘dir’ => true,
‘lang’ => true,
‘style’ => true,
‘xml:lang’ => true,
),
‘sup’ => array(),
‘table’ => array(
‘align’ => true,
‘bgcolor’ => true,
‘border’ => true,
‘cellpadding’ => true,
‘cellspacing’ => true,
‘class’ => true,
‘dir’ => true,
‘id’ => true,
‘rules’ => true,
‘style’ => true,
‘summary’ => true,
‘width’ => true,
),
‘tbody’ => array(
‘align’ => true,
‘char’ => true,
‘charoff’ => true,
‘valign’ => true,
),
‘td’ => array(
‘abbr’ => true,
‘align’ => true,
‘axis’ => true,
‘bgcolor’ => true,
‘char’ => true,
‘charoff’ => true,
‘class’ => true,
‘colspan’ => true,
‘dir’ => true,
‘headers’ => true,
‘height’ => true,
‘nowrap’ => true,
‘rowspan’ => true,
‘scope’ => true,
‘style’ => true,
‘valign’ => true,
‘width’ => true,
),
‘textarea’ => array(
‘cols’ => true,
‘rows’ => true,
‘disabled’ => true,
‘name’ => true,
‘readonly’ => true,
),
‘tfoot’ => array(
‘align’ => true,
‘char’ => true,
‘class’ => true,
‘charoff’ => true,
‘valign’ => true,
),
‘th’ => array(
‘abbr’ => true,
‘align’ => true,
‘axis’ => true,
‘bgcolor’ => true,
‘char’ => true,
‘charoff’ => true,
‘class’ => true,
‘colspan’ => true,
‘headers’ => true,
‘height’ => true,
‘nowrap’ => true,
‘rowspan’ => true,
‘scope’ => true,
‘valign’ => true,
‘width’ => true,
),
‘thead’ => array(
‘align’ => true,
‘char’ => true,
‘charoff’ => true,
‘class’ => true,
‘valign’ => true,
),
‘title’ => array(),
‘tr’ => array(
‘align’ => true,
‘bgcolor’ => true,
‘char’ => true,
‘charoff’ => true,
‘class’ => true,
‘style’ => true,
‘valign’ => true,
),
‘tt’ => array(),
‘u’ => array(),
‘ul’ => array (
‘class’ => true,
‘style’ => true,
‘type’ => true,
),
‘ol’ => array (
‘class’ => true,
‘start’ => true,
‘style’ => true,
‘type’ => true,
),
‘var’ => array(),
);}
Is there anything i should take out? For security reasons?
In reply to: bbPress Editor – Text Formatting Not Saving?I found a way to make it work without disabling filtering completely. I placed this in functions.php:
add_action(‘init’, ‘my_html_tags_code’, 10);
function my_html_tags_code() {
global $allowedposttags, $allowedtags;
//$allowedposttags[“ol”] = array();
//$allowedposttags[“ul”] = array();
$allowedtags[“ol”] = array();
$allowedtags[“ul”] = array();
$allowedtags[“li”] = array();
$allowedtags[“span”] = array( “style” => array() );
}Now i have another problem. I use the Ultimate TinyMCE plugin and i have many other buttons on my editor that don’t work (i.e. Add Images, Add Video, …etc)
How can i know what tags they are using so i can put them in the function above?
In reply to: bbPress Editor – Text Formatting Not Saving?wp-includes/kses.php seems to be the file that filters the content.
In reply to: bbPress Editor – Text Formatting Not Saving?@Stephen Edgar
After a week of testing I finally found the problem. I notice that when i change the user role to Editor and Administrator the editor works perfectly on both the backend and frontend. So i installed the User Role Editor plugin and checked the Unfiltered HTML setting and not everything works fine except for the fact that a message shows up for all users:
“Your account has the ability to post unrestricted HTML content.” – how can i get rid of it?
BTW…is this the best way to do it? I’m thinking it would be better to modify the way WP filters HTML instead of disabling filtering completely.
What do you say?
In reply to: Roles under username (.bbp-author-role)@synergywp1 I can’t get this to work…Can you post the whole code on PasteBin.com and share it? I would really appreciate it.
The topics show in the widgets when the user is logged in. But i don’t want them to show when logged out.
It’s there an easy solution? Like a filter or function.
In reply to: bbPress Editor – Text Formatting Not Saving?UPDATE: I also tried disabling all plugins (except bbpress) and activated Twenty Eleven theme. Still no different..
So this means it either a wordpress or a bbpress problem.
I would also like to mention that used this method to give wordpress it’s own directory and maybe the editor can’t access something. I dont know.
https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
Any other ideas?
In reply to: bbPress Editor – Text Formatting Not Saving?Hi Stephen,
Thanks for getting back to me. I tried using the Twenty Eleven theme and No difference.
I also tried disabling all plugins (except bbpress and buddypress) and the formatting still doesn’t get saved.
It’s obviously an issue with either bbpress or buddypress.
Any other ideas? It drives me crazy…I’ve been trying to find a solution for several months.
Thanks for your support,
AllenIn reply to: Hide topics from non-logged users? Please help…i still haven’t found a solution to this problem. can anyone help?
In reply to: Anyone good with .htaccess rules? Need some help…I posted my question on StackOverflow as well.
I have to find a solution fast because i’m currently losing a lot of SE traffic.
In reply to: Anyone good with .htaccess rules? Need some help…Hi Stephen. The bbpress built-in import tool didn’t work for me and paid the guys from gConverter.com to do it. They did a great job with the conversion and everything is working fine now.
Regarding the htaccess rules, i have no idea how to write them even after reading the resources you posted. So if there’s anyone here who can help, i would really appreciate it.
I would like to add that it the Ultimate TinyMCE editor works well with wordpress posts…It just doesn’t work with bbpress anymore (after last update).
@John James Jacoby
Ultimate TinyMCE buttons show up now after using your code but they don’t work.
I just created a new bbpress post and used the Ultimate TinyMCE’s buttons to make some text bold, change the font size, color, underline, etc.. and when i submitted the post only the bold text remained unchanged. All my other formatting (font size, color, underline) was not preserved and was lost after submission.
Please help.
In reply to: Remove Freshness Date In Forum & Topic Pages@rsanchez1 Thanks a lot. Your post made me even more confused at first because i’m new to WordPress and PHP but after reading it a couple of more times and actually implementing what you said it made sense and i managed to get it to work.
I used this code (please look at it and let me know if there are any errors):
————————————————————-
function remove_bbpress_forum_freshness_date( $anchor, $forum_id) {
$forum_id = bbp_get_forum_id( $forum_id );
$active_id = bbp_get_forum_last_active_id( $forum_id );if ( empty( $active_id ) ) {
$active_id = bbp_get_forum_last_reply_id( $forum_id );
}
if ( empty( $active_id ) ) {
$active_id = bbp_get_forum_last_topic_id( $forum_id );
}if (bbp_is_topic( $active_id ) ) {
$link_url = bbp_get_forum_last_topic_permalink( $forum_id );
} elseif ( bbp_is_reply( $active_id ) ) {
$link_url = bbp_get_forum_last_reply_url( $forum_id );
}return "View Post";
}
add_filter('bbp_get_forum_freshness_link', 'remove_bbpress_forum_freshness_date', 10, 2);
——————————————————–
function remove_bbpress_topic_freshness_date( $anchor, $topic_id) {
$link_url = bbp_get_topic_last_reply_url( $topic_id );
$time_since = bbp_get_topic_last_active_time( $topic_id );
if ( empty( $time_since ) ) {
return 'No Replies';
} else {
return "View Post";
}}
add_filter('bbp_get_topic_freshness_link', 'remove_bbpress_topic_freshness_date', 10, 2);
———————————————————-
I have one more question. I gave this more thought and i think it would be better if i replace “View Post” with the post’s title on the forums page(not topics).
To do this is have to change the first function above.
Any ideas how should i change the code to return the post’s title instead of View Post?
Thank you for your help. It’s very much appreciated.
In reply to: Remove Freshness Date In Forum & Topic PagesAnyone?
In reply to: Remove Freshness Date In Forum & Topic PagesManaged to make it work using this 2 functions:
function remove_bbpress_forum_freshness_date() {
return '';
}
add_filter('bbp_get_forum_freshness_link', 'remove_bbpress_forum_freshness_date');function remove_bbpress_topic_freshness_date() {
return '';
}
add_filter('bbp_get_topic_freshness_link', 'remove_bbpress_topic_freshness_date');But now i’m thinking to do something else. Instead of removing the date i want to rename it to something like “View Post”. The freshness date already links to the last post by default so i just want to rename it.
Do you know how can i do this?
In reply to: Remove Freshness Date In Forum & Topic PagesI tried to use div.forums-topic-datetime with display: none; but i can’t get it to work. Can you please post the whole code? I’m fairly new to CSS.
Regarding the PHP filers…I’m not sure how to do this either. Any help would be greatly appreciated.