[wp-hackers] User folders for themes, plug-ins

Charles lists07 at wiltgen.net
Thu Jan 18 02:12:23 GMT 2007


>> It would probably be easiest going forward if 2.1 created a new
>> non-user folder such as wp-system-content. That way existing
>> installations could be upgrade without changing the name of
>> or replacing the files in wp-content.
>
> That'd introduce a lot of complexity and break backwards
> compatibility in a lot of things.  

I know I'm oversimplifying, but isn't the gist of it checking for two
folders instead of one, and then deciding which has priority (probably user
themes but system plug-ins) in case of conflicts?

Now:

// If a plugin file does not exist, remove it from the list of active
// plugins.
foreach ($check_plugins as $check_plugin) {
	if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) {
		$current = get_option('active_plugins');
		$key = array_search($check_plugin, $current);
		if ( false !== $key && NULL !== $key ) {
			unset($current[$key]);
			update_option('active_plugins', $current);
		}
	}
}

If WordPress supported user folders:

// If a plugin file does not exist in either the system plug-ins
// folder or the user plug-ins folder, remove it from the list of
// active plugins.
foreach ($check_plugins as $check_plugin) {
	if (!file_exists(ABSPATH . PLUGINDIR . '/' . $check_plugin)) {
		$current = get_option('active_plugins');
		$key = array_search($check_plugin, $current);
		if ( false !== $key && NULL !== $key ) {
			unset($current[$key]);
			update_option('active_plugins', $current);
		}
	}
}
foreach ($check_plugins as $check_plugin) {
	if (!file_exists(ABSPATH . USERPLUGINDIR . '/' . $check_plugin)) {
		$current = get_option('active_plugins');
		$key = array_search($check_plugin, $current);
		if ( false !== $key && NULL !== $key ) {
			unset($current[$key]);
			update_option('active_plugins', $current);
		}
	}
}

-- Charles




More information about the wp-hackers mailing list