WordPress.org

Forums

functions.php breaks Admin area Ajax (2 posts)

  1. Dan.LaSota
    Member
    Posted 4 years ago #

    I've noticed that if I have the following code in my theme's functions.php file:

    <?php
    
    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
    		'before_widget' => '<li id="%1$s" class="widget %2$s">',
    		'after_widget' => '</li>',
    		'before_title' => '',
    		'after_title' => '',
    	));
    
    ?>

    then the Ajax functionality of the admin/author editing area does not work. For instance, with the above code in my functions.php file, the "Add New Category" Link shows an empty text area, let's me enter a new category, but does not automatically assign the category to the post and have it checked. If I update the the category does show up, but its not selected.

    Another effect is that custom fields do not seem to be entered, until I have clicked on the "Update Post" button, then they are entered for as many times as I have clicked the button, seemingly in vain.

    Any idea as to what's going on?

  2. Dan.LaSota
    Member
    Posted 4 years ago #

    If I leave the functions.php file empty, then the Admin area Ajax works just fine.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.