Fix and short link support
-
Dear plugin author,
I added support for short links to the function and fixed some issues. Feel free to include my changes in the next version.
function the_post_qrcode( $size = '150', $opts = [] ) { $opts += [ "fore_color" => null, "back_color"=> null, "margin" => null, "short" => false, ]; $src = add_query_arg( 'text', urlencode( $opts["short"] ? wp_get_shortlink() : get_permalink() ), site_url('/lh_qr_codes/') ); if ($opts["fore_color"]){ $src = add_query_arg( 'fore_color', $opts["fore_color"], $src ); } if ($opts["back_color"]){ $src = add_query_arg( 'back_color', $opts["back_color"], $src ); } if ($opts["margin"]){ $src = add_query_arg( 'margin', $opts["margin"], $src ); } $src = apply_filters( 'lh_qr_codes_template_src', $src); echo '<img src="'.$src.'" height="'.$size.'" width="'.$size.'" />'; }
Best regards
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Fix and short link support’ is closed to new replies.