BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!

Shortcode to display and copy text

Goal

This snippet creates a shortcode that displays the configured text along with a copy button to easily display copyable content on your site.

Usage:

  • [bl_copy]Some text to copy[/bl_copy]
  • [bl_copy label="API Key"]sk_live_123...[/bl_copy]
  • [bl_copy tag="span"]Text[/bl_copy]

Attributes:

  • label: small label shown above the value
  • tag: wrapper tag for the value (div|span|code), default: div
Install Using Code Snippets

This code is best installed directly on your site using the Code Snippets plugin.

Check Out the Code

Loading...

Code Copied!
Stay Updated On This Snippet

This entry has no reviews.