wordpress - Cannot use $this as parameter in contact-form.php -
i trying run wordpress using xampp theme 'total' themeforest.
it says
fatal error: cannot use $this parameter in /applications/xampp/xamppfiles/htdocs/wp-content/themes/total/framework/3rd-party/contact-form-7.php on line 38
i referred this link , other websites outside of stack overflow too.
the code contact-form-7.php
follows,
<?php /** * contat form 7 configuration class * * @package total wordpress theme * @subpackage 3rd party * @version 3.6.0 */ if ( ! class_exists( 'wpex_contact_form_7' ) ) { class wpex_contact_form_7 { /** * start things * * @version 3.6.0 */ public function __construct() { // remove css - theme adds styles add_filter( 'wpcf7_load_css', '__return_false' ); // remove js add_filter( 'wpcf7_load_js', '__return_false' ); // conditionally load js add_action( 'wpcf7_contact_form', array( 'wpex_contact_form_7', 'enqueue_js' ), 1 ); } /** * load js conditionally * * @version 3.6.0 */ public static function enqueue_js( $this ) { if ( function_exists( 'wpcf7_enqueue_scripts' ) ) { wpcf7_enqueue_scripts(); } } } } new wpex_contact_form_7();
here's did,
i first installed in office computer , worked perfectly. tired implement same in personal laptop.
hence copied htdocs
folder , replaced in laptop. exported , imported database phpmyadmin.
try removing $this
, e.g.
public static function enqueue_js() { if ( function_exists( 'wpcf7_enqueue_scripts' ) ) { wpcf7_enqueue_scripts(); } }
see code @ gist.
Comments
Post a Comment