Skip to content

Commit 7ad8d79

Browse files
author
Antti Kuosmanen
committed
Better copy-paste for the shortcode with input readonly
1 parent f360409 commit 7ad8d79

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

classes/class-cpt-wplf-form.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ function custom_columns_cpt( $columns ) {
185185
*/
186186
function custom_columns_display_cpt( $column, $post_id ) {
187187
if( 'shortcode' === $column ) {
188-
echo '<code>[libre-form id="' . $post_id . '"]</code>';
188+
?>
189+
<input type="text" class="code" value='[libre-form id="<?php echo $post_id; ?>"]' readonly>
190+
<?php
189191
}
190192
if( 'submissions' === $column ) {
191193
// count number of submissions
@@ -260,7 +262,7 @@ function add_meta_boxes_cpt() {
260262
*/
261263
function metabox_shortcode( $post ) {
262264
?>
263-
<p><code>[libre-form id="<?php echo $post->ID; ?>"]</code></p>
265+
<p><input type="text" class="code" value='[libre-form id="<?php echo $post->ID; ?>"]' readonly></p>
264266
<?php
265267
}
266268

0 commit comments

Comments
 (0)