Advertisement
chrishajer

Process shortcodes in Gravity Forms descriptions

Jan 12th, 2017
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. <?php
  2. // process shortcodes all over the form
  3. add_filter( 'gform_get_form_filter', 'shortcode_unautop', 11 );
  4. add_filter( 'gform_get_form_filter', 'do_shortcode', 11 );
  5.  
  6. // TEST: quick [date] shortcode
  7. function gf_displaydate(){
  8.     return date('F jS, Y');
  9. }
  10. add_shortcode( 'date', 'gf_displaydate' );
  11. // try [date] shortcode now in the form description or a field description
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement