WordPress Developer Ukraine, Kyiv
How to Enqueue a Script After All Other Scripts in WordPress

How to Enqueue a Script After All Other Scripts in WordPress

How to enqueue a script after all other scripts in WordPress By default, WordPress prints scripts in the order they are enqueued, taking dependencies into account. Sometimes a script must run last, after jQuery and everything that other plugins have added to the page. The dependency list, a late hook priority and the wp_footer hook…
WooCommerce: Add Custom Fields to Product Variations

WooCommerce: Add Custom Fields to Product Variations

WooCommerce: add a custom field to product variations Each variation of a variable product (a size, a colour) has its own price, stock and SKU. Sometimes it also needs its own text: a “Best value” badge on the large size, a delivery note for one colour. WooCommerce has hooks to add such a field to…
WooCommerce Action and Filter Hooks: A Reference

WooCommerce Action and Filter Hooks: A Reference

The WooCommerce hooks you need most often WooCommerce adds hundreds of its own actions and filters on top of WordPress. With them you can change the product page, the checkout fields, order processing and emails without copying template files into the theme. The hard part is finding the right one, so here are the hooks…
How to Use wp_redirect and wp_safe_redirect in WordPress

How to Use wp_redirect and wp_safe_redirect in WordPress

wp_redirect() and wp_safe_redirect() in WordPress Redirects are an everyday task: after a form is sent, after login, when a page has moved, when a guest opens a page for members. In WordPress you do not call header( 'Location: ...' ) yourself; there are two functions for it, and the difference between them matters for security.
How to change arguments of the global query on default pages

How to change arguments of the global query on default pages

Modify the global WordPress query on default pages pre_get_posts fires after the query variable object is created but before the database query runs. It gives you direct access to the $query object for every query WordPress makes, including the main loop, so you can change arguments without duplicating the template or creating a secondary query.