PHP 8.1.33
Preview: bbpress.cls.php Size: 2.32 KB
/home/jambtst2015/public_html/tomorrowzfurniture.com/wp-content/plugins/litespeed-cache/thirdparty/bbpress.cls.php

<?php
/**
 * The Third Party integration with the bbPress plugin.
 *
 * @since		1.0.5
 */
namespace LiteSpeed\Thirdparty;

defined('WPINC') || exit();

use LiteSpeed\Router;

class BBPress
{
	/**
	 * Detect if bbPress is installed and if the page is a bbPress page.
	 *
	 * @since 1.0.5
	 * @access public
	 */
	public static function detect()
	{
		if (function_exists('is_bbpress')) {
			add_action('litespeed_api_purge_post', __CLASS__ . '::on_purge'); //todo
			if (apply_filters('litespeed_esi_status', false)) {
				// don't consider private cache yet (will do if any feedback)
				add_action('litespeed_control_finalize', __CLASS__ . '::set_control');
			}
		}
	}

	/**
	 * This filter is used to let the cache know if a page is cacheable.
	 *
	 * @access public
	 * @since 1.2.0
	 */
	public static function set_control()
	{
		if (!apply_filters('litespeed_control_cacheable', false)) {
			return;
		}

		// set non ESI public
		if (is_bbpress() && Router::is_logged_in()) {
			do_action('litespeed_control_set_nocache', 'bbpress nocache due to loggedin');
		}
	}

	/**
	 * When a bbPress page is purged, need to purge the forums list and
	 * any/all ancestor pages.
	 *
	 * @since 1.0.5
	 * @access public
	 * @param integer $post_id The post id of the page being purged.
	 */
	public static function on_purge($post_id)
	{
		if (!is_bbpress()) {
			if (!function_exists('bbp_is_forum') || !function_exists('bbp_is_topic') || !function_exists('bbp_is_reply')) {
				return;
			}
			if (!bbp_is_forum($post_id) && !bbp_is_topic($post_id) && !bbp_is_reply($post_id)) {
				return;
			}
		}

		// Need to purge base forums page, bbPress page was updated.
		do_action('litespeed_purge_posttype', bbp_get_forum_post_type());
		$ancestors = get_post_ancestors($post_id);

		// If there are ancestors, need to purge them as well.
		if (!empty($ancestors)) {
			foreach ($ancestors as $ancestor) {
				do_action('litespeed_purge_post', $ancestor);
			}
		}

		global $wp_widget_factory;
		if (bbp_is_reply($post_id) && !is_null($wp_widget_factory->widgets['BBP_Replies_Widget'])) {
			do_action('litespeed_purge_widget', $wp_widget_factory->widgets['BBP_Replies_Widget']->id);
		}
		if (bbp_is_topic($post_id) && !is_null($wp_widget_factory->widgets['BBP_Topics_Widget'])) {
			do_action('litespeed_purge_widget', $wp_widget_factory->widgets['BBP_Topics_Widget']->id);
		}
	}
}

Directory Contents

Dirs: 0 × Files: 30

Name Size Perms Modified Actions
1.79 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.88 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
730 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
647 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.32 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
933 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
403 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.20 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.34 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.46 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
685 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
525 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
4.64 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
6.15 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
575 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
875 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
509 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
645 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
932 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
594 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
23.78 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
3.45 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
184 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
480 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
606 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
793 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
689 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
627 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
704 B lrw-r--r-- 2024-11-22 17:53:11
Edit Download
4.32 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).