Created
June 24, 2017 13:07
-
-
Save igorbenic/2b21a0e826e4b28e423f6311f14e73aa to your computer and use it in GitHub Desktop.
How to Extend Non Extensible Plugins | http://www.ibenic.com/extend-non-extensible-plugins
This file contains hidden or 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 | |
| //... Somewhere in a class that works with hooks | |
| // Get the global Renderer | |
| global $edd_points_render; | |
| // Remove the Old Renderer Methods | |
| remove_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_guest_user_message' ) ); | |
| remove_action( 'edd_before_download_content', array( $edd_points_render,'edd_points_message_content' ) ); | |
| remove_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_checkout_message_content' ) ); | |
| remove_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_redeem_point_markup' ) ); | |
| remove_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_buy_points_type_user_message' ) ); | |
| $edd_points_render = new HW_Points_Renderer(); | |
| // Add enhanced Renderer Methods | |
| add_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_guest_user_message' ) ); | |
| add_action( 'edd_before_download_content', array( $edd_points_render,'edd_points_message_content' ) ); | |
| add_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_checkout_message_content' ) ); | |
| add_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_redeem_point_markup' ) ); | |
| add_action( 'edd_before_purchase_form', array( $edd_points_render,'edd_points_buy_points_type_user_message' ) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment