Support » Plugins » [Plugin: NextGEN Gallery] Warning: call_user_func_array() … /plugin.php on line 311

  • Warning: call_user_func_array() []: First argument is expected to be a valid callback, ‘media_admin_css’ was given in /webhotels/domains/ on line 311

    This probably is because of broken file, but I can’t find the broken one.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi,
    your wordpress is 2.62 ? a beta i guess. Maybe that’s where the problem is coming from. In gallery/admin/25/media-upload.php in line 53 you will find add_action('admin_head_media_upload_nextgen_form', 'media_admin_css'); but this file is only called in nggallery.php
    if (IS_WP25) this you can find four times in that file.
    which means in short that nggallery is not prepared for wp betas. You may try to change all four to if (IS_WP26) and see what happens.

    best regards

    I changed to (IS_WP26), but nothing new happens, I still got the same warning.

    define('IS_WP25', version_compare($wp_version, '2.4', '>=') ); line 56 was overseen yesterday by me maybe you add a line which is according to 2.6.

    best regards

    Hello! πŸ™‚

    you mean that it should look like that:

    define(‘IS_WP25’, version_compare($wp_version, ‘2.6’, ‘>=’) );
    Whith that I got the same error.

    If I make it like that:

    define(‘IS_WP26’, version_compare($wp_version, ‘2.6’, ‘>=’) );
    then plugin doesn’t work at all.

    define(‘IS_WP26’, version_compare($wp_version, ‘2.4’, ‘>=’) );
    doesn’t work also.

    last try ok?
    define('IS_WP26', version_compare($wp_version, '2.5', '>=') );
    would be in the logic i guess

    best regards

    πŸ™ define(‘IS_WP26’, version_compare($wp_version, ‘2.5’, ‘>=’) );

    not working.

    I installed WP 2.6Beta3 on other server and gallery works fine on it, so this probably is not a version problem.. πŸ™

    Then maybe a beta 2.62 problem.
    best regards

    NextGEN will support WP 2.6 after the first RC.

    Required changes :

    // not longer needed for wp2.6
    if ( !function_exists('wp_enqueue_style') )
    add_action('admin_head_media_upload_nextgen_form', 'media_admin_css');

    I’ve had that issue with the Flexible Upload plug in as well. Disabling the plugin worked nicely πŸ™‚

    After commenting out the line alexrabe shows, call the media.css file from fup_admin_header at the top of the file like so:

    function fup_admin_header() {
        global $fup_rel_dir;
                          array('prototype'), false);
       echo '<link rel="stylesheet" href="'. get_option('home') .'/wp-admin/css/media.css?ver=20080709" type="text/css" />'. "\n";

    ThatΒ΄s it xxxevilgrinxxx, same problem with the “Add Media” button.

    “Warning: call_user_func_array() []: First argument is expected to be a valid callback, ‘media_admin_css’ was given in /home/…/wp-includes/plugin.php on line 311”

    If you deactivate the flexible upload plugin the problem is solve.

    I am having this same problem. Disabling Flexible Upload gets rid of it but now when I click on images I have added to a post, it stops showing as a pop up thick box, but just opens as an image.

    I basically have to set the images up in a NextGEN gallery to be able to get that effect.

    I got this same error today. Everything was working fine earlier. Now I get the error.

    After trying to deactivate the plugin i get this error.

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/a/l/n/alnmedia/html/blog/wp-config.php:29) in /home/content/a/l/n/alnmedia/html/blog/wp-includes/pluggable.php on line 770

    past this into the bottom of the includes/plugin.php file
    if( ! function_exists(‘media_admin_css’) ){
    function media_admin_css(){

    should go just above the end php tag (?>)

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: NextGEN Gallery] Warning: call_user_func_array() … /plugin.php on line 311’ is closed to new replies.