Changeset 643133
- Timestamp:
- 12/21/2012 09:06:48 PM (13 years ago)
- Location:
- remove-inactive-widgets/trunk
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
readme.txt (modified) (2 diffs)
-
remove-inactive-widgets.php (modified) (2 diffs)
-
riw.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
remove-inactive-widgets/trunk
-
Property
svn:ignore
set to
.git
.gitignore
-
Property
svn:ignore
set to
-
remove-inactive-widgets/trunk/readme.txt
r384882 r643133 4 4 Tags: widgets, removal, inactive 5 5 Requires at least: 3.0 6 Tested up to: 3. 1.17 Stable tag: 0.2 6 Tested up to: 3.5 7 Stable tag: 0.2.1 8 8 9 9 This plugin adds a button to the widget's admin page that will delete all inactive widgets. … … 28 28 29 29 == Changelog == 30 31 - 0.2.1 32 Update code 33 Verify working in 3.5 30 34 31 35 = 0.2 = -
remove-inactive-widgets/trunk/remove-inactive-widgets.php
r384882 r643133 3 3 Plugin Name: Remove Inactive Widgets 4 4 Plugin URI: http://benjaminsterling.com/wordpress-plugins/remove-inactive-widgets/ 5 Description: 6 Version: 0.2 5 Description: This plugin adds a button to the widget's admin page that will delete all inactive widgets. 6 Version: 0.2.1 7 7 Author: Benjamin Sterling 8 8 Author URI: http://kenzomedia.com … … 27 27 28 28 function riw_admin_print_scripts( $arg ){ 29 global $pagenow;30 if (is_admin() && $pagenow == 'widgets.php') {31 $js = plugins_url('/riw.js', __FILE__ );32 wp_enqueue_script("riwscript", $js );33 }29 global $pagenow; 30 if (is_admin() && $pagenow == 'widgets.php') { 31 $js = plugins_url('/riw.js', __FILE__ ); 32 wp_enqueue_script("riwscript", $js ); 33 } 34 34 } 35 35 36 36 function riw_async(){ 37 $widgets = get_option('sidebars_widgets');38 $widgets['wp_inactive_widgets'] = array();39 update_option('sidebars_widgets', $widgets);37 $widgets = get_option('sidebars_widgets'); 38 $widgets['wp_inactive_widgets'] = array(); 39 update_option('sidebars_widgets', $widgets); 40 40 } 41 41 42 42 function riw_add_action(){ 43 wp_nonce_field( 'riw_asyncnonce', 'riw_asyncnonce' );43 wp_nonce_field( 'riw_asyncnonce', 'riw_asyncnonce' ); 44 44 } 45 45 -
remove-inactive-widgets/trunk/riw.js
r384882 r643133 1 1 (function( $ ){ 2 $(document)3 .ready(4 function(){2 $(document) 3 .ready( 4 function () { 5 5 6 var wp_inactive_widgets = $('#wp_inactive_widgets'), 7 btn = $('<a href="#" class="button">Remove inactive widgets</a>') 8 .insertAfter( wp_inactive_widgets ); 9 10 btn.wrap( 11 '<p class="description" style="clear:both;line-height: 26px;">Press the following button will remove all of these inactive widgets </p>' 12 ); 13 14 btn 15 .click( 16 function(){ 17 jQuery.post(ajaxurl, { 18 action: 'riw_async', 19 riw_asyncnonce: jQuery('#riw_asyncnonce').val() 20 }, function(data) { 21 wp_inactive_widgets.empty(); 22 }); 23 } 24 ); 25 } 26 ); 6 var 7 wp_inactive_widgets = $('#wp_inactive_widgets'), 8 btn = $('<a href="#" class="button">Remove inactive widgets</a>') 9 .insertAfter( wp_inactive_widgets ); 10 11 btn.wrap( 12 '<p class="description" style="clear:both;line-height: 26px;">Press the following button will remove all of these inactive widgets </p>' 13 ) 14 .click( 15 function () { 16 $.post( 17 ajaxurl, { 18 action : 'riw_async', 19 riw_asyncnonce : $('#riw_asyncnonce').val() 20 }, 21 function (data) { 22 wp_inactive_widgets.empty(); 23 } 24 ); 25 } 26 ); 27 } 28 ); 27 29 })(jQuery);
Note: See TracChangeset
for help on using the changeset viewer.