【问题标题】:How to add raw html to a success message in a Wordpress form如何将原始 html 添加到 Wordpress 表单中的成功消息中
【发布时间】:2023-12-21 14:45:01
【问题描述】:

我有一个只包含文本的字段。可悲的是它不允许我添加 html。 有什么办法可以强制吗?

解释这个问题的最好方法是用图片。

如果有人有任何想法,请告诉我。 我是 wordpress 新手。

【问题讨论】:

    标签: wordpress forms href


    【解决方案1】:

    您必须将普通文本框转换为 wp 编辑器

        //custom field
        $custom_shot_content_timer = get_post_meta( $post->ID, 'custom_shot_content_timer', true ); 
    
    
        //wp text editor
        $settings = array( 'textarea_name' => 'custom_shot_content_timer' );
    
        $editor_id = 'custom_shot_content_timer';
    
        $content = $custom_shot_content_timer;
    
        wp_editor( $content, $editor_id, $settings );
        //wp text editor
    

    截图 https://prnt.sc/22l8s9n https://prnt.sc/22l8trb

    【讨论】:

      最近更新 更多