Why was my plugin rejected from the WordPress.org repository?

This is because you directly call a PHP file from within your plugin folder. This is bad for two reasons, the first being that some people block direct access to PHP files inside the wp-content folder. The second is you need to include wp-load.php to access the WordPress API. Instead of linking to… site_url().””.”/wp-content/plugins/Printer-Friendly-WP/print.php?id=page_id=”.””. get_the_ID()` … Read more

Woocommmerce show SKU in cart page

Add the following code to your theme’s functions.php file, or as a new plugin: add_filter( ‘woocommerce_in_cart_product_title’, ‘add_sku_in_cart’, 20, 3); function add_sku_in_cart( $title, $values, $cart_item_key ) { $sku = $values[‘data’]->get_sku(); return $sku ? $title . sprintf(” (SKU: %s)”, $sku) : $title; }

Getting the Product object in a custom loop

You could use a custom query to fetch the product object. Here is a snippet to get the stock count. Take a look at the product class: http://docs.woothemes.com/wc-apidocs/class-WC_Product.html for functions available for the product object. <?php $args = array( ‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ … Read more

Reposition Woocommerce Message

WooCommerce renders messages by using woocommerce_show_messages() function. This function is hooked to woocommerce_before_single_product action. So if you don’t want to render messages before single product, you need to remove that hook for the action. remove_action( ‘woocommerce_before_single_product’, ‘woocommerce_show_messages’ ); If you want to render messages in another place, then just call woocommerce_show_messages() function in desired place.

Can I delete plugin files using FTP?

In almost all cases you can simply delete the plugin and it will be switched off automatically, and in fact that is advice I’ve given many times to help reel in broken sites. The same is true for themes. Some plugins are actually more complicated than that and require additional steps. Notably, the caching plugins … Read more