Account Settings

Winkelwagen

De winkelwagen is nog leeg

Website Settings

Dondere modus
Hoog contrast
Font grootte
Lees pagina-inhoud
Afdrukken
Realtime
  • Datum: 19-02-2026
  • Week: 08
  • Weer:
  • Seizoen: Winter

Allow unfiltered html for admins on multisite

Omschrijving

  • Mijn versie werkte niet goed
  • Michael heeft nieuwe versie gemaat
  • Ik heb deze aangepast zodat hij ook <script> accepteert naast <iframe>

Snippet

FieldValue
Snippet StatusDone
Snippet Description
Snippet Type CodeOther
Snippet URL
Snippet Content/** * Allow unfiltered html for admins on multisite * * Opens up unfiltered_html capability for administrators on a multisite installation for placing html like embeds. * * @author Toine Branbergen * @version 1.2 * Created: AI (GPT-5 mini) and modified by Toine Branbergen */ add_filter('map_meta_cap', 'nrdq_allow_unfiltered_html_for_admins_on_multisite', 1, 4); function nrdq_allow_unfiltered_html_for_admins_on_multisite($caps, $cap, $user_id, $args) { if ($cap !== 'unfiltered_html') { return $caps; } if (!is_multisite() || is_super_admin($user_id)) { return $caps; } $user = get_userdata($user_id); if (!$user) { return $caps; } $allowed_roles = array('administrator', 'shop_manager', 'employee'); if (array_intersect($user->roles, $allowed_roles)) { return array('unfiltered_html'); } return $caps; }
Snippet Content CSS
Snippet Content HTML
Snippet Content JS
Snippet Content PHP/** * Allow unfiltered html for admins on multisite * * Opens up unfiltered_html capability for administrators on a multisite installation for placing html like embeds. * * @author Toine Branbergen * @version 1.2 * Created: AI (GPT-5 mini) and modified by Toine Branbergen */ add_filter('map_meta_cap', 'nrdq_allow_unfiltered_html_for_admins_on_multisite', 1, 4); function nrdq_allow_unfiltered_html_for_admins_on_multisite($caps, $cap, $user_id, $args) { if ($cap !== 'unfiltered_html') { return $caps; } if (!is_multisite() || is_super_admin($user_id)) { return $caps; } $user = get_userdata($user_id); if (!$user) { return $caps; } $allowed_roles = array('administrator', 'shop_manager', 'employee'); if (array_intersect($user->roles, $allowed_roles)) { return array('unfiltered_html'); } return $caps; }
Particle Snippet in Software1
Particle Snippet in Boilerplate0

Relations

ItemType

Pointing items

ItemTypeCategoryTags
Categorie
Tags, , ,
URL
TypeSnippet
Time
Price

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *

Home