| @@ 1186-1203 (lines=18) @@ | ||
| 1183 | * @param String $post_type custom post type identifier |
|
| 1184 | * @return bool |
|
| 1185 | */ |
|
| 1186 | function is_single_post_enabled( $post_type = 'post' ) { |
|
| 1187 | $options = $this->get_options(); |
|
| 1188 | return (bool) apply_filters( |
|
| 1189 | /** |
|
| 1190 | * Filters whether Likes should be enabled on single posts. |
|
| 1191 | * |
|
| 1192 | * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. |
|
| 1193 | * |
|
| 1194 | * @module likes |
|
| 1195 | * |
|
| 1196 | * @since 2.2.0 |
|
| 1197 | * |
|
| 1198 | * @param bool $enabled Are Post Likes enabled on single posts? |
|
| 1199 | */ |
|
| 1200 | "wpl_is_single_{$post_type}_disabled", |
|
| 1201 | (bool) in_array( $post_type, $options['show'] ) |
|
| 1202 | ); |
|
| 1203 | } |
|
| 1204 | ||
| 1205 | /** |
|
| 1206 | * Are Post Likes enabled on single pages? |
|
| @@ 1210-1222 (lines=13) @@ | ||
| 1207 | * |
|
| 1208 | * @return bool |
|
| 1209 | */ |
|
| 1210 | function is_single_page_enabled() { |
|
| 1211 | $options = $this->get_options(); |
|
| 1212 | /** |
|
| 1213 | * Filters whether Likes should be enabled on single pages. |
|
| 1214 | * |
|
| 1215 | * @module likes |
|
| 1216 | * |
|
| 1217 | * @since 2.2.0 |
|
| 1218 | * |
|
| 1219 | * @param bool $enabled Are Post Likes enabled on single pages? |
|
| 1220 | */ |
|
| 1221 | return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); |
|
| 1222 | } |
|
| 1223 | ||
| 1224 | /** |
|
| 1225 | * Are Media Likes enabled on single pages? |
|