Customize and localize WP FC using wpfc_js_vars filter bug fixed
-
Since the 0.8.3 release, there is a new filter in WPFC, called wpfc_js_vars, that you can use for customization and/or localization WP Fullcalendar.
After some test and a bug fix here’s how it works:In your function.php add your filter function and normaly it should be enough ;).
add_filter( 'wpfc_js_vars', 'my_wpfc_js_vars' ); function my_wpfc_js_vars($js_vars) { $js_vars['wpfc_locale']['allDayText']='Journée'; // French translation $js_vars['wpfc_locale']['axisFormat']='HH(:mm)'; // 24H format $js_vars['wpfc_locale']['minTime']='8:00'; // lazy... return $js_vars; }
But Markus, I found a bug in the way this filter is called.
In wp-fullcalendar you must replace the 2 last lines of localize_script function by this one :
wp_localize_script('wp-fullcalendar','WPFC',apply_filters('wpfc_js_vars', $js_vars));
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Customize and localize WP FC using wpfc_js_vars filter bug fixed’ is closed to new replies.