Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorpierovdfn
    • CommentTimeAug 13th 2010
     permalink
    Hi.
    This error can be considered a non-implemented feature but a bug, too (for me the second).
    The error is this: in line 54 of core.widgets.php is used function_exists, that accepts only variables.
    If you want to pass a function of a class or a function created with create_function it won't works.
    Instead if you use is_callable there isn't any error.
    is_callable is more correct too because call_user_func_array needs a callback, not a function.
    Regards, Piero VDFN.
    •  
      CommentAuthorNoWhereMan
    • CommentTimeAug 14th 2010
     permalink
    it is a leftover from the time when each plugin could define one (and only one, of course) function plugin_PLUGINID_widget(). Fixed.

    BTW, FYI create_function() does work, since it actually returns a string which references a fresh function, and not a function reference ("closures"), which is something they introduced with the very last versions of PHP5

    compare plugin.blockparser.php lines 46-70 which actually uses this technique;

    you are right about methods, though, function_exists would return false.

    as for "callback", it is a generic term ("pseudo-type" in php-speech) which includes function names as strings, methods and closures, so call_user_func_array() expects any of those.
    •  
      CommentAuthorpierovdfn
    • CommentTimeAug 14th 2010 edited
     permalink
    Posted By: NoWhereManit is a leftover from the time when each plugin could define one (and only one, of course) function plugin_PLUGINID_widget(). Fixed.

    BTW, FYI create_function()doeswork, since it actually returns a string which references a fresh function, and not a function reference ("closures"), which is something they introduced with the very last versions of PHP5

    I've used this function some times but I didn't know (I supposed it wasn't impossible). Thanks!


    compare plugin.blockparser.php lines 46-70 which actually uses this technique;

    you are right about methods, though, function_exists would return false.

    as for "callback", it is a generic term ("pseudo-type" in php-speech) which includes function names as strings, methods and closures, so call_user_func_array() expects any of those.

    Yes, sorry, my fault again.
    In the post I wrote "function", but I meant "function name" (I know it's a valid callback ;-), yesterday I would to say that it's not the only :-) ).