| @@ 365-382 (lines=18) @@ | ||
| 362 | * @param String $post_type custom post type identifier |
|
| 363 | * @return bool |
|
| 364 | */ |
|
| 365 | function is_single_post_enabled( $post_type = 'post' ) { |
|
| 366 | $options = $this->get_options(); |
|
| 367 | return (bool) apply_filters( |
|
| 368 | /** |
|
| 369 | * Filters whether Likes should be enabled on single posts. |
|
| 370 | * |
|
| 371 | * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled. |
|
| 372 | * |
|
| 373 | * @module likes |
|
| 374 | * |
|
| 375 | * @since 2.2.0 |
|
| 376 | * |
|
| 377 | * @param bool $enabled Are Post Likes enabled on single posts? |
|
| 378 | */ |
|
| 379 | "wpl_is_single_{$post_type}_disabled", |
|
| 380 | (bool) in_array( $post_type, $options['show'] ) |
|
| 381 | ); |
|
| 382 | } |
|
| 383 | ||
| 384 | /** |
|
| 385 | * Get the 'disabled_likes' option from the DB of the current blog. |
|
| @@ 452-464 (lines=13) @@ | ||
| 449 | * |
|
| 450 | * @return bool |
|
| 451 | */ |
|
| 452 | function is_single_page_enabled() { |
|
| 453 | $options = $this->get_options(); |
|
| 454 | /** |
|
| 455 | * Filters whether Likes should be enabled on single pages. |
|
| 456 | * |
|
| 457 | * @module likes |
|
| 458 | * |
|
| 459 | * @since 2.2.0 |
|
| 460 | * |
|
| 461 | * @param bool $enabled Are Post Likes enabled on single pages? |
|
| 462 | */ |
|
| 463 | return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) ); |
|
| 464 | } |
|
| 465 | ||
| 466 | /** |
|
| 467 | * Are Media Likes enabled on single pages? |
|