Broadcasts are dynamic areas capable of holding multiple other blocks in rotation, for the purpose of internal advertising. These broadcast areas can be added via the editor as Broadcast Blocks, or via code.
With Broadcasts, you can show a different block in your marketing or campaign rotation on each page view, maximising exposure without cluttering your site up.
This not only easily allows you to rotate through more than one block at a time, but also to distribute any new block to many different broadcasting areas in one go.
In some cases, you might need to display a Broadcast in a PHP template. So Accelerate provides a handy helper function to help you do that. You can use the following function:
if ( function_exists( 'Altis\\Accelerate\\Broadcast\\render' ) ) {
echo Altis\\Accelerate\\Broadcast\\render( $broadcast_id = 120, $client_id = 'footer-hero-broadcast' );`
}
$broadcast_id
is the ID of the Broadcast to target.$client_id
is an optional unique identifier for that instance of the Broadcast, for later Analytics analysis and reporting.