How to hook in to the “output buffer” and add html content

You can use this class to buffer and filter any output coming from specific hook, or between two hooks. class HookBuffer { private static $buffers = []; private $buffer_name=””; private $buffer=””; private $buffer_status=”waiting”; private $priority1; private $priority2; private $tag1; private $tag2; private $output=FALSE; public function __construct( $buffer_name, $tag1=”, $tag2=” ) { if ( !( function_exists( … Read more

How to add description over forum list on bbpress root page

One possibility would be to hook into the bbp_template_before_forums_index like this: add_action( ‘bbp_template_before_forums_index’, ‘wpse118937_bbpress_forum_list_desc’); function wpse118937_bbpress_forum_list_desc() { //add your description code here } This will be displayed after the breadcrumbs and before the list. If you want more extensive customizations you can customize the template for that, but you shouldn’t do that in the plugin … Read more

Redirect returning users to a certain page?

function redirect_user() { if ( is_user_logged_in() ) { wp_redirect( ‘http://yoursite.com/page/’ ); exit; } } add_action( ‘init’, ‘redirect_user’ ); This will redirect the user to the page of your choice if they are logged in. It might be necessary to add a conditional that checks to make sure the user isn’t already on that page, to … Read more

Is this hook really deprecated? ( manage_{$taxonomy}_custom_column )

manage_{$taxonomy}_custom_column is a dynamic hook, so until you are using a proper value for $taxonomy like post_tag, it would work perfectly. Adam Brown page tells it as deprecated because it looks for exact match, while there is a change in the files so the current hook being used are manage_{$this->screen->taxonomy}_custom_column or manage_{$screen->taxonomy}_custom_column which accepts the … Read more

What hook can I use to modify custom post data before it is displayed on the page?

You can use the_content filter to modify content before it’s output. function my_the_content_filter( $content ) { // maybe limit to archive or single cpt display? if( is_post_type_archive( ‘your-cpt’ ) || is_singular( ‘your-cpt’ ) ){ global $post; $meta = get_post_meta( $post->ID, ‘some-key’, true ); if( false === $meta ){ return $content . ‘some extra content’; } … Read more

Renaming wordpress login and get new password button

This is a bad idea for general usage plugin, unless you intend to supply translations for all the languages for which there is a wordpress translation. If you need a new login form then use new strings for the text, don’t override the string used in the wordpress login form, it give you no advantage … Read more