Override a plugin class function

Finally, I figured out how to solve my problem:

class Import_Facebook_Events_Facebook_Ext extends Import_Facebook_Events_Facebook {

    function get_location( $facebook_event ) {

        if ( !isset( $facebook_event->place->id ) ) {
            $facebook_event->place->id = '';
            //return null;
        }
        //other code here

        return $event_location;
    }
}

$new_ife_events = run_import_facebook_events();
$new_ife_events->facebook = new Import_Facebook_Events_Facebook_Ext();

A question: the last two code lines must be included in a function/action?

Leave a Comment