// via wp_kses is enough to keep the output XSS-proof.
$arrow_svg = sprintf( '', $is_next ? 'right' : 'left' );
$arrow = wp_kses(
$arrow_svg,
array(
'span' => array(
'class' => array(),
'aria-hidden' => array(),
),
)
);
if ( ! $topic || '' === $topic['url'] ) {
printf(
'%2$s%5$s',
esc_attr( $classes ),
$is_next ? '' : wp_kses_post( $arrow ),
esc_html( $label ),
esc_html( $is_next ? __( 'End of course', 'academy' ) : __( 'Start of course', 'academy' ) ),
$is_next ? wp_kses_post( $arrow ) : ''
);
return;
}
printf(
'%5$s%8$s',
esc_attr( $classes ),
esc_url( $topic['url'] ),
$is_next ? 'next' : 'prev',
esc_attr( wp_json_encode( (object) [ 'type' => $topic['type'] ] ) ),
$is_next ? '' : wp_kses_post( $arrow ),
esc_html( $label ),
esc_html( $topic['title'] ),
$is_next ? wp_kses_post( $arrow ) : ''
);
};
$academy_wrapper = get_block_wrapper_attributes(
[
'class' => 'academy-learn-footer',
// A region the router swaps must be an interactive root of its own.
'data-wp-interactive' => 'academy/learn',
'data-wp-router-region' => 'academy-learn-footer',
]
);
?>