GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Wordpress question (https://gfy.com/showthread.php?t=1026500)

iwantchixx 06-14-2011 05:44 AM

Wordpress question
 
How does one give access to a certain plugin to only a specific user on wordpress while blocking other users from being able to use it?

Running Wp 3.1.x

iwantchixx 06-14-2011 05:45 AM

.. or ..
How does one only allow certain users to be able to embed an iframe code? Tips on either question will solve the dilema.

Thanks.

fris 06-14-2011 06:10 AM

i would create a role and do it based on that, and filter out iframe codes via the editor using a filter.

iwantchixx 06-14-2011 06:14 AM

After much plugin database searching I actually just found, activated and configured a plugin that works great. Funny how one finds the answer right after asking for help lol

A plugin called "multisite-plugin-manager" did the trick and allowed me to just activate an iframe loader on a trusted user's site manually.

fris 06-14-2011 06:24 AM

ahh ok, didnt know you were doing multisite.

Code:


<?php

// only admins will be allowed to post iframes or else it will strip them.
// have a peek at http://codex.wordpress.org/Roles_and_Capabilities
// set it to whatever level you want to be able to iframe

if ( !current_user_can('manage_options') ) {

function remove_iframe($content) {
    $content = get_the_content();
    $content = apply_filters('the_content', $content);
    $pattern = '/(<iframe.+?>)/';
    $content = preg_replace($pattern, '', $content);
    return $content;
}

add_filter('the_content','remove_iframe');

}

probably something like this without a plugin.


All times are GMT -7. The time now is 07:01 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123