| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/repository/wp-content/plugins/jetpack/modules/shortcodes/ |
Upload File : |
<?php
/**
* Most of the heavy lifting done in iCalendarReader class
*/
class Upcoming_Events_Shortcode {
public static function init() {
add_shortcode( 'upcomingevents', array( __CLASS__, 'shortcode' ) );
}
public static function shortcode( $atts = array() ) {
jetpack_require_lib( 'icalendar-reader' );
$atts = shortcode_atts( array( 'url' => '', 'number' => 0 ), $atts, 'upcomingevents' );
$args = array(
'context' => 'shortcode',
'number' => absint( $atts['number'] ),
);
$events = icalendar_render_events( $atts['url'], $args );
if ( ! $events ) {
$events = sprintf( '<p>%s</p>', __( 'No upcoming events', 'jetpack' ) );
}
return $events;
}
}
add_action( 'plugins_loaded', array( 'Upcoming_Events_Shortcode', 'init' ), 101 );