回答:
これをJavascriptで解決しました。完全に防止したい場合は、JavaScriptを無効にしてウィジェットを編集できるため、サーバー側でも実行する必要があります(試してみてください!)。
異なるサイドバーは、ウィジェットをドロップしたり、ウィジェットから離れたりするときにチェックされます。それらがいっぱいになると、背景色が変化し、アイテムをドロップできなくなります。起動時に、サイドバーがすでにいっぱいになっている場合(制限を厳しくしたため)、背景色は赤になります。ウィジェットを完全なウィジェットからドラッグして、空にすることができます。

このコードをテストして、見逃したウィジェットを追加または削除する方法を見つけてください。jQueryのコード内の「魔法」から来ているアマン、私はそれについて投稿スタックオーバーフローの質問に答えました。
Javascript:
jQuery( function( $ ) {
    var sidebarLimits = {
        'sidebar-1': 2,
        'sidebar-2': 2,
    };
    var realSidebars = $( '#widgets-right div.widgets-sortables' );
    var availableWidgets = $( '#widget-list' ).children( '.widget' );
    var checkLength = function( sidebar, delta ) {
        var sidebarId = sidebar.id;
        if ( undefined === sidebarLimits[sidebarId] ) {
            return;
        }
        // This is a limited sidebar
        // Find out how many widgets it already has
        var widgets = $( sidebar ).sortable( 'toArray' );
        $( sidebar ).toggleClass( 'sidebar-full', sidebarLimits[sidebarId] <= widgets.length + (delta || 0) );
        $( sidebar ).toggleClass( 'sidebar-morethanfull', sidebarLimits[sidebarId] < widgets.length + (delta || 0) );
        var notFullSidebars = $( 'div.widgets-sortables' ).not( '.sidebar-full' );
        availableWidgets.draggable( 'option', 'connectToSortable', notFullSidebars );
        realSidebars.sortable( 'option', 'connectWith', notFullSidebars );
    }
    // Check existing sidebars on startup
    realSidebars.map( function() {
        checkLength( this );
    } );
    // Update when dragging to this (sort-receive)
    // and away to another sortable (sort-remove)
    realSidebars.bind( 'sortreceive sortremove', function( event, ui ) {
        checkLength( this );
    } );
    // Update when dragging back to the "Available widgets" stack
    realSidebars.bind( 'sortstop', function( event, ui ) {
        if ( ui.item.hasClass( 'deleting' ) ) {
            checkLength( this, -1 );
        }
    } );
    // Update when the "Delete" link is clicked
    $( 'a.widget-control-remove' ).live( 'click', function() {
        checkLength( $( this ).closest( 'div.widgets-sortables' )[0], -1 );
    } );
} );CSS:
.sidebar-full
{
    background-color: #cfe1ef !important;
}
.sidebar-morethanfull
{
    background-color: #c43 !important;
}それらをロードするPHP:
$wpse19907_file = $plugin;
add_action( 'admin_enqueue_scripts', 'wpse19907_admin_enqueue_scripts' );
function wpse19907_admin_enqueue_scripts( $hook_suffix )
{
    if ( 'widgets.php' == $hook_suffix ) {
        wp_enqueue_script( 'wpse-19907', plugins_url( 'wpse-19907.js', $GLOBALS['wpse19907_file'] ), array(), false, true );
        wp_enqueue_style( 'wpse-19907', plugins_url( 'wpse-19907.css', $GLOBALS['wpse19907_file'] ) );
    }
}サーバー側のチェックの試み(おそらくまだ完了していない):
$wpse19907_sidebars_max_widgets = array(
    'sidebar-1' => 2,
);
add_action( 'sidebar_admin_setup', 'wpse19907_sidebar_admin_setup' );
function wpse19907_sidebar_admin_setup()
{
    if ( ! isset( $_POST['action'] ) || 'save-widget' != $_POST['action'] || empty( $_POST['add_new'] ) ) {
        return;
    }
    // We're adding a new widget to a sidebar
    global $wpse19907_sidebars_max_widgets;
    $sidebar_id = $_POST['sidebar'];
    if ( ! array_key_exists( $sidebar_id, $wpse19907_sidebars_max_widgets ) ) {
        return;
    }
    $sidebar = wp_get_sidebars_widgets();
    $sidebar = isset( $sidebars[$sidebar_id] ) ? $sidebars[$sidebar_id] : array();
    if ( count( $sidebar ) <= $wpse19907_sidebars_max_widgets[$sidebar_id] ) {
        die( 'mx' ); // Length must be shorter than 2, and unique
    }
}あなたの質問であなたを助けるために、私は提案があります。例のようfirst-footer-widget-areaに、デフォルトのTwenty Tenテンプレートsidebar-footer.phpファイルのプレゼントを使用してみましょう。
良い習慣として安全に、まず頭痛を避けるためにそれをバックアップしてください。
最初のフッターウィジェットを表示するための元のTwenty Tenテンプレートコードは次のとおりです。
<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?>
       <div id="first" class="widget-area">
        <ul class="xoxo">
            <?php dynamic_sidebar( 'first-footer-widget-area' ); ?>
        </ul>
       </div><!-- #first .widget-area -->
<?php endif; ?>変更して、条件付きのコードを追加して、その領域で許可されるウィジェットの数を制限します。
<?php if ( is_active_sidebar( 'first-footer-widget-area' ) ) : ?>
    <div id="first" class="widget-area">
    <?php
           $mysidebars = wp_get_sidebars_widgets();
           $total_widgets = count( $mysidebars['first-footer-widget-area'] );
           $limit_allowed=2;
    ?>
        <ul class="xoxo">
            <?php  if ($total_widgets > $limit_allowed) {
                echo 'Your '.$total_widgets.' added widgets goes over the allowed limit: <strong>'.$limit_allowed.'</trong>';
                } else { ?>
            <?php dynamic_sidebar( 'first-footer-widget-area' ); ?>
          <?php }; ?>
        </ul>
        </div><!-- #first .widget-area -->
<?php endif; ?>この変更されたコードの機能:
$mysidebars = wp_get_sidebars_widgets();
$total_widgets = count( $mysidebars['first-footer-widget-area'] );
$limit_allowed=2;そのサイドバー内のウィジェットの数をカウントし、許可された制限を設定します(ユーザーが設定)。
...
<?php  if ($total_widgets > $limit_allowed) {
            echo 'Your '.$total_widgets.' added widgets goes over the allowed limit: <strong>'.$limit_allowed.'</trong>';
       } else { ?>
            <?php dynamic_sidebar( 'first-footer-widget-area' ); ?>
<?php }; ?>
...そのエリアのウィジェットに許可されている制限に達すると、制限が表示されることを警告するメッセージが表示されます。
だから私はあなたの質問に役立ったことを願っています。