@@ -13,24 +13,24 @@ discard block |
||
13 | 13 | * @return array |
14 | 14 | */ |
15 | 15 | function get_restricted_post_types() { |
16 | - $post_types = array( |
|
17 | - 'page', |
|
18 | - 'attachment', |
|
19 | - 'forum', |
|
20 | - 'topic', |
|
21 | - 'lesson', |
|
22 | - 'quiz', |
|
23 | - 'question', |
|
24 | - 'reply', |
|
25 | - 'popup', |
|
26 | - 'sensei_message', |
|
27 | - 'envira', |
|
28 | - 'soliloquy', |
|
29 | - 'certificate_template', |
|
30 | - 'certificate', |
|
31 | - 'project', |
|
32 | - ); |
|
33 | - return apply_filters( 'lsx_sharing_get_restricted_post_types', $post_types ); |
|
16 | + $post_types = array( |
|
17 | + 'page', |
|
18 | + 'attachment', |
|
19 | + 'forum', |
|
20 | + 'topic', |
|
21 | + 'lesson', |
|
22 | + 'quiz', |
|
23 | + 'question', |
|
24 | + 'reply', |
|
25 | + 'popup', |
|
26 | + 'sensei_message', |
|
27 | + 'envira', |
|
28 | + 'soliloquy', |
|
29 | + 'certificate_template', |
|
30 | + 'certificate', |
|
31 | + 'project', |
|
32 | + ); |
|
33 | + return apply_filters( 'lsx_sharing_get_restricted_post_types', $post_types ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -39,16 +39,16 @@ discard block |
||
39 | 39 | * @return array |
40 | 40 | */ |
41 | 41 | function get_to_post_types() { |
42 | - $post_types = array( |
|
43 | - 'accommodation', |
|
44 | - 'tour', |
|
45 | - 'destination', |
|
46 | - 'review', |
|
47 | - 'special', |
|
48 | - 'vehicle', |
|
49 | - 'activity', |
|
50 | - ); |
|
51 | - return apply_filters( 'lsx_sharing_get_to_post_types', $post_types ); |
|
42 | + $post_types = array( |
|
43 | + 'accommodation', |
|
44 | + 'tour', |
|
45 | + 'destination', |
|
46 | + 'review', |
|
47 | + 'special', |
|
48 | + 'vehicle', |
|
49 | + 'activity', |
|
50 | + ); |
|
51 | + return apply_filters( 'lsx_sharing_get_to_post_types', $post_types ); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | * @return array |
58 | 58 | */ |
59 | 59 | function get_hp_post_types() { |
60 | - $post_types = array( |
|
61 | - 'workout', |
|
62 | - 'exercise', |
|
63 | - 'recipe', |
|
64 | - 'meal', |
|
65 | - 'tip', |
|
66 | - ); |
|
67 | - return apply_filters( 'lsx_sharing_get_hp_post_types', $post_types ); |
|
60 | + $post_types = array( |
|
61 | + 'workout', |
|
62 | + 'exercise', |
|
63 | + 'recipe', |
|
64 | + 'meal', |
|
65 | + 'tip', |
|
66 | + ); |
|
67 | + return apply_filters( 'lsx_sharing_get_hp_post_types', $post_types ); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | * @return boolean |
74 | 74 | */ |
75 | 75 | function is_button_disabled( $post_type = '', $service = '' ) { |
76 | - $sharing = lsx_sharing(); |
|
77 | - $option = false; |
|
78 | - if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display'][ 'sharing_disable_' . $service ] ) ) { |
|
79 | - $option = true; |
|
80 | - } elseif ( true === $sharing->is_new_options && ! empty( $sharing->options[ $post_type . '_disable_' . $service ] ) ) { |
|
81 | - $option = true; |
|
82 | - } |
|
83 | - return apply_filters( 'lsx_sharing_is_button_disabled', $option ); |
|
76 | + $sharing = lsx_sharing(); |
|
77 | + $option = false; |
|
78 | + if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display'][ 'sharing_disable_' . $service ] ) ) { |
|
79 | + $option = true; |
|
80 | + } elseif ( true === $sharing->is_new_options && ! empty( $sharing->options[ $post_type . '_disable_' . $service ] ) ) { |
|
81 | + $option = true; |
|
82 | + } |
|
83 | + return apply_filters( 'lsx_sharing_is_button_disabled', $option ); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | * @return boolean |
90 | 90 | */ |
91 | 91 | function is_pt_disabled( $post_type = '' ) { |
92 | - $sharing = lsx_sharing(); |
|
93 | - $option = false; |
|
94 | - if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display'][ 'sharing_disable_pt_' . $post_type ] ) ) { |
|
95 | - $option = true; |
|
96 | - } elseif ( true === $sharing->is_new_options && isset( $sharing->options[ $post_type . '_disable_pt' ] ) ) { |
|
97 | - $option = true; |
|
98 | - } |
|
99 | - return apply_filters( 'lsx_sharing_is_pt_disabled', $option ); |
|
92 | + $sharing = lsx_sharing(); |
|
93 | + $option = false; |
|
94 | + if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display'][ 'sharing_disable_pt_' . $post_type ] ) ) { |
|
95 | + $option = true; |
|
96 | + } elseif ( true === $sharing->is_new_options && isset( $sharing->options[ $post_type . '_disable_pt' ] ) ) { |
|
97 | + $option = true; |
|
98 | + } |
|
99 | + return apply_filters( 'lsx_sharing_is_pt_disabled', $option ); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | * @return boolean |
106 | 106 | */ |
107 | 107 | function is_disabled() { |
108 | - $sharing = lsx_sharing(); |
|
109 | - $option = false; |
|
110 | - if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display']['sharing_disable_all'] ) ) { |
|
111 | - $option = true; |
|
112 | - } elseif ( true === $sharing->is_new_options && isset( $sharing->options['global_disable_all'] ) ) { |
|
113 | - $option = true; |
|
114 | - } |
|
115 | - return apply_filters( 'lsx_sharing_is_disabled', $option ); |
|
108 | + $sharing = lsx_sharing(); |
|
109 | + $option = false; |
|
110 | + if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display']['sharing_disable_all'] ) ) { |
|
111 | + $option = true; |
|
112 | + } elseif ( true === $sharing->is_new_options && isset( $sharing->options['global_disable_all'] ) ) { |
|
113 | + $option = true; |
|
114 | + } |
|
115 | + return apply_filters( 'lsx_sharing_is_disabled', $option ); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -121,16 +121,16 @@ discard block |
||
121 | 121 | * @return string |
122 | 122 | */ |
123 | 123 | function get_sharing_text( $post_type = '' ) { |
124 | - $sharing = lsx_sharing(); |
|
125 | - $text = ''; |
|
126 | - if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display']['sharing_label_text'] ) ) { |
|
127 | - $text = $sharing->options['display']['sharing_label_text']; |
|
128 | - } elseif ( true === $sharing->is_new_options ) { |
|
129 | - if ( isset( $sharing->options[ $post_type . '_label_text' ] ) ) { |
|
130 | - $text = $sharing->options[ $post_type . '_label_text' ]; |
|
131 | - } elseif ( isset( $sharing->options['global_label_text'] ) ) { |
|
132 | - $text = $sharing->options['global_label_text']; |
|
133 | - } |
|
134 | - } |
|
135 | - return $text; |
|
124 | + $sharing = lsx_sharing(); |
|
125 | + $text = ''; |
|
126 | + if ( false === $sharing->is_new_options && isset( $sharing->options['display'] ) && ! empty( $sharing->options['display']['sharing_label_text'] ) ) { |
|
127 | + $text = $sharing->options['display']['sharing_label_text']; |
|
128 | + } elseif ( true === $sharing->is_new_options ) { |
|
129 | + if ( isset( $sharing->options[ $post_type . '_label_text' ] ) ) { |
|
130 | + $text = $sharing->options[ $post_type . '_label_text' ]; |
|
131 | + } elseif ( isset( $sharing->options['global_label_text'] ) ) { |
|
132 | + $text = $sharing->options['global_label_text']; |
|
133 | + } |
|
134 | + } |
|
135 | + return $text; |
|
136 | 136 | } |