imarkelis
Forum Replies Created
-
Forum: Plugins
In reply to: [Memphis Documents Library] FATAL ERROR WP 5.7 PHP 8.0Try casting the #num variable to float. To do that go to line 241 of mdocs-show-file-info-templates.php file and change $the_rating[‘average’] to (float)$the_rating[‘average’]
Or you can use floatval($the_rating[‘average’])
Hope this helps.Forum: Plugins
In reply to: [Memphis Documents Library] No files found in this folder for non membersI had to disable Hide All Files: (Non Members) from the File Options on Configuration Settings. Now works like a charm. I control file access with the Ultimate Member plugin (just in case someone wants to find a solution to the file access problem). Memphis Document Library is a great plugin. Thank you!
Forum: Hacks
In reply to: Can't display dashboard widget contentOk. I got it. The only thing I had to do was use the object itself by refering to it ($this). So I changed the code and voila. No need for a static function.
public function couponsgen_add_dashboard_widget() { //$cg_widget = new Couponsgen_Admin(); //$cg_widget->couponsgen_create_dashboard_widget(); wp_add_dashboard_widget( 'couponsgen_dashboard_widget', 'Coupons Generator Dashboard Widget', array($this, 'couponsgen_create_dashboard_widget') ); }Forum: Hacks
In reply to: Can't display dashboard widget contentI was wondering if there is a way to do it without using static… I’m creating a new instanse of the class Coupogen_Admin but i think it’s a lot more work to do.
Forum: Hacks
In reply to: Can't display dashboard widget contentThank you very much for the quick response!
I also had to turn my function to static cause I got the message
Strict standards: call_user_func() expects parameter 1 to be a valid callback, non-static method
The final code for adding the widget is
public function couponsgen_add_dashboard_widget() { wp_add_dashboard_widget( 'couponsgen_dashboard_widget', 'Coupons Generator Dashboard Widget', array(__CLASS__,'couponsgen_create_dashboard_widget') ); }and for putting content inside the widget is
public static function couponsgen_create_dashboard_widget() { echo "<p>Hello World! This is my couponsgen Dashboard Widget</p>"; }Thank you very much for your help!