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

  • Hi @ituk

    It seems the document selector is the one that causes the issue. Could you please try to add the following code to your functions.php file?

    add_action('acf/input/admin_head', 'my_acf_move_content_editor');
    
    function my_acf_move_content_editor() {
        
        ?>
        <script type="text/javascript">
        (function($) {
            
            $(document).ready(function(){
                
                
                if( $("#in-category-1").is(':checked') ){
                    $('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
                }
                
                $('#in-category-1').on("change", function(){
                    if( $(this).is(':checked') ){
                        $('.acf-field-57bc88444d651 .acf-input').append( $('#postdivrich') );
                    } else {
                        $('#post-body-content').append( $('#postdivrich') );
                    }
                });
                
            });
            
        })(jQuery);    
        </script>
        <style type="text/css">
            .acf-field #wp-content-editor-tools {
                background: transparent;
                padding-top: 0;
            }
        </style>
        <?php    
        
    }

    I hope this helps 🙂