• Hope this isn’t a dupe, I don’t think so. Love the plugin, include it in themes religiously – a big thanks.

    I have an issue I don’t seem to be able to fix, OT still works but is throwing numerous PHP warnings in the media uploader when used in conjunction with another plugin (https://www.ads-software.com/extend/plugins/wp-filebase/).

    The error is;

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'ot_after_theme_options_save' was given in xxx\wp-includes\plugin.php on line 406

    And it is thrown for the following hooks in ot-loader.php;

    /* prepares the after save do_action */
          add_action( 'admin_init', array( &$this, 'ot_after_theme_options_save' ), 1 );
    
          /* default settings */
          add_action( 'admin_init', 'ot_default_settings', 2 );
    
          /* add xml to upload filetypes array */
          add_action( 'admin_init', 'ot_add_xml_to_upload_filetypes', 3 );
    
          /* import */
          add_action( 'admin_init', 'ot_import', 4 );
    
          /* export */
          add_action( 'admin_init', 'ot_export', 5 );
    
          /* save settings */
          add_action( 'admin_init', 'ot_save_settings', 6 );
    
          /* save layouts */
          add_action( 'admin_init', 'ot_modify_layouts', 7 );
    
          /* create media post */
          add_action( 'admin_init', 'ot_create_media_post', 8 );

    Looking into it, it seems to relate to this issue,

    https://wordpress.stackexchange.com/questions/82245/warning-error-in-admin-panel-while-developing-theme

    And whilst Filebase Pro is handling things in the way shown in the Stack above, Options Tree isn’t (which is why I’ve posted here – rightly or wrongly). I’ve tried all kinds of juggling to redo it so it will handle the hook in the same manner, however this;

    /* prepares the after save do_action */
    add_action( 'admin_init', array( &$this, 'ot_after_theme_options_save' ), 1 );

    Will throw the following warning in the backend no matter what;

    First argument is expected to be a valid callback, 'OT_Loader::ot_after_theme_options_save' was given in C:\wamp\www\bartlett\wp-includes\plugin.php on line 406

    I’ve tried on PHP 5.2.x and 5.3.x, no joy. It’s not a huge disaster fo me as I’ll have the error reporting off on the live site but it’s one of those things that eats away at you. I hoped you might have some insight. Thanks for any help and the thanks again for the plugin Derek.

    https://www.ads-software.com/extend/plugins/option-tree/

  • The topic ‘PHP Warning: call_user_func_array() on wp-includes/plugin.php line 406’ is closed to new replies.