Generate WP-CLI @alias for each site on multisite

I have a few multisites, each with several sites, that I want to auto-generate @aliases for. Is there way to sync those sites as aliases in my site list? I’d like to be able to target a single site without having to specify –url=http://domain.com/sub-site/ and using the last part of the url seems like a … Read more

Send automatic mail to Admin when user/member changes/adds profile

Is there a way to send the updated/added values from profile, when a member/user updates his/hers data, to the admin of the site or another emailadress? Can this be the first step? /* do something when user edits profile */ add_action(‘personal_options_update’, ‘notify_admin_on_update’); function notify_admin_on_update(){ // send a mail with the updated values to [email protected] exit; … Read more

How to add/assign or change featured image in post programmatically?

I have written a plugin that (besides other functionality) makes posts from existing content. For each post I have one picture – how to make them featured programmatically? I do the: $id = wp_insert_post( $my_post ); wp_set_object_terms( $id, $cat_ids, ‘category’ ); and I would like my next step to be inserting $image (file path or … Read more

Automatically create child pages when saving a (parent) page

I have a bit of a tricky one… I have a hierarchical Custom Post Type (‘shows’) that represents events. Is it possible for the user to create a new page (ie show), save the page and for WordPress to automatically create a defined set of child pages with defined names? Ideally each child page would … Read more