| Issue 284: | K2 should disable WordPress' Widgets | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
Please read this first: http://code.google.com/p/kaytwo/wiki/HowtoFileanIssue If this is a bug, what steps will reproduce the problem? 1. Install bleeding edge WordPress. 2. Use K2 theme. 3. What did you expect to happen? What does happen?: Expected to see Sidebar Modules present on blog page and the presence of the admin area, Presentation > K2 Sidebar Modules. Neither of which show up under these circumstances. SVN revision or version used (not 'latest')?: K2 (334) Version of WordPress used?: 2.3-alpha (rev 5363) If this is available online, what is the URI?: Please provide any additional information below: http://trac.wordpress.org/ticket/4201 It might be useful for K2 to somehow integrate a: remove_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); to cancel out the activation of the WordPress Widgets. Using the "fix" on Trac or the remove_action here, seems to solve the problem and displays things as they should... |
||||||||||||
,
May 01, 2007
I'm not skilled enough to figure out how to make it work within the theme...so I made this simple Disable WordPress Widgets plugin. |
|||||||||||||
,
Sep 02, 2007
I want to see this plugin included in K2 as an option.
Status: Accepted
Labels: -Priority-Medium Priority-Critical Milestone-Release1.0 |
|||||||||||||
,
Sep 02, 2007
Soon after I attached this plugin, I added it to the WordPress plugin area: http://wordpress.org/extend/plugins/disable-wordpress-widgets/ Integrate as you see fit. |
|||||||||||||
,
Sep 14, 2007
Looking for a way to activate that plugin snippet automatically when K2 is activated.
Owner: heilemann
|
|||||||||||||
,
Sep 19, 2007
(No comment was entered for this change.)
Summary: K2 should disable WordPress' Widgets
|
|||||||||||||
,
Sep 19, 2007
Feel free to shoot down this premise...
Arrr! Slap something like the following within app/display/options.php. When someone
configures K2, a background process starts up (if necessary).
// check to see if Disable WordPress Widgets exists
if (!file_exists(ABSPATH . PLUGINDIR . '/' .
disable-wordpress-widgets/disable-wordpress-widgets.php)) { install_the_plugin();
}
function install_the_plugin() {
global $wpdb;
echo 'Installing Disable WordPress Widgets plugin now.';
exec("cp -r
/Applications/MAMP/htdocs/wordpress23/wp-content/themes/kaytwo/disable-wordpress-widgets
/Applications/MAMP/htdocs/wordpress23/wp-content/plugins/");
$wpdb->query("UPDATE $wpdb->options SET option_value =
'a:1:{i:0;s:55:\"disable-wordpress-widgets/disable-wordpress-widgets.php\";}' WHERE
option_name = 'active_plugins'");
}
The path determination needs to be cleaned and the tricky part is the update itself.
The above update assumes that there are no currently active plugins.
The option_value would need to be sliced and diced if there were multiple plugins active.
For instance, here's three plugins:
a:3:{i:0;s:19:"akismet/akismet.php";i:1;s:29:"disable-wordpress-widgets.php";i:2;s:9:"hello.php";}
Here's just dww plugin:
a:1:{i:0;s:55:"disable-wordpress-widgets/disable-wordpress-widgets.php";}
If the plugin wasn't there already, one would have to grab the existing
active_plugins' option_value string and the single dww option_value so that it
increments the first a:[number of plugins] and each i:[position value for each
plugin] would need to have the correct value (and appropriately placed in the correct
order).
Easy. Aye.
|
|||||||||||||
,
Sep 19, 2007
Correction...
if (!file_exists(ABSPATH . PLUGINDIR .
'/disable-wordpress-widgets/disable-wordpress-widgets.php')) { install_my_plugin();
}
|
|||||||||||||
,
Sep 19, 2007
I got it t' work. It's probably lackin' some logic checkin', but it works. Woo! Just need t' make aye folks immediately 'Configure K2' followin' their selection o' t' K2 theme. |
|||||||||||||
,
Sep 20, 2007
Or, you can go with Ben's method in r476... |
|||||||||||||
,
Sep 20, 2007
Should be done in r480. It's a little... involved.
Status: Fixed
|
|||||||||||||
,
Sep 20, 2007
Looks great Ben. Nice job. I don't think it's worthy of a starting a new issue, but could you change any instance of 'Wordpress' to 'WordPress' throughout the K2? There's a few of them... Thanks again. I'm sure the K2 community will be pleased -- obsoleting K2's usage of Disable WordPress Widgets is a good thing. |
|||||||||||||
,
Sep 20, 2007
"Should be done in r480" When will this be made available? Thanks, Stefan |
|||||||||||||
,
Sep 20, 2007
It's available. http://code.google.com/p/kaytwo/source |
|||||||||||||
|
|
|||||||||||||