How to create a shortcode/edit a function to solve the conflict between Bootstrap and wpautop in Wordpress

浪尽此生 提交于 2019-12-02 11:08:32

This is the function that I am using to output the test buttons.

add_shortcode('show_boot_buttons', 'func_show_buttons');

function func_show_buttons( $atts ) {
    $atts = shortcode_atts(
        array(
            'class' => 'btn',
            'text' => 'Press Me',
        ), $atts, 'show_boot_buttons' );

    return '<button type="button" class="btn ' . esc_html( $atts['class'] ) .'">'. esc_html( $atts['text'] ). '</button>';
}

You can insert a button with the following code example.

[show_boot_buttons class="btn-primary" text="Press This"]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!