array(), 'em' => array(), 'b' => array(), 'i' => array(), 'u' => array(), 'span' => array( 'class' => true ), // Allow class attribute in span 'div' => array( 'class' => true ), // Allow class attribute in div ) ); $link_url = esc_url( Helper::get_setting( 'footer_link_url' ) ); $custom_class = Helper::get_setting( 'footer_custom_class', '' ); // ack-footer-link and any custom class are the stable hooks external CSS // targets, so they are emitted unconditionally in both style modes. $classes = trim( 'ack-footer-link ' . $custom_class ); $attributes = array( 'class="' . esc_attr( $classes ) . '"' ); $link_attributes = array( 'href="' . $link_url . '"', 'target="_blank"', 'rel="noopener"', ); if ( 'plugin' === Helper::get_setting( 'footer_style_mode' ) ) { $text_color = Helper::get_setting( 'footer_text_color' ); $font_size = Helper::get_setting( 'footer_font_size' ); $bg_color = Helper::get_setting( 'footer_bg_color' ); $alignment = Helper::get_setting( 'footer_alignment' ); $wrapper_styles = array( 'color:' . $text_color, 'font-size:' . $font_size, ); // Both are optional; emit nothing when unset so the theme decides. if ( '' !== $bg_color ) { $wrapper_styles[] = 'background-color:' . $bg_color; } if ( 'inherit' !== $alignment ) { $wrapper_styles[] = 'text-align:' . $alignment; } $attributes[] = 'style="' . esc_attr( implode( '; ', $wrapper_styles ) . ';' ) . '"'; // Colour and size must also be set on the anchor. Themes style // "a { color: ... }" directly, which beats a colour inherited from // the wrapper -- so setting it only on the div meant the chosen // colour never reached the visible link text. An inline style on the // anchor itself wins against theme stylesheets. $link_styles = array( 'color:' . $text_color, 'font-size:' . $font_size, ); $link_attributes[] = 'style="' . esc_attr( implode( '; ', $link_styles ) . ';' ) . '"'; } $output = '
'; return wp_kses_post( $output ); } /** * Echo the acknowledgment markup for a placement. * * Retained as the echoing entry point; get_markup() is the one to call when * the caller wants the string. * * @param string $placement_selector auto_insert, shortcode or php_snippet. * @return void */ public static function footer_output( $placement_selector ) { // Already passed through wp_kses_post() in get_markup(). // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo self::get_markup( $placement_selector ); } }