Version Description
- Changed the call to WP_Widget to use the PHP 5 __construct() method. Ref: https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/
Download this release
Release Info
Developer | Otto42 |
Plugin | PHP Code Widget |
Version | 2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2 to 2.3
- execphp.php +3 -3
- php-code-widget.pot +0 -48
- readme.txt +7 -5
execphp.php
CHANGED
@@ -4,17 +4,17 @@ Plugin Name: PHP Code Widget
|
|
4 |
Plugin URI: http://ottopress.com/wordpress-plugins/php-code-widget/
|
5 |
Description: Like the Text widget, but it will take PHP code as well. Heavily derived from the Text widget code in WordPress.
|
6 |
Author: Otto
|
7 |
-
Version: 2.
|
8 |
Text Domain: php-code-widget
|
9 |
Author URI: http://ottodestruct.com
|
10 |
*/
|
11 |
|
12 |
class PHP_Code_Widget extends WP_Widget {
|
13 |
-
function
|
14 |
load_plugin_textdomain( 'php-code-widget', false, dirname( plugin_basename( __FILE__ ) ) );
|
15 |
$widget_ops = array('classname' => 'widget_execphp', 'description' => __('Arbitrary text, HTML, or PHP Code', 'php-code-widget'));
|
16 |
$control_ops = array('width' => 400, 'height' => 350);
|
17 |
-
|
18 |
}
|
19 |
|
20 |
function widget( $args, $instance ) {
|
4 |
Plugin URI: http://ottopress.com/wordpress-plugins/php-code-widget/
|
5 |
Description: Like the Text widget, but it will take PHP code as well. Heavily derived from the Text widget code in WordPress.
|
6 |
Author: Otto
|
7 |
+
Version: 2.3
|
8 |
Text Domain: php-code-widget
|
9 |
Author URI: http://ottodestruct.com
|
10 |
*/
|
11 |
|
12 |
class PHP_Code_Widget extends WP_Widget {
|
13 |
+
function __construct() {
|
14 |
load_plugin_textdomain( 'php-code-widget', false, dirname( plugin_basename( __FILE__ ) ) );
|
15 |
$widget_ops = array('classname' => 'widget_execphp', 'description' => __('Arbitrary text, HTML, or PHP Code', 'php-code-widget'));
|
16 |
$control_ops = array('width' => 400, 'height' => 350);
|
17 |
+
parent::__construct('execphp', __('PHP Code', 'php-code-widget'), $widget_ops, $control_ops);
|
18 |
}
|
19 |
|
20 |
function widget( $args, $instance ) {
|
php-code-widget.pot
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
# Copyright (C) 2013 PHP Code Widget
|
2 |
-
# This file is distributed under the same license as the PHP Code Widget package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: PHP Code Widget 2.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/php-code-widget\n"
|
7 |
-
"POT-Creation-Date: 2013-10-22 18:55:57+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
|
15 |
-
#: execphp.php:14
|
16 |
-
msgid "Arbitrary text, HTML, or PHP Code"
|
17 |
-
msgstr ""
|
18 |
-
|
19 |
-
#: execphp.php:16
|
20 |
-
msgid "PHP Code"
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: execphp.php:51
|
24 |
-
msgid "Title:"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: execphp.php:56
|
28 |
-
msgid "Automatically add paragraphs."
|
29 |
-
msgstr ""
|
30 |
-
#. Plugin Name of the plugin/theme
|
31 |
-
msgid "PHP Code Widget"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#. Plugin URI of the plugin/theme
|
35 |
-
msgid "http://ottopress.com/wordpress-plugins/php-code-widget/"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#. Description of the plugin/theme
|
39 |
-
msgid "Like the Text widget, but it will take PHP code as well. Heavily derived from the Text widget code in WordPress."
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#. Author of the plugin/theme
|
43 |
-
msgid "Otto"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#. Author URI of the plugin/theme
|
47 |
-
msgid "http://ottodestruct.com"
|
48 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
=== PHP Code Widget ===
|
2 |
Contributors: Otto42
|
3 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=otto%40ottodestruct%2ecom
|
4 |
Tags: php, widget, execphp
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.opensource.org/licenses/GPL-2.0
|
10 |
|
@@ -22,7 +21,7 @@ Only users with the unfiltered_html role will be allowed to insert unfiltered HT
|
|
22 |
|
23 |
== Frequently Asked Questions ==
|
24 |
|
25 |
-
= There's some kind of error on line
|
26 |
|
27 |
That error means that your PHP code is incorrect or otherwise broken.
|
28 |
|
@@ -32,7 +31,7 @@ No, it's not. Really.
|
|
32 |
|
33 |
This widget has no real errors in it, it's about the simplest widget one can possibly make. Any errors coming out of the "execphp.php" file are errors in code you put into one of the widgets. The reason that it shows the error being in the execphp.php file is because that is where your widget's code is actually being run.
|
34 |
|
35 |
-
So, if it says that you have an error on line
|
36 |
|
37 |
= I have code that works normally in a template but doesn't work when in the widget? =
|
38 |
|
@@ -45,6 +44,9 @@ Code in a template runs in the global context. Code in the widget will run in a
|
|
45 |
|
46 |
== Changelog ==
|
47 |
|
|
|
|
|
|
|
48 |
= 2.2 =
|
49 |
* Translation fixes for WP 3.7
|
50 |
* Remove donation link
|
1 |
=== PHP Code Widget ===
|
2 |
Contributors: Otto42
|
|
|
3 |
Tags: php, widget, execphp
|
4 |
Requires at least: 2.8
|
5 |
+
Tested up to: 4.7
|
6 |
+
Stable tag: 2.3
|
7 |
License: GPLv2
|
8 |
License URI: http://www.opensource.org/licenses/GPL-2.0
|
9 |
|
21 |
|
22 |
== Frequently Asked Questions ==
|
23 |
|
24 |
+
= There's some kind of error on line 27! =
|
25 |
|
26 |
That error means that your PHP code is incorrect or otherwise broken.
|
27 |
|
31 |
|
32 |
This widget has no real errors in it, it's about the simplest widget one can possibly make. Any errors coming out of the "execphp.php" file are errors in code you put into one of the widgets. The reason that it shows the error being in the execphp.php file is because that is where your widget's code is actually being run.
|
33 |
|
34 |
+
So, if it says that you have an error on line 27, I assure you, the problem is yours. Please don't email me about that error.
|
35 |
|
36 |
= I have code that works normally in a template but doesn't work when in the widget? =
|
37 |
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
= 2.3 =
|
48 |
+
* Changed the call to WP_Widget to use the PHP 5 __construct() method. Ref: https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/
|
49 |
+
|
50 |
= 2.2 =
|
51 |
* Translation fixes for WP 3.7
|
52 |
* Remove donation link
|