Created
November 18, 2016 20:21
-
-
Save ziemekpr0/757361e30b7768475a9a105b3b2d7edf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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