Highlight “Show all” item in wp_list_categories

Unfortunately there is no filter allowing to modify the “Show all” link directly or to add any class to this item: $output .= “<li class=”cat-item-all”><a href=”https://wordpress.stackexchange.com/questions/331852/$posts_page”>$show_option_all</a></li>”; But there is a wp_list_categories at the end of function that allows you to modify all the output. Here’s a filter that will highlight “Show all” option if no … Read more

Which hook should I use to capture $_POST(‘password’) via profile update and password reset

Sometimes you have to look at the name of the input you’re trying to pick up via $_POST. It’s not always consistent across forms. In the case of the WooCommerce password change form, the input name for the new password field is ‘password_1’ so that’s what you need to pick up via $_POST: function my_profile_update( … Read more

Get rid of product images mobile swipe functionality from WooCommerce single product [closed]

Everything required is located on Class WC_Frontend_Scripts source code: To target mobile devices, you can use the WordPress conditional tag wp_is_mobile(). A) For the Photoswipe functionality you have essentially 2 hooks: woocommerce_single_product_photoswipe_enabled to disable it. woocommerce_single_product_photoswipe_options to change options (see below). 1) To disable it, you will use: add_filter( ‘woocommerce_single_product_photoswipe_enabled’, ‘__return_false’ ); or targeting mobile … Read more

Remove Order List Row Link in WooCommerce Admin?

Based on class-wc-admin-list-table-orders.php (order column on line 173) there doesn’t seem to be a filter to change the markup. To circumvent this, perhaps you could add a js/jQuery script, to admin_footer or with admin_enqueue_scripts, which either adds the necessary class(es), removes href or changes it to #, or with some event delegation wizardry have your … Read more

Running a script before absolutely everything

init is not the first action to run on a WordPress install. Here is a basic rundown of a typical stack order. https://codex.wordpress.org/Plugin_API/Action_Reference Try hooking into `muplugins_loaded’. I don’t believe it is conditional, so it should run every time. https://codex.wordpress.org/Plugin_API/Action_Reference/muplugins_loaded <?php add_action( ‘muplugins_loaded’, ‘my_script’ ); function my_script() { // my script here }

Hook to change Logout url

There’s no need to regenerate the logout URL (the $logout_url part in your code) because the first parameter passed to your function is already the logout URL. So basically, just rename that $force_reauth to $logout_url and remove the $logout_url = wp_nonce_url( … );: function my_custom_logout_url($logout_url, $redirect=null){ // rename the $force_reauth // And remove this: //$logout_url … Read more