Wiki plugin (not lite), Absolutely no flexibility with the settings

Hi,

I was wondering if there was a way to limit the power of editing by a non-administrator. For an example, a non-admin level someone can easily edit and make a change where no one can edit a wiki, basically locking themselves out and any other non-member from editing the wiki. This would be a pain because then an admin would have to keep resetting to anyone can edit.

Also I would like to be able to have a non-admin member NOT have the "advanced" setting with the dashboard. I think I would only want the editing done from the front-end by non-admin members.

Anyway to do this otherwise, would be a great help!

Thanks,

Christer

  • Mason
    • DEV MAN’s Sidekick

    Hiya guys,

    We may look at making this definable in the options at some point.

    For now, you could create a new php file that would remove the page links via CSS.

    Just create a new PHP file (phpstyle.php) and add it to your theme's root directory. It should contain the following:

    .incsub_wiki_link_advanced_edit, .incsub_wiki_revisions {
    	<?php if ( !current_user_can( 'edit_themes' ) ) { echo( "display: none !important; \n" ); }
    	else { ?>
    <?php } ?>

    In your theme's header file add the following line:
    <link rel="stylesheet" href="phpstyle.php" type="text/css" />

    That should hide the tabs and revisions for everyone except site admins. Note that this is totally untested/supported and should be considered a 'hack', but it'll get the job done.

    Thanks!

  • christer
    • WPMU DEV Initiate

    Hey masonjames,

    Excellent, this is working, but not quite there yet. (Sorry for being a bug)

    How do I make it that

    You absolutely need to be logged in to edit and

    Only an admin can use the "advanced" tab and have the "Allow editing by" options that are in the simple front-end editor.

    The phpstyle.php file right now is still letting users who are logged in use the features above that I would like only admins to do, however it takes those features away from folks who are not logged in.

    So, right now, the interface I would like to have for logged in users is the one that the folks who are not logged in have.

    UG, I hope I don't sound wishy-washy,

    Thanks for all your help Masonjames,

    Christer

  • DebatewiseDave
    • Design Lord, Child of Thor

    Hi,

    I can't get this to work. When I check the source code I see

    .incsub_wiki_link_advanced_edit, .incsub_wiki_revisions {
    	<br />
    <b>Fatal error</b>:  Call to undefined function current_user_can() in <b>/home/debatene/public_html/wp-content/themes/twentyeleven-child/phpstyle.php</b> on line <b>3</b><br />

    Line 3 for me is:
    <?php if ( !current_user_can( 'edit_themes' ) ) { echo( "display: none !important; \n" ); }

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    This is probably because the code here is pretty old (almost a year). Are you using multisite? Try using this:

    .incsub_wiki_link_advanced_edit, .incsub_wiki_revisions {
    	<?php if ( !current_user_can( 'edit_theme_options' ) ) { echo( "display: none !important; \n" ); }
    	else { ?>
    <?php } ?>

    Let me know how it goes. Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.