• Hello,

    I’m trying to override a plugin class with my own.

    The plugin class is

    ` function yith_woocompare_constructor() {
    // stuff here

    }
    add_action( ‘plugins_loaded’, ‘yith_woocompare_constructor’ );`

    So in my functions.php I tried to do like that

    ` remove_action( ‘plugins_loaded’, ‘yith_woocompare_constructor’, 0 );
    // now add your own filter
    add_action( ‘plugins_loaded’, ‘new_yith_woocompare_constructor’, 0 );

    function new_yith_woocompare_constructor()
    {
    // my stuff here
    } `

    But It doesn’t seem to be working, what Am I doing wrong ?

    I checked the return value of remove_action and it is false, why ?

  • The topic ‘Override plugin function’ is closed to new replies.