How to listen to color changes on the color picker?

I hate answering my own question, but hopefully this can help someone else with similar issues: WordPress uses Iris color picker. http://automattic.github.io/Iris/# WordPress also creates a jquery widget with default settings for Iris. The file can be found under wp-admin/js/color-picker.js At first I was trying to pass values directly to iris(), which works, but that … Read more

Why are my widgets not saving when being added to a sidebar?

Its the camel-case in the widget ID. The following works: add_action( ‘widgets_init’, ‘ditto_register_sidebars’ ); function ditto_register_sidebars() { register_sidebar(array( ‘name’ => __( ‘Right Hand Sidebar’ ), ‘id’ => ‘right-bar’, ‘description’ => __( ‘Widgets in this area will be shown on the right-hand side.’ ) )); } Per the Codex: id – Sidebar id – Must be … Read more

Why Can’t wp_editor Be Used in a Custom Widget?

Short answer: Because there is a hidden widget where the TinyMCE appears first. Long answer (sorry, a very long answer): Go to the Codex and copy the example widget Foo_Widget to make sure we are talking about the same code. Now open your IDE (not an editor) and write a short testing widget as plugin. … Read more

Create Image Uploader for Widget

Let’s face it in detail: The registered sidebar (with the ID left-sidebar) has two arguments to wrap the whole widget (before_widget and after_widget) which you can output via echo $before_widget and echo $after_widget in your widget (see my version below): <?php // Register sidebar if (function_exists(‘register_sidebar’)) { register_sidebar( array( ‘name’ => ‘Left Sidebar’, ‘id’ => … Read more

Video Embed in Sidebar Widget with Links to Others in Category

I would create a Custom Post Type for Videos, and use in conjunction with some plugin like Simple Video Embed From there you can make a list of videos like so: <?php query_posts(‘post_type= videoss’,’showposts=20′); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class=”vidoes” > <?php echo p75GetVideo($post->ID, 400); ?> <h5><?php the_title(); ?></h5> … Read more

Has anyone managed to integrate the wp_editor inside a widget?

As said I think it’s quite hard to find a reliable solution because you have to take care of so many things. I go either for the way proposed by Danny van Kooten: http://dannyvankooten.com/450/tinymce-wysiwyg-editor-in-wordpress-plugin/ add and open the editor in a thickbox or another way I’ve used once, using the widget “accessibility mode” for “advanced” … Read more