Skip to content

Instantly share code, notes, and snippets.

@ziemekpr0
Created November 18, 2016 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziemekpr0/757361e30b7768475a9a105b3b2d7edf to your computer and use it in GitHub Desktop.
Save ziemekpr0/757361e30b7768475a9a105b3b2d7edf to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Title shortcode
* Description: Turns support for shortcodes placed in post/page title
* Version: 1.0
* Author: ziemekpr0
* Author Email: ziemekpr0@gmail.com
* Author URI: http://wpadmin.pl
* License: GPLv2 or later
*/
/* Security check - block direct access */
if (!defined('ABSPATH')) exit('No direct script access allowed');
function wpa_filter_title( $title, $id ) {
return do_shortcode($title);
}
add_filter( 'the_title', 'wpa_filter_title', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment