This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Hook into the admin bar menu with a high priority so it appears toward the right. | |
| add_action('admin_bar_menu', 'add_db_name_admin_bar_item', 100); | |
| update_option( 'dpdevkit_adminer', 'yes' ); | |
| /** | |
| * Adds a new node to the WordPress admin bar that displays the database name. | |
| * | |
| * If the option "dpdevkit_adminer" is set to "yes" and the plugin | |
| * devkit/devkit.php is active, the badge links to /devkit-adminer. | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function delete_plugins() { | |
| require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| require_once ABSPATH . 'wp-admin/includes/file.php'; | |
| // Plugin basenames you NEVER want to delete | |
| $protected = array( | |
| DPDEV_BASE, // devkit itself | |
| ); | |
| // Let other code add more protected plugins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add this to the main file | |
| // Disable requests only for devkit/devkit.php. | |
| //add_filter( 'devkit_dpupdatechecker_enable_request_devkit_devkit_php', '__return_false' ); | |
| //Then update inc/update.php with this | |
| public function request() { | |
| // 0) Allow disabling / short-circuiting the request via filters. | |
| // Global toggle for all plugins using this updater. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add Filter to Requests simlar to: | |
| public function request() { | |
| // 1) Global toggle for all plugins using hoster updater | |
| $enabled = apply_filters( | |
| 'devkit_dpupdatechecker_enable_request', | |
| true, | |
| $this->slug, | |
| $this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function request() { | |
| $remote = get_transient( $this->cache_key ); | |
| // If we have any cached value (success OR failure) take note. | |
| if ( false !== $remote ) { | |
| if ( ! is_array( $remote ) ) { | |
| $decoded = json_decode( $remote ); | |
| if ( json_last_error() === JSON_ERROR_NONE ) { | |
| $remote = $decoded; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter('mainwp_before_save_cached_icons', function ($cached_icons, $icon, $slug, $type, $custom_icon, $noexp) { | |
| // Use the SAME raw links as before | |
| $map_urls = [ | |
| 'plugin' => 'https://raw.githubusercontent.com/stingray82/mainwp-plugin-icons/main/icons-map.json', | |
| 'theme' => 'https://raw.githubusercontent.com/stingray82/mainwp-plugin-icons/main/themes-icons-map.json', | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Snippet | |
| add_filter('wp_mail', function ($args) { | |
| $domains_to_override = ['hotmail.com', 'outlook.com', 'live.com', 'msn.com']; // add/remove as needed | |
| $new_from_email = 'no-reply@yourdomain.com'; | |
| $new_from_name = 'Your Site'; | |
| // Normalize "to" into an array | |
| $recipients = is_array($args['to']) | |
| ? $args['to'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Register the REST API route | |
| add_action('rest_api_init', function () { | |
| register_rest_route('custom-fluentcrm-api/v1', '/add-note', [ | |
| 'methods' => 'POST', | |
| 'callback' => 'handle_custom_fluentcrm_add_note', | |
| 'permission_callback' => function () { | |
| return current_user_can('edit_users'); // Adjust capability if needed | |
| }, | |
| 'args' => [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Open WPCodeBoxIDE Frontend with Overlay | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Click floating icon on WP Admin or front-end to open WPCodeBoxIDE frontend.php | |
| // @match *://*/* | |
| // @grant GM_openInTab | |
| // @grant GM_registerMenuCommand | |
| // @run-at document-idle | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: Post Access Expiry Scheduler | |
| * Description: Separately schedules and handles expiry of post access granted by the main Post Access Manager plugin, with enable/disable toggle and debug logging, linked to the main plugin | |
| * Version: 1.0.0 | |
| * Author: Reallyusefulplugins.com | |
| * Text Domain: rup-pamsc-access-expiry | |
| */ | |
| if ( ! defined( 'ABSPATH' ) ) { |
NewerOlder