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 user generate --format=ids --count=10 | xargs -d ' ' -I % bash -c 'wp user update % --user_registered="2020-04-02 14:35:02" && wp user meta add % verification_token randomstring1234' |
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 user generate --format=ids --count=10 | xargs -d ' ' -I % wp user meta add % verification_token randomstring1234 |
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 user generate --count=10 |
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 text with a link after the LearnDash login modal heading. | |
*/ | |
function kanuka_add_text_after_login_modal_heading() { | |
?> | |
<div class="my-custom-text"> | |
<p>This is some additional text. <a href="https://example.com">Click here</a> for more information.</p> | |
</div> | |
<?php |
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 | |
/** | |
* Write a log entry. | |
* | |
* Helper function to write a log entry with a given title, category, and any | |
* log data. Relies on the Maintenance Functionality mu-plugin being present. | |
* | |
* Usage: | |
* | |
* kanuka_log( 'Data Import', 'import', array( |
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 | |
/** | |
* Generate a phone link with an aria-label for accessibility. | |
* | |
* @link https://link.from.pw/3HElEp9 | |
* | |
* @param string $phone The phone number to format. | |
* @param string $class Optional. The CSS class name to add to the link. | |
* | |
* @return string The formatted telephone link. |
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 | |
/** | |
* Enable email-based 2FA by default. | |
* | |
* We configure MailHog to catch outbound mail on our local/staging | |
* environments. To avoid unnecessary hassle, we have disabled our default | |
* email-based 2FA on local/staging environments. | |
* | |
* @link https://link.from.pw/3P7cH9u | |
* @author pjv |
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 | |
/** | |
* Enable email-based 2FA by default. | |
* | |
* @author pjv | |
* @link https://link.from.pw/3P7cH9u | |
* | |
* @param $providers | |
* @param $user_id | |
* @return mixed |
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
SELECT | |
post_type, | |
count(*) | |
FROM | |
wp_posts | |
GROUP BY | |
post_type | |
HAVING | |
count(*) | |
ORDER BY |
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
#!/bin/bash | |
# Save script, run chmod +x on it, then... | |
# Usage: ./delete_products.sh [user_id] | |
ARGS="$@" | |
COUNT=$(wp wc product list --user=$1 --format=count) | |
BATCHES=$(bc <<< "$COUNT/100+1") | |
echo "Deleting $COUNT products in $BATCHES batches (via user ID $1)" |
NewerOlder