Create a WP test site with lots of users and posts

Posted on Wed 05 January 2022 in programming, IT, wordpress

The following WP-CLI command will create a lot of test data into a WordPress site: 1000 new users, each with 50 posts. Each post gets a random date in the last year and a random post content of variable length filled using a lorem ipsum generator.

WP_CLI::add_command( 'test', 'create_test_data …

WP CLI custom commands not working

Posted on Tue 19 June 2018 in wordpress, wp-cli

Make sure to add them in active code. Adding a spare php file with the WP-CLI command definition in /wordpress won't work, because that code won't be loaded by WP. Dropping the file into wp-content/plugins won't work as well. Make it part of an active plugin, or use your …

WordPress function url_to_postid not working with Anspress

Posted on Mon 23 January 2017 in wordpress, tips

With the Anspress theme/plugin, using the WordPress native function url_to_postid() on a question permalink returns the page ID of the base page. For example,

url_to_postid( "www.website.com/questions/question/this-is-the-question");

would return the page ID of the /questions page.

To get the WP question ID of this-is-the-question, use …

bbPress - Anonymous Subscriptions

Posted on Mon 15 February 2016 in wordpress, IT

This add-on plugin for bbPress will allow anonymous users to subscribe to topics and get email notifications when a new reply is posted. The notification email includes an unsubscribe link.

bbPress notifications will keep to go out to registered users, this plugin only extends the thing to anonymous posters as …

Posts To-Do List: keep track of writing ideas

Posted on Mon 10 September 2012 in wordpress

I worked for several blogs and websites. In most of them, we often felt the need to share hints and ideas about future posts, about what each of us stumbled upon while surfing. Unfortunately, there was not a great way to fulfill that need, and we often told each other …