Add hooks to allow rendering messages near buttons like before

This commit is contained in:
Alex P 2023-10-17 09:21:33 +03:00
parent fa46b88b16
commit 874a4e92ff
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 20 additions and 0 deletions

View file

@ -7,3 +7,7 @@
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.ppc-button-wrapper #ppcp-messages:first-child {
padding-top: 10px;
}

View file

@ -652,8 +652,24 @@ class SmartButton implements SmartButtonInterface {
// The wrapper is needed for the loading spinner,
// otherwise jQuery block() prevents buttons rendering.
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>';
/**
* 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 ) {
do_action( $action_name );
}