PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
jetpack
/
modules
/
shortcodes
<?php /** * Archives shortcode * * @author bubel & nickmomrik * [archives limit=10] * * @package automattic/jetpack */ add_shortcode( 'archives', 'archives_shortcode' ); /** * Display Archives shortcode. * * @param array $atts Shortcode attributes. */ function archives_shortcode( $atts ) { if ( is_feed() ) { return '[archives]'; } global $allowedposttags; $default_atts = array( 'type' => 'postbypost', 'limit' => '', 'format' => 'html', 'showcount' => false, 'before' => '', 'after' => '', 'order' => 'desc', ); $attr = shortcode_atts( $default_atts, $atts, 'archives' ); if ( ! in_array( $attr['type'], array( 'yearly', 'monthly', 'daily', 'weekly', 'postbypost' ), true ) ) { $attr['type'] = 'postbypost'; } if ( ! in_array( $attr['format'], array( 'html', 'option', 'custom' ), true ) ) { $attr['format'] = 'html'; } $limit = (int) $attr['limit']; // A Limit of 0 makes no sense so revert back to the default. if ( empty( $limit ) ) { $limit = ''; } $showcount = ( false !== $attr['showcount'] && 'false' !== $attr['showcount'] ) ? true : false; $before = wp_kses( $attr['before'], $allowedposttags ); $after = wp_kses( $attr['after'], $allowedposttags ); // Get the archives. $archives = wp_get_archives( array( 'type' => $attr['type'], 'limit' => $limit, 'format' => $attr['format'], 'echo' => false, 'show_post_count' => $showcount, 'before' => $before, 'after' => $after, ) ); if ( 'asc' === $attr['order'] ) { $archives = implode( "\n", array_reverse( explode( "\n", $archives ) ) ); } // Check to see if there are any archives. if ( empty( $archives ) ) { $archives = '<p>' . __( 'Your blog does not currently have any published posts.', 'jetpack' ) . '</p>'; } elseif ( 'option' === $attr['format'] ) { $is_amp = class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request(); $change_attribute = $is_amp ? 'on="change:AMP.navigateTo(url=event.value)"' : 'onchange="document.location.href=this.options[this.selectedIndex].value;"'; $archives = '<select name="archive-dropdown" ' . $change_attribute . '><option value="' . get_permalink() . '">--</option>' . $archives . '</select>'; } elseif ( 'html' === $attr['format'] ) { $archives = '<ul>' . $archives . '</ul>'; } return $archives; }
[-] class.filter-embedded-html-objects.php
[edit]
[-] vimeo.php
[edit]
[-] inline-pdfs.php
[edit]
[+]
js
[-] vine.php
[edit]
[-] getty.php
[edit]
[-] twitter-timeline.php
[edit]
[-] codepen.php
[edit]
[-] upcoming-events.php
[edit]
[-] archiveorg-book.php
[edit]
[-] archiveorg.php
[edit]
[-] tweet.php
[edit]
[-] videopress.php
[edit]
[+]
..
[-] youtube.php
[edit]
[-] dailymotion.php
[edit]
[-] mixcloud.php
[edit]
[-] untappd-menu.php
[edit]
[-] crowdsignal.php
[edit]
[+]
img
[-] cartodb.php
[edit]
[-] presentations.php
[edit]
[-] others.php
[edit]
[-] recipe.php
[edit]
[-] unavailable.php
[edit]
[-] flickr.php
[edit]
[-] vr.php
[edit]
[-] gist.php
[edit]
[-] twitchtv.php
[edit]
[-] pinterest.php
[edit]
[-] quiz.php
[edit]
[+]
css
[-] bandcamp.php
[edit]
[-] wufoo.php
[edit]
[-] hulu.php
[edit]
[-] ustream.php
[edit]
[-] slideshare.php
[edit]
[-] kickstarter.php
[edit]
[-] soundcloud.php
[edit]
[-] sitemap.php
[edit]
[-] scribd.php
[edit]
[-] googleapps.php
[edit]
[-] houzz.php
[edit]
[-] facebook.php
[edit]
[+]
images
[-] instagram.php
[edit]
[-] mailchimp.php
[edit]
[-] archives.php
[edit]
[-] spotify.php
[edit]
[-] googleplus.php
[edit]
[-] googlemaps.php
[edit]
[-] slideshow.php
[edit]
[-] ted.php
[edit]
[-] wordads.php
[edit]
[-] gravatar.php
[edit]
[-] brightcove.php
[edit]
[-] flatio.php
[edit]
[-] medium.php
[edit]