Add file to media library programmatically

wp_insert_attachment( string|array $args, string|false $file = false, int $parent_post_id, bool $wp_error = false, bool $fire_after_hooks =…

create_folder_and_upload_file

Creating a folder directly inside the WordPress Media Library through code requires understanding that the WordPress…

Changing the logo on the WordPress login page.

// Zmiana logo na stronie logowania Wordpress. add_filter( 'login_head', function () { $custom_logo = 'https://yourimageurl.com'; $logo_width…

Untitled Snippet

Raymond Berry
<10

_MK - SECURITY - Block Author Enumeration

// 🔒 Block ?author=1 user enumeration attempts add_action('init', function () { if (!is_admin() && isset($_GET['author'])) {…

<10

_MK - Last connection

// Enregistre la date de connexion de l'utilisateur function enregistrer_derniere_connexion($user_login, $user) { // Met à jour…

<10

_MK - SECURITY - Disable XML-RPC-API

// Disable XML-RPC add_filter( 'xmlrpc_enabled', '__return_false' ); // Block access to xmlrpc.php via .htaccess equivalent (Apache…

<10

Easter

Info om tävlingenStarta tävling   Första gåtanSubmit   Andra gåtanSubmit   Tredje gåtanSubmit   Resultat och översiktTiden det tog för…

CWP - MailChimp RSS email ID

Adds MailChimp email ID to RSS feeds for better conversion tracking

TOC before first heading

Output the TOC block before the first heading in a post

Custom Countries

Illustrates how to add a custom list of countries

<10

Sort Events Category by Publish Date (Oldest First)

function sort_posts_by_category($query) { if ($query->is_main_query() && !is_admin()) { $oldest_first_categories = array(1483,1486,1485,1484,1482,1391); // Replace with the IDs…

1 121 122 123 124 125 210