jquery-ui-tabs not working in theme options on latest version of wordpress

旧巷老猫 提交于 2019-12-12 03:28:54

问题


Since I have updated my wordpress installation to 4.2.2 jquery-ui-tabs is not working at theme options page I am loading it at line # 458 in s3-options.php I also have another file which contains jQuery which was perfectly working on previous version of wordpress I am pasting the code below also the file is host on github.

<script type="text/javascript">
jQuery(document).ready(function($) {
    var sections = [];
    <?php foreach ( $this->sections as $section_slug => $section ){
        echo "sections['$section'] = '$section_slug';";
    }?>
    var wrapped = $(".wrap h3").wrap("<div class=\"ui-tabs-panel\">");
    wrapped.each(function() {
        $(this).parent().append($(this).parent().nextUntil("div.ui-tabs-panel"));
    });

    $(".ui-tabs-panel").each(function(index) {
        $(this).attr("id", sections[$(this).children("h3").text()]);
            if (index > 0)
                $(this).addClass("ui-tabs-hide");
    });

    $(".ui-tabs").tabs({
        fx: { opacity: "toggle", duration: "fast" }
    });

    $("input[type=text], textarea").each(function() {
            if ($(this).val() == $(this).attr("placeholder") || $(this).val() == "")
                $(this).css("color", "#999");
        });

        $("input[type=text], textarea").focus(function() {
            if ($(this).val() == $(this).attr("placeholder") || $(this).val() == "") {
                $(this).val("");
                $(this).css("color", "#000");
            }
        }).blur(function() {
            if ($(this).val() == "" || $(this).val() == $(this).attr("placeholder")) {
                $(this).val($(this).attr("placeholder"));
                $(this).css("color", "#999");
            }
        });

        $(".wrap h3, .wrap table").show();

        // This will make the "warning" checkbox class really stand out when checked.
        // I use it here for the Reset checkbox.
        $(".warning").change(function() {
            if ($(this).is(":checked"))
                $(this).parent().css("background", "#c00").css("color", "#fff").css("fontWeight", "bold");
            else
                $(this).parent().css("background", "none").css("color", "inherit").css("fontWeight", "normal");

});

// Browser compatibility
if ($.browser.mozilla)
    $("form").attr("autocomplete", "off");
}); 

Please help me to figured out

来源:https://stackoverflow.com/questions/36246680/jquery-ui-tabs-not-working-in-theme-options-on-latest-version-of-wordpress

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