Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/06/2018 10:47:08 AM (8 years ago)
Author:
imath
Message:

BP Nouveau: restrict the allowed HTML tags for Messages.

BP Nouveau is using the WP Editor to improve the user experience of the Messages component when people are writing a new message or replying to a thread. So far allowed HTML tags for the messages content *when BP Nouveau is the active template pack* were the same than WordPress Posts. When BP Nouveau is not the active template pack, the allowed tags are those of the WordPress global .

This commit is introducing a new function that is used to filter the allowed HTML tags for activity content and message content. It extends the with new tags (img, span, ul, ol & li) and leaves specific functions to the 2 components to include filters so that it is possible to restrict/extend allowed HTML tags for both content types or one of them. It also restricts the WP Editor available buttons when used into the BP Nouveau Messages UI so that they are consistent with the allowed HTML tags.

Props DJPaul

Fixes #7795

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/common/js-templates/messages/index.php

    r12058 r12067  
    4242<script type="text/html" id="tmpl-bp-messages-editor">
    4343    <?php
    44     // Temporarily filter the editor
    45     add_filter( 'mce_buttons', 'bp_nouveau_mce_buttons', 10, 1 );
     44    // Add a temporary filter on editor buttons
     45    add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    4646
    4747    wp_editor(
     
    5959        )
    6060    );
    61     // Temporarily filter the editor
    62     remove_filter( 'mce_buttons', 'bp_nouveau_mce_buttons', 10, 1 );
     61    // Remove the temporary filter on editor buttons
     62    remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    6363    ?>
    6464</script>
Note: See TracChangeset for help on using the changeset viewer.