Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| # error_log('Red Alert: Shields failing! Code malfunction in sector 42.'); | |
| add_action('activated_plugin', 'save_error_to_log'); | |
| function save_error_to_log() { | |
| // Get the error message (if any) during plugin activation | |
| $error_message = ob_get_contents(); | |
| // Define the log file path (adjust as needed) |
| <?php | |
| /** | |
| * Registers the "One time hook" functionality. | |
| * | |
| * Note that this file is intentionally in the *global* namespace! | |
| * | |
| * @author Growella | |
| * @license MIT | |
| */ |
| <?php | |
| /* | |
| * Select one or more of the options below to your wp-config.php file to have WordPress updates run automatically. | |
| */ | |
| // Apply Major WordPress Updates Automatically | |
| define( 'WP_AUTO_UPDATE_CORE', true ); | |
| // Apply Minor WordPress Updates Automatically |
| <?php | |
| # http://kovshenin.com/2012/the-wordpress-settings-api/ | |
| # http://codex.wordpress.org/Settings_API | |
| add_action( 'admin_menu', 'my_admin_menu' ); | |
| function my_admin_menu() { | |
| add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' ); | |
| } | |
| add_action( 'admin_init', 'my_admin_init' ); |
| <?php | |
| /* | |
| Plugin Name: Testimonials Custom Post Type | |
| Plugin URI: http://wpbeaches.com/create-custom-post-types-in-genesis-child-theme-in-wordpress/ | |
| Description: Testimonials Custom Post Types | |
| Author: Neil Gowran | |
| Version:1.0.0 | |
| Author URI:http://wpbeaches.com | |
| */ |
| <?php | |
| if ( ! defined( 'ABSPATH' ) ) exit; | |
| class WordPress_Plugin_Template_Settings { | |
| private $dir; | |
| private $file; | |
| private $assets_dir; | |
| private $assets_url; | |
| private $settings_base; |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| /** | |
| * Test if a WordPress plugin is active | |
| */ | |
| if ( is_plugin_active('plugin-directory/plugin-file.php') ) { | |
| // the plugin is active | |
| } |
| The below code is plugin codes used for adding new functionality setup | |
| while updating the plugin or activating the plugin. | |
| This is simple plugin code and it will add transient while updating or activating the plugin. | |
| Clear transient once we finished the operation. | |
| ======================================================================================= | |
| <?php | |
| /*Plugin Name: Wordpress Update |
| :root { | |
| --violation-color: red; /* used for clear issues */ | |
| --warning-color: orange; /* used for potential issues we should look into */ | |
| } | |
| /* IMAGES */ | |
| /* | |
| * Lazy-Loaded Images Check | |
| * ==== |