From 073851155c2c82d95b8feb609655092062d7af9c Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Sun, 23 Jun 2013 20:38:08 +0200 Subject: [PATCH] Widget Logic 0.56 --- .../languages/widget-logic-de_DE.mo | Bin 0 -> 2289 bytes .../languages/widget-logic-de_DE.po | 95 ++++++++++++++++ .../languages/widget-logic-es_ES.mo | Bin 0 -> 2790 bytes .../languages/widget-logic-es_ES.po | 103 ++++++++++++++++++ .../widget-logic/languages/widget-logic.pot | 101 +++++++++++++++++ wp-content/plugins/widget-logic/readme.txt | 34 +++++- .../plugins/widget-logic/widget_logic.php | 86 +++++++++------ 7 files changed, 380 insertions(+), 39 deletions(-) create mode 100755 wp-content/plugins/widget-logic/languages/widget-logic-de_DE.mo create mode 100755 wp-content/plugins/widget-logic/languages/widget-logic-de_DE.po create mode 100755 wp-content/plugins/widget-logic/languages/widget-logic-es_ES.mo create mode 100755 wp-content/plugins/widget-logic/languages/widget-logic-es_ES.po create mode 100755 wp-content/plugins/widget-logic/languages/widget-logic.pot diff --git a/wp-content/plugins/widget-logic/languages/widget-logic-de_DE.mo b/wp-content/plugins/widget-logic/languages/widget-logic-de_DE.mo new file mode 100755 index 0000000000000000000000000000000000000000..bd86287675df0d83d018217eff30f98c62a62cac GIT binary patch literal 2289 zcmca7#4?qEfq_Acfq_AWfq~%+0|SFB0|P@1BS@5i;R7QBgERvJ!$(F2h9m|C23{rx z1~Uc*h5{xAhEN6uhUH8Q415d>41b|C4>JRU2m=FyG&2K(Ap--00W$*w7Xt%B5;FsX z1Oo#@E;9pzGXn!d8#4m~KLZ29DP{%+eFg@GTg(g$k_-$CTr3O>atsU%Dl8E7&MXk~ zVptd$1Q{3@3RxH!gcukYnpqeagc%qZrm;ZWy^4i_;S~b|!*Lb{24w~YhE1#t4228~ z4A)p07#tWF7(Cb*7!nv57&_S?=DmW_|Jfk+h_Ev-XfrS{=&~~~a5FG4M6xq5$TKi7 zq_Q(GgflQOw6ZfWh%zuR++}B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I3c`)Z;mE~+k$K&~nO7krGq0*N?eL!T)I0{a!+X+86jC$uQu7q@QcF|wK&c;D zokB`#o<d3~C~u^Il;tX<W~Qftlso6Aq$=c<mQ<zYDP$++<rSCcDR_gFpk`~o(vqsu zymW=U!`n(S)AbmFOHxZyi&CMAiWPD*OCZ_WDHRk#rFrSax*>__#d-?inV>9Po(Rj| zI-m@$#}JlURCRb;dTLRLLP}<;f>UZ@QBrDV3CNC=(xT)Huqbj!C?sVTD<tMAl%*CG zCud})rljVjDg>0~WtXHXq@)&ueC(5$l3JEul%ANEUd#YVys3E#so-3nnOc;ZhY*CM zW{6;DUi#rZIVG9tsjw6ePE(l-;XY6SQ0go#1_yAFLP%;wNlIc#YNi6RA)wMPTOlVg zB{h!$5`GW|6hq8XNGwfDPc1*ZBqOJUAvm?93gT^NNWKq*=6g`M7b}E-3WZ{Ys?wsv zdy=yil0be^07n}%xS>UDVrg-DYTDsF8AT-u<(Wk(DDEvTNX<;nNG-}k5zWlQ@C1@V zkn2*x3KT$@DpMit@SY-Y(t#9}46a3K`8nzEf&uC^crcVOfRYK8(!nhgt#p8dO==!P zUSe`aN@^~|&kE_O-~d!8FD*(*Wys7`2u{r`NzGI6aCLNX4Pq!y&C62&6%jCXnZ+eg WL8NjbwM0Q9xFj(zC9x<)lK}u<G^B0- literal 0 HcmV?d00001 diff --git a/wp-content/plugins/widget-logic/languages/widget-logic-de_DE.po b/wp-content/plugins/widget-logic/languages/widget-logic-de_DE.po new file mode 100755 index 000000000..1f2b755d1 --- /dev/null +++ b/wp-content/plugins/widget-logic/languages/widget-logic-de_DE.po @@ -0,0 +1,95 @@ +# Translation of Widget Logic in German +# This file is distributed under the same license as the Widget Logic package. +msgid "" +msgstr "" +"PO-Revision-Date: 2012-12-17 22:14:30+0000\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: GlotPress/0.1\n" +"Project-Id-Version: Widget Logic\n" + +#: widget_logic.php:96 +msgid "Success! Options file imported" +msgstr "Erfolg! Options-Datei importiert" + +#: widget_logic.php:99 +msgid "Invalid options file" +msgstr "Ungültige Options-Datei" + +#: widget_logic.php:104 +msgid "No options file provided" +msgstr "Keine Options-Datei aufgewählt" + +#: widget_logic.php:5 +msgid "Control widgets with WP's conditional tags is_home etc" +msgstr "Steuere Widgets mit WP's Bedingungs-Tags. Wie etwa is_home, etc." + +#: widget_logic.php:204 +msgid "Load all WL options from a plain text config file" +msgstr "WL Optionen aus einer Textdatei importieren" + +#: widget_logic.php:20 +msgid "when all PHP loaded" +msgstr "wenn PHP geladen ist" + +#: widget_logic.php:21 +msgid "during page header" +msgstr "im Seiten HEADER" + +#: widget_logic.php:178 +msgid "Add 'widget_content' filter" +msgstr "'widget_content' Filter hinzufügen" + +#: widget_logic.php:183 +msgid "Use 'wp_reset_query' fix" +msgstr "Nutze 'wp_reset_query' Fix" + +#: widget_logic.php:18 +msgid "when plugin starts (default)" +msgstr "wenn Plugin startet (Standard)" + +#: widget_logic.php:19 +msgid "after theme loads" +msgstr "nachdem Theme geladen wurde" + +#: widget_logic.php:173 +msgid "Widget Logic options" +msgstr "Widget Logic Optionen" + +#: widget_logic.php:176 +msgid "Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality." +msgstr "Fügt einen neuen WP Filter hinzu den du in deinem eigenen Code nutzen kannst. Keine Widget Logic Nutzung nötig." + +#: widget_logic.php:181 +msgid "Resets a theme's custom queries before your Widget Logic is checked" +msgstr "Setzt die Custom Queries eines Themes zurück bevor deine Widget Logic ausgeführt wird" + +#: widget_logic.php:186 +msgid "Delays widget logic code being evaluated til various points in the WP loading process" +msgstr "Verzögert die Bearbeitung durch die Widget Logic bis an verschiedene Punkte des WP Ladevorgangs" + +#: widget_logic.php:186 +msgid "Load logic" +msgstr "Logik laden" + +#: widget_logic.php:199 +msgid "Save WL options" +msgstr "WL Optionen speichern" + +#: widget_logic.php:203 +msgid "Export options" +msgstr "Optionen exportieren" + +#: widget_logic.php:203 +msgid "Save all WL options to a plain text config file" +msgstr "WL Optionen in einer Textdatei speichern" + +#: widget_logic.php:204 +msgid "Import options" +msgstr "Optionen importieren" + +#: widget_logic.php:205 +msgid "Select file for importing" +msgstr "Wähle eine Datei für den Import" \ No newline at end of file diff --git a/wp-content/plugins/widget-logic/languages/widget-logic-es_ES.mo b/wp-content/plugins/widget-logic/languages/widget-logic-es_ES.mo new file mode 100755 index 0000000000000000000000000000000000000000..c10cf6b8102167116089ab44ec584d3bc062f054 GIT binary patch literal 2790 zcmca7#4?qEfq_Akfq_AWfq~%&0|SFB0|P@2BS@5i;Q=E9gERvJ!$U>}h9m|ChQEvq z4517R3<*pO415d>4BMdeQ6>fk5e5c^D@+Uwh71f0FPRt^xEL51q?s8QBp4VN)R-9< zoEaDx?3o!D_!$@&nwc3G^cff!CNncINHQ=m9A;)<kYiwAxC>SPhZ$m?C<_CFAOiz~ z77GJ|5Ca2)4GRN<FaraFKMTaY$t(;EHcSi*4J-@{N(>APd)XKmrZF%uJYZvB$YWq& zC})T0e+H$0utV(O;$UFNW?*2@<X~VBV_;yI%E7>(%fP^}hJ%42k%58X76$`^0?0m2 z28K)q28LKp1_nh228QFDQ2%j4+%3%o@t-Ld1A{mN1A`wI#GEuP1_liV28Jn6dM_6P z12jk(*cl*h5@29p;ADXKix(2yC?p#LBn&}u1M)LW5)|&BFl1$bgb@o=f|-GVft!JW zfro*Cfr){EfdeG&n3AHPUY?nfo>~&0oS#>cnpdK(kd~QKl3K*zn37Vgkf@NCTCNZt z02NfI%r8|)PRvs%ElyR)%mZ<Y6!OdS6q55(QuP%4@=Fx*Qd3h>QxwwjixhGbGxHR} z!KN$t<fmsQE2Nd?C6{F8=OyN3mQ?C7xTNMJRu(Hj9H5W`Rsu3fAt^O8FI^$EEHS4v zu_QG`p(Ha$p)9c|GrzQ0p&&mqucR1cdr3wr$Z0wGi76oE1x5MEsl~+%t`!COMI{R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`}|Gm8{*62ZkEr1VQkOi@TWys$Vk zIZ***9a15w#}JfSl30|I2+{#50+TZjZ_ZOlNzH*-hOS2;BeA#yWKv0LQEp~lVoH9o zLP2R>Nq#X{7o=p&2kA;qEJ_C{MEDR|UM3bP<QITaVJfW1L>6(&OwLFx0-FF+rI44e zP<D7>PG(9zLjcIyl2iq-=|u`9`6-FT3OR|za3dkkfMj!&0wg81I0YO7X$Tu2<!otD zBE;XI&`zx=$p;n1dHD>^ARmB&vltY(DVb0=`{gSXrz&J5f}<tB2qc=Ak`IboB$Huo zX9!Bo%*#y91cfo!nBvl$lEh+#g4Cj7aP3r;2=W2MWhJS(i3*8%C8?mm1gD4MRE4tC zqRh0+!qQYwEae>DoDPY}9B5^x$KVbs6p(@t6!^$Khlg1@R3Qn0mYRp=FZ>|}t^>dU zQltP23~=Iv6!wWl46dL&f*He*0EMbb$p?kE!r_$_nI-uQp|HGwUPmzaLsJokhn-6k z^HRXE1WqQPj0p-_2A9$zQ0RgJ5+acT4%Fntq}1fpB5-2ONmM8}yf8g8FOdOZN=70i ty`|)X5?nsWJZN522=E9%QV5Oe)ErRZ0jg*;3i68-Qc}}WlS}e7836e1TN(fW literal 0 HcmV?d00001 diff --git a/wp-content/plugins/widget-logic/languages/widget-logic-es_ES.po b/wp-content/plugins/widget-logic/languages/widget-logic-es_ES.po new file mode 100755 index 000000000..166d969b6 --- /dev/null +++ b/wp-content/plugins/widget-logic/languages/widget-logic-es_ES.po @@ -0,0 +1,103 @@ +msgid "" +msgstr "" +"Project-Id-Version: Widget Logic en español\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-20 11:32+0100\n" +"PO-Revision-Date: 2012-12-20 11:32+0100\n" +"Last-Translator: Eduardo Larequi <elarequi@gmail.com>\n" +"Language-Team: PNTE <blogs@educacion.navarra.es>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_c;_n:1,2;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-Language: Spanish\n" +"X-Poedit-Country: Spain\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SearchPath-0: .\n" + +#: widget_logic.php:18 +msgid "when plugin starts (default)" +msgstr "Cuando se inicia el plugin (por defecto)" + +#: widget_logic.php:19 +msgid "after theme loads" +msgstr "Cuando se carga el tema" + +#: widget_logic.php:20 +msgid "when all PHP loaded" +msgstr "Cuando se ha cargado todo el código PHP" + +#: widget_logic.php:21 +msgid "during page header" +msgstr "Durante la carga de la cabecera de la página" + +#: widget_logic.php:96 +msgid "Success! Options file imported" +msgstr "El fichero de opciones se ha importado con éxito" + +#: widget_logic.php:99 +msgid "Invalid options file" +msgstr "Fichero de opciones no válido" + +#: widget_logic.php:104 +msgid "No options file provided" +msgstr "No se ha proporcionado un fichero de opciones" + +#: widget_logic.php:173 +msgid "Widget Logic options" +msgstr "Opciones de Widget Logic" + +#: widget_logic.php:176 +msgid "Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality." +msgstr "Añade un nuevo filtro de WordPress que puedes utilizar en tu propio código. No es necesario para conseguir la funcionalidad básica de Widget Logic." + +#: widget_logic.php:178 +msgid "Add 'widget_content' filter" +msgstr "Añadir el filtro 'widget_content'" + +#: widget_logic.php:181 +msgid "Resets a theme's custom queries before your Widget Logic is checked" +msgstr "Reinicia las consultas personalizadas de un tema antes de que se verifique la lógica del widget." + +#: widget_logic.php:183 +msgid "Use 'wp_reset_query' fix" +msgstr "Utilizar 'wp_reset_query'" + +#: widget_logic.php:186 +msgid "Delays widget logic code being evaluated til various points in the WP loading process" +msgstr "Retarda la evaluación del código de Widget Logic hasta determinados puntos del proceso de carga de WordPress" + +#: widget_logic.php:186 +msgid "Load logic" +msgstr "Cargar las condiciones" + +#: widget_logic.php:199 +msgid "Save WL options" +msgstr "Guardar opciones de Widget Logic" + +#: widget_logic.php:203 +msgid "Save all WL options to a plain text config file" +msgstr "Permite guardar todas las opciones del plugin Widget Logic en un fichero de configuración en texto plano" + +#: widget_logic.php:203 +msgid "Export options" +msgstr "Exportar opciones" + +#: widget_logic.php:204 +msgid "Import options" +msgstr "Importar opciones" + +#: widget_logic.php:204 +msgid "Load all WL options from a plain text config file" +msgstr "Permite cargar todas las opciones del plugin Widget Logic desde un fichero de configuración en texto plano" + +#: widget_logic.php:205 +msgid "Select file for importing" +msgstr "Seleccionar fichero para importar" + +#~ msgid "Widget logic" +#~ msgstr "Condiciones del widget" + +#~ msgid "Save" +#~ msgstr "Guardar" diff --git a/wp-content/plugins/widget-logic/languages/widget-logic.pot b/wp-content/plugins/widget-logic/languages/widget-logic.pot new file mode 100755 index 000000000..69de64178 --- /dev/null +++ b/wp-content/plugins/widget-logic/languages/widget-logic.pot @@ -0,0 +1,101 @@ +# Copyright (C) 2012 +# This file is distributed under the same license as the package. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp\n" +"POT-Creation-Date: 2012-12-17 22:12:06+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" + +#: widget_logic.php:5 +msgid "Control widgets with WP's conditional tags is_home etc" +msgstr "" + +#: widget_logic.php:18 +msgid "when plugin starts (default)" +msgstr "" + +#: widget_logic.php:19 +msgid "after theme loads" +msgstr "" + +#: widget_logic.php:20 +msgid "when all PHP loaded" +msgstr "" + +#: widget_logic.php:21 +msgid "during page header" +msgstr "" + +#: widget_logic.php:96 +msgid "Success! Options file imported" +msgstr "" + +#: widget_logic.php:99 +msgid "Invalid options file" +msgstr "" + +#: widget_logic.php:104 +msgid "No options file provided" +msgstr "" + +#: widget_logic.php:173 +msgid "Widget Logic options" +msgstr "" + +#: widget_logic.php:176 +msgid "" +"Adds a new WP filter you can use in your own code. Not needed for main " +"Widget Logic functionality." +msgstr "" + +#: widget_logic.php:178 +msgid "Add 'widget_content' filter" +msgstr "" + +#: widget_logic.php:181 +msgid "Resets a theme's custom queries before your Widget Logic is checked" +msgstr "" + +#: widget_logic.php:183 +msgid "Use 'wp_reset_query' fix" +msgstr "" + +#: widget_logic.php:186 +msgid "" +"Delays widget logic code being evaluated til various points in the WP " +"loading process" +msgstr "" + +#: widget_logic.php:186 +msgid "Load logic" +msgstr "" + +#: widget_logic.php:199 +msgid "Save WL options" +msgstr "" + +#: widget_logic.php:203 +msgid "Save all WL options to a plain text config file" +msgstr "" + +#: widget_logic.php:203 +msgid "Export options" +msgstr "" + +#: widget_logic.php:204 +msgid "Import options" +msgstr "" + +#: widget_logic.php:204 +msgid "Load all WL options from a plain text config file" +msgstr "" + +#: widget_logic.php:205 +msgid "Select file for importing" +msgstr "" diff --git a/wp-content/plugins/widget-logic/readme.txt b/wp-content/plugins/widget-logic/readme.txt index 0ad439ed7..1160febac 100644 --- a/wp-content/plugins/widget-logic/readme.txt +++ b/wp-content/plugins/widget-logic/readme.txt @@ -3,15 +3,16 @@ Contributors: alanft Donate link: http://www.justgiving.com/widgetlogic_cancerresearchuk Tags: widget, admin, conditional tags, filter, context Requires at least: 2.8 -Tested up to: 3.3.2 -Stable tag: 0.52 +Tested up to: 3.5 +Stable tag: 0.56 +License: GPLv2 or later Widget Logic lets you control on which pages widgets appear using WP's conditional tags. It also adds a 'widget_content' filter. == Description == This plugin gives every widget an extra control field called "Widget logic" that lets you control the pages that the widget will appear on. The text field lets you use WP's [Conditional Tags](http://codex.wordpress.org/Conditional_Tags), or any general PHP code. -PLEASE NOTE The widget logic you introduce is EVAL'd directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. If you are worried about the security implications, please let me know how you think I could guard against this without compromising the general power and flexibility of Widget Logic too much. +PLEASE NOTE The widget logic you introduce is EVAL'd directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. There is an optional filter 'widget_logic_eval_override' which you can use to bypass the EVAL with your own code if needed. (See [Other Notes](../other_notes/)). There is also an option to add a wordpress 'widget_content' filter -- this lets you tweak any widget's HTML to suit your theme without editing plugins and core code. @@ -19,6 +20,10 @@ There is also an option to add a wordpress 'widget_content' filter -- this lets If you like and use Widget Logic you could consider a small donation to Cancer Research UK. I have a [JustGiving.com donation link](http://www.justgiving.com/widgetlogic_cancerresearchuk). As of December 2011 we have raised 440 UKP. I'm going to aim to have upped that to 750 UKP by the end of 2012. += Translate = + +Social Translation: [https://translate.foe-services.de](https://translate.foe-services.de) + == Installation == 1. Upload `widget-logic.php` to the `/wp-content/plugins/` directory @@ -130,6 +135,9 @@ There are lots of great code examples on the WP forums, and on WP sites across t Note the extra ';' on the end where there is an explicit 'return'. +== The 'widget_logic_eval_override' filter == +Before the Widget Logic code is evaluated for each widget, the text of the Widget Logic code is passed through this filter. If the filter returns a BOOLEAN result, this is used instead to determine if the widget is visible. Return TRUE for visible. + == The 'widget_content' filter == When this option is active (tick the option tickbox at the foot of the widget admin page) you can modify the text displayed by ANY widget from your own theme's functions.php file. Hook into the filter with: @@ -174,6 +182,26 @@ function make_alternating_widget_styles($content='') == Changelog == += 0.56 = +Small fix to the original WP3.5 fix in 0.54 that had the side effect of failing to save logic text on newly added widgets. + += 0.55 = +Restored a striplashes that vanished in 0.54 causing much grief. + +Translation: Spanish by Eduardo Larequi http://wordpress.org/support/profile/elarequi + += 0.54 = +Removed a WP 3.1+ function call, hopefully making it 2.8 compatible again. + +A little 'trim' of WL code to stop "syntax error, unexpected ')'" errors, which could occur if your WL was just a single space. Thanks to https://twitter.com/chrisjean for pointing this out. + +Translation support! Thanks to Foe Services Labs http://wordpress.org/support/profile/cfoellmann for the work on this and the German translation files. + +Added a 'widget_logic_eval_override' filter. This allows advanced users to bypass EVAL with a function of their own. + += 0.53 = +Accidentally released code with a terrible bug in it :-( + = 0.52 = Two new features: optional delayed loading of logic (see Configuration under [Installation](../installation/)), and the ability to save out and reload all your site's widget logic into a config file diff --git a/wp-content/plugins/widget-logic/widget_logic.php b/wp-content/plugins/widget-logic/widget_logic.php index 8db4cad53..a8e8a896f 100644 --- a/wp-content/plugins/widget-logic/widget_logic.php +++ b/wp-content/plugins/widget-logic/widget_logic.php @@ -1,18 +1,24 @@ <?php /* -Plugin Name: Widget Logic -Plugin URI: http://freakytrigger.co.uk/wordpress-setup/ -Description: Control widgets with WP's conditional tags is_home etc -Author: Alan Trewartha -Version: 0.52 -Author URI: http://freakytrigger.co.uk/author/alan/ +Plugin Name: Widget Logic +Plugin URI: http://wordpress.org/extend/plugins/widget-logic/ +Description: Control widgets with WP's conditional tags is_home etc +Version: 0.56 +Author: Alan Trewartha +Author URI: http://freakytrigger.co.uk/author/alan/ + +Text Domain: widget-logic +Domain Path: /languages/ */ +$plugin_dir = basename(dirname(__FILE__)); +load_plugin_textdomain( 'widget-logic', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); + global $wl_options; -$wl_load_points=array( 'plugins_loaded' => 'when plugin starts (default)', - 'after_setup_theme'=> 'after theme loads', - 'wp_loaded' => 'when all PHP loaded', - 'wp_head'=> 'during page header' +$wl_load_points=array( 'plugins_loaded' => __( 'when plugin starts (default)', 'widget-logic' ), + 'after_setup_theme' => __( 'after theme loads', 'widget-logic' ), + 'wp_loaded' => __( 'when all PHP loaded', 'widget-logic' ), + 'wp_head' => __( 'during page header', 'widget-logic' ) ); if((!$wl_options = get_option('widget_logic')) || !is_array($wl_options) ) $wl_options = array(); @@ -51,7 +57,7 @@ function widget_logic_ajax_update_callback($instance, $new_instance, $this_widge { global $wl_options; $widget_id=$this_widget->id; if ( isset($_POST[$widget_id.'-widget_logic'])) - { $wl_options[$widget_id]=$_POST[$widget_id.'-widget_logic']; + { $wl_options[$widget_id]=trim($_POST[$widget_id.'-widget_logic']); update_option('widget_logic', $wl_options); } return $instance; @@ -87,15 +93,15 @@ function widget_logic_expand_control() { list($key, $value)=split("\t",$import_option); $wl_options[$key]=json_decode($value); } - $wl_options['msg']="OK – options file imported"; + $wl_options['msg']= __('Success! Options file imported','widget-logic'); } else - { $wl_options['msg']="Invalid options file"; + { $wl_options['msg']= __('Invalid options file','widget-logic'); } } else - $wl_options['msg']="No options file provided"; + $wl_options['msg']= __('No options file provided','widget-logic'); update_option('widget_logic', $wl_options); wp_redirect( admin_url('widgets.php') ); @@ -119,7 +125,7 @@ function widget_logic_expand_control() if ( 'post' == strtolower($_SERVER['REQUEST_METHOD']) ) { foreach ( (array) $_POST['widget-id'] as $widget_number => $widget_id ) if (isset($_POST[$widget_id.'-widget_logic'])) - $wl_options[$widget_id]=$_POST[$widget_id.'-widget_logic']; + $wl_options[$widget_id]=trim($_POST[$widget_id.'-widget_logic']); // clean up empty options (in PHP5 use array_intersect_key) $regd_plus_new=array_merge(array_keys($wp_registered_widgets),array_values((array) $_POST['widget-id']), @@ -164,24 +170,24 @@ function widget_logic_options_control() ?><div class="wrap"> - <h2>Widget Logic options</h2> + <h2><?php _e('Widget Logic options', 'widget-logic'); ?></h2> <form method="POST" style="float:left; width:45%"> <ul> - <li><label for="widget_logic-options-filter" title="Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality."> - <input id="widget_logic-options-filter" name="widget_logic-options-filter" type="checkbox" value="checked" class="checkbox" <?php echo $wl_options['widget_logic-options-filter'] ?>/> - Add 'widget_content' filter + <li><label for="widget_logic-options-filter" title="<?php _e('Adds a new WP filter you can use in your own code. Not needed for main Widget Logic functionality.', 'widget-logic'); ?>"> + <input id="widget_logic-options-filter" name="widget_logic-options-filter" type="checkbox" value="checked" class="checkbox" <?php if (isset($wl_options['widget_logic-options-filter'])) echo "checked" ?>/> + <?php _e('Add \'widget_content\' filter', 'widget-logic'); ?> </label> </li> - <li><label for="widget_logic-options-wp_reset_query" title="Resets a theme's custom queries before your Widget Logic is checked"> - <input id="widget_logic-options-wp_reset_query" name="widget_logic-options-wp_reset_query" type="checkbox" value="checked" class="checkbox" <?php echo $wl_options['widget_logic-options-wp_reset_query'] ?> /> - Use 'wp_reset_query' fix + <li><label for="widget_logic-options-wp_reset_query" title="<?php _e('Resets a theme\'s custom queries before your Widget Logic is checked', 'widget-logic'); ?>"> + <input id="widget_logic-options-wp_reset_query" name="widget_logic-options-wp_reset_query" type="checkbox" value="checked" class="checkbox" <?php if (isset($wl_options['widget_logic-options-wp_reset_query'])) echo "checked" ?> /> + <?php _e('Use \'wp_reset_query\' fix', 'widget-logic'); ?> </label> </li> - <li><label for="widget_logic-options-load_point" title="Delays widget logic code being evaluated til various points in the WP loading process">Load logic + <li><label for="widget_logic-options-load_point" title="<?php _e('Delays widget logic code being evaluated til various points in the WP loading process', 'widget-logic'); ?>"><?php _e('Load logic', 'widget-logic'); ?> <select id="widget_logic-options-load_point" name="widget_logic-options-load_point" ><?php foreach($wl_load_points as $action => $action_desc) { echo "<option value='".$action."'"; - if ($action==$wl_options['widget_logic-options-load_point']) + if (isset($wl_options['widget_logic-options-load_point']) && $action==$wl_options['widget_logic-options-load_point']) echo " selected "; echo ">".$action_desc."</option>"; // } @@ -190,16 +196,13 @@ function widget_logic_options_control() </label> </li> </ul> - - <?php submit_button( __( 'Save WL options' ), 'button-primary', 'widget_logic-options-submit', false ); ?> + <?php submit_button( __( 'Save WL options', 'widget-logic' ), 'button-primary', 'widget_logic-options-submit', false ); ?> </form> <form method="POST" enctype="multipart/form-data" style="float:left; width:45%"> - <a class="submit button" href="?wl-options-export" title="Save all WL options to a plain text config file">Export options</a><p> - <?php submit_button( __( 'Import options' ), 'button', 'wl-options-import', false, - array( 'title'=>'Load all WL options from a plain text config file' - ) ); ?> - <input type="file" name="wl-options-import-file" id="wl-options-import-file" title="Select file for importing" /></p> + <a class="submit button" href="?wl-options-export" title="<?php _e('Save all WL options to a plain text config file', 'widget-logic'); ?>"><?php _e('Export options', 'widget-logic'); ?></a><p> + <?php submit_button( __( 'Import options', 'widget-logic' ), 'button', 'wl-options-import', false, array('title'=> __( 'Load all WL options from a plain text config file', 'widget-logic' ) ) ); ?> + <input type="file" name="wl-options-import-file" id="wl-options-import-file" title="<?php _e('Select file for importing', 'widget-logic'); ?>" /></p> </form> </div> @@ -228,12 +231,12 @@ function widget_logic_extra_control() // dealing with multiple widgets - get the number. if -1 this is the 'template' for the admin interface $number=$params[0]['number']; - if ($number==-1) {$number="%i%"; $value="";} + if ($number==-1) {$number="__i__"; $value="";} $id_disp=$id; if (isset($number)) $id_disp=$wp_registered_widget_controls[$id]['id_base'].'-'.$number; // output our extra widget logic field - echo "<p><label for='".$id_disp."-widget_logic'>Widget logic <textarea class='widefat' type='text' name='".$id_disp."-widget_logic' id='".$id_disp."-widget_logic' >".$value."</textarea></label></p>"; + echo "<p><label for='".$id_disp."-widget_logic'>Widget logic: <textarea class='widefat' type='text' name='".$id_disp."-widget_logic' id='".$id_disp."-widget_logic' >".$value."</textarea></label></p>"; } @@ -264,9 +267,20 @@ function widget_logic_filter_sidebars_widgets($sidebars_widgets) { if ($widget_area=='wp_inactive_widgets' || empty($widget_list)) continue; foreach($widget_list as $pos => $widget_id) - { - $wl_value=(!empty($wl_options[$widget_id]))? stripslashes($wl_options[$widget_id]) : "true"; - $wl_value =(stristr($wl_value,"return"))? $wl_value: "return (" . $wl_value . ");"; + { if (empty($wl_options[$widget_id])) continue; + $wl_value=stripslashes(trim($wl_options[$widget_id])); + if (empty($wl_value)) continue; + + $wl_value=apply_filters( "widget_logic_eval_override", $wl_value ); + if ($wl_value===false) + { unset($sidebars_widgets[$widget_area][$pos]); + continue; + } + if ($wl_value===true) continue; + + if (stristr($wl_value,"return")===false) + $wl_value="return (" . $wl_value . ");"; + if (!eval($wl_value)) unset($sidebars_widgets[$widget_area][$pos]); } -- GitLab