Set oEmbed Max Width

function wpcode_snippet_oembed_defaults( $sizes ) { return array( ‘width’ => 400, ‘height’ => 280, ); } add_filter( ’embed_defaults’, ‘wpcode_snippet_oembed_defaults’ );Continue reading

Media sync script

add_action( ‘admin_init’, ‘media_sync_library’ ); function media_sync_library() { // Folder inside uploads to scan $scan_folder = ‘/2026/02’; $upload_dir = wp_upload_dir(); $base_dir = $upload_dir[‘basedir’]; $base_url = $upload_dir[‘baseurl’]; $target_dir = $base_dir . $scan_folder; // Stop if folder doesn’t exist if( ! is_dir( $target_dir…Continue reading

Geo Search Header 1

if ( ! function_exists( ‘rw_geo_search_after_header_1280’ ) ) { add_action( ‘kadence_after_header’, ‘rw_geo_search_after_header_1280’ ); function rw_geo_search_after_header_1280() { if ( is_admin() ) { return; } echo ‘ ‘; echo ‘ ‘; echo do_shortcode( ‘[geo_search]’ ); echo ‘ ‘; echo ‘ ‘; } }Continue reading

Completely Disable Comments (copy) (copy) (copy)

add_action(‘admin_init’, function () { // Redirect any user trying to access comments page global $pagenow; if ($pagenow === ‘edit-comments.php’) { wp_safe_redirect(admin_url()); exit; } // Remove comments metabox from dashboard remove_meta_box(‘dashboard_recent_comments’, ‘dashboard’, ‘normal’); // Disable support for comments and trackbacks in…Continue reading

RewardsWP — My Account Rewards Tab

/** * Plugin Name: RewardsWP — My Account Rewards Tab * Description: Adds a “My Rewards” tab to WooCommerce My Account that opens the rewards widget. * Version: 1.0.0 * Author: AffiliateWP */ if ( ! defined( ‘ABSPATH’ ) )…Continue reading