When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?

I imagine you’re also adding a filter mce_buttons to add in the button to, something like.. add_filter( ‘mce_buttons’, ‘add_my_tinymce_buttons’ ); function add_my_tinymce_buttons( $items ) { $items[] = ‘your-button’; return $items; } Just change the filter to hook onto mce_buttons_2 instead, and the button will appear on the second row , eg.. add_filter( ‘mce_buttons_2’, ‘add_my_tinymce_buttons’ ); … Read more

Filter my args by the post 1st letter

To restrict to letter X dynamically, the following should work. It depends upon the fact that WP_Query will let ad hoc parameters pass through. That lets you send your own data to the filters. I do not know if this is intentional behavior so caveat emptor, but it is very useful behavior. Simply send your … Read more

How to center oEmbedded content

After some Googling, I found a solution that was originally done for a Twitter embed, but I modified it to work with all oEmbed contents. Keep in mind that for this to work on existing posts, you’ll need to do an “update” for the oEmbed content to refresh from the cache. add_filter(‘oembed_result’,’center_oembed’,10,3); function center_oembed($html, $url, … Read more

remove_action in plugin file

Make sure you remove the action after the theme has added it. And use the same priority. A rather safe way is using the same action you want to clean up: add_action( ‘admin_notices’, ‘remove_woothemes_updater_notice’, 0 ); function remove_woothemes_updater_notice() { remove_action( ‘admin_notices’, ‘woothemes_updater_notice’ ); }

Question about how do wordpress filters/actions work

For every filter or action hook that you use with the add_filter or add_action functions, there is a corresponding apply_filters or do_action function called somewhere in the WordPress core. This function sets up which parameters will be sent to the filter or action. For the filter hook the_content example that you gave, the filter hook … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)