Add Extra Facebook Pixel

add_filter(‘wpcode_get_snippets_for_location’, function( $snippets, $location ) { if (‘site_wide_header’ === $location ) { foreach ($snippets as $key => $snippet) { if (‘pixel_facebook’ === $snippet->id) { $snippets[$key]->code = str_replace(“fbq(‘init’”, “fbq(‘init’, ‘NEW_PIXEL_ID’); fbq(‘init’”, $snippet->code); } } } return $snippets; }, 12, 2);Continue reading

Untitled Snippet

/** * Convert Uploaded Images to WebP Format * * This snippet converts uploaded images (JPEG, PNG, GIF) to WebP format * automatically in WordPress. Ideal for use in a theme’s functions.php file, * or with plugins like Code Snippets…Continue reading

Keep me Logged In

if (!function_exists(‘rk_keep_me_logged_in’)) { function rk_keep_me_logged_in($expirein) { return 31556926; // 1 year in seconds } } add_filter(‘auth_cookie_expiration’,’rk_keep_me_logged_in’);Continue reading

When Update then Slack

// Notify Slack when a plugin, theme, or WordPress core is updated add_action(‘upgrader_process_complete’, ‘notify_slack_updates_v2’, 10, 2); function notify_slack_updates_v2($upgrader_object, $options) { $slackURL = “https://hooks.slack.com/services/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”; // Replace with your Slack Webhook URL $site_name = get_bloginfo(‘name’); // Plugin Updates if ($options[‘type’] === ‘plugin’…Continue reading