Saving widget gets an undefined variable

I am willing to be that since you have not initialized the widgets pool it cannot be duplicated. So within your main class or plugin file you would add this: For Class: add_action ( ‘widgets_init’, array ( &$this, ‘my_widgets’ ) ); For .php file add_action ( ‘widgets_init’, ‘my_widgets’); then create your function public function my_widgets(){ … Read more

How to stop WordPress from removing & from URL?

Here’s the why part: This part of the redirect_canonical() is removing the leading & in the redirect query part: // tack on any additional query vars $redirect[‘query’] = preg_replace( ‘#^\??&*?#’, ”, $redirect[‘query’] ); Example: example.tld/?&a=1&b=2&c=3 is redirected to example.tld/?a=1&b=2&c=3 If you must have the leading & you might try to adjust it through the redirect_canonical … Read more

How to Integrate Trac and WordPress (as done on the WP Development blog)?

Here’s the source of the functionality. It’s just a content filter and some basic regex that one of my coworkers at Automattic wrote. add_filter( ‘the_content’, ‘markup_wporg_links’ ); add_filter( ‘comment_text’, ‘markup_wporg_links’ ); function markup_wporg_links( $content ) { $find = array( ‘/(\ |^)#(\d{3,6})(\b|$)/i’, // core trac ticket #1234-core in http://core.trac.wordpress.org/ticket/ ‘/(\ |^)r(\d{3,6})(\b|$)/i’, // core changeset r1234-core in … Read more