首页 > 解决方案 > WordPress 自定义启用/禁用多站点的管理设置

问题描述

我有这个多站点设置,您可以在其中启用和禁用全局分类。但我不知道如何检索和保存数据。有谁能够帮我?

这将是视图

在此处输入图像描述

这是我的代码

function network_settings_screen() {

<div class="wrap">
    <h1><?php esc_html_e( 'MCMultisite Distributor Global Settings', 'distributor' ); ?></h1>

    <form action="" method="post">
    <input type="hidden" name="dt_network_settings" value="1">
    <table class="form-table">
        <tbody>
            <tr>
                <th scope="row"><?php esc_html_e( 'Enable Multisite use one taxonomy db table.', 'distributor' ); ?></th>                   
            </tr>
            <tr>
                <td>
                    <ul class="media-handling">
                        <li>
                            <label><input type="radio" value="enable" name="dt_settings[network_taxonomy]">
                            <?php esc_html_e( 'Enable (default).', 'distributor' ); ?>
                            </label>
                        </li>
                        <li>
                            <label><input type="radio" value="disable" name="dt_settings[network_taxonomy]">
                            <?php esc_html_e( 'Disable', 'distributor' ); ?>
                            </label>
                        </li>
                    </ul>
                </td>
            </tr>
        </tbody>
    </table>

    <?php submit_button(); ?>

    </form>     
</div>  
<?php
}

标签: phpwordpresscustom-wordpress-pageswordpress-shortcode

解决方案


推荐阅读