Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. /**
  3. * Plugin Name: First Attempt
  4. * Plugin URI: http://www.cubidesigns.co.uk
  5. * Description: This is my first attempt and replaces <h2> tags with <h3>
  6. * Version: 1.0
  7. * Author: Reece McDonald
  8. * Author URI: http://www.cubidesigns.co.uk
  9. */
  10.  
  11.  
  12. function change_tags($content)
  13. {
  14. $theContent = preg_replace('/<h2>/','<h3>', $content);
  15. $theContent = preg_replace('/<\/h2>/', '</h3>', $theContent);
  16.  
  17. if(is_single())
  18. {
  19. return $theContent;
  20. }
  21. }
  22.  
  23.  
  24.  
  25. add_filter('the_content','change_tags');
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement