Skip to:

Plugin custom pages

  • Can plugins have their own standalone pages?

    I have a very basic plugin that attempts to do this, but it displays both my output, and then the entire index page below it. I suspect this has something to do with the ‘bb_get_location’ function, but I don’t know how to resolve it.


    include_once(rtrim(dirname(__FILE__),' /\').'/my-plugin-core.php');
    if (isset($_GET['my-plugin'])) {
    add_action( 'bb_init', 'display_deals');


    echo "Example";

    Can someone tell me the proper way to do this? Do I need to link directly into the ‘/bb-plugins/my-plugin/’ directory?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Okay, I ended up going a totally different route with this, I don’t know that it will work for everyone or if it is “proper”, but it works for me.

    my-plugin.php now has:


    From there I check if the user is authenticated as an admin with:


    After that I just call ‘my-function();’

    I will use mod_rewrite to make the URL less ridiculous.

    Alright, now I am having *serious* issues getting Rewrite Rules to work.

    I’ve done these dozens of times and they aren’t particular complicated, here is a brief example of what I am trying to do:

    RewriteBase /
    RewriteRule ^example/?$ /forum/bb-plugins/example/example.php [NC,L]

    Accessing ‘; directly works perfectly. Accessing from ‘; does a redirect to ‘;.

    There are NO other rewrite rules active. I even disabled those from bbpress to try to track down what is happening. But some sort of 302 redirect keeps occurring. Is bbpress triggering this internally somehow?

    A friend of mine helped me to determine this *is* being done by bbpress, most likely as some referral rule system. How do I get around this? I would like to be able to access my page from a rewritten URL.


    bb_auth(); in ‘’ is causing this redirection problem.

    I appear to be failing at the line:

    if ( !bb_validate_auth_cookie( '', $scheme ) ) {

    I’ll have to look into bb_validate_auth_cookie() to see where that leads.

    Well, I replaced the:


    line with:

    if (!bb_current_user_can('administrate')) {bb_auth();}

    Hopefully that is secure, everything seems to work now. Huzzah!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar