PATH:
home
/
urbaoubp
/
gns.pitgradnja.com
/
wp-content
/
plugins
/
jetpack
/
modules
/
shortcodes
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** * Display a list of upcoming events from a calendar. * * @package automattic/jetpack */ /** * Register a upcomingevents shortcode. * Most of the heavy lifting done in iCalendarReader class, * where the icalendar_render_events() function controls the display. */ class Upcoming_Events_Shortcode { /** * Register things. */ public static function init() { add_shortcode( 'upcomingevents', array( __CLASS__, 'shortcode' ) ); } /** * Register the shortcode. * * @param array $atts Shortcode attributes. */ public static function shortcode( $atts = array() ) { require_once JETPACK__PLUGIN_DIR . '/_inc/lib/icalendar-reader.php'; $atts = shortcode_atts( array( 'url' => '', 'number' => 0, ), $atts, 'upcomingevents' ); $args = array( 'context' => 'shortcode', 'number' => absint( $atts['number'] ), ); if ( empty( $atts['url'] ) ) { // If the current user can access the Appearance->Widgets page. if ( current_user_can( 'edit_theme_options' ) ) { return sprintf( '<p>%s</p>', __( 'You must specify a URL to an iCalendar feed in the shortcode. This notice is only displayed to administrators.', 'jetpack' ) ); } return self::no_upcoming_event_text(); } $events = icalendar_render_events( $atts['url'], $args ); if ( ! $events ) { $events = self::no_upcoming_event_text(); } return $events; } /** * Returns No Upcoming Event text. */ private static function no_upcoming_event_text() { return sprintf( '<p>%s</p>', __( 'No upcoming events', 'jetpack' ) ); } } add_action( 'after_setup_theme', array( 'Upcoming_Events_Shortcode', 'init' ), 2 );
[-] youtube.php
[edit]
[-] flickr.php
[edit]
[-] googlemaps.php
[edit]
[-] kickstarter.php
[edit]
[-] mailchimp.php
[edit]
[-] ted.php
[edit]
[-] unavailable.php
[edit]
[-] houzz.php
[edit]
[-] archiveorg.php
[edit]
[-] others.php
[edit]
[-] facebook.php
[edit]
[-] soundcloud.php
[edit]
[-] googleplus.php
[edit]
[-] instagram.php
[edit]
[+]
css
[-] twitter.php
[edit]
[-] mixcloud.php
[edit]
[-] gist.php
[edit]
[-] presentations.php
[edit]
[-] wufoo.php
[edit]
[-] ustream.php
[edit]
[-] googleapps.php
[edit]
[-] gravatar.php
[edit]
[-] twitter-timeline.php
[edit]
[-] codepen.php
[edit]
[-] smartframe.php
[edit]
[-] dailymotion.php
[edit]
[+]
images
[-] class.filter-embedded-html-objects.php
[edit]
[-] bandcamp.php
[edit]
[-] brightcove.php
[edit]
[-] archives.php
[edit]
[-] sitemap.php
[edit]
[-] getty.php
[edit]
[-] twitchtv.php
[edit]
[-] slideshare.php
[edit]
[-] quiz.php
[edit]
[-] inline-pdfs.php
[edit]
[-] vimeo.php
[edit]
[+]
..
[-] archiveorg-book.php
[edit]
[-] flatio.php
[edit]
[-] crowdsignal.php
[edit]
[-] pinterest.php
[edit]
[-] vr.php
[edit]
[-] medium.php
[edit]
[-] upcoming-events.php
[edit]
[-] videopress.php
[edit]
[-] spotify.php
[edit]
[-] cartodb.php
[edit]
[-] descript.php
[edit]
[+]
img
[-] recipe.php
[edit]
[-] untappd-menu.php
[edit]
[-] slideshow.php
[edit]
[-] tweet.php
[edit]
[-] vine.php
[edit]
[-] scribd.php
[edit]
[+]
js