Add Media File Size Column

// 1. Add a column for file size in the Media Library table function custom_media_column_file_size( $columns ) { $columns[‘file_size’] = __( ‘File Size’, ‘custom-media-columns’ ); return $columns; } add_filter( ‘manage_media_columns’, ‘custom_media_column_file_size’ ); // 2. Display the file size for each…Continue reading

Niet actieve thema’s verbergen

add_filter(‘wp_prepare_themes_for_js’, ‘customize_theme_display’, 20); function customize_theme_display($themes) { // Haal de huidige gebruiker op $current_user = wp_get_current_user(); $user_login = $current_user->user_login; // Lijst van gebruikers die ALLE thema’s mogen zien $allowed_users = array(‘Nico’, ‘Thijs’, ‘Mark’, ‘PXLSZ_NK’, ‘PXLSZ_TJW’, ‘PXLSZ_MK’); // Als de gebruiker NIET…Continue reading

Geen update rechten

/** * Allow-list: deze gebruikers mogen alles. Anderen: * – mogen plugins ACTIVEREN & DEACTIVEREN * – mogen GEEN plugins installeren / uploaden / updaten / verwijderen * – mogen geen thema’s installeren / wisselen / verwijderen / updaten *…Continue reading

Duplicate Post/Page Link

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

Elementor-knapp

add_action(‘admin_head’, function() { echo ‘ ‘; }); // 2. Bytt ut “Edit with Elementor”-link med ny knappstruktur add_action(‘admin_footer’, function() { echo ‘‘; }); // 3. Last inn Elementor sine ikoner riktig i admin add_action(‘admin_enqueue_scripts’, function() { if (!function_exists(‘is_plugin_active’)) { require_once…Continue reading

WordPress Database FINAL MULTI-PURPOSE “UPSERT” FUNCTION – PHP

/** * ============================================================================ * FINAL WORDPRESS MULTI-PURPOSE “UPSERT” FUNCTION * ============================================================================ * @author Sumaiya Akter, Anytype Doc: anytype://object?objectId=bafyreib7wbeew4uvzm63ust7r74hthzduantjvxkwfuv5ahdxltgr4mdae&spaceId=bafyreih4bocrmskuomcrks3sjwpnzxpbxvxwgto23vof3umg2fywdqzjmy.31bq39w6q8ru7&cid=bafybeifc55atash7zlqcjd3fv425bkwl7z5zstcxdilct5hstlng73xwci&key=6kKA3QiwnksqLbpcJ4T6UhmQ5BHzgJUfbpn1QLnkv5Lv * @description This function provides a dynamic “upsert” (update or insert) * capability for any WordPress database table. It is designed to…Continue reading