Created
August 2, 2020 07:00
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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