PHP Code Widget icon
Content & Editing

PHP Code Widget hooks reference

  • By Samuel Wood (Otto)
  • v2.4
  • Updated

PHP Code Widget 2.4 has 0 actions and 2 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Change a value PHP Code Widget is about to use
add_filter( 'widget_execphp', function( $instance, $instance2 ) {
	// Change $instance here.
	return $instance;
}, 10, 2 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • execphp.php line 23
    apply_filters( 'widget_execphp', $instance['text'], $instance );
  • widget_title

    filter
    execphp.php line 22
    apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );

Generated from PHP Code Widget's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: