Created
December 1, 2016 22:58
-
-
Save corazzi/47c5e971259f805e2fa2775ffef32441 to your computer and use it in GitHub Desktop.
Add Jetpack Markdown to an ACF Textarea field
This file contains hidden or 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 | |
/** | |
* Filter an ACF field to add Markdown support with Jetpack | |
* | |
* @link https://www.advancedcustomfields.com/resources/acfload_value/ | |
*/ | |
add_filter('acf/load_value/type=textarea', function ($content) { | |
return wpautop( | |
WPCom_Markdown::get_instance()->transform($content) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment