get current product name in functions.php

Please check below code : add_action( ‘woocommerce_single_product_summary’,’content_after_addtocart_button’ ); function content_after_addtocart_button() { global $product; $product_title = $product->get_name(); $product_price = $product->get_price(); echo ‘<div class=”content-section”> <a href=”https://wordpress.stackexchange.com/questions/340361/mailto:[email protected]?&subject=Richiesta Informazioni&body=” . $product_title . ‘??? ‘ . $product_price . ‘ ??? “> <input type=”button” value=”Richiedi Informazioni”/ ></a></div>’; }

How do I publish only one page to production after making changes on staging?

No, not unless you push the change manually. More specifically, WordPress has no concept of production/preprod/etc or of pushing/pulling. These features are always implemented by hosts or custom software, and are extensions of WP, not parts of WP itself. Otherwise, production and preprod etc are just 2 separate WP installations that just happen to be … Read more

Merging WordPress posts from different databases

If you never send/sync Production posts to live. Then just pull/copy the live database to the development database via mysqldump (or similar) and use wp-config vars to force the site and blog URL. Use the following in the dev versions wp-config.php to force the URL’s define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’, ‘http://example.com’); You may as well sync the entire … Read more

How to Work Seamlessly Between Development, Staging, and Production Sites in wordpress

There’s a good article at WP Tavern that suggests some good methods. There is also a plugin called WP Pusher. With regard to using the different domains, like dev, staging, production, etc. you could set up different remote repos for dev, staging, production, etc. And then you can push to them individually depending on what … Read more

Different color admin bars for dev, staging and production

You can use a filter to set the admin color scheme, which includes colors for the admin bar: <?php // add a filter add_filter(‘get_user_option_admin_color’, ‘wpse_313419_conditional_admin_color’); // function wpse_313419_conditional_admin_color($result) { // Dev: use ‘light’ color scheme if(get_site_url() == ‘http://dev.example.com’) { return ‘light’; // Staging: use ‘blue’ color scheme } elseif(get_site_url() == ‘http://staging.example.com’) { return ‘blue’; // … Read more

What actions affect files, DB, or both?

Registering a new user – database Adding a post or comment – database Changing to a new theme – database(yes) Changing a theme’s settings – database Installing or removing a plugin – file system,database Activating, or deactivating a plugin – file system,database Updating a plugin – file system and database (DB structure may change if … Read more