wpdb prepare insert table doesn’t work

I’m pretty sure that first SQL query isn’t correct SQL (insert has different syntax) 😉 It should be: INSERT INTO {$wpdb->prefix}awpcp_adphotos (ad_id, image_name, disabled, isprimary) VALUES (%d, %s, %d,%d) In second example, I’m almost sure that ad_id is not string, and image_name is not a number. Of cours I’m only guessing, because I haven’t seen … Read more

change add to cart button link [closed]

After hours of research, i found a somewhat weird solution but somehow works. I used the woocommerce_is_purchasble hook. It passes 2 parameters is_purchasable and object (WC_Product) Which I can now get the product total number of stock. Here’s what I did. function order_is_purchasable($is_purchasable, $object) { if($object->get_total_stock() > 50){ echo ‘<a style=”margin-bottom: 10px;” href=”” class=”button”>Call to … Read more

Are there any official or unofficial guidelines for the styling of a widget?

A theme has near complete control over the appearance of a site, including the widgets. And any plugin could load a stylesheet that overrides elements of your, intentionally or not. There are guidelines to encourage certain standards of code quality, which are enforced to some degree if the plugin/theme is hosted on the WordPress.org plugin … Read more

my own SVN for a plugin/theme

Sure it is possible there is a great chapter about that in the Professional WordPress Plugin Development book (http://www.amazon.de/Professional-WordPress-Plugin-Development-Williams/dp/0470916222). I’ve already got a system for my premium plugins like that. Essentially you have to hook into the WordPress API requests and root them to your own API Here is an example for premium plugins https://gist.github.com/Horttcore/5197032

First plugin, problem with get_pages

Take a look at this to get you started. Then work from here. There were a number of things you had wrong, and I think this will clarify. <?php /* Plugin Name: Child Pages Query Author: Sten Winroth Plugin URI: Description: Version: 1.0 Author URI: Domain Path: /languages Text Domain: */ class childPagesQuery { private … Read more