I’m trying to call a method into a function widget. The $this
of the widget is passed to that method, but I get the following error:
Strict Standards: Non-static method class_name::method_name() should not be called statically, assuming $this from incompatible context in C:xampphtdocswpwp-contentthemes...... on line 446
Here’s what I’m trying to do exactly.
The widget form function:
class new_widget extends WP_Widget {
function form($instance) {
<?php widget_fields::input($instance, 'title'); ?>
}
}
And the class which I’m using out of the score of the widget class:
class widget_fields {
function input($t, $slug) {
?>
<p>
<input type="text" name="<?php echo $this->get_field_name($slug); ?>" value="<?php echo $t[$slug]; ?>" />
</p>
<?php
}
}