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
<?php | |
// Place this code in wp-content/mu-plugins/docketcache_flush_when_save_post.php | |
add_action('docketcache/init', function($docket_cache_instance) { | |
$docket_cache = $docket_cache_instance; | |
add_action( 'save_post', function($post_id, $post, $update) use($docket_cache) { | |
$result = $docket_cache->flush_cache(true); | |
$docket_cache->co()->lookup_set('occacheflushed', $result); | |
do_action('docketcache/action/flush/objectcache', $result); | |
}, 10, 3); |
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
<?php | |
// Place this code in wp-content/mu-plugins/docketcache_flush_daily.php | |
add_action('docketcache/init', function($docket_cache_instance) { | |
$docket_cache = $docket_cache_instance; | |
add_action('docketcache_flush_daily', function() use($docket_cache) { | |
$result = $docket_cache->flush_cache(true); | |
$docket_cache->co()->lookup_set('occacheflushed', $result); | |
do_action('docketcache/action/flush/objectcache', $result); | |
}); |
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
<?php | |
function custom_base64_decode($input) { | |
$base64_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
$output = ''; | |
// Remove padding characters and replace invalid characters | |
$input = str_replace(['-', '_'], ['+', '/'], $input); | |
$input = rtrim($input, '='); |
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
<?php | |
// Disable wp-content/object-cache.php | |
if (!defined('DOCKET_CACHE_DISABLED')) { | |
define('DOCKET_CACHE_DISABLED', true); | |
} | |
// Deactivate docket-cache | |
add_action('docketcache/init', function ($docket_cache_instance) { | |
try { | |
(new Nawawi\DocketCache\Event($docket_cache_instance))->unregister(); |
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
<?php | |
add_action('wpstg.clone_first_run', function () { | |
// Set to false for actual operation | |
$isDryRun = true; | |
// Abort if not wp-staging staging site | |
if (empty($GLOBALS['table_prefix']) || !preg_match('@^wpstg\d+@', $GLOBALS['table_prefix'])) { | |
return; | |
} |
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
<?php | |
add_action('docketcache/init', function($docket_cache_instance) { | |
$docket_cache = $docket_cache_instance; | |
// Flush cache | |
add_action('docket_cache_control_flush_cache', function() use($docket_cache) { | |
$result = $docket_cache->flush_cache(true); | |
$docket_cache->co()->lookup_set('occacheflushed', $result); | |
do_action('docketcache/action/flush/objectcache', $result); | |
}); |
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
<?php | |
// Configuration settings for the key | |
$config = array( | |
"digest_alg" => "sha512", | |
"private_key_bits" => 4096, | |
"private_key_type" => OPENSSL_KEYTYPE_RSA, | |
); | |
// Create the private and public key | |
$res = openssl_pkey_new($config); |
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
<?php | |
/* | |
* Plugin Name: Intuitive Custom Post Order | |
* Plugin URI: http://hijiriworld.com/web/plugins/intuitive-custom-post-order/ | |
* Description: Intuitively, Order Items (Posts, Pages, ,Custom Post Types, Custom Taxonomies, Sites) using a Drag and Drop Sortable JavaScript. | |
* Version: 3.1.5 | |
* Author: hijiri | |
* Author URI: http://hijiriworld.com/web/ | |
* Text Domain: intuitive-custom-post-order | |
* Domain Path: /languages |
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
<?php | |
function export_object($value, string $indent = '') | |
{ | |
switch (true) { | |
case \is_int($value) || \is_float($value): return var_export($value, true); | |
case [] === $value: return '[]'; | |
case false === $value: return 'false'; | |
case true === $value: return 'true'; | |
case null === $value: return 'null'; |
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
-- Replace wp_postmeta and wp_posts with your prefix table | |
CREATE TRIGGER `remove_orphan_post` AFTER DELETE ON `wp_posts` | |
FOR EACH ROW BEGIN IF ('post' = old.post_type) THEN | |
DELETE FROM wp_postmeta WHERE wp_postmeta.post_id = old.ID; | |
END IF; END |
NewerOlder