| @@ 1214-1231 (lines=18) @@ | ||
| 1211 | * @param String $post_type custom post type identifier |
|
| 1212 | * @return bool |
|
| 1213 | */ |
|
| 1214 | function is_single_post_enabled( $post_type = 'post' ) { |
|
| 1215 | $options = $this->get_options(); |
|
| 1216 | return (bool) apply_filters( |
|
| 1217 | /** |
|
| 1218 | * Filters whether Likes should be enabled on single posts. |
|
| 1219 | * |
|
| 1220 | * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. |
|
| 1221 | * |
|
| 1222 | * @module likes |
|
| 1223 | * |
|
| 1224 | * @since 2.2.0 |
|
| 1225 | * |
|
| 1226 | * @param bool $enabled Are Post Likes enabled on single posts? |
|
| 1227 | */ |
|
| 1228 | "wpl_is_single_{$post_type}_disabled", |
|
| 1229 | (bool) in_array( $post_type, $options['show'] ) |
|
| 1230 | ); |
|
| 1231 | } |
|
| 1232 | ||
| 1233 | /** |
|
| 1234 | * Are Post Likes enabled on single pages? |
|
| @@ 1238-1250 (lines=13) @@ | ||
| 1235 | * |
|
| 1236 | * @return bool |
|
| 1237 | */ |
|
| 1238 | function is_single_page_enabled() { |
|
| 1239 | $options = $this->get_options(); |
|
| 1240 | /** |
|
| 1241 | * Filters whether Likes should be enabled on single pages. |
|
| 1242 | * |
|
| 1243 | * @module likes |
|
| 1244 | * |
|
| 1245 | * @since 2.2.0 |
|
| 1246 | * |
|
| 1247 | * @param bool $enabled Are Post Likes enabled on single pages? |
|
| 1248 | */ |
|
| 1249 | return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); |
|
| 1250 | } |
|
| 1251 | ||
| 1252 | /** |
|
| 1253 | * Are Media Likes enabled on single pages? |
|