post->post_content filter

You use preg_replace function incorrectly. This function returns replaced content: add_filter( ‘the_content’, ‘wpdu_image_replace’ ); function wpdu_image_replace( $content ) { return preg_replace( ‘/<img.*?src=”https://wordpress.stackexchange.com/questions/55241/(.*?)”.*?>/’, ‘<a href=”$1″>Image file</a>’, $content ); } Also pay attention that you don’t have to use global variable $post, because content of the post is passed to your function as first argument.

Changing checkbox array from single to multiple select

After days and days of frustration, I’m proudly answering my own question. The original code was not displaying multiple checkboxes because I was using the conditional !strcmp( $term->slug, $selected[0]->slug ) to render my “checked” options. Somehow it only returned 1 “checked” value at best. The correct conditional simply gets the value of the selected option, … Read more

Issue with custom plugin

Your plugin just creates a widget, you won’t see anything else in the Dashboard. If you drag the widget into a widget area, you’ll see all of the options to configure it. one other issue you will potentially have is the way you’re including javascript for your widget. if you use this with another plugin … Read more