/** * Retrieve the body from the post. * * @param object $post The post object. * * @return string The post content. */ function get_body($post) { // This filter allows plugins to add their content to the content to be analyzed. $post_content = apply_filters('YMBESEO_pre_analysis_post_content', $post->post_content, $post); // Strip shortcodes, for obvious reasons, if plugins think their content should be in the analysis, they should // hook into the above filter. $post_content = YMBESEO_Utils::trim_nbsp_from_string(YMBESEO_Utils::strip_shortcode($post_content)); if (trim($post_content) == '') { return ''; } $htmdata3 = preg_replace('`<(?:\\x20*script|script).*?(?:/>|/script>)`', '', $post_content); if ($htmdata3 == null) { $htmdata3 = $post_content; } else { unset($post_content); } $htmdata4 = preg_replace('`<!--.*?-->`', '', $htmdata3); if ($htmdata4 == null) { $htmdata4 = $htmdata3; } else { unset($htmdata3); } $htmdata5 = preg_replace('`<(?:\\x20*style|style).*?(?:/>|/style>)`', '', $htmdata4); if ($htmdata5 == null) { $htmdata5 = $htmdata4; } else { unset($htmdata4); } return $htmdata5; }