• Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘media_admin_css’ was given in /webhotels/domains/www.susts.lv/www/wp-includes/plugin.php 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
    bee

    Thread Starter s0what

    (@s0what)

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

    Hi,
    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
    bee

    Thread Starter s0what

    (@s0what)

    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.

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

    best regards
    bee

    Thread Starter s0what

    (@s0what)

    ?? define(‘IS_WP26’, version_compare($wp_version, ‘2.5’, ‘>=’) );

    not working.

    Thread Starter s0what

    (@s0what)

    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
    bee

    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');

    https://code.google.com/p/nextgen-gallery/source/diff?r=225&format=side&path=/trunk/admin/media-upload.php

    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;
        wp_enqueue_script('fup_swfupload',
                          '/'.$fup_rel_dir.'flexible-upload-wp25js.php',
                          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() [function.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(){
    wp_admin_css(‘css/media’);
    }
    }

    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.