Kate Anderson on July 17, 2023
/**
* SNN Article Link Cleanup & Display Stability
* Disable BOTH "Link Cleaner" and "WP Perf" before activating.
* Paste into Code Snippets as PHP; run everywhere.
*
* Standard RSS feeds, REST output, schema and article identifiers
* are not rewritten. Requires WordPress 6.2+ for link cleanup.
*/
if ( ! class_exists( 'SNN_Safe_Display_20261031', false ) ) {
final class SNN_Safe_Display_20261031 {
public static function boot() {
add_action( 'init', array( __CLASS__, 'head_cleanup' ), 20 );
add_filter( 'the_content', array( __CLASS__, 'article_links' ), 99 );
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'display_css' ), 100 );
}
public static function head_cleanup() {
if ( is_admin() ) {
return;
}
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}
public static function skip_request() {
return is_admin()
|| is_feed()
|| is_trackback()
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|| wp_doing_ajax()
|| is_preview();
}
/**
* Remove UTM parameters while preserving other query parameters,
* their order, encoding and the URL fragment.
*/
public static function clean_url( $url ) {
if ( ! is_string( $url ) || $url === '' ) {
return $url;
}
// Preserve non-web schemes such as mailto:, tel: and data:.
if (
preg_match( '/^[a-z][a-z0-9+.-]*:/i', $url )
&& ! preg_match( '~^https?://~i', $url )
) {
return $url;
}
$parts = explode( '#', $url, 2 );
$base = explode( '?', $parts[0], 2 );
if ( count( $base ) !== 2 ) {
return $url;
}
$pairs = explode( '&', $base[1] );
// Preserve commonly signed URLs.
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = strtolower( urldecode( $parameter[0] ) );
if (
in_array(
$key,
array(
'signature',
'sig',
'x-amz-signature',
'x-goog-signature',
),
true
)
) {
return $url;
}
}
$kept = array();
$changed = false;
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = urldecode( $parameter[0] );
if ( stripos( $key, 'utm_' ) === 0 ) {
$changed = true;
continue;
}
$kept[] = $pair;
}
if ( ! $changed ) {
return $url;
}
$query = implode( '&', $kept );
return $base[0]
. ( $query !== '' ? '?' . $query : '' )
. ( isset( $parts[1] ) ? '#' . $parts[1] : '' );
}
/**
* Clean anchor URLs in displayed single-post content only.
* Do not buffer or rewrite the full page or feed response.
*/
public static function article_links( $html ) {
if (
! is_string( $html )
|| self::skip_request()
|| ! is_singular( 'post' )
|| ! in_the_loop()
|| ! is_main_query()
|| apply_filters( 'snn_safe_display_skip_links', false )
|| ! class_exists( 'WP_HTML_Tag_Processor' )
) {
return $html;
}
$processor = new WP_HTML_Tag_Processor( $html );
while ( $processor->next_tag( 'A' ) ) {
$href = $processor->get_attribute( 'href' );
if ( ! is_string( $href ) ) {
continue;
}
$clean = self::clean_url( $href );
if ( $clean !== $href ) {
$processor->set_attribute( 'href', $clean );
}
}
return $processor->get_updated_html();
}
public static function display_css() {
if ( self::skip_request() || ! is_singular( 'post' ) ) {
return;
}
/*
* Space reservations apply only to ad wrappers with these classes.
* Adjust the heights to match your actual ad placements.
* Unfilled ad slots can retain blank space.
*/
$css = '
.snn-ad-container.snn-ad-inarticle {
min-height: 280px;
}
.snn-ad-container.snn-ad-sidebar {
min-height: 280px;
}
.entry-content p.wp-block-paragraph {
overflow-wrap: break-word;
}
@media (max-width: 921px) {
.snn-ad-container.snn-ad-sidebar {
min-height: 100px;
}
}
';
wp_register_style(
'snn-safe-display',
false,
array(),
'1.0.0'
);
wp_enqueue_style( 'snn-safe-display' );
wp_add_inline_style( 'snn-safe-display', $css );
}
}
SNN_Safe_Display_20261031::boot();
}
A judge approved a request by the American Civil Liberties Union (ACLU) and Planned Parenthood of Iowa to block a new law that bans abortions in the state after a heartbeat is detected, according to The Associated Press.
The law was signed by Republican Gov. Kim Reynolds Friday after passing through both legislative houses Tuesday during a special session. The lawsuit was filed less than a day later and the judge ordered that a temporary injunction be put in place to halt the law’s implementation while the lawsuit goes through the courts, according to AP.
The lawsuit aims to challenge the constitutionality of the law and argued that the bill would stop most abortions in the state due to how early a heartbeat can be detected, often at six weeks and on rare occasions, even earlier. The ACLU and Planned Parenthood claim that the temporary injunction is necessary “to safeguard … medical providers and other staff, and … patients from this unconstitutional law.”
The law bans abortions in the state of Iowa once a fetal heartbeat is detected, except in cases of rape, incest or to protect the life of the mother, and also requires a physician to conduct an ultrasound to determine if there is cardiac activity before an abortion. A similar law passed in 2018 that banned abortions after six weeks was killed in June after the Iowa Supreme Court ruled that it violated a woman’s right to privacy.

/**
* SNN Article Link Cleanup & Display Stability
* Disable BOTH "Link Cleaner" and "WP Perf" before activating.
* Paste into Code Snippets as PHP; run everywhere.
*
* Standard RSS feeds, REST output, schema and article identifiers
* are not rewritten. Requires WordPress 6.2+ for link cleanup.
*/
if ( ! class_exists( 'SNN_Safe_Display_20261031', false ) ) {
final class SNN_Safe_Display_20261031 {
public static function boot() {
add_action( 'init', array( __CLASS__, 'head_cleanup' ), 20 );
add_filter( 'the_content', array( __CLASS__, 'article_links' ), 99 );
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'display_css' ), 100 );
}
public static function head_cleanup() {
if ( is_admin() ) {
return;
}
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}
public static function skip_request() {
return is_admin()
|| is_feed()
|| is_trackback()
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|| wp_doing_ajax()
|| is_preview();
}
/**
* Remove UTM parameters while preserving other query parameters,
* their order, encoding and the URL fragment.
*/
public static function clean_url( $url ) {
if ( ! is_string( $url ) || $url === '' ) {
return $url;
}
// Preserve non-web schemes such as mailto:, tel: and data:.
if (
preg_match( '/^[a-z][a-z0-9+.-]*:/i', $url )
&& ! preg_match( '~^https?://~i', $url )
) {
return $url;
}
$parts = explode( '#', $url, 2 );
$base = explode( '?', $parts[0], 2 );
if ( count( $base ) !== 2 ) {
return $url;
}
$pairs = explode( '&', $base[1] );
// Preserve commonly signed URLs.
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = strtolower( urldecode( $parameter[0] ) );
if (
in_array(
$key,
array(
'signature',
'sig',
'x-amz-signature',
'x-goog-signature',
),
true
)
) {
return $url;
}
}
$kept = array();
$changed = false;
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = urldecode( $parameter[0] );
if ( stripos( $key, 'utm_' ) === 0 ) {
$changed = true;
continue;
}
$kept[] = $pair;
}
if ( ! $changed ) {
return $url;
}
$query = implode( '&', $kept );
return $base[0]
. ( $query !== '' ? '?' . $query : '' )
. ( isset( $parts[1] ) ? '#' . $parts[1] : '' );
}
/**
* Clean anchor URLs in displayed single-post content only.
* Do not buffer or rewrite the full page or feed response.
*/
public static function article_links( $html ) {
if (
! is_string( $html )
|| self::skip_request()
|| ! is_singular( 'post' )
|| ! in_the_loop()
|| ! is_main_query()
|| apply_filters( 'snn_safe_display_skip_links', false )
|| ! class_exists( 'WP_HTML_Tag_Processor' )
) {
return $html;
}
$processor = new WP_HTML_Tag_Processor( $html );
while ( $processor->next_tag( 'A' ) ) {
$href = $processor->get_attribute( 'href' );
if ( ! is_string( $href ) ) {
continue;
}
$clean = self::clean_url( $href );
if ( $clean !== $href ) {
$processor->set_attribute( 'href', $clean );
}
}
return $processor->get_updated_html();
}
public static function display_css() {
if ( self::skip_request() || ! is_singular( 'post' ) ) {
return;
}
/*
* Space reservations apply only to ad wrappers with these classes.
* Adjust the heights to match your actual ad placements.
* Unfilled ad slots can retain blank space.
*/
$css = '
.snn-ad-container.snn-ad-inarticle {
min-height: 280px;
}
.snn-ad-container.snn-ad-sidebar {
min-height: 280px;
}
.entry-content p.wp-block-paragraph {
overflow-wrap: break-word;
}
@media (max-width: 921px) {
.snn-ad-container.snn-ad-sidebar {
min-height: 100px;
}
}
';
wp_register_style(
'snn-safe-display',
false,
array(),
'1.0.0'
);
wp_enqueue_style( 'snn-safe-display' );
wp_add_inline_style( 'snn-safe-display', $css );
}
}
SNN_Safe_Display_20261031::boot();
}
Following the state Supreme Court’s ruling, Reynolds immediately expressed her disappointment and called legislators back to work in order to get a new bill passed.
“There is no right more sacred than life, and nothing more worthy of our strongest defense than the innocent unborn,” Reynolds said in a press release.
/**
* SNN Article Link Cleanup & Display Stability
* Disable BOTH "Link Cleaner" and "WP Perf" before activating.
* Paste into Code Snippets as PHP; run everywhere.
*
* Standard RSS feeds, REST output, schema and article identifiers
* are not rewritten. Requires WordPress 6.2+ for link cleanup.
*/
if ( ! class_exists( 'SNN_Safe_Display_20261031', false ) ) {
final class SNN_Safe_Display_20261031 {
public static function boot() {
add_action( 'init', array( __CLASS__, 'head_cleanup' ), 20 );
add_filter( 'the_content', array( __CLASS__, 'article_links' ), 99 );
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'display_css' ), 100 );
}
public static function head_cleanup() {
if ( is_admin() ) {
return;
}
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}
public static function skip_request() {
return is_admin()
|| is_feed()
|| is_trackback()
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|| wp_doing_ajax()
|| is_preview();
}
/**
* Remove UTM parameters while preserving other query parameters,
* their order, encoding and the URL fragment.
*/
public static function clean_url( $url ) {
if ( ! is_string( $url ) || $url === '' ) {
return $url;
}
// Preserve non-web schemes such as mailto:, tel: and data:.
if (
preg_match( '/^[a-z][a-z0-9+.-]*:/i', $url )
&& ! preg_match( '~^https?://~i', $url )
) {
return $url;
}
$parts = explode( '#', $url, 2 );
$base = explode( '?', $parts[0], 2 );
if ( count( $base ) !== 2 ) {
return $url;
}
$pairs = explode( '&', $base[1] );
// Preserve commonly signed URLs.
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = strtolower( urldecode( $parameter[0] ) );
if (
in_array(
$key,
array(
'signature',
'sig',
'x-amz-signature',
'x-goog-signature',
),
true
)
) {
return $url;
}
}
$kept = array();
$changed = false;
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = urldecode( $parameter[0] );
if ( stripos( $key, 'utm_' ) === 0 ) {
$changed = true;
continue;
}
$kept[] = $pair;
}
if ( ! $changed ) {
return $url;
}
$query = implode( '&', $kept );
return $base[0]
. ( $query !== '' ? '?' . $query : '' )
. ( isset( $parts[1] ) ? '#' . $parts[1] : '' );
}
/**
* Clean anchor URLs in displayed single-post content only.
* Do not buffer or rewrite the full page or feed response.
*/
public static function article_links( $html ) {
if (
! is_string( $html )
|| self::skip_request()
|| ! is_singular( 'post' )
|| ! in_the_loop()
|| ! is_main_query()
|| apply_filters( 'snn_safe_display_skip_links', false )
|| ! class_exists( 'WP_HTML_Tag_Processor' )
) {
return $html;
}
$processor = new WP_HTML_Tag_Processor( $html );
while ( $processor->next_tag( 'A' ) ) {
$href = $processor->get_attribute( 'href' );
if ( ! is_string( $href ) ) {
continue;
}
$clean = self::clean_url( $href );
if ( $clean !== $href ) {
$processor->set_attribute( 'href', $clean );
}
}
return $processor->get_updated_html();
}
public static function display_css() {
if ( self::skip_request() || ! is_singular( 'post' ) ) {
return;
}
/*
* Space reservations apply only to ad wrappers with these classes.
* Adjust the heights to match your actual ad placements.
* Unfilled ad slots can retain blank space.
*/
$css = '
.snn-ad-container.snn-ad-inarticle {
min-height: 280px;
}
.snn-ad-container.snn-ad-sidebar {
min-height: 280px;
}
.entry-content p.wp-block-paragraph {
overflow-wrap: break-word;
}
@media (max-width: 921px) {
.snn-ad-container.snn-ad-sidebar {
min-height: 100px;
}
}
';
wp_register_style(
'snn-safe-display',
false,
array(),
'1.0.0'
);
wp_enqueue_style( 'snn-safe-display' );
wp_add_inline_style( 'snn-safe-display', $css );
}
}
SNN_Safe_Display_20261031::boot();
}
Reynolds did not immediately respond to the Daily Caller News Foundation’s request for comment.
All content created by the Daily Caller News Foundation, an independent and nonpartisan newswire service, is available without charge to any legitimate news publisher that can provide a large audience. All republished articles must include our logo, our reporter’s byline and their DCNF affiliation. For any questions about our guidelines or partnering with us, please contact [email protected].
/**
* SNN Article Link Cleanup & Display Stability
* Disable BOTH "Link Cleaner" and "WP Perf" before activating.
* Paste into Code Snippets as PHP; run everywhere.
*
* Standard RSS feeds, REST output, schema and article identifiers
* are not rewritten. Requires WordPress 6.2+ for link cleanup.
*/
if ( ! class_exists( 'SNN_Safe_Display_20261031', false ) ) {
final class SNN_Safe_Display_20261031 {
public static function boot() {
add_action( 'init', array( __CLASS__, 'head_cleanup' ), 20 );
add_filter( 'the_content', array( __CLASS__, 'article_links' ), 99 );
add_action( 'wp_enqueue_scripts', array( __CLASS__, 'display_css' ), 100 );
}
public static function head_cleanup() {
if ( is_admin() ) {
return;
}
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
}
public static function skip_request() {
return is_admin()
|| is_feed()
|| is_trackback()
|| ( defined( 'REST_REQUEST' ) && REST_REQUEST )
|| wp_doing_ajax()
|| is_preview();
}
/**
* Remove UTM parameters while preserving other query parameters,
* their order, encoding and the URL fragment.
*/
public static function clean_url( $url ) {
if ( ! is_string( $url ) || $url === '' ) {
return $url;
}
// Preserve non-web schemes such as mailto:, tel: and data:.
if (
preg_match( '/^[a-z][a-z0-9+.-]*:/i', $url )
&& ! preg_match( '~^https?://~i', $url )
) {
return $url;
}
$parts = explode( '#', $url, 2 );
$base = explode( '?', $parts[0], 2 );
if ( count( $base ) !== 2 ) {
return $url;
}
$pairs = explode( '&', $base[1] );
// Preserve commonly signed URLs.
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = strtolower( urldecode( $parameter[0] ) );
if (
in_array(
$key,
array(
'signature',
'sig',
'x-amz-signature',
'x-goog-signature',
),
true
)
) {
return $url;
}
}
$kept = array();
$changed = false;
foreach ( $pairs as $pair ) {
$parameter = explode( '=', $pair, 2 );
$key = urldecode( $parameter[0] );
if ( stripos( $key, 'utm_' ) === 0 ) {
$changed = true;
continue;
}
$kept[] = $pair;
}
if ( ! $changed ) {
return $url;
}
$query = implode( '&', $kept );
return $base[0]
. ( $query !== '' ? '?' . $query : '' )
. ( isset( $parts[1] ) ? '#' . $parts[1] : '' );
}
/**
* Clean anchor URLs in displayed single-post content only.
* Do not buffer or rewrite the full page or feed response.
*/
public static function article_links( $html ) {
if (
! is_string( $html )
|| self::skip_request()
|| ! is_singular( 'post' )
|| ! in_the_loop()
|| ! is_main_query()
|| apply_filters( 'snn_safe_display_skip_links', false )
|| ! class_exists( 'WP_HTML_Tag_Processor' )
) {
return $html;
}
$processor = new WP_HTML_Tag_Processor( $html );
while ( $processor->next_tag( 'A' ) ) {
$href = $processor->get_attribute( 'href' );
if ( ! is_string( $href ) ) {
continue;
}
$clean = self::clean_url( $href );
if ( $clean !== $href ) {
$processor->set_attribute( 'href', $clean );
}
}
return $processor->get_updated_html();
}
public static function display_css() {
if ( self::skip_request() || ! is_singular( 'post' ) ) {
return;
}
/*
* Space reservations apply only to ad wrappers with these classes.
* Adjust the heights to match your actual ad placements.
* Unfilled ad slots can retain blank space.
*/
$css = '
.snn-ad-container.snn-ad-inarticle {
min-height: 280px;
}
.snn-ad-container.snn-ad-sidebar {
min-height: 280px;
}
.entry-content p.wp-block-paragraph {
overflow-wrap: break-word;
}
@media (max-width: 921px) {
.snn-ad-container.snn-ad-sidebar {
min-height: 100px;
}
}
';
wp_register_style(
'snn-safe-display',
false,
array(),
'1.0.0'
);
wp_enqueue_style( 'snn-safe-display' );
wp_add_inline_style( 'snn-safe-display', $css );
}
}
SNN_Safe_Display_20261031::boot();
}