Frank, using current_user_can('edit_plugins') is not a good idea, if the constant is set the plugin will throw the permissions error in its option page.
Would be glad to hear your opinion in this Q&A.
cheers!
Frank, using current_user_can('edit_plugins') is not a good idea, if the constant is set the plugin will throw the permissions error in its option page.
Would be glad to hear your opinion in this Q&A.
cheers!
ok, the solution I mention there would be something like:
if ( current_user_can('edit_pluginss') ) {
searchandreplace_action();
} else {
if( !defined('DISALLOW_FILE_EDIT') )
wp_die('<div class="error"><p>' . __('You do not have sufficient permissions to edit plugins for this blog.', FB_SAR_TEXTDOMAIN) . '</p></div>');
else
wp_die('<div class="error"><p>' . __('This plugin cannot work when DISALLOW_FILE_EDIT is set as true in wp-config.php .', FB_SAR_TEXTDOMAIN) . '</p></div>');
}
Also, updated the codex with your input, considering the situation where a plugin author that needs to check for this capability. So you can still request the edit_plugins capability but display an appropriate error message.
solved in 2.6.4
You must log in to post.