Disable Random Content Redirects

// Turn off the random content redirects added in WordPress 7.2 (/random/, /random/category/news/, ?random). add_filter( ‘wp_enable_random_content_redirect’, ‘__return_false’ ); // The /random/ URLs are stored rewrite rules, so rebuild them once if any are still there. add_action( ‘init’, function () {…Continue reading

Export Snippets From the Snippets List

add_filter( ‘wpcode_code_snippets_row_actions’, function ( $actions, $snippet, $view ) { if ( ‘trash’ === $view || ! current_user_can( ‘wpcode_edit_php_snippets’ ) ) { return $actions; } $url = wp_nonce_url( add_query_arg( array( ‘page’ => ‘wpcode’, ‘action’ => ‘export’, ‘snippet_id’ => absint( $snippet->ID ),…Continue reading

Sticky Posts on Category Pages (copy)

add_action(‘pre_get_posts’, function($query) { if (!is_admin() && $query->is_main_query() && is_category()) { $sticky_posts = get_option(‘sticky_posts’); if (!empty($sticky_posts)) { add_filter(‘posts_orderby’, function($orderby, $query) use ($sticky_posts) { if (!is_admin() && $query->is_main_query() && is_category()) { global $wpdb; $sticky_list = implode(‘,’, array_map(‘intval’, $sticky_posts)); return “FIELD({$wpdb->posts}.ID, {$sticky_list}) DESC,…Continue reading

E-Mail via eigen mail server

add_action( ‘phpmailer_init’, ‘mijn_eigen_smtp_instellingen’ ); function mijn_eigen_smtp_instellingen( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Host = ‘mail.devierambachten.com’; // De hostnaam van je eigen server $phpmailer->SMTPAuth = true; $phpmailer->Port = 587; // 587 voor TLS, of 465 voor SSL $phpmailer->Username = ‘[email protected]’; // Je mailbox…Continue reading

CONTROLEPAGINA -ALLE VELDEN ACF

/** * PRO Adminpagina: volledige ACF controle * + Filterknoppen * + Zoekveld * + Kolommen inklapbaar * + PDF-export * (Bulk-fix verwijderd) */ add_action(‘admin_menu’, function() { add_menu_page( ‘ACF Productcontrole’, ‘Productcontrole (ACF)’, ‘edit_products’, ‘dv-acf-pro-check’, ‘dv_acf_pro_check_page’, ‘dashicons-visibility’, 26 ); }); /*…Continue reading

Yoast SEO Premium – Disable Automatic Redirects & Notices

// Prevent automatic redirects for post and taxonomy URL changes. add_filter( ‘Yoast\WP\SEO\post_redirect_slug_change’, ‘__return_true’ ); add_filter( ‘Yoast\WP\SEO\term_redirect_slug_change’, ‘__return_true’ ); // Suppress redirect notices for URL changes, deletion and restoration. add_filter( ‘Yoast\WP\SEO\enable_notification_post_slug_change’, ‘__return_false’ ); add_filter( ‘Yoast\WP\SEO\enable_notification_term_slug_change’, ‘__return_false’ ); add_filter( ‘Yoast\WP\SEO\enable_notification_post_trash’, ‘__return_false’ );…Continue reading