wp_schedule_event didn’t work

Cron fires outside of the standard WordPress loop, so $post will not be filled with any post-related data when the function is called. It should be obvious, then, that providing an ID directly isn’t referencing the non-existent $post variable which is why it works in that scenario. The best way to set post_statuses to expired …

Read more

Multisite network admin – User’s role not showing up

This worked for me: Make sure the row in option-table in the database for wordpress-site have the correct option_name for the serialised roles-data. For instance; if the database-table is wp_options, the column option_name in the role-row should be wp_user_roles. if the database-table is wp_20_options, the column option_name in the role-row should be wp_20_user_roles. Don’t ask …

Read more