WordPress.org

Ready to get started?Download WordPress

Forums

How to use another plugin's functions in my theme functions.php? (2 posts)

  1. DDT
    Member
    Posted 7 months ago #

    Hello,

    How can i use a plugin's function from my theme functions.php, at the moment i have

    function test_totals(){
        require_once(WP_PLUGIN_URL . '/wp-e-commerce-style-email/mail.class.php');
        return "Total, please ".ecse_get_the_totals();
    }

    But i get a Fatal error: Call to undefined function ecse_get_the_totals()?

    Any suggestions?

  2. esmi
    Forum Moderator
    Posted 7 months ago #

    Have you tried asking the plugin's developer?

    a more elegant way of implementing the above code so that the site doesn't collapse would be to use:

    function test_totals(){
        if(function_exists( 'ecse_get_the_totals' ) ) return "Total, please ".ecse_get_the_totals();
    }

Reply

You must log in to post.

About this Topic

Tags