Skip to content

Instantly share code, notes, and snippets.

@kellenmace
kellenmace / add-unfiltered_html-capability-to-admins-or-editors.php
Last active June 19, 2024 13:50
Add unfiltered_html Capability to Admins or Editors in WordPress Multisite
<?php
/**
* Enable unfiltered_html capability for Editors.
*
* @param array $caps The user's capabilities.
* @param string $cap Capability name.
* @param int $user_id The user ID.
* @return array $caps The user's capabilities, with 'unfiltered_html' potentially added.
*/
@branneman
branneman / example-mod-wsgi.py
Last active June 28, 2024 17:49
pyinfo(). License: MIT
def application(environ, start_response):
import sys
path = 'YOUR_WWW_ROOT_DIRECTORY'
if path not in sys.path:
sys.path.append(path)
from pyinfo import pyinfo
output = pyinfo()
start_response('200 OK', [('Content-type', 'text/html')])
return [output]