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: List Image URLs From Attachment IDs | |
Plugin URI: https://www.philwylie.co.uk/ | |
Description: Generate list of original attachment file URLs from a list of attachment IDs. Download using something like Tab Save - https://link.from.pw/3veCu6q | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |
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
wp post list --post_type=post,page --field=ID | xargs -n1 -I % wp embed cache clear % |
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 | |
/** | |
* Push custom fields to Algolia. | |
* | |
* @param array $attributes | |
* @param WP_Post $post | |
* | |
* @return array | |
*/ | |
function iweb_algolia_product_attributes( array $attributes, WP_Post $post ) { |
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
wp site list --field=url | xargs -n1 -I % wp --url=% yoast index |
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: List Variable Products | |
Plugin URI: https://www.philwylie.co.uk/ | |
Description: Generate list of WooCommerce variable products. | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |
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 | |
/** | |
* Prevent LearnDash certificates from being edited. | |
* | |
* @param $pdf | |
*/ | |
function iweb_learndash_certification_created( $pdf ) { | |
$pdf->SetProtection( array( 'modify' ), '', '#:EcjN7P(sGjF*6L', 0, null ); | |
} | |
add_action( 'learndash_certification_created', 'iweb_learndash_certification_created' ); |
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
# BEGIN Force HTTPS | |
RewriteCond %{HTTP:X-Forwarded-Proto} !=https | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{REQUEST_METHOD} !=POST | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# END Force HTTPS |
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: Time Smudge | |
Plugin URI: https://www.philwylie.co.uk/ | |
Description: Do you have a bunch of posts which share the same publish date & time? Do you find the order of your posts shifts around each time a query is run? This can happen after running a mass import of posts. Time Smudge spaces out the publish time randomly over the same/next day giving you a definite value for a buttery smooth, consistent sort order. | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |
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: Import terms | |
Plugin URI: https://www.philwylie.co.uk/ | |
Description: Given an array of terms, import into a specified taxonomy. Tool to help format array - https://link.from.pw/2tM8iEs | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: https://www.philwylie.co.uk/ | |
License: GPL2 | |
*/ |
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
0 18 * * 1-5 wp algolia reindex --all --path=/home/user/public_html | |
0 18 * * 1-5 wp algolia reindex searchable_posts --path=/home/user/public_html |