With this function I open the new post series about WordPress Cron. I don’t want to create the common post about all the cron functions, so we will look at each function separately.
pre_user_query tutorial: hiding the user with the exact ID, hiding the users by the role, extending the user search
First of all you should know one important moment. There are two base user query action hooks:
pre_get_users— it fires before WP_User_Query has been parsed and allows you to change some query vars like
I’m sure there are a lot of things where this function could be helpful. As for me I wanted the following: someone posts a comment on the website and when he goes to contact me page, the respond form would be filled with this data automatically
Let’s look at the simple example of a eshop on WordPress.
The shop has custom post type
product and category for products
product_cat. By default product links looks like