coresocial-sharing-qrcode

Developer Knowledge Level

This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!

JS
Action identifier (JavaScript)
do_action( "coresocial-sharing-qrcode", link );
coreSocial 4.0 — src/pro/frontend/index.ts:79
Arguments
Name
Type
Description
link
HTMLAnchorElement
Activated share/print/QR link.

Pro version only

This action is available only in the Pro version of the plugin. See the coreSocial Pro pricing page for available plans.

JavaScript wp.hooks action in coreSocial Pro. Fires after the QR overlay is appended to the document, provided the kjua library is available. Tracking is initiated separately and is not awaited.

The overlay contains an SVG QR code. This event reports display of that overlay, not scanning of the QR code or successful sharing. No event is emitted from this path when kjua is unavailable.

Register with wp.hooks.addAction(), not PHP add_action(). Load the listener with the wp-hooks script dependency before the relevant user interaction. The Source Code block uses its generic action template; the code example shows the actual JavaScript API.

Example

wp.hooks.addAction( 'coresocial-sharing-qrcode', 'my-site/qr-observer', function ( link ) {
    const overlay = document.getElementById( 'coresocial-overlay-wrapper' );
    console.log( 'QR overlay ready:', Boolean( overlay ) );
} );
Rate this reference
0
0
3

You are not allowed to rate this post.

Leave a Comment

0
0
0
0
0
0
0
0
0