This file contains 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
/** | |
* Deactivate Specific Plugins on Staging & Non-Production Sites [SnipSnip.pro] - https://snipsnip.pro/s/827 | |
*/ | |
if (!class_exists('Deactivate_Plugins_On_Staging')) { | |
/** | |
* Selectively deactivates plugins on staging and similar environments. | |
*/ | |
class Deactivate_Plugins_On_Staging { | |
private $stagingKeywords = ['staging', 'dev', 'local', 'test', 'sandbox', 'demo']; | |
private $forceDeactivations = false; // Set to true to deactivate regardless of environment detection. |
This file contains 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
/** | |
* Deactivate Specific Plugins on Production Sites [SnipSnip.pro] - https://snipsnip.pro/s/825 | |
*/ | |
if (!class_exists('Deactivate_Plugins_On_Production')) { | |
/** | |
* Selectively deactivates plugins on production environments. | |
*/ | |
class Deactivate_Plugins_On_Production { | |
private $stagingKeywords = ['staging', 'dev', 'local', 'test', 'sandbox', 'demo']; | |
private $forceDeactivations = false; // Set to true to deactivate regardless of environment detection. |
This file contains 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
set dir to "~/Dropbox/Dropbox2/ScreenshotTimer/" | |
do shell script ("mkdir -p " & dir) | |
set intervalMins to 15 -- Change as per your desired frequency (in minutes) | |
set durationHours to 8 -- Change as per your desired duration (in hours) | |
-- Convert minutes to seconds for screenshot interval | |
set intervalSecs to intervalMins * 60 | |
-- Calculate total repetitions within duration | |
set totalReps to durationHours * 60 / intervalMins |
This file contains 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
if(!class_exists('WPOptionsViewPage')) { | |
class WPOptionsViewPage { | |
public function __construct() { | |
} | |
public function add_submenu_page() { | |
} | |
public function display_options_page() { |
This file contains 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
{ | |
"generator": "Code Snippets v3.4.2.2", | |
"date_created": "2023-08-03 19:38", | |
"snippets": [ | |
{ | |
"id": 63, | |
"name": "CustomUserRedirect - Redirect Users After Login [SnipSnip.pro]", | |
"desc": "<p>CustomUserRedirect - Redirect Users After Login [SnipSnip.pro] - Redirect users upon login based on user roles. Easily add/remove/edit the custom roles and redirection rules. Include dynamic data, such as <code>{{username}}</code>, <code>{{user_id}}</code>, and more, including user meta with <code>{{user_meta:META_KEY_HERE}}</code>. *Notes: This class assumes that each user has only one role. If a user has multiple roles, they will be redirected based on the first role found in their role list. Also, be aware of privacy considerations when using tokens like <code>{{user_email}}</code> and <code>{{user_ip}}</code>, as these could potentially expose sensitive user information. <a id=\"sample-permalink\" href=\"https://snipsnip.pro/s/730\">https://snipsnip.pro/s/730</a></p>", | |
"code": "// Custo |
This file contains 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 a Metabox to List Attachments in the editor - https://snipsnip.pro/s/724 | |
if (!class_exists('AddPostAttachmentsMetaBox')) { | |
class AddPostAttachmentsMetaBox { | |
public function __construct() { | |
add_action('add_meta_boxes', array($this, 'add_metabox_of_post_attachments')); | |
} | |
public function add_metabox_of_post_attachments() { | |
$post_types = get_post_types(array('public' => true), 'names'); | |
foreach ($post_types as $post_type) { |
This file contains 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
// SimplePostDuplicator - Adds a Duplicate option to Posts & Pages without using a plugin! https://snipsnip.pro/s/701 | |
if (!class_exists('SimplePostDuplicator')) { | |
class SimplePostDuplicator { | |
public function __construct() { | |
add_action('admin_action_simple_post_duplicator_duplicate_post_as_draft', array($this, 'duplicatePostAsDraft')); | |
add_filter('post_row_actions', array($this, 'addDuplicatePostLink'), 10, 2); | |
add_filter('page_row_actions', array($this, 'addDuplicatePostLink'), 10, 2); | |
} |
This file contains 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
<? // <- remove this line if you copy/paste into Code Snippets Pro | |
/** | |
* SITE: Add Env Notice to Admin Screens | |
* | |
* For admins only, display an admin notice with the current domain environment, such as: [STAGING] or [LOCAL] or [PRODUCTION] | |
* /* Requires Env555 */ | |
*/ | |
/* Requires Env555 */ |
NewerOlder