New answers tagged


It is all fine. You just need to declare variable global first then you can set the value of this and access globally. function my_free_shipping( $is_available ) { global $woocommerce, $product_notfree_ship; // set the product ids that are $product_notfree_ship $product_notfree_ship = array( '1', '2', '3', '4', '5' ); Then again declare it globally when ...


Declare it as global $product_notfree_ship as you are doing, just access it via this $GLOBALS['product_notfree_ship'];


You can get an array with just the numbers by using array_values($your_array); It will return an array with just the numbers. Is this what you need, or a string with a comma separated list of IDs? If that's the case, use this: implode(",",array_values($your_array)); Hope this helps.


I think you are on the right track, but that last part is messy. You are using the bw_add_markup_class function for two different purposes : to return the classes that you want to add to list the context of the filters that you want to call If I understand well want you are trying to do, you need a function to return the array and then apply your ...


QUERY ALL PROGRAMAS - SORTED BY DAYS IN THE FUTURE Loop for one week into the future and store the values to reduce calcs later. $now = date('w'); $today = intval($now); $futures = array(); for($offset = 0; $offset < 7; $offset ++) { if(($next = $today + $offset) > 6) $next -= 7; // day offset $futures[] = $next; } Do the query and collect ...


What about using just get_posts (removing the order_by argument), then looping through to create and array of programs, then building the output from that: $posts = get_posts(array('post_type'=>'programas','meta_key'=>'audio_date')); $programs = array(); foreach ($posts as $post) { $days = get_post_meta( $post->ID, 'audio_date', true ); // ...

Top 50 recent answers are included