'', ), $atts ) ); $date = ''; if ( '' != $year ) { $date .= $year . ' - '; } $date .= date( 'Y' ); return esc_html( $date ); } /** * Register the [attesa_copyright] shortcode * * @since 1.1.8 */ public function copyright_symbol_shortcode( $atts, $content = null ) { return '©'; } /** * Register the [attesa_registered_trademark] shortcode * * @since 1.1.8 */ public function registered_trademark_symbol_shortcode( $atts, $content = null ) { return '®'; } /** * Register the [attesa_qrcode] shortcode * * @since 1.1.8 */ public function registered_qrcode_shortcode( $atts, $content = null ) { $atts = shortcode_atts( array( 'url' => '', 'size' => 200, 'color' => '#000000', 'background' => '#ffffff', 'format' => 'png', 'position' => 'center', ), $atts, 'attesa_qrcode' ); if ( ! $atts['url'] ) { return '

' . esc_html__('Please enter a valid URL to generate the QR code', 'attesa-extra') . '

'; } $url = add_query_arg( array( 'data' => rawurlencode( $atts['url'] ), 'size' => sprintf( '%1$sx%1$s', intval( $atts['size'] ) ), 'format' => $atts['format'], 'color' => ltrim( $atts['color'], '#' ), 'bgcolor' => ltrim( $atts['background'], '#' ), ), 'https://api.qrserver.com/v1/create-qr-code/' ); return '
'; } } } new AttesaExtra_Shortcodes();