Codeblock with copy button wordpress plugin
This wordpress plugin adds a button called codeblock to the classic editor to insert code. The wordpress plugin also creates a copy button.
New version available
Use the classic HTML editor or the codeblock shortcode
Update version 1.1:
protection against overflowing text
respositive copy button
Demo:
<?php $args = array(
‘post_type’ => ‘attachment’,
‘post_mime_type’ => ‘
application/pdf,
application/rtf,
application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.ms-powerpoint,
application/zip,
application/vnd.oasis.opendocument.text,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.ms-excel
‘,
‘numberposts’ => -1,
‘post_status’ => null,
‘post_parent’ => get_the_ID()
);
$attachments = get_posts( $args );
if ( $attachments ) {
foreach ( $attachments as $attachment ) {
echo ‘<li>’;
the_attachment_link( $attachment->ID, true );
echo ‘</li>’;
}
} ?>