Last active
February 20, 2018 00:36
-
-
Save sng2c/de05585d24bbfc78b85f17d3c95d6048 to your computer and use it in GitHub Desktop.
WordPress readmore_selectable Plugin for inserting AD
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: Read More Selectable | |
Plugin URI: | |
Description: Insert 'wp-read-more' class into span-tags that has 'more-?' id in content. | |
Version: 0.1 | |
Author: sng2c | |
Author URI: https://github.com/sng2c | |
License: GPL2 | |
*/ | |
add_filter('the_content', 'readmore_selectable'); | |
function readmore_selectable($content){ | |
$content = preg_replace('/<span\s+id=([\"\'])more-\d+\1/','\0 class="wp-read-more"',$content); | |
return $content; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
place this file to reamore_selectable directory and zip it. Then upload the zip file to wordpress plugin page.