WordPress.org

Ready to get started?Download WordPress

Forums

problem with admin-ajax in 3.5 (1 post)

  1. cellobrutos
    Member
    Posted 1 year ago #

    Hi,

    I have a problem with a function that prevents the new media library to work with 3.5 (I can't upload nor select pictures for posts), and it seems to come from this function:

    function portfolio_metabox_do_ajax_update( $form_fields, $post ) {
    	?>
    	<script type="text/javascript">
    	    // <![CDATA[
    	    jQuery.ajax({
    		    url: "<?php echo admin_url( 'admin-ajax.php' );?>",
    		    type: "POST",
    		    data: "action=portfolio_update&id=<?php echo $post->post_parent; ?>",
    		    success: function(res) {
                            jQuery('#portfolio tbody', top.document).html(res);
    		    },
    		    error: function(request, status, error) {
                            //console.log(arguments);
                            //alert("There was an error! Please try again.");
    		    }
    	   });
    	   // ]]>
        </script>
    	<?php
    	return $form_fields;
    }

    Apparently (I posted this earlier, but the topic was closed before I could get a clear answer because of some morons jumping in with "hey my 3.5 doesn't work either"), there is something happening with
    <?php echo admin_url( 'admin-ajax.php' );?>
    but I can't seem to find what is wrong there.

    I have 2 options: deactivate that line everywhere I don't need it (it's built into my theme and only need it for a certain custom post type, and will only affect the admin side), but I don't know how. Or I can try to solve this problem. Whichever comes first... ;-)

    Sadly, the theme developer does not answer so I'm left with trying to modify it myself...

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic