Support

Account

Home Forums Backend Issues (wp-admin) Visual editor breaks when applying post-category rule + moving the editor Reply To: Visual editor breaks when applying post-category rule + moving the editor

  • for those who have the same problem. thanks to James, here is the full solution:

        (function($) {
            
            $(document).ready(function(){
    			
    			$("#tagsdiv-knowlendge").appendTo(".acf-field-57bc8db4167d8");
    			$("#tagsdiv-tools").appendTo(".acf-field-57bc8dcc167d9");
    			$("#tagsdiv-materials").appendTo(".acf-field-57bc8de1167da");
    			$("#aboutcontent").append("<div class='clear' style='height:8px;'></div>");    
    
                if( $("#in-category-1").is(':checked') ){
                    $('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
                }
    			else{
    				$("#acf-group_57bc87aa02bb7").addClass("acf-hidden");
    			}
                
                $('#in-category-1').on("change", function(){
                    if( $(this).is(':checked') ){
                        $('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
                        tinymce.EditorManager.execCommand('mceRemoveEditor',true, "content");
                        tinymce.EditorManager.execCommand('mceAddEditor',true, "content");
                    } else {
                        $('#post-body-content').append( $('#postdivrich') );
                        tinymce.EditorManager.execCommand('mceRemoveEditor',true, "content");
                        tinymce.EditorManager.execCommand('mceAddEditor',true, "content");
    					$("#acf-group_57bc87aa02bb7").addClass("acf-hidden");
                    }
                });
    			        
            });
            
        })(jQuery);