Escaping Data
// instead the _e(), __() or _x() use the escaped version _e('Email Summary', 'duplicator-pro'); // this…
Basic WP escaping functions
// ❌ Don't use _e(), __(), _x() etc. to output data // ✅ Use the escaped…
Escaping data with wp_kses
// ❌ Don't use html tags in escaping functions like esc_html, esc_attr and their localized equivalents…
HTML inside PHP
How to output HTML inside PHP.
TplMng
// This code is part of the template, $tplData['hasShellZip'] is provided through TplMng $hasShellZip = $tplData['hasShellZip'];…
Give export capability to administrator
This snippet adds the export capability to the administrator user role.
Reset Duplicator Pro capabilities
This snippet resets the Duplicator Pro capabilities. Insert it into the wp-config.php file, refresh the wp-admin…
Database connection test snippet
A snippet to test the connection to the database.
change media owner
Allows the admin to assign any media library file from one user to another
Count and message according to number of user files
Displays a different message according to how many files a user has in their media library.
Limit user files in media library
change the number in the snippet
Enable automatic updates for WordPress core, plugins, and themes
// Enable automatic updates for WordPress core, plugins, and themes add_filter('automatic_updater_disabled', '__return_false'); add_filter('auto_update_core', '__return_true'); add_filter('auto_update_plugin', '__return_true');…
Unattached Media Cleanup
// Schedule the event if it is not already scheduled function schedule_unattached_media_cleanup() { if (!wp_next_scheduled('delete_unattached_media_event')) {…
Welcome Cards
4 cards to display service offering