mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
✨ New option to configure BN-Code
Configurable via a wp-config constant, or a new wp-filter.
This commit is contained in:
parent
34245a852b
commit
6efcaa5630
7 changed files with 57 additions and 12 deletions
|
@ -95,14 +95,21 @@ class PayLaterWCBlocksRenderer {
|
|||
) {
|
||||
if ( PayLaterWCBlocksModule::is_placement_enabled( $c->get( 'wcgateway.settings.status' ), $location ) ) {
|
||||
|
||||
$html = '<div id="' . esc_attr( $attributes['ppcpId'] ?? '' ) . '" class="ppcp-messages" data-partner-attribution-id="Woo_PPCP"></div>';
|
||||
/**
|
||||
* The BN code.
|
||||
*
|
||||
* @psalm-suppress UndefinedConstant -- PPCP_PAYPAL_BN_CODE
|
||||
*/
|
||||
$bn_code = PPCP_PAYPAL_BN_CODE;
|
||||
|
||||
$html = '<div id="' . esc_attr( $attributes['ppcpId'] ?? '' ) . '" class="ppcp-messages" data-partner-attribution-id="' . esc_attr( $bn_code ) . '"></div>';
|
||||
|
||||
$processor = new \WP_HTML_Tag_Processor( $html );
|
||||
|
||||
if ( $processor->next_tag( 'div' ) ) {
|
||||
$processor->set_attribute( 'data-block-name', esc_attr( $attributes['blockId'] ?? '' ) );
|
||||
$processor->set_attribute( 'class', 'ppcp-messages' );
|
||||
$processor->set_attribute( 'data-partner-attribution-id', 'Woo_PPCP' );
|
||||
$processor->set_attribute( 'data-partner-attribution-id', $bn_code );
|
||||
|
||||
if ( $this->layout === 'flex' ) {
|
||||
$processor->set_attribute( 'data-pp-style-layout', 'flex' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue