Created
September 12, 2016 09:44
-
-
Save Stiofan/b3d37f2899c6b36d3d6c9eebdc37abc1 to your computer and use it in GitHub Desktop.
Make shortcode work in field type and htmlvar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_enable_shortcodes_in_cf($html,$location,$cf){ | |
// this line will enable it only for a text input with html var 'textx' | |
if(isset($cf['htmlvar_name']) && $cf['htmlvar_name']=='geodir_textx'){ | |
$html = do_shortcode( $html ); | |
} | |
return $html; | |
} | |
add_filter('geodir_custom_field_output_text','my_enable_shortcodes_in_cf',15,3); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment