• Resolved phantom.omaga

    (@phantomomaga)


    hi
    nice plugin great work .
    i wanted to know that can we make other bbcode or shortcode plugins so that the automatically work with bbpress2 shortcode whitelist and can be used in bbpress.
    for example i use this great plugin BBcode w editor which allows me to make or add bbcodes really easily so can i add some kind of support to this plugin so that it works automatically with bbPress2 shortcode whitelist without me manually adding the shortcodes or bbcdes in the bbPress2 shortcode whitelist filter through the admin page

    http://wordpress.org/extend/plugins/bbpress2-shortcode-whitelist/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter phantom.omaga

    (@phantomomaga)

    and the things is i have customized the BBcode w editor plugin a bit to match my needs so i really want to use it.

    Thread Starter phantom.omaga

    (@phantomomaga)

    i don’t mean to bump here but can i get a quicker reply

    Plugin Author antonchanning

    (@antonchanning)

    Sorry I wasn’t notified that their was a post here.

    To answer you, in the long term I can look into the BBcode w editor plugin to see if I can add support for that, or fork it to make it work with the whitelist properly. Some shortcode plugins allow their content to bypass the whitelist, allowing users to do something like [b][bbp-login][/b]. Not really bad but I have noticed doing that without the whitelist enabled ends a thread so no more posts can be made on it.

    If you can edit that plugin yourself, all the info you need to make it work with the whitelist is in the readme.txt

    If you aren’t that bothering in the short term, you can always add the codes manually in the whitelist settings.

    Plugin Author antonchanning

    (@antonchanning)

    From the FAQ:

    Q. I’m a shortcode plugin developer. How do I make my shortcodes safe?
    A. If your shortcodes contain no calls to do_shortcode($content), then they are probably already safe as far as I’m aware. If they do contain calls to do_shortcode($content), then you can make them safe by creating a function or class method in your plugin similar to:

    function yourplugin_do_shortcode($content) {
    if(function_exists(‘bbp_whitelist_do_shortcode’)) {
    return bbp_whitelist_do_shortcode($content);
    } else {
    return do_shortcode($content);
    }
    }
    And then replace calls to do_shortcode($content) inside your shortcode handlers with calls to this new function.

    Plugin Author antonchanning

    (@antonchanning)

    Also from the FAQ:

    Q. I’m a shortcode plugin developer. How do I self-declare my plugin?
    A. To self-declare your plugin to the shortcode whitelist plugin, include the following code somewhere in your plugin, changing the names, unique identifier and the array of safe to use in the forums shortcodes that your plugin provides:

    function yourplugin_get_shortcode_whitelist() {
    $plugin_name = ‘Your Plugin Name’;
    $plugin_author = ‘Plugin Author Name’;
    $shortcodes = array(‘test’,’test2′); //array of safe shortcodes the plugin provides.

    return array(‘name’=>$plugin_name,’tag’=>’your-plugin-unique-identifier’,’author’=>$plugin_author,’shortcodes’=>$shortcodes);
    }

    if(!isset($bbpscwl_selfdeclared_plugins)) $bbpscwl_selfdeclared_plugins = array();
    $bbpscwl_selfdeclared_plugins[] = yourplugin_get_shortcode_whitelist();

    Plugin Author antonchanning

    (@antonchanning)

    In the case of a plugin that can add custom bbcodes, you probably need to amend the function ‘yourplugin_get_shortcode_whitelist()’ described above to get your list of shortcodes from your settings rather than just hardcoding them. But otherwise, its as simple as that.

    Thread Starter phantom.omaga

    (@phantomomaga)

    ok thanks for your time on this i will try that and if em not successful i can always use the manual method.

    Plugin Author antonchanning

    (@antonchanning)

    I’m planning to improve the interface for adding and removing manual additions to the whitelist at some point, so I may be able to do some detection for this plugin then. It just sounds like a potential case where the admin doesn’t want an all shortcodes or none option.

    Thread Starter phantom.omaga

    (@phantomomaga)

    that sounds really good

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: bbPress2 shortcode whitelist] Auto support for other bbcodes or shor codes plugin’ is closed to new replies.