Facebook Checkout URL fix

/** * 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

Duplicate Post/Page Link (copy)

// 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

Wishlist System (copy)

// 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

Wishlist System

// Utility ———————————————————— 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

Remove trailing slash from homepage URL in AIOSEO sitemap

function aioseo_remove_trailing_slash_from_homepage( $entry, $post_id, $post_type, $entry_type ) { // Get the homepage ID $homepage_id = aioseo()->helpers->getHomePageId(); // Check if this is the homepage if ( $homepage_id && $post_id === $homepage_id ) { // Remove trailing slash from the URL if…Continue reading