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