New option to configure BN-Code

Configurable via a wp-config constant, or a new wp-filter.
This commit is contained in:
Philipp Stracker 2024-07-02 16:10:10 +02:00
parent 34245a852b
commit 6efcaa5630
No known key found for this signature in database
7 changed files with 57 additions and 12 deletions

View file

@ -28,7 +28,14 @@ class PayLaterBlockRenderer {
public function render( array $attributes, ContainerInterface $c ): string {
if ( PayLaterBlockModule::is_block_enabled( $c->get( 'wcgateway.settings.status' ) ) ) {
$html = '<div id="' . esc_attr( $attributes['id'] ?? '' ) . '" 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['id'] ?? '' ) . '" class="ppcp-messages" data-partner-attribution-id="' . esc_attr( $bn_code ) . '"></div>';
$processor = new \WP_HTML_Tag_Processor( $html );