' . $source . ''; } return apply_filters( 'isc_overlay_html_source', $source, $image_id ); } /** * Check whether the source text is empty before AI labels are added. * * @param int $image_id Image ID. * @param string[] $data Metadata. * * @return bool */ private static function source_is_empty( int $image_id, array $data = [] ): bool { $source = $data['source'] ?? Image_Sources::get_image_source_text_raw( $image_id ); $own = $data['own'] ?? Standard_Source::use_standard_source( $image_id ); if ( $own && ! Standard_Source::hide_standard_source_for_image( $image_id ) ) { $source = Standard_Source::get_standard_source_text_for_attachment( $image_id ); } return '' === $source; } /** * Add pre-text * * @param string $source Source string. * @return string */ public static function add_prefix( $source ) { $options = self::get_options(); if ( empty( $options['source_pretext'] ) ) { return $source; } return $options['source_pretext'] . ' ' . $source; } /** * Check if the caption has a style in general * * @return bool */ public static function has_caption_style(): bool { $style = self::get_options()['caption_style']; return $style !== 'none'; } }