php 事件日历:将“所有事件”链接转换为真正的“后退”按钮。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 事件日历:将“所有事件”链接转换为真正的“后退”按钮。相关的知识,希望对你有一定的参考价值。

<?php
/**
 * The Events Calendar: Turn the "All Events" link into a true "Back" button.
 *
 * Generally not advisable but provided at customer's request:
 * https://theeventscalendar.com/support/forums/topic/upcoming-events-8/
 *
 * @link https://gist.github.com/cliffordp/60b5acf003fa68ad7803313d662c08e7
 * @link https://css-tricks.com/snippets/javascript/go-back-button/
 * @link https://api.jquery.com/replacewith/
 */
add_action( 'wp_footer', 'cliff_all_events_link_replaced_with_back_button' );
function cliff_all_events_link_replaced_with_back_button() {
	wp_enqueue_script( 'jquery' );
	?>
	<script type="text/javascript">
		jQuery( document ).ready( function () {
			var all_events = jQuery( 'p.tribe-events-back a' );

			// The following line is commented out because an "All Events" link that goes back to say the Blog Posts page would confuse the user.
			// var button_text = all_events.text().trim();
			var button_text = '&laquo; Go Back';

			var new_element = '<input type="button" value="';
			new_element += button_text;
			new_element += '" onclick="history.back(-1)" />';

			all_events.replaceWith( new_element );
		} );
	</script>
	<?php
}

以上是关于php 事件日历:将“所有事件”链接转换为真正的“后退”按钮。的主要内容,如果未能解决你的问题,请参考以下文章

php 将事件日历“所有事件”页面重定向到custon URL

从数据库获取事件并放置日历视图(android)

php 事件日历(TEC)和事件聚合器(EA):将站点B的导入TEC事件链接到站点A上的规范事件票证位置。

EventKit 日历的最后一个事件

日历中的重复事件 - Rails

使用php从字符串中显示日历上的日期