WordPress hooks/filters insert before content or after title

Just use the the_content filter, e.g.: <?php function theme_slug_filter_the_content( $content ) { $custom_content=”YOUR CONTENT GOES HERE”; $custom_content .= $content; return $custom_content; } add_filter( ‘the_content’, ‘theme_slug_filter_the_content’ ); ?> Basically, you append the post content after your custom content, then return the result. Edit As Franky @bueltge points out in his comment, the process is the same … Read more

How to remove a filter that is an anonymous object?

That’s a very good question. It goes down to the dark heart of the plugin API and best programming practices. For the following answer I created a simple plugin to illustrate the problem with easy to read code. <?php # -*- coding: utf-8 -*- /* Plugin Name: Anonymous OOP Action */ if ( ! class_exists( … Read more

Disable emojicons introduced with WP 4.2

We will hook into init and remove actions as followed: function disable_wp_emojicons() { // all actions related to emojis remove_action( ‘admin_print_styles’, ‘print_emoji_styles’ ); remove_action( ‘wp_head’, ‘print_emoji_detection_script’, 7 ); remove_action( ‘admin_print_scripts’, ‘print_emoji_detection_script’ ); remove_action( ‘wp_print_styles’, ‘print_emoji_styles’ ); remove_filter( ‘wp_mail’, ‘wp_staticize_emoji_for_email’ ); remove_filter( ‘the_content_feed’, ‘wp_staticize_emoji’ ); remove_filter( ‘comment_text_rss’, ‘wp_staticize_emoji’ ); // filter to remove TinyMCE emojis add_filter( … Read more