首页 > 解决方案 > 如何在 WordPress 定制器中使用 HTML 代码

问题描述

我想在定制器 API 中使用 html 代码。但是当我使用它时,WordPress 会删除 html 标签。

在默认区域中,我使用了一些 html 标签,但它确实适用于我的实际页面。请问有什么办法吗?

$wp_customize->add_setting('banner_title_display',array(
        'default' => 'Largest <span> GiveAway</span> collections <small>Online</small>',
        'sanitize_callback' => array($this, 'sanitize_custom_options')

));
$wp_customize->add_control(new WP_Customize_Control($wp_customize,'banner_title_display_control',array(
        'label' => 'Main header text',
        'section' => 'baner_header_section',
        'settings' => 'banner_title_display',
        'type' => 'textarea'

    )));

标签: phpwordpresscustomizer

解决方案


推荐阅读