Could use a lot of filters
-
To make this really extensible for developers, it would be nice if you could add a bunch of filters. For example:
function dgx_donate_paypalstd_payment_section( $form_content ) { // Show the button that kicks it all off $processing_image_url = apply_filters( 'seamless_donations_processing_image_url', plugins_url( '/images/ajax-loader.gif', __FILE__ )); $button_image_url = apply_filters( 'seamless_donations_button_image_url', plugins_url( '/images/paypal_btn_donate_lg.gif', __FILE__ ) ); $disabled_button_image_url = apply_filters( 'seamless_donations_disabled_image_url', plugins_url( '/images/paypal_btn_donate_lg_disabled.gif', __FILE__ ) ); $section = "<div class='dgx-donate-form-section' id='dgx-donate-form-payment-section'>" . "<p>" . "<input class='dgx-donate-pay-enabled' type='image' src='" . esc_url( $button_image_url ) . "' value='" . esc_attr__( 'Donate Now', 'dgx-donate' ) . "'/>" . "<img class='dgx-donate-pay-disabled' src='" . esc_url( $disabled_button_image_url ) . "' />" . "<img class='dgx-donate-busy' src='" . esc_url( $processing_image_url ) . "' />" . "</p>" . "<p class='dgx-donate-error-msg'></p>" . "</div>\n"; $section = apply_filters( 'seamless_donations_form_payment_section', $section, $processing_image_url, $button_image_url, $disabled_button_image_url ); $form_content .= $section; return $form_content; }
This would make the paypal buttons customizable without anyone needing to modify your core files.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Could use a lot of filters’ is closed to new replies.