Skip to content

Commit

Permalink
Introduce a dedicated field rendered with some HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jan 20, 2025
1 parent 5a2b207 commit 8a890d0
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/class-cf7-extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,22 @@ public function wpcf7_add_meta_boxes( $post_id ) {
);
}

private function esc_field_label( $label ) {
return wp_kses(
$label,
array(
'a' => array(
'href' => array(),
'target' => array(),
),
'strong' => array(),
'em' => array(),
'span' => array(),
'code' => array(),
)
);
}

/**
* Display our custom form settings.
*
Expand All @@ -204,7 +220,7 @@ public function wpcf7_metabox( $cf7 ) {
<p class="desc">%s</p>',
checked( $settings['disable-ajax'], true, false ),
esc_html__( 'Disable AJAX for this form', 'contact-form-7-extras' ),
__( 'Same as <code>define( \'WPCF7_LOAD_JS\', false );</code>. Disabling AJAX will also disable Google Analytics event tracking and HTML5 input type fallback for this form.', 'contact-form-7-extras' )
$this->esc_field_label( __( 'Same as <code>define( \'WPCF7_LOAD_JS\', false );</code>. Disabling AJAX will also disable Google Analytics event tracking and HTML5 input type fallback for this form.', 'contact-form-7-extras' ) )
),
),
'extra-disable-css' => array(
Expand All @@ -218,7 +234,7 @@ public function wpcf7_metabox( $cf7 ) {
<p class="desc">%s</p>',
checked( $settings['disable-css'], true, false ),
esc_html__( 'Disable default CSS for this form', 'contact-form-7-extras' ),
__( 'Disables CSS that comes bundled with Contact Form 7. Same as <code>define( \'WPCF7_LOAD_CSS\', false );</code>.', 'contact-form-7-extras' )
$this->esc_field_label( __( 'Disables CSS that comes bundled with Contact Form 7. Same as <code>define( \'WPCF7_LOAD_CSS\', false );</code>.', 'contact-form-7-extras' ) )
),
),
'extra-disable-autop' => array(
Expand All @@ -232,7 +248,7 @@ public function wpcf7_metabox( $cf7 ) {
<p class="desc">%s</p>',
checked( $settings['disable-autop'], true, false ),
esc_html__( 'Disable automatic paragraph formatting in form output', 'contact-form-7-extras' ),
__( 'Same as <code>define( \'WPCF7_AUTOP\', false );</code>.', 'contact-form-7-extras' )
$this->esc_field_label( __( 'Same as <code>define( \'WPCF7_AUTOP\', false );</code>.', 'contact-form-7-extras' ) )
),
),
'extra-enable-shortcodes' => array(
Expand Down

0 comments on commit 8a890d0

Please sign in to comment.