How to enable visual editor when editing comments on the dashboard?

If you are using WordPress 4.0+ you can do this using the wp_editor_settings and the global $pagenow to determine if you are on the comments page. add_filter( ‘wp_editor_settings’, ‘remove_editor_quicktags’, 10, 2 ); function remove_editor_quicktags( $settings, $id ){ global $pagenow; if ( $id == ‘content’ && $pagenow === ‘comment.php’ ){ $settings[‘quicktags’] = false; $settings[‘tinymce’] = true; … Read more

Moving sharedaddy buttons (in Jetpack) to the top of a post?

Basically it line 480 in sharing-service.php where it says: return $text.$sharing_content; and it should be return $sharing_content.$text; now changing that file won’t keep your changes on updates so you can copy that function (sharing_display) to your functions.php and rename it to something different say my_sharing_display and make the change there. Next you need to remove … Read more

Changing document title only on a custom page template

I think you will want to use the wp_title filter. Add the following to functions.php: function wpse62415_filter_wp_title( $title ) { // Return a custom document title for // the boat details custom page template if ( is_page_template( ‘boatDetails.php’ ) ) { return ‘I\’m the boat details page’; } // Otherwise, don’t modify the document title … Read more

remove other tabs in new wordpress media gallery

If you want to hide the Media Library submenu: you can do it via the admin_menu action: function wpse85351_hide_submenus() { if(!current_user_can(‘edit_posts’)){ global $submenu; unset($submenu[‘upload.php’][5]); // hide the Media Library } } add_action(‘admin_menu’, ‘wpse85351_hide_submenus’); If you want to change/remove the Media strings: you can use the media_view_strings filter: function wpse85351_media_strings($strings) { // only for subscribers: if(!current_user_can(‘edit_posts’)){ … Read more

About Hooks and Filters

Seeing that you’ve referenced 3 Genesis Developers, i’d like to answer this question using 2 Genesis code snippets as well as 2 WordPress examples of action hooks and filters. Hooks Different template files in Genesis include hooks which simply enable you to execute PHP code in that position of the template. Here’s a visual guide … Read more

Search with filters and title

First, you are setting $_GET[‘filterN’] but you are trying to use $_GET[‘condition_N’]. That is not ever going to work right. Secondly, pagename is an “exact match” value, not a search parameter, and it only works with the “Page” post type (at least so far as I can tell). You are using a CPT and, presumably, … Read more

How to apply content filter permanently?

//run once $allposts = get_posts(‘post_status=publish&numberposts=-1’); foreach ($allposts as $thispost) { wp_update_post( array( ‘ID’ => $thispost->ID, ‘post_content’ => fix_zip_code($thispost->post_content) ) ); } But as Rarst mentioned, backup your database before doing anything…