Skip to content

Instantly share code, notes, and snippets.

@maheshwaghmare
Created August 2, 2020 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheshwaghmare/ac657e64450d1622a1e74a45f4f0cef2 to your computer and use it in GitHub Desktop.
Save maheshwaghmare/ac657e64450d1622a1e74a45f4f0cef2 to your computer and use it in GitHub Desktop.
Copy anything to Clipboard: Allow to copy as HTML. See https://maheshwaghmare.com/?p=8138
<?php
/**
* Allow to copy as HTML.
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return mixed
*/
if( ! function_exists( 'prefix_allow_copy_as_html' ) ) :
function prefix_allow_copy_as_html( $args = array() ) {
// Allow to copy content as HTML.
$args['copy_content_as'] = 'html';
return $args;
}
add_filter( 'copy_the_code_localize_vars', 'prefix_allow_copy_as_html' );
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment