WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Warning: call_user_func_array() ... /plugin.php on line 311 (16 posts)

  1. s0what
    Member
    Posted 6 years ago #

    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.

  2. bee dudler
    Member
    Posted 6 years ago #

    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

  3. s0what
    Member
    Posted 6 years ago #

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

  4. bee dudler
    Member
    Posted 6 years ago #

    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

  5. s0what
    Member
    Posted 6 years ago #

    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.

  6. bee dudler
    Member
    Posted 6 years ago #

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

    best regards
    bee

  7. s0what
    Member
    Posted 6 years ago #

    :( define('IS_WP26', version_compare($wp_version, '2.5', '>=') );

    not working.

  8. s0what
    Member
    Posted 6 years ago #

    I installed WP 2.6Beta3 on other server and gallery works fine on it, so this probably is not a version problem.. :(

  9. bee dudler
    Member
    Posted 6 years ago #

    Then maybe a beta 2.62 problem.
    best regards
    bee

  10. Alex Rabe
    Member
    Posted 6 years ago #

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

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

  11. xxxevilgrinxxx
    Member
    Posted 6 years ago #

    I've had that issue with the Flexible Upload plug in as well. Disabling the plugin worked nicely :)

  12. phillycp
    Member
    Posted 6 years ago #

    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";
    
    }
  13. comprido
    Member
    Posted 6 years ago #

    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.

  14. asgard
    Member
    Posted 6 years ago #

    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.

  15. alnmedia
    Member
    Posted 5 years ago #

    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

  16. visualadventures
    Member
    Posted 5 years ago #

    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 (?>)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.