scripts_admin.js
32 lines
| 1 | /** |
| 2 | * Created by jules on 7/17/2015. |
| 3 | */ |
| 4 | |
| 5 | console.log('loading scripts_admin.js'); |
| 6 | var old_compose = _wpcf7.taggen.compose; |
| 7 | |
| 8 | (function($) { |
| 9 | console.log(_wpcf7.taggen.compose); |
| 10 | |
| 11 | // ...before overwriting the jQuery extension point |
| 12 | _wpcf7.taggen.compose = function(tagType, $form) |
| 13 | { |
| 14 | |
| 15 | $('#tag-generator-panel-group-style-hidden').val($('#tag-generator-panel-group-style').val()); |
| 16 | |
| 17 | // original behavior - use function.apply to preserve context |
| 18 | var ret = old_compose.apply(this, arguments); |
| 19 | //tagType = arguments[0]; |
| 20 | //$form = arguments[1]; |
| 21 | |
| 22 | // START: code here will be executed after the _wpcf7.taggen.update function |
| 23 | if (tagType== 'group') ret += "[/group]"; |
| 24 | // END |
| 25 | |
| 26 | return ret; |
| 27 | }; |
| 28 | |
| 29 | console.log(_wpcf7.taggen.compose); |
| 30 | |
| 31 | })( jQuery ); |
| 32 |