|string $atts Shortcode attributes; WordPress passes an empty string when there are none. */ public function render( $atts = array() ): string { $atts = shortcode_atts( array( 'label' => '' ), is_array( $atts ) ? $atts : array(), self::TAG ); return self::link( $atts['label'] ); } /** * The link markup, shared by the shortcode and the `consentfold/settings-link` block. * * @param string $label Link text; the translatable default when empty. * @param string $extra_class Further class names for the link. */ public static function link( string $label = '', string $extra_class = '' ): string { $label = '' !== trim( $label ) ? $label : __( 'Cookie settings', 'consentfold' ); $class = trim( 'consentfold-settings-link ' . $extra_class ); return sprintf( '%s', esc_attr( $class ), esc_attr( self::HREF ), esc_html( $label ) ); } }