| @@ 1227-1244 (lines=18) @@ | ||
| 1224 | * @param String $post_type custom post type identifier |
|
| 1225 | * @return bool |
|
| 1226 | */ |
|
| 1227 | function is_single_post_enabled( $post_type = 'post' ) { |
|
| 1228 | $options = $this->get_options(); |
|
| 1229 | return (bool) apply_filters( |
|
| 1230 | /** |
|
| 1231 | * Filters whether Likes should be enabled on single posts. |
|
| 1232 | * |
|
| 1233 | * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. |
|
| 1234 | * |
|
| 1235 | * @module likes |
|
| 1236 | * |
|
| 1237 | * @since 2.2.0 |
|
| 1238 | * |
|
| 1239 | * @param bool $enabled Are Post Likes enabled on single posts? |
|
| 1240 | */ |
|
| 1241 | "wpl_is_single_{$post_type}_disabled", |
|
| 1242 | (bool) in_array( $post_type, $options['show'] ) |
|
| 1243 | ); |
|
| 1244 | } |
|
| 1245 | ||
| 1246 | /** |
|
| 1247 | * Are Post Likes enabled on single pages? |
|
| @@ 1251-1263 (lines=13) @@ | ||
| 1248 | * |
|
| 1249 | * @return bool |
|
| 1250 | */ |
|
| 1251 | function is_single_page_enabled() { |
|
| 1252 | $options = $this->get_options(); |
|
| 1253 | /** |
|
| 1254 | * Filters whether Likes should be enabled on single pages. |
|
| 1255 | * |
|
| 1256 | * @module likes |
|
| 1257 | * |
|
| 1258 | * @since 2.2.0 |
|
| 1259 | * |
|
| 1260 | * @param bool $enabled Are Post Likes enabled on single pages? |
|
| 1261 | */ |
|
| 1262 | return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); |
|
| 1263 | } |
|
| 1264 | ||
| 1265 | /** |
|
| 1266 | * Are Media Likes enabled on single pages? |
|