I'm writing a custom plugin to tap into an external database, and I'm getting the overall results I want. However, I want to wrap my return values around a conditional to avoid processing unnecessary queries further down the line - this bit doesn't seem to be working :-/
Basically I want to check whether the current date is Christmas Day. So I have this early on in my logic:
if($date[2]=="25" && $date[1]=="12") {
$this->return_data = '<p>Sorry, there are no sailings on Christmas Day.</p>';
}
If it is 25/12, then obviously output the above message and ignore the rest of the plugin, otherwise run the SQL and return a timetable.
Whats happening is (when I change the date to today) it continues through the plugin, always outputting the timetable, presumably because I've nothing to stop the plugin after it returns the data in this conditional.
Do I need to wrap this in an if/else structure? Or can I break the processing somehow?