2

I'm using Wordpress 4.2.3

The shortcode is added with the following:

function upsellxid_shortcode() {
    return '9eaa86d1a36a126313aa752c2ff8e16c';
}

function upsellxid_shortcode_2() {
    return '4849f6a5e3b188fa4b3b4c1f37975706';
}

function upsellxid_shortcode_rsa() {
    return '7a9bc3b332605817594dbac27847dff0';
}

function infusionsoftEmail_shortcode() {
    // Code
    $in = $_REQUEST;
    if (isset($_REQUEST['q'])) {
        $parse = parse_url($_REQUEST['q']);
        parse_str($parse['query'], $get);
        $in = $get;
    }

    $email = false;
    if (isset($in['inf_field_Email']) == true &&  empty($in['inf_field_Email']) == false) {
        $email = $in['inf_field_Email'];
    } else if(isset($in['Contact0Email']) == true &&  empty($in['Contact0Email']) == false) {
        $email = $in['Contact0Email'];
    }
    return $email;
}
add_shortcode('upsellxid', 'upsellxid_shortcode');
add_shortcode('xid_RSAMonthly', 'upsellxid_shortcode_2');
add_shortcode('rsa30daytrial', 'upsellxid_shortcode_rsa');
add_shortcode('infusionsoftEmail', 'infusionsoftEmail_shortcode');

Using it in a post seems fine (just [rsa30daytrial] will output the correct code). But using it inside an html input returns the raw text:

[rsa30daytrial]
[rsa30daytrial]
<input type="text" value="[rsa30daytrial]" />

results in (page source):

<p>7a9bc3b332605817594dbac27847dff0
7a9bc3b332605817594dbac27847dff0
<input type="text" value="[rsa30daytrial]" /></p>
1

As above, https://wordpress.stackexchange.com/a/195673/22728 solved it:

add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
    if ( $context == 'post' ) {
        $allowedposttags['input']['value'] = 1;
    }
    return $allowedposttags;
}, 10, 2 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.