@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @return array |
14 | 14 | */ |
15 | -function get_restricted_post_types() { |
|
16 | - $post_types = array( |
|
15 | +function get_restricted_post_types(){ |
|
16 | + $post_types=array( |
|
17 | 17 | 'page', |
18 | 18 | 'attachment', |
19 | 19 | 'forum', |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | 'certificate', |
31 | 31 | 'project', |
32 | 32 | ); |
33 | - return apply_filters( 'lsx_sharing_get_restricted_post_types', $post_types ); |
|
33 | + return apply_filters('lsx_sharing_get_restricted_post_types',$post_types); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @return array |
40 | 40 | */ |
41 | -function get_to_post_types() { |
|
42 | - $post_types = array( |
|
41 | +function get_to_post_types(){ |
|
42 | + $post_types=array( |
|
43 | 43 | 'accommodation', |
44 | 44 | 'tour', |
45 | 45 | 'destination', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'vehicle', |
49 | 49 | 'activity', |
50 | 50 | ); |
51 | - return apply_filters( 'lsx_sharing_get_to_post_types', $post_types ); |
|
51 | + return apply_filters('lsx_sharing_get_to_post_types',$post_types); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @return array |
58 | 58 | */ |
59 | -function get_hp_post_types() { |
|
60 | - $post_types = array( |
|
59 | +function get_hp_post_types(){ |
|
60 | + $post_types=array( |
|
61 | 61 | 'workout', |
62 | 62 | 'exercise', |
63 | 63 | 'recipe', |
64 | 64 | 'meal', |
65 | 65 | 'tip', |
66 | 66 | ); |
67 | - return apply_filters( 'lsx_sharing_get_hp_post_types', $post_types ); |
|
67 | + return apply_filters('lsx_sharing_get_hp_post_types',$post_types); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -72,15 +72,15 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @return boolean |
74 | 74 | */ |
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; |
|
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 | 82 | } |
83 | - return apply_filters( 'lsx_sharing_is_button_disabled', $option ); |
|
83 | + return apply_filters('lsx_sharing_is_button_disabled',$option); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -88,15 +88,15 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @return boolean |
90 | 90 | */ |
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; |
|
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 | 98 | } |
99 | - return apply_filters( 'lsx_sharing_is_pt_disabled', $option ); |
|
99 | + return apply_filters('lsx_sharing_is_pt_disabled',$option); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return boolean |
106 | 106 | */ |
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; |
|
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 | 114 | } |
115 | - return apply_filters( 'lsx_sharing_is_disabled', $option ); |
|
115 | + return apply_filters('lsx_sharing_is_disabled',$option); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -120,16 +120,16 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @return string |
122 | 122 | */ |
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']; |
|
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 | 133 | } |
134 | 134 | } |
135 | 135 | return $text; |