PHP Code Widget

Plugin: PHP Code Widget
Version: 2.1
Last updated: 307 days ago.
Downloaded: 109,157 times.

Overview

The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any inserted PHP code and executes it. This makes it easier to migrate to a widget-based theme.

Download Now

Requirements

WordPress 2.8 or higher.

Features

  • Like a Text widget, but works with PHP code.
  • PHP Code must be in tags to function.

Installation Instructions

  1. Upload the files to the `/wp-content/plugins/php-code-widget/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Licensing

This plugin is licensed under the GPL Version 2 only.

Method to get support

You are free to email me, however I am also a moderator at the WordPress.org support forums, so you’ll find me there as well.

Download Now

6 Comments

  1. I was looking for something like this. I was so noob when I try to put php int text/html widget box and that doesnt works. Thanks for this.

  2. Cees says:

    I am a WP newbie, so I just followed the instructions and uploaded the execphp.php file and activated it thru the Plugins screen. So far, so good.
    When I make a new post thru

    1. VISUAL mode, is just printed on the screen (as text)
    2. HTML mode, it becomes

    Neither way is getting parsed, what am I doing wrong?

    Thanks

  3. Cees says:

    Oh okay, thanks for the quick reply, Otto!

  4. Art Lee says:

    Thank you for yr plugin. I had it installed fine on one site. I cloned that site, but on the cloned site none of the widgets are copied over. I copied ALL the files and SQLed the whole database. The ONLY file I changed was wp-config.php, pointing to the new database. Everything else works fine. I don’t know if the “problem” is with your widget, or with wordpress cloning widgets. I took special care with wp-options, ID=195. Since EVERYTHING is cloned except pointing to the new database, I’m at a loss to understand why 1 installation would show the widgets, and the other not.
    The new installation had all the plugins correctly installed, also.

    anyway thank you again, for yr nice widget, as wp itself is very php, it’s kind of strange that it is not built in into the source code.

    • Otto says:

      Moving blogs around is finicky in WordPress in general. If the URL is different between the two sites, search through for where that URL might be in the database. Some of the rows of the options table incorporate it in as a hash or plaintext in the key names.

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>