Add a file upload field

First do a var_dump on the $_FILES variable to check if the array key you are using is the correct one, and you should never just grab a variable that comes from user input and just use it, try doing a isset or empty before you use the variable. After you found what is the … Read more

WordPress Update Question

Yes. Update. It is important. There are security fixes in just about every release, not just changes to functionality. The longer a release is in the wild the more time bad people have to figure out how to break in. Update. If you are getting errors, update manually. If you tell us what those errors … Read more

how to request a script more than once in wordpress

When you’re using wp_register/enqueue_script(), you’re basically pushing an element to an array named global $wp_scripts. Therefore you can’t echo something twice as WordPress successfully prevents scripts being registered or added multiple times. The reason is easy: Else, every plugin that registers or enqueues jQuery (or uses it as dependency) would add another instance. Which would … Read more

How to hook into action/filter call

The callbacks hooked onto ‘all’ are called prior to the callbacks for any hook (action and filters) being called. (See source) add_action( ‘all’, ‘wpse115617_all_hooks’ ); function wpse115617_all_hooks(){ //This is called for every filter & action //You can get the current hook to which it belongs with: $hook = current_filter(); } See http://queryposts.com/function/current_filter/

Add a “default sorting” menu to child store pages

Take a look at whether or not your theme has an archive-product.php file in the woocommerce folder. This is a copy of the WooCommerce category template (which is displayed by archive-product.php. As long as your template has the do_action( ‘woocommerce_before_shop_loop’ ); action hook then the woocommerce_catalog_ordering() function should automatically be called with a priority of … Read more

When I click on Add Product in woocommerce plugin, I get a blank white page [closed]

From http://wordpress.org/plugins/woocommerce/ Requires: 3.5 or higher This assumes you are using WooCommerce 2, if you are using a version below 2 then you don’t need to upgrade and it’s going to be something else. In either case you might be able to track the error down by enabling WordPress debug mode (http://codex.wordpress.org/Debugging_in_WordPress) and trying to … Read more

Activate a plugin via a SQL query

If your goal is automated plugin activation you don’t have to do it via SQL. You could, of course, but why not use functionality that comes with WordPress? As I mentioned in my comment, the data has been serialized so you just have to unserialize the data, add your plugin, re-serialize the data, and update … Read more