Advertisement
Guest User

ShareDaddy & PPA/APP Fix

a guest
Jul 29th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. Plugin Name: ShareDaddy & PPA/APP Fix
  6. Description: Fixes the Incompatibility between Post-Page-Associator/Associated Posts Pro and ShareDaddy (JetPack) Plugin.
  7. Version: 1.0
  8. Author: Dennis Hoppe
  9. Author URI: http://DennisHoppe.de
  10.  
  11. */
  12.  
  13. // Plugin Class
  14. If (!Class_Exists('wp_plugin_sharedaddy_post_page_associator_fix')){
  15. Class wp_plugin_sharedaddy_post_page_associator_fix {
  16.  
  17.   Function __construct(){
  18.     Add_Action('init', Array($this, 'Repair_ShareDaddy_Hooks'));
  19.   }
  20.  
  21.   Function Repair_ShareDaddy_Hooks(){
  22.     If (Function_Exists('sharing_display')){
  23.       // Remove non working filters
  24.       Remove_Filter( 'the_content', 'sharing_display', 19 );
  25.       Remove_Filter( 'the_excerpt', 'sharing_display', 19 );
  26.      
  27.       // Add new filters
  28.       Add_Filter( 'the_content', 'sharing_display', 11 );
  29.       Add_Filter( 'the_excerpt', 'sharing_display', 11 );
  30.     }
  31.   }
  32.  
  33. } /* End of Class */
  34. New wp_plugin_sharedaddy_post_page_associator_fix();
  35. } /* End of If-Class-Exists-Condition */
  36. /* End of File */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement