The MU forums have moved to WordPress.org

REQ: special rewrite rule for extensions (2 posts)

  1. nexia
    Member
    Posted 7 years ago #

    i've tested several modifications to the core, but none was working properly regarding a new rule to add to the rewrite process, so i'd like to see if it's possible to write one here...

    the goal, display the content of a static page like it would be a real "page" inside wp, but not having to create that page, because it cause too much process from the users.

    so if mysite.com/blogname/show/stats

    /show/ is the rewrite rule to call the /stats*

    like for the /page/ rule, it would simply call the show.php template and display the content of the /stats* thing in it...

    my way to see it is that if we add a new plugin that require this feature, the coder simply have to create a function like show_stats() that would return the content, and the template show.php looks something like:
    <?php get_header() ?>
    <div id="container">
    <div id="content" class="hfeed">
    <?php

    $resync_show = 'show_' . $_REQUEST['show'];
    echo $resync_show();

    ?>
    </div>
    <!-- #content .hfeed -->
    </div>
    <!-- #container -->
    <?php get_sidebar() ?>
    <?php get_footer() ?>

    easy to understand ???

    i have most of the things working properly, like creating the rewrite rule as a plugin... but the other details need to be inside the core code, and not all the lines are working properly...

    can someone help?

  2. nexia
    Member
    Posted 7 years ago #

    for the ones who would ask "why ?"

    let's say i have a wpmu with kids having their blogs in... i don't want them to create pages with external content like stats, useronline, etc...

    and i don't want the pages to be linked inside the wp-content or elsewhere... i need cute-urls.

    and i'm sure i'm not the only one. and i'm sure once it would work, many addons would come like widgets.

    example: having the lesterchan useronline linked to a php file deep inside the wp-content directory is not bright... all these tools that have hardcoded files are to be displayed like a page anyway, so we need this feature.

About this Topic