Changeset 724974
- Timestamp:
- 06/10/2013 03:59:29 PM (13 years ago)
- Location:
- advanced-settings
- Files:
-
- 1 added
- 2 deleted
- 2 edited
- 4 copied
-
tags/1.5.1 (copied) (copied from advanced-settings/trunk)
-
tags/1.5.1/class.resize.php (copied) (copied from advanced-settings/trunk/class.resize.php)
-
tags/1.5.1/index.php (copied) (copied from advanced-settings/trunk/index.php) (11 diffs)
-
tags/1.5.1/readme.txt (copied) (copied from advanced-settings/trunk/readme.txt) (3 diffs)
-
tags/1.5.1/screenshot-1.png (deleted)
-
tags/1.5.1/screenshot-2.png (deleted)
-
trunk/index.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/screenshot-3.png (added)
Legend:
- Unmodified
- Added
- Removed
-
advanced-settings/tags/1.5.1/index.php
r716355 r724974 6 6 Author: Arthur Araújo 7 7 Author URI: http://tutzstyle.com 8 Version: 1.5 8 Version: 1.5.1 9 9 */ 10 10 … … 13 13 // remove_filter('pre_user_description', 'wp_filter_kses'); 14 14 15 //Disable The “Please Update Now” Message On WordPress Dashboard 16 /*if (0&&!current_user_can('edit_users')) { 17 add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); 18 add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); 19 }*/ 20 15 21 if( is_admin() ) { 16 22 … … 26 32 function advset_update() { 27 33 34 // security 35 if( !current_user_can('manage_options') ) 36 return false; 37 28 38 $_POST['powerconfigs'] = $_POST; 29 39 unset( … … 38 48 $_POST['powerconfigs']['add_thumbs'] = '1'; 39 49 40 // save fields 50 $_POST['powerconfigs']['remove_filters'] = advset_option( 'remove_filters' ); 51 52 // save settings 41 53 register_setting( 'advanced-settings', 'powerconfigs' ); 42 54 … … 47 59 } 48 60 61 // save a advanced-settings option (using only by admin filters page) 62 function advset_save_option( $option_name, $value='' ) { 63 global $advset_options; 64 65 if( !isset($advset_options) ) 66 $advset_options = get_option('powerconfigs'); 67 68 $advset_options[$option_name] = $value; 69 70 update_option( 'powerconfigs', $advset_options ); 71 } 72 73 // get a advanced-settings option 49 74 function advset_option( $option_name, $default='' ) { 50 75 global $advset_options; … … 72 97 # ADMIN MENU 73 98 function advset_menu() { 74 add_options_page('Advanced settings', 'Advanced', 'manage_options', 'advanced-settings', 'advset_page'); 99 add_options_page(__('Advanced settings'), __('Advanced'), 'manage_options', 'advanced-settings', 'advset_page'); 100 add_options_page(__('Filters/Actions'), __('Filters/Actions'), 'manage_options', 'advanced-settings-filters', 'advset_page_filters'); 75 101 } 76 102 … … 527 553 } 528 554 555 # remove filters if not in filters admin page 556 $remove_filters = advset_option( 'remove_filters' ); 557 if( !isset($_GET['page']) 558 || $_GET['page']!='advanced-settings-filters' && is_array($remove_filters) ) { 559 560 if( isset($remove_filters) && is_array($remove_filters) ) 561 foreach( $remove_filters as $tag=>$array ) 562 if( is_array($array) ) 563 foreach( $array as $function=>$_ ) 564 //echo "$tag=>".$function.'<br />'; 565 remove_filter( $tag, $function ); 566 } 529 567 530 568 // translate to pt_BR … … 534 572 535 573 $advset_ptbr = array( 574 'Be careful, removing a filter can destabilize your system. For security reasons, no filter removal has efects over this page.' => 'Cuidado! Remover um filtro pode desestabilizar seu sistema. Por segurança, nenhum filtro removido terá efeito nesta página.', 575 'Filters/Actions' => 'Filtros/Ações', 536 576 'Save changes' => 'Salvar alterações', 537 577 'width' => 'largura', … … 585 625 // ----------------------------------------------------------------------- 586 626 587 588 # THE AMIND PAGE 589 function advset_page() { //$configs = get_option('powerconfigs'); ?> 627 add_action('wp_ajax_advset_filters', 'prefix_ajax_advset_filters'); 628 function prefix_ajax_advset_filters() { 629 //echo $_POST['tag'].' - '.$_POST['function']; 630 631 // security 632 if( !current_user_can('manage_options') ) 633 return false; 634 635 $remove_filters = (array) advset_option( 'remove_filters' ); 636 $tag = (string)$_POST['tag']; 637 $function = (string)$_POST['function']; 638 639 if( $_POST['enable']=='true' ) 640 unset($remove_filters[$tag][$function]); 641 else if ( $_POST['enable']=='false' ) 642 $remove_filters[$tag][$function] = 1; 643 644 advset_save_option( 'remove_filters', $remove_filters ); 645 646 //echo $_POST['enable']; 647 648 return true; 649 } 650 651 # THE ADMIN FILTERS PAGE 652 function advset_page_filters() { ?> 590 653 591 654 <div class="wrap"> … … 606 669 607 670 <div id="icon-options-general" class="icon32"><br></div> 608 <h2>Advanced settings</h2> 671 <h2><?php _e('Filters/Actions') ?> <sub style="color:red">beta</sub></h2> 672 673 <div> </div> 674 675 <div id="message" class="error"><?php _e('Be careful, removing a filter can destabilize your system. For security reasons, no filter removal has efects over this page.') ?></div> 676 677 <?php 678 global $wp_filter; 679 680 $hook=$wp_filter; 681 ksort($hook); 682 683 $remove_filters = (array) advset_option( 'remove_filters' ); 684 685 //print_r($remove_filters); 686 687 echo '<table id="advset_filters" style="font-size:90%"> 688 <tr><td> </td><td><strong>'.__('priority').'</strong></td></tr>'; 689 690 foreach($hook as $tag => $priority){ 691 echo "<tr><th align='left'>[<a target='_blank' href='http://wpseek.com/$tag/'>$tag</a>]</th></tr>"; 692 ksort($priority); 693 foreach($priority as $priority => $function){ 694 foreach($function as $function => $properties) { 695 696 $checked = isset($remove_filters[$tag][$function]) ? '': "checked='checked'"; 697 698 echo "<tr><td> <label><input type='checkbox' name='$tag' value='$function' $checked /> 699 $function</label> 700 <sub><a target='_blank' href='http://wpseek.com/$function/'>help</a></sub></td> 701 <td align='right'>$priority</td></tr>"; 702 } 703 } 704 echo '<tr><td> </td></tr>'; 705 } 706 echo '</table>'; 707 ?> 708 709 <script> 710 jQuery('#advset_filters input').click(function(){ 711 jQuery.post( '<?php echo admin_url('admin-ajax.php'); ?>', 712 { 713 'action':'advset_filters', 714 'tag':this.name, 715 'function':this.value, 716 'enable':this.checked 717 }, 718 function(response){ 719 //alert('The server responded: ' + response); 720 } 721 ); 722 }); 723 </script> 724 725 </div> 726 <?php 727 } 728 729 730 # THE ADMIN PAGE 731 function advset_page() { //$configs = get_option('powerconfigs'); ?> 732 733 <div class="wrap"> 734 735 <?php 736 $external_plugin_name = 'Advanced Settings'; 737 $external_plugin_url = 'http://tutzstyle.com/portfolio/advanced-settings/'; 738 ?> 739 <div style="float:right;width:400px"> 740 <div style="float:right; margin-top:10px"> 741 <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($external_plugin_url) ?>&layout=box_count&show_faces=false&width=450&action=like&font=arial&colorscheme=light&height=21" 742 scrolling="no" frameborder="0" style="overflow:hidden; width:90px; height:61px; margin:0 0 0 10px; float:right" allowTransparency="true"></iframe> 743 <strong style="line-height:25px;"> 744 <?php echo __("Do you like <a href=\"{$external_plugin_url}\" target=\"_blank\">{$external_plugin_name}</a> Plugin? "); ?> 745 </strong> 746 </div> 747 </div> 748 749 <div id="icon-options-general" class="icon32"><br></div> 750 <h2><?php _e('Advanced Settings'); ?></h2> 609 751 610 752 <form action="options.php" method="post"> … … 788 930 </form> 789 931 </div> 790 <? 932 <?php 791 933 } 792 934 -
advanced-settings/tags/1.5.1/readme.txt
r716352 r724974 4 4 Author URI: http://tutzstyle.com/ 5 5 Plugin URI: http://tutzstyle.com/portfolio/advanced-settings/ 6 Tags: settings, hacks, option, admin, menu, page, image, setting, images, google, analytics, compress, html, thumbnail, post type, auto save, seo, keywords, favicon, feedburner, compact, comments, remove comments, hide comments, author, resize at upload, auto post thumbnails 6 Tags: settings, hacks, option, admin, menu, page, image, setting, images, google, analytics, compress, html, thumbnail, post type, auto save, seo, keywords, favicon, feedburner, compact, comments, remove comments, hide comments, author, resize at upload, auto post thumbnails, filters 7 7 Requires at least: 3.0 8 8 Tested up to: 3.5.1 9 Stable tag: 1.5 9 Stable tag: 1.5.1 10 10 License: GPLv2 or later 11 11 Some advanced settings that are not provided by WordPress … … 15 15 This is an essential plugin for your WordPress websites: 16 16 17 * Remover especific actions/filters 17 18 * Resize image at upload 18 19 * Automatically generate the Post Thumbnail … … 54 55 1. Menu 55 56 2. The admin page 57 3. The Filters/Actions admin page 56 58 57 59 58 60 == Changelog == 61 62 = 1.5.1 = 63 * Actions/Filter admin page 59 64 60 65 = 1.5 = -
advanced-settings/trunk/index.php
r716355 r724974 6 6 Author: Arthur Araújo 7 7 Author URI: http://tutzstyle.com 8 Version: 1.5 8 Version: 1.5.1 9 9 */ 10 10 … … 13 13 // remove_filter('pre_user_description', 'wp_filter_kses'); 14 14 15 //Disable The “Please Update Now” Message On WordPress Dashboard 16 /*if (0&&!current_user_can('edit_users')) { 17 add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); 18 add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) ); 19 }*/ 20 15 21 if( is_admin() ) { 16 22 … … 26 32 function advset_update() { 27 33 34 // security 35 if( !current_user_can('manage_options') ) 36 return false; 37 28 38 $_POST['powerconfigs'] = $_POST; 29 39 unset( … … 38 48 $_POST['powerconfigs']['add_thumbs'] = '1'; 39 49 40 // save fields 50 $_POST['powerconfigs']['remove_filters'] = advset_option( 'remove_filters' ); 51 52 // save settings 41 53 register_setting( 'advanced-settings', 'powerconfigs' ); 42 54 … … 47 59 } 48 60 61 // save a advanced-settings option (using only by admin filters page) 62 function advset_save_option( $option_name, $value='' ) { 63 global $advset_options; 64 65 if( !isset($advset_options) ) 66 $advset_options = get_option('powerconfigs'); 67 68 $advset_options[$option_name] = $value; 69 70 update_option( 'powerconfigs', $advset_options ); 71 } 72 73 // get a advanced-settings option 49 74 function advset_option( $option_name, $default='' ) { 50 75 global $advset_options; … … 72 97 # ADMIN MENU 73 98 function advset_menu() { 74 add_options_page('Advanced settings', 'Advanced', 'manage_options', 'advanced-settings', 'advset_page'); 99 add_options_page(__('Advanced settings'), __('Advanced'), 'manage_options', 'advanced-settings', 'advset_page'); 100 add_options_page(__('Filters/Actions'), __('Filters/Actions'), 'manage_options', 'advanced-settings-filters', 'advset_page_filters'); 75 101 } 76 102 … … 527 553 } 528 554 555 # remove filters if not in filters admin page 556 $remove_filters = advset_option( 'remove_filters' ); 557 if( !isset($_GET['page']) 558 || $_GET['page']!='advanced-settings-filters' && is_array($remove_filters) ) { 559 560 if( isset($remove_filters) && is_array($remove_filters) ) 561 foreach( $remove_filters as $tag=>$array ) 562 if( is_array($array) ) 563 foreach( $array as $function=>$_ ) 564 //echo "$tag=>".$function.'<br />'; 565 remove_filter( $tag, $function ); 566 } 529 567 530 568 // translate to pt_BR … … 534 572 535 573 $advset_ptbr = array( 574 'Be careful, removing a filter can destabilize your system. For security reasons, no filter removal has efects over this page.' => 'Cuidado! Remover um filtro pode desestabilizar seu sistema. Por segurança, nenhum filtro removido terá efeito nesta página.', 575 'Filters/Actions' => 'Filtros/Ações', 536 576 'Save changes' => 'Salvar alterações', 537 577 'width' => 'largura', … … 585 625 // ----------------------------------------------------------------------- 586 626 587 588 # THE AMIND PAGE 589 function advset_page() { //$configs = get_option('powerconfigs'); ?> 627 add_action('wp_ajax_advset_filters', 'prefix_ajax_advset_filters'); 628 function prefix_ajax_advset_filters() { 629 //echo $_POST['tag'].' - '.$_POST['function']; 630 631 // security 632 if( !current_user_can('manage_options') ) 633 return false; 634 635 $remove_filters = (array) advset_option( 'remove_filters' ); 636 $tag = (string)$_POST['tag']; 637 $function = (string)$_POST['function']; 638 639 if( $_POST['enable']=='true' ) 640 unset($remove_filters[$tag][$function]); 641 else if ( $_POST['enable']=='false' ) 642 $remove_filters[$tag][$function] = 1; 643 644 advset_save_option( 'remove_filters', $remove_filters ); 645 646 //echo $_POST['enable']; 647 648 return true; 649 } 650 651 # THE ADMIN FILTERS PAGE 652 function advset_page_filters() { ?> 590 653 591 654 <div class="wrap"> … … 606 669 607 670 <div id="icon-options-general" class="icon32"><br></div> 608 <h2>Advanced settings</h2> 671 <h2><?php _e('Filters/Actions') ?> <sub style="color:red">beta</sub></h2> 672 673 <div> </div> 674 675 <div id="message" class="error"><?php _e('Be careful, removing a filter can destabilize your system. For security reasons, no filter removal has efects over this page.') ?></div> 676 677 <?php 678 global $wp_filter; 679 680 $hook=$wp_filter; 681 ksort($hook); 682 683 $remove_filters = (array) advset_option( 'remove_filters' ); 684 685 //print_r($remove_filters); 686 687 echo '<table id="advset_filters" style="font-size:90%"> 688 <tr><td> </td><td><strong>'.__('priority').'</strong></td></tr>'; 689 690 foreach($hook as $tag => $priority){ 691 echo "<tr><th align='left'>[<a target='_blank' href='http://wpseek.com/$tag/'>$tag</a>]</th></tr>"; 692 ksort($priority); 693 foreach($priority as $priority => $function){ 694 foreach($function as $function => $properties) { 695 696 $checked = isset($remove_filters[$tag][$function]) ? '': "checked='checked'"; 697 698 echo "<tr><td> <label><input type='checkbox' name='$tag' value='$function' $checked /> 699 $function</label> 700 <sub><a target='_blank' href='http://wpseek.com/$function/'>help</a></sub></td> 701 <td align='right'>$priority</td></tr>"; 702 } 703 } 704 echo '<tr><td> </td></tr>'; 705 } 706 echo '</table>'; 707 ?> 708 709 <script> 710 jQuery('#advset_filters input').click(function(){ 711 jQuery.post( '<?php echo admin_url('admin-ajax.php'); ?>', 712 { 713 'action':'advset_filters', 714 'tag':this.name, 715 'function':this.value, 716 'enable':this.checked 717 }, 718 function(response){ 719 //alert('The server responded: ' + response); 720 } 721 ); 722 }); 723 </script> 724 725 </div> 726 <?php 727 } 728 729 730 # THE ADMIN PAGE 731 function advset_page() { //$configs = get_option('powerconfigs'); ?> 732 733 <div class="wrap"> 734 735 <?php 736 $external_plugin_name = 'Advanced Settings'; 737 $external_plugin_url = 'http://tutzstyle.com/portfolio/advanced-settings/'; 738 ?> 739 <div style="float:right;width:400px"> 740 <div style="float:right; margin-top:10px"> 741 <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($external_plugin_url) ?>&layout=box_count&show_faces=false&width=450&action=like&font=arial&colorscheme=light&height=21" 742 scrolling="no" frameborder="0" style="overflow:hidden; width:90px; height:61px; margin:0 0 0 10px; float:right" allowTransparency="true"></iframe> 743 <strong style="line-height:25px;"> 744 <?php echo __("Do you like <a href=\"{$external_plugin_url}\" target=\"_blank\">{$external_plugin_name}</a> Plugin? "); ?> 745 </strong> 746 </div> 747 </div> 748 749 <div id="icon-options-general" class="icon32"><br></div> 750 <h2><?php _e('Advanced Settings'); ?></h2> 609 751 610 752 <form action="options.php" method="post"> … … 788 930 </form> 789 931 </div> 790 <? 932 <?php 791 933 } 792 934 -
advanced-settings/trunk/readme.txt
r716352 r724974 4 4 Author URI: http://tutzstyle.com/ 5 5 Plugin URI: http://tutzstyle.com/portfolio/advanced-settings/ 6 Tags: settings, hacks, option, admin, menu, page, image, setting, images, google, analytics, compress, html, thumbnail, post type, auto save, seo, keywords, favicon, feedburner, compact, comments, remove comments, hide comments, author, resize at upload, auto post thumbnails 6 Tags: settings, hacks, option, admin, menu, page, image, setting, images, google, analytics, compress, html, thumbnail, post type, auto save, seo, keywords, favicon, feedburner, compact, comments, remove comments, hide comments, author, resize at upload, auto post thumbnails, filters 7 7 Requires at least: 3.0 8 8 Tested up to: 3.5.1 9 Stable tag: 1.5 9 Stable tag: 1.5.1 10 10 License: GPLv2 or later 11 11 Some advanced settings that are not provided by WordPress … … 15 15 This is an essential plugin for your WordPress websites: 16 16 17 * Remover especific actions/filters 17 18 * Resize image at upload 18 19 * Automatically generate the Post Thumbnail … … 54 55 1. Menu 55 56 2. The admin page 57 3. The Filters/Actions admin page 56 58 57 59 58 60 == Changelog == 61 62 = 1.5.1 = 63 * Actions/Filter admin page 59 64 60 65 = 1.5 =
Note: See TracChangeset
for help on using the changeset viewer.