qTranslate-Team / woocommerce-qtranslate-x

Enables multilingual framework for plugin "WooCommerce - excelling eCommerce".
GNU General Public License v3.0
11 stars 19 forks source link

Made code compatible with PHP 5.3 #5

Closed mweimerskirch closed 9 years ago

mweimerskirch commented 9 years ago

Made code compatible with PHP 5.3 -.- Fixes #3

mweimerskirch commented 9 years ago

Do we have to support 5.3? The official WordPress requirements say 5.4: https://wordpress.org/about/requirements/

johnclause commented 9 years ago

Do we have to support 5.3?

I would try to not to be fancy, because I would assume that there are many servers in the world, which are still behind ...

mweimerskirch commented 9 years ago

I'm just not used to write code for 2009 anymore ;-) But yes, you're right :-(

OGSWEB commented 9 years ago

Sorry, my client has other scripts and websites on the same plateform...

OGSWEB commented 9 years ago

Is it the correct code for 5.2?

add_action( 'save_post', 'qwc_my_function', 10, 3); function qwc_my_function($post_id, $post, $update) { if ( 'shop_order' != $post->post_type || $update /* ignore updates */ ) { return; } global $q_config; add_post_meta( $post_id, '_user_language', $q_config['language'], true ); };