[wp-hackers] the_content for shortcode and custom field

Dwain Maralack dwain.maralack at gmail.com
Fri Oct 26 18:53:38 UTC 2012


Hi Chris

You'll need to extract each post's custom fields and run your code  against
it.

See the link bellow for info on how to get the values:

http://codex.wordpress.org/Function_Reference/get_post_custom_values

You'll have to use the exact code the plugin uses to check if the short
code is in the custom field value by using a regular expresion.

$pattern="/\[s3mediastream\]([^\/]*)\[\/s3\]/";


The alternative would be to update the plugin function.

Regards
Dwain

On 26 Oct 2012, at 2:14 PM, chris <chris at lod.com> wrote:

Im using a plugin that doesn't use the traditional shortcode, so I cant run
do_shortcode on the custom field.

Uses something like $pattern="/\[s3mediastream\]([^\/]*)\[\/s3\]/"; on
the_content.

Anyway I can use the shortcode in a custom field and run a filter on the
field so it applies the non traditional shortcode?



_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list