Wordpress Plugin

53 views
Skip to first unread message

Admin SCCA

unread,
Jan 31, 2024, 9:49:35 PM1/31/24
to motorsportreg-api-developers
Hey Brian - not sure if you saw this from other conversations I was having with support, but the WordPress plugin seems to be missing some quotation marks in an important area.  Line 277-310 should be updated to:

        $start=$event["start"];
   
if($field_eventdate){
$start=$event["start"];
$end=$event["end"];
if(!$end)
$out .='<td>'.date_display_formate($start).'</td>';
else
$out .='<td>'.date_display_formate($start,$end).'</td>';
}

if($field_eventname)
$out .='<td>'.$event["name"].'</td>';

if($field_organization)
$out .='<td>'.$event["organization"]["name"].'</td>';

if($field_venue)
$out .='<td>'.$event["venue"]["name"].'</td>';

if($field_venuecity)
$out .='<td>'.$event["venue"]["city"].', '.$event["venue"]["region"].'</td>';

if($field_eventtype)
$out .='<td>'.$event["type"].'</td>';

$r_start=$event["registration"]["start"];
$r_end=$event["registration"]["end"];
$flag=registr_display_formate($r_start,$r_end);
if($show){
if($flag)
$out .='<td><a href="'.$event['detailuri'].'" class="imglink"><img src="' . plugins_url('calendar/images/register.gif', __FILE__) . '" height="17" width="85" alt="Register now on MotorsportReg.com" /></a></td>';
else
$out .='<td><a href="'.$event['detailuri'].'" class="txtlink">More Details</a></td>';

Admin SCCA

unread,
Jan 31, 2024, 10:57:55 PM1/31/24
to motorsportreg-api-developers
And it appears that this is undocumented, but for us less than stellar coders, it looks like you can actually pass a URL to the shortcode to override the one in the settings, e.g.    

[msr_calendar url="https://api.motorsportreg.com/rest/calendars/organization/<your org id here>?types=E45CDE72-A859-E79F-D0CB8D7C1A6D415B,4DC7FA93-AF1F-8454-1A71E330357E382C"]

Woo hoo!

Brian Ghidinelli

unread,
Feb 1, 2024, 8:44:44 PM2/1/24
to motorsportreg-api-developers
Thanks for the bug report! We didn't develop the Wordpress plugin internally so I will look into getting someone to give it a once over and make sure it will remain compatible with future versions of Wordpress.

We also have our new widget powered by our GraphQL API which we'd encourage folks to look at for a more visually engaging display of your events: https://assets.motorsportreg.com/gec/docs/widget/

Brian

Brian Ghidinelli

unread,
Feb 14, 2024, 3:32:59 PM2/14/24
to motorsportreg-api-developers
Circling back on this - we'll be releasing a small update to the plugin. I did not, however, find any bugs with the existing code and didn't require the above modification so I'm not sure what happened there. I tested up thru 6.4.3 on PHP 8.2.15. I did make a few other changes and improvements though and will release those shortly. 

If anyone wants to grab the code or contribute to it, you can find it here: https://github.com/MotorsportReg/calendar-wordpress

Thanks for the feedback!


Brian

Reply all
Reply to author
Forward
0 new messages