PHP Strict Warnings
-
Hello,
Thanks for this plugin. It’s very helpful. However, with wp_debug enabled, I’m getting PHP Strict Warnings using PHP 5.4:
PHP Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GFUploadRules::localize() should not be called statically...
Simply adjusting the filter & action hooks at the end of your main plugin file from this:
public function actions() { add_filter( 'gform_field_validation', array( __CLASS__, 'field_validation' ), 10, 4 ); add_action( 'gform_field_advanced_settings', array( __CLASS__, 'field_settings' ), 5 ); add_action( 'gform_editor_js', array( __CLASS__, 'editor_js' ), 20 ); add_filter( 'gform_tooltips', array( __CLASS__, 'tooltips' ) ); add_action( 'admin_init', array( __CLASS__, 'register_scripts' ) ); add_action( 'init', array( __CLASS__, 'localize' ) ); }
To this:
public function actions() { add_filter( 'gform_field_validation', array( $this, 'field_validation' ), 10, 4 ); add_action( 'gform_field_advanced_settings', array( $this, 'field_settings' ), 5 ); add_action( 'gform_editor_js', array( $this, 'editor_js' ), 20 ); add_filter( 'gform_tooltips', array( $this, 'tooltips' ) ); add_action( 'admin_init', array( $this, 'register_scripts' ) ); add_action( 'init', array( $this, 'localize' ) ); }
Eliminated the errors. If you’d be willing to incorporate this change into a future update, I’d appreciate it. Thanks again!
https://www.ads-software.com/plugins/gravity-forms-upload-rules/
- The topic ‘PHP Strict Warnings’ is closed to new replies.