customization - save short-code in my custom plugin settings problem missed something

i want to have dynamic shortcode to CF7when i create new Contact form the id is different from develop env to production

i want to have dynamic shortcode to CF7

when i create new Contact form the id is different from develop env to production

i decide to put my shortcodes in my plugin settings.

and use them as option

            <?php
            echo do_shortcode(get_option("email_ShortCode_text"));
            ?>

the more important code is this code that used in setting:

        <p>Enter your email_shortcode
        </p> <input type="text" name="email_ShortCode_text" value="<?php echo get_option('email_ShortCode_text'); ?>" />

        <hr />

but when user put his shortcode in my plugin setting then save it worked

but second time when shortcodes raed from database missed some characters

so when save all those settings missed

please help me

how can i convert setting to normal string when read from wordpress?

thank you

i want to have dynamic shortcode to CF7

when i create new Contact form the id is different from develop env to production

i decide to put my shortcodes in my plugin settings.

and use them as option

            <?php
            echo do_shortcode(get_option("email_ShortCode_text"));
            ?>

the more important code is this code that used in setting:

        <p>Enter your email_shortcode
        </p> <input type="text" name="email_ShortCode_text" value="<?php echo get_option('email_ShortCode_text'); ?>" />

        <hr />

but when user put his shortcode in my plugin setting then save it worked

but second time when shortcodes raed from database missed some characters

so when save all those settings missed

please help me

how can i convert setting to normal string when read from wordpress?

thank you

Share Improve this question edited Oct 14, 2019 at 9:24 saber tabatabaee yazdi asked Oct 14, 2019 at 8:36 saber tabatabaee yazdisaber tabatabaee yazdi 1931 gold badge5 silver badges13 bronze badges 2
  • 1 The more important code here is the code for adding and saving the setting. – Jacob Peattie Commented Oct 14, 2019 at 8:47
  • thank you ... i put it here for you. – saber tabatabaee yazdi Commented Oct 14, 2019 at 9:22
Add a comment  | 

1 Answer 1

Reset to default 0

just need to use text area instead of input in your settings page:

        <p>Enter your email shortcode
        </p> <textarea type="text" name="email_ShortCode_text" > <?php echo stripslashes(get_option('email_ShortCode_text')); ?>" </textarea>

        <hr />

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745083234a4610252.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信