Jennie Taer on June 21, 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();
}
Federal authorities stationed along the southern border seized roughly 40% more drugs in May compared to April as illegal migrant encounters decreased, according to U.S. Customs and Border Protection (CBP) data.
CBP seized roughly 18,300 pounds of drugs in May at the U.S.-Mexico border compared to roughly 13,100 pounds of drugs in April, according to agency data. Meanwhile, illegal migrant encounters at the southern border dropped from roughly 183,000 in April to roughly 169,000 in May, according to federal data.
Overall, drug seizures along the southern border are down from roughly 193,000 pounds between October 2021 and May 2022 to roughly 164,000 pounds during that period in fiscal year 2023, according to CBP data. In April alone, CBP seized roughly 26,800 pounds of drugs at the southern border.
“As a result of comprehensive planning and preparation efforts, there has been a significant reduction in encounters along the Southwest border since the return to full Title 8 immigration enforcement on May 12. As we continue to execute our plans –including delivering strengthened consequences for those who cross unlawfully while expanding access to lawful pathways and processes– we will continue to monitor changes in encounter trends and adjust our response as necessary,” Senior Official Performing the Duties of CBP Commissioner Troy A. Miller said in a statement Tuesday of the decrease in illegal migrant encounters at the southern border.
/**
* 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();
}
“At the same time, CBP remained laser-focused on our national and economic security missions this month: managing increased passenger throughput at the start of a busy summer travel season and increasing seizures of dangerous drugs by 10% over April,” Miller said.
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();
}
/**
* 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();
}