ID ) ) { $output .= get_the_post_thumbnail( $result->ID, array( $ata_settings['thumb_width'], $ata_settings['thumb_height'], ), array( 'title' => $title, 'alt' => $title, 'class' => 'ata_thumb', 'border' => '0', ) ); } else { $postimage = get_post_meta( $result->ID, $ata_settings['thumb_meta'], true ); if ( ! $postimage && $ata_settings['scan_images'] ) { preg_match_all( '||i', $result->post_content, $matches ); if ( isset( $matches ) && $matches[1][0] ) { $postimage = $matches[1][0]; // Get the first one only. } } if ( ! $postimage ) { // If no other thumbnail set, try to get the custom video thumbnail set by the Video Thumbnails plugin. $postimage = get_post_meta( $result->ID, '_video_thumbnail', true ); } if ( $ata_settings['thumb_default_show'] && ! $postimage ) { // If no thumb found and settings permit, use default thumb. $postimage = $ata_settings['thumb_default']; } if ( $postimage ) { $output .= '' . $title . ''; } } return apply_filters( 'ata_get_the_post_thumbnail', $output ); } /** * Function to create an excerpt for the post. * * @param integer $id Post ID. * @param mixed $excerpt_length Length of the excerpt in words. * @param bool $use_excerpt Use excerpt. * @return string The excerpt */ function ata_excerpt( $id, $excerpt_length = 0, $use_excerpt = true ) { $content = ''; if ( $use_excerpt ) { $content = get_post( $id )->post_excerpt; } if ( '' === $content ) { $content = get_post( $id )->post_content; } $output = strip_tags( strip_shortcodes( $content ) ); if ( $excerpt_length > 0 ) { $output = wp_trim_words( $output, $excerpt_length ); } return apply_filters( 'ata_excerpt', $output, $id, $excerpt_length, $use_excerpt ); } /* *---------------------------------------------------------------------------- * Include files *---------------------------------------------------------------------------- */ require_once ATA_PLUGIN_DIR . 'includes/admin/default-settings.php'; require_once ATA_PLUGIN_DIR . 'includes/admin/register-settings.php'; require_once ATA_PLUGIN_DIR . 'includes/content.php'; require_once ATA_PLUGIN_DIR . 'includes/header.php'; require_once ATA_PLUGIN_DIR . 'includes/footer.php'; require_once ATA_PLUGIN_DIR . 'includes/feed.php'; require_once ATA_PLUGIN_DIR . 'includes/modules/statcounter.php'; require_once ATA_PLUGIN_DIR . 'includes/modules/google-analytics.php'; require_once ATA_PLUGIN_DIR . 'includes/modules/tynt.php'; require_once ATA_PLUGIN_DIR . 'includes/modules/site-verification.php'; /* *---------------------------------------------------------------------------- * Dashboard and Administrative Functionality *---------------------------------------------------------------------------- */ if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { require_once ATA_PLUGIN_DIR . 'includes/admin/admin.php'; require_once ATA_PLUGIN_DIR . 'includes/admin/settings-page.php'; require_once ATA_PLUGIN_DIR . 'includes/admin/save-settings.php'; require_once ATA_PLUGIN_DIR . 'includes/admin/help-tab.php'; } /* *---------------------------------------------------------------------------- * Deprecated functions, variables and constants *---------------------------------------------------------------------------- */ require_once ATA_PLUGIN_DIR . '/includes/deprecated.php';