functions.php
<?php
// ^ the <?php above should only be in your functions.php file ONCE, at the top
//
// This code is provided for educational purposes only
//
// Executing shortcodes from user input is not support or recommended as this will
// allow users to input any shortcode even ones you may not want them to use.
// I do not support this and will not be held liable for anything done to your site
// as a result of executing shortcodes from user input. Use at your own risk.
// The filter is field_editor_output_as_value_METAKEY
// where you need to replace METAKEY with the actual meta key you want to filter the output for
// .... as you can see below you can also add multiple filters using the same function.
add_filter( 'field_editor_output_as_value_META_KEY_ONE', 'my_custom_exe_shortcode' );
add_filter( 'field_editor_output_as_value_META_KEY_TWO', 'my_custom_exe_shortcode' );
function my_custom_exe_shortcode( $value ){
if( empty( $value ) ) return $value;
return do_shortcode( $value );
}
No comments yet.