/** * Pixelsz Sitemap shortcode * Gebruik: [pixelsz-sitemap] * Opties (optioneel): * [pixelsz-sitemap types=”page,post” orderby=”title” order=”ASC” posts_per_page=”-1″ exclude_ids=”” exclude_cats=””] */ function px_simple_sitemap_shortcode($atts) { $atts = shortcode_atts(array( ‘types’ => ‘page,post’, // comma-gescheiden ‘orderby’ => ‘title’, // title | date | modified…Continue reading
add_action( ‘admin_head’, function () { // Bail if WooCommerce isn’t active. if ( ! class_exists( ‘WooCommerce’ ) ) { return; } if ( ! function_exists( ‘get_current_screen’ ) ) { return; } $screen = get_current_screen(); // Legacy order/subscription edit. $is_legacy_order_screen =…Continue reading
add_filter( ‘pp_offcanvas_body_inner_wrap’, ‘__return_false’ );Continue reading
/** * Handle Meta (Facebook/Instagram Shops) checkout URLs * Format: /checkout?products=wc_post_id_123:2,wc_post_id_456:1&coupon=CODE */ add_action( ‘template_redirect’, function() { if ( isset( $_GET[‘products’] ) ) { // Ensure WooCommerce is loaded if ( ! function_exists( ‘WC’ ) || ! WC()->cart ) { return;…Continue reading
/** * Alleen toegang tot Code Snippets / WPCode voor specifieke e-mailadressen. * Verberg alle varianten (free/pro/legacy) en menu’s in de admin + adminbar. */ add_action(‘admin_menu’, function () { $allowed_emails = array(‘[email protected]’, ‘[email protected]’, ‘[email protected]’); $current = wp_get_current_user(); $is_allowed = ($current…Continue reading
// Add duplicate button to post/page list of actions. add_filter( ‘post_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); add_filter( ‘page_row_actions’, ‘wpcode_snippet_duplicate_post_link’, 10, 2 ); // Let’s make sure the function doesn’t already exist. if ( ! function_exists( ‘wpcode_snippet_duplicate_post_link’ ) ) { /** *…Continue reading
// Utilities ———————————————————— function wishlist_is_allowed_path() { $allowed_paths = [‘/rentals’, ‘/collections/’]; $request_uri = $_SERVER[‘REQUEST_URI’] ?? ”; foreach ($allowed_paths as $path) { if (strpos($request_uri, $path) !== false) { return true; } } return false; } // ———————————————————————- // Shortcode: [wishlist_count] —————————————— function…Continue reading