mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Add hooks to allow rendering messages near buttons like before
This commit is contained in:
parent
fa46b88b16
commit
874a4e92ff
2 changed files with 20 additions and 0 deletions
|
@ -7,3 +7,7 @@
|
||||||
-webkit-filter: grayscale(100%);
|
-webkit-filter: grayscale(100%);
|
||||||
filter: grayscale(100%);
|
filter: grayscale(100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ppc-button-wrapper #ppcp-messages:first-child {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
|
|
@ -652,8 +652,24 @@ class SmartButton implements SmartButtonInterface {
|
||||||
// The wrapper is needed for the loading spinner,
|
// The wrapper is needed for the loading spinner,
|
||||||
// otherwise jQuery block() prevents buttons rendering.
|
// otherwise jQuery block() prevents buttons rendering.
|
||||||
echo '<div class="ppc-button-wrapper">';
|
echo '<div class="ppc-button-wrapper">';
|
||||||
|
|
||||||
|
$hook_gateway_id = str_replace( '-', '_', $gateway_id );
|
||||||
|
/**
|
||||||
|
* A hook executed after rendering of the opening tag for the PCP wrapper (before the inner wrapper for the buttons).
|
||||||
|
*
|
||||||
|
* For the PayPal gateway the hook name is ppcp_start_button_wrapper_ppcp_gateway.
|
||||||
|
*/
|
||||||
|
do_action( 'ppcp_start_button_wrapper_' . $hook_gateway_id );
|
||||||
|
|
||||||
echo '<div id="ppc-button-' . esc_attr( $gateway_id ) . '"></div>';
|
echo '<div id="ppc-button-' . esc_attr( $gateway_id ) . '"></div>';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hook executed before rendering of the closing tag for the PCP wrapper (before the inner wrapper for the buttons).
|
||||||
|
*
|
||||||
|
* For the PayPal gateway the hook name is ppcp_end_button_wrapper_ppcp_gateway.
|
||||||
|
*/
|
||||||
|
do_action( 'ppcp_end_button_wrapper_' . $hook_gateway_id );
|
||||||
|
|
||||||
if ( null !== $action_name ) {
|
if ( null !== $action_name ) {
|
||||||
do_action( $action_name );
|
do_action( $action_name );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue