WooCommerce reviews + tutorials

How to Create a WooCommerce Widget

…ate each setting individually. public function update( $new_instance, $old_instance ) { $instance[‘setting1’] = strip_tags( $new_instance[‘setting1’] ); $instance[‘setting2’] = strip_tags( $new_instance[‘setting2’] ); return $instance; } Our shipping plugin will look like this: public function update( $new_instance, $old_instance ) { $instance[‘title’] = strip_tags( $new_instance[‘title’] ); $instance[‘text’] = strip_tags( $new_instance[‘text’] );…

Read More

WooCommerce extension updates & releases

WooCommerce Social Login 2.0

…e logos were also no longer abiding by brand guidelines for providers like Instagram. We’ve refreshed the design of all login buttons and ensured that they each follow branding guidelines from the available providers. Widget Improvements Widgets have also become more useful for your customers, and will now show buttons to link an account if a user is already logged in. When a user is logged out of your site or is a guest visitor, they’ll see the s…

Read More

WooCommerce extension updates & releases

WooCommerce Memberships 1.7: Member emails, New Plan Options, and more

…of which will be shown at the side of the plan email content settings. A useful one is definitely the renewal url merge tag, which can let you add a link that customers can click to renew their membership. This link will automatically log customers in (since we’re directly emailing the account the membership was purchased with), add the product that grants access to their cart, and lead them straight to checkout. The last email available is the “R…

Read More

WordPress development tutorials

Translating a WordPress Plugin on the Command Line Step by Step

…: define(‘WPLANG’, ”); Just change this to the language abbreviation, for instance: define(‘WPLANG’, ‘de_DE’); And visit your site to verify the translation is being picked up. One possible stumbling point for developers: your translation files may not be picked up if you symlink your plugin into your webroot as I do. Working with WPML, so that the site language isn’t hardcoded in your wp-config.php file and can for instance be selected by your s…

Read More

WooCommerce reviews + tutorials

Widgets, Part Deux: Create a Smart WooCommerce Widget

…_active_widget function. Example 1: Storefront theme Post Meta Widget The default Storefront theme blog layout shows the post meta (categories, tags, comment count) to the left of the main content: Default blog post We can use a widget to display this post meta in a widget instead so that our blog posts can be full width. Since this widget should only be used on blog posts, we’ll want to hide it when any other content but a blog post is being view…

Read More

Pagely staging site

How to create a Pagely staging site (for the non-developer)

…is being created, you’ll have to wait a few minutes for the new site to be installed. Once it’s installed, you’ll have a temporary Pagely domain for it (something like http://s12345.p123.sites.pressdns.com). You can access the information for you app by going to “Sites” to get your site list, and clicking “App Details”. You’ll then see your temporary Pagely URL on this page: Make a note of your temporary domain as well as the name you gave your si…

Read More

WP Development

Extending the WordPress XML-RPC API

…PHP Client At this point you should have XML-RPC enabled on your WordPress installed, an xmlrpc-client user created, and hopefully have tested your connection from the command line. If you’re on a primitive operating system that lacks a functional command line, or simply wish to see how to perform an remote call from PHP, here is a sample PHP XML-RPC client which you can use and modify for your own purposes: class XMLRPC_Client { private $url; fun…

Read More

Moving WooCommerce Upsells on Product Pages

…uct->get_upsells() ) { return; } // get the widget configuration $title = $instance[‘title’]; echo $args[‘before_widget’]; if ( $title ) { echo $args[‘before_title’] . wp_kses_post( $title ) . $args[‘after_title’]; } // Show the product’s upsells woocommerce_upsell_display(); echo $args[‘after_widget’]; } That’s the meat of our widget already 🙂 Now we have to remove the original upsell display if this widget is in use. The is_active_widget() check…

Read More

WP Development

Debugging WordPress

…ebugging functions. WP_DEBUG must be enabled for this constant to have any effect: define( ‘WP_DEBUG’, true ); define( ‘WP_DEBUG_LOG’, true ); Watch the log file like any other for convenience while developing: $ tail -f wp-content/debug.log Remember: One thing to keep in mind with this configuration enabled is that there will be some spots in the WordPress code that are executed prior to the log file being set, so depending on how deeply you’re d…

Read More