Making changes to woocommerce order before save

A popular method is to hook to the order status. You have several status names to choose from: completed processing cancelled on-hold You would use it like this: add_action(‘woocommerce_order_status_processing’ In addition you can intercept a certain change like this: add_action(‘woocommerce_order_status_on-hold_to_completed’ Finally you can intercept any change that takes place like this: add_action(‘woocommerce_order_status_changed’

Undeletable posts, users or other content

When I see behavior like this, it’s almost always a corrupt MySQL table or two. You can activate WordPress’s built-in repair tool by adding define( ‘WP_ALLOW_REPAIR’, true ); to your wp-config.php file and visiting {$your_site}/wp-admin/maint/repair.php You can remove the define after you’re done.

Admin – Dashboard – Unset recent comments

The recent comments list is part of the Activity Dashboard Widget. Approach #1 We could remove that dashboard widget and then add our modified version of it: /** * Remove the latest comments from the Activity dashboard widget (approach #1) */ add_action( ‘wp_dashboard_setup’, function() { // Remove the Activity widget remove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’ ); … Read more

Renaming “Expand Details” within “Add Media”

It’s possible to change the output of the label with jQuery but I’m not sure the best hook to do this besides admin_footer. // Collapse var $open = jQuery(‘.acf-expand-details > .is-open’), $open_icon = $open.find(‘span’); $open.html(‘MIN Details –>’); $open.prepend($open_icon); // Expand var $close = jQuery(‘.acf-expand-details > .is-closed’), $close_icon = $close.find(‘span’); $close.html(‘<– MAX Details’); $close.prepend($close_icon); add_action( ‘admin_enqueue_scripts’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)