In WooCommerce I need to modify the thankyou.php page [closed]

I ended up inserting the payment description. (the one you specify in the woocommerce settings in the WordPress backend) The “native” build-in woocommerce payment-text is static and doesn’t relates to the actual selected payment method. 🙁 I did this by modifying the woocommerce template file: 1: Copy this template file: ..wp-content/plugins/woocommerce/templates/checkout/thankyou.php to your-theme-folder/woocommerce/checkout/thankyou.php 2: Replace … Read more

Hook/notify when any option or setting is added or updated

Looking at the sources (core files, wp-includes/option.php) you can always find your target hook tags: add_action(‘added_option’, ‘wpse230212_callback_add’, 10, 2); add_action(‘updated_option’, ‘wpse230212_callback_update’, 10, 3); function wpse230212_callback_add( $option_name, $option_value ) { // do stuff on add_option } function wpse230212_callback_update( $option_name, $old_value, $option_value ) { // do stuff on update_option } Hope that helps.

How to use the_excerpt in a filter hook?

use the filter get_the_excerpt. Look at line no. 250 here, they are using the_excerpt internally on the function get_the_excerpt(), and in this function on line no. 272, they’re applying the filter get_the_excerpt on the actual excerpt. Hence, add_filter(‘get_the_excerpt’, ‘exc’); function exc($param) { return “Whew !”.$param; } is the way to go if you want to … Read more

Woocommerce Product Category Widget – hide categories that have no products in stock [closed]

Use the woocommerce_product_categories_widget_args and woocommerce_get_availability filters in a custom function to filter the product categories widget for out of stock products. See what you can come up using these filters and post the code back here if you get stuck. Here’s some code from my site which may help you get started. add_filter( ‘woocommerce_product_categories_widget_args’, ‘wpsites_exclude_product_cat_widget’ … Read more

Admin Post Update Redirection to Posts Screen

Use the redirect_post_location filter and admin_url() function. add_filter( ‘redirect_post_location’, ‘wpse_124132_redirect_post_location’ ); /** * Redirect to the edit.php on post save or publish. */ function wpse_124132_redirect_post_location( $location ) { if ( isset( $_POST[‘save’] ) || isset( $_POST[‘publish’] ) ) return admin_url( “edit.php” ); return $location; } To redirect to a different url, add everything after the … Read more

How to make post and comment count unclickable with dashboard_glance_items hook

The dashboard_glance_items filter is only useful for modifying the extra elements. The posts/comments data elements have already been displayed. Here are three ideas: Method #1 – Use the dashboard_glance_items filter: You can use the following filter setup, to remove the posts/pages/comments elements from the output of wp_dashboard_right_now(). The trick is simple, foul WordPress to think … Read more

Difference between hooks Plugin_loaded and admin_int?

plugins_loaded fires once activated plugins have loaded. This fires on both admin and public screens. admin_init fires as an admin screen or script is being initialized. This fires only on admin screens. The typical order for firing of hooks on the admin screen is: muplugins_loaded – this is the first hook available to must-use plugins … Read more

Filter Hook on plugin update

Maybe upgrader_process_complete() action hook. Fires when the bulk upgrader process is complete. On line 761 of wp-admin/includes/class-wp-upgrader.php From source: /** * Fires when the upgrader process is complete. * * See also {@see ‘upgrader_package_options’}. * * @since 3.6.0 * @since 3.7.0 Added to WP_Upgrader::run(). * @since 4.6.0 `$translations` was added as a possible argument to … Read more

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