php - Overiding the function -
php - Overiding the function -
i'm using wordpress plugin "contact-form-7" , there function [ function wpcf7_default_form_template(){} ] in file [ contact-form.php ]...
now comes work have write same function in function.php in custom template create facing problem [ either function redclare error or plugin not activating ]
<?php include_once( abspath . 'wp-admin/includes/plugin.php' ); // check plugin using plugin name if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { //code function default form if(! function_exists('wpcf7_default_form_template')){ function wpcf7_default_form_template() {} } } ?>
if utilize above code don't function redclare....
<?php include_once( abspath . 'wp-admin/includes/plugin.php' ); // check plugin using plugin name if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { //code function default form function wpcf7_default_form_template() {} } ?>
now abovecode need... want overide plugin file function function in function.php on plugin activation...
thank you!
in situation easiest way modify "contact-form-7" plugin core directly.
in experience, updating addons / core on production server rare thing, , won't it.
otherwise can seek search hooks within function, special subsystem in wordpress modify info @ point in functions.
php wordpress
Comments
Post a Comment