Passed
Push — master ( 4d6c6a...7456b9 )
by Fernando
02:10
created

the-events-calendar.php ➔ lsx_tec_theme_wrapper_start()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 7
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * LSX functions and definitions - The Events Calendar.
4
 *
5
 * @package    lsx
6
 * @subpackage the-events-calendar
7
 */
8
9
if ( ! defined( 'ABSPATH' ) ) {
10
	exit;
11
}
12
13
if ( ! function_exists( 'lsx_tec_scripts_add_styles' ) ) :
14
15
	/**
16
	 * The Events Calendar enqueue styles.
17
	 *
18
	 * @package    lsx
19
	 * @subpackage the-events-calendar
20
	 */
21
	function lsx_tec_scripts_add_styles() {
22
		wp_enqueue_style( 'the-events-calendar-lsx', get_template_directory_uri() . '/assets/css/the-events-calendar.css', array( 'lsx_main' ), LSX_VERSION );
23
		wp_style_add_data( 'the-events-calendar-lsx', 'rtl', 'replace' );
24
	}
25
26
	add_action( 'wp_enqueue_scripts', 'lsx_tec_scripts_add_styles' );
27
28
endif;
29
30 View Code Duplication
if ( ! function_exists( 'lsx_tec_theme_wrapper_start' ) ) :
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
32
	/**
33
	 * The Events Calendar wrapper start.
34
	 *
35
	 * @package    lsx
36
	 * @subpackage the-events-calendar
37
	 */
38
	function lsx_tec_theme_wrapper_start() {
39
		lsx_content_wrap_before();
40
		echo '<div id="primary" class="content-area ' . esc_attr( lsx_main_class() ) . '">';
41
		lsx_content_before();
42
		echo '<main id="main" class="site-main" role="main">';
43
		lsx_content_top();
44
	}
45
46
	add_action( 'tribe_events_before_html', 'lsx_tec_theme_wrapper_start', 9 );
47
48
endif;
49
50 View Code Duplication
if ( ! function_exists( 'lsx_tec_theme_wrapper_end' ) ) :
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
52
	/**
53
	 * The Events Calendar wrapper end.
54
	 *
55
	 * @package    lsx
56
	 * @subpackage the-events-calendar
57
	 */
58
	function lsx_tec_theme_wrapper_end() {
59
		lsx_content_bottom();
60
		echo '</main>';
61
		lsx_content_after();
62
		echo '</div>';
63
		lsx_content_wrap_after();
64
	}
65
66
	add_action( 'tribe_events_after_html', 'lsx_tec_theme_wrapper_end', 11 );
67
68
endif;
69
70
if ( ! function_exists( 'lsx_tec_disable_lsx_banner' ) ) :
71
72
	/**
73
	 * Disable LSX Banners in some pages.
74
	 *
75
	 * @package    lsx
76
	 * @subpackage the-events-calendar
77
	 */
78
	function lsx_tec_disable_lsx_banner( $disabled ) {
79
		global $current_screen;
80
81
		$post_types = apply_filters( 'tribe_is_post_type_screen_post_types', Tribe__Main::get_post_types() );
82
83
		if ( ! in_array( $current_screen->post_type, $post_types ) ) {
84
			$disabled = true;
85
		}
86
87
		if ( is_null( $id ) && false !== strpos( $current_screen->id, 'tribe' ) ) {
0 ignored issues
show
Bug introduced by
The variable $id does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
88
			$disabled = true;
89
		}
90
91
		if ( is_single() && tribe_is_event() ) {
92
			$disabled = true;
93
		}
94
95
		return $disabled;
96
	}
97
98
	// LSX
99
	add_filter( 'lsx_global_header_disable', 'lsx_tec_disable_lsx_banner' );
100
	// LSX Banners - Plugin, Placeholders
101
	add_filter( 'lsx_banner_plugin_disable', 'lsx_tec_disable_lsx_banner' );
102
	// LSX Banners - Banner
103
	add_filter( 'lsx_banner_disable', 'lsx_tec_disable_lsx_banner' );
104
105
endif;
106