START TRANSACTION;
DELETE FROM wp_posts
WHERE post_type = 'flamingo_inbound'
AND post_date < DATE_SUB(CURDATE(), INTERVAL 3 MONTH);
ROLLBACK;
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_filter( | |
"render_block", | |
function ($block_content, $block) { | |
$should_replace_title = ("title" === $block["attrs"]["gpDynamicTextType"]); | |
if (is_tax("your-custom-taxonomy") && $should_replace_title) { | |
// Get the dynamically defined text we want to replace. | |
$text_to_replace = $block["attrs"]["gpDynamicTextReplace"]; |
START TRANSACTION;
DELETE FROM wp_posts
WHERE post_type = 'flamingo_contact'
AND post_date < DATE_SUB(CURDATE(), INTERVAL 3 MONTH);
ROLLBACK;
START TRANSACTION;
DELETE FROM wp_posts
WHERE wp_posts.post_type = 'flamingo_contact';
ROLLBACK;
START TRANSACTION;
DELETE FROM wp_posts
WHERE wp_posts.post_type = 'flamingo_inbound';
ROLLBACK;
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
let types = wp.blocks.getBlockTypes(); | |
// filter to just the core blocks | |
let core_blocks = types.filter( | |
type => type.name.startsWith('core/') | |
); | |
// grab just the names | |
let block_names = types.map(type => type.name); |
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 add_new_admin_column($columns) | |
{ | |
$columns['last_modified'] = 'Last Modified'; | |
return $columns; | |
} | |
add_filter('manage_posts_columns', 'add_new_admin_column'); |
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 | |
// Check if ACF function `get_field()` exists. If it doesn't exist, display ads won't be shown. | |
// If it does exist and ACF 'hide_display_ads' value is not falsey, show display ads. | |
if(function_exists('get_field') && !get_field('hide_display_ads')) | |
{ | |
echo '<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-[your-adsense-id]" crossorigin="anonymous"></script>'; | |
} |
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 | |
/** | |
* Shortcode Extended | |
* | |
* @package ShortcodeExtended | |
* @author Chris Sparshott | |
* @copyright 2022 Chris Sparshott | |
* @license GPL-2.0-or-later | |
* |
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
Setting up my new Apple M1 macbook pro I was having issues setting up [email protected] using homebrew, with the following message being thrown: | |
``` | |
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) | |
``` | |
We need to modify the MySQL config file: | |
``` | |
nano /usr/local/etc/my.cnf |
NewerOlder