| @@ 334-351 (lines=18) @@ | ||
| 331 | * @param String $post_type custom post type identifier |
|
| 332 | * @return bool |
|
| 333 | */ |
|
| 334 | function is_single_post_enabled( $post_type = 'post' ) { |
|
| 335 | $options = $this->get_options(); |
|
| 336 | return (bool) apply_filters( |
|
| 337 | /** |
|
| 338 | * Filters whether Likes should be enabled on single posts. |
|
| 339 | * |
|
| 340 | * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. |
|
| 341 | * |
|
| 342 | * @module likes |
|
| 343 | * |
|
| 344 | * @since 2.2.0 |
|
| 345 | * |
|
| 346 | * @param bool $enabled Are Post Likes enabled on single posts? |
|
| 347 | */ |
|
| 348 | "wpl_is_single_{$post_type}_disabled", |
|
| 349 | (bool) in_array( $post_type, $options['show'] ) |
|
| 350 | ); |
|
| 351 | } |
|
| 352 | ||
| 353 | /** |
|
| 354 | * Get the 'disabled_likes' option from the DB of the current blog. |
|
| @@ 421-433 (lines=13) @@ | ||
| 418 | * |
|
| 419 | * @return bool |
|
| 420 | */ |
|
| 421 | function is_single_page_enabled() { |
|
| 422 | $options = $this->get_options(); |
|
| 423 | /** |
|
| 424 | * Filters whether Likes should be enabled on single pages. |
|
| 425 | * |
|
| 426 | * @module likes |
|
| 427 | * |
|
| 428 | * @since 2.2.0 |
|
| 429 | * |
|
| 430 | * @param bool $enabled Are Post Likes enabled on single pages? |
|
| 431 | */ |
|
| 432 | return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); |
|
| 433 | } |
|
| 434 | ||
| 435 | /** |
|
| 436 | * Are Media Likes enabled on single pages? |
|