Is there anyway to rewrite woocommerce-template.php?

All of the functions in that file are pluggable functions, you can define any of those functions in your theme’s functions.php file or another plugin and they will override the WooCommerce core functions. There are also a number of filters in most of those functions which may allow you to do what you want without … Read more

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

Custom post type archive – error in nav-menu-template.php

print_r($queried_object) right before line 439 generates the following – there’s no ‘ancestors’ key: When you are on a post type archive calling get_queried_object (which the code probably does) or using WP_Query::$queried_object return the post type “object”. All that is is the arguments with which the post type was registered. The relevant bit of nav-menu-template.php in … 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/