PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.4.3
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.4.3
3.4.3 3.4.2 3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 All 196 releases
← All changes | admin/section/class-convertkit-admin-section-base.php +23 -0 3.4.03.4.3 View file →
@@ -871,8 +871,31 @@
871 871
872 872 }
873 873
874 874 /**
875 + * Outputs the given code in a code block, with a button to copy the code
876 + * to the clipboard.
877 + *
878 + * Requires the settings.css and ui.js resources to be enqueued on the screen
879 + * calling this method.
880 + *
881 + * @since 3.4.1
882 + *
883 + * @param string $code Code to display.
884 + * @param string $id Optional ID attribute to assign to the code element.
885 + */
886 + public function output_code_block( $code, $id = '' ) {
887 +
888 + ?>
889 + <div class="kit-code">
890 + <pre><code<?php echo ( ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : '' ); ?>><?php echo esc_html( $code ); ?></code></pre>
891 + <button type="button" class="button button-secondary kit-code-copy"><?php esc_html_e( 'Copy', 'convertkit' ); ?></button>
892 + </div>
893 + <?php
894 +
895 + }
896 +
897 + /**
875 898 * Returns the given text wrapped in a paragraph with the description class.
876 899 *
877 900 * @since 1.9.6
878 901 *