diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-12 11:27:54 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-12 11:27:54 +0000 |
| commit | 4f3bce79bfb5851cef9e7bc655c91bb3093cc401 (patch) | |
| tree | 10a0991fddeb0e075d7fa46e2b40e5dbc64d1e88 /wp-inst/wp-content/smarty-plugins/function.custom_fields.php | |
| download | wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.gz wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.xz wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.zip | |
Initial Import
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-content/smarty-plugins/function.custom_fields.php')
| -rw-r--r-- | wp-inst/wp-content/smarty-plugins/function.custom_fields.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/wp-inst/wp-content/smarty-plugins/function.custom_fields.php b/wp-inst/wp-content/smarty-plugins/function.custom_fields.php new file mode 100644 index 0000000..8c684b7 --- /dev/null +++ b/wp-inst/wp-content/smarty-plugins/function.custom_fields.php @@ -0,0 +1,31 @@ +<?php +/* + * Smarty plugin + * ------------------------------------------------------------- + * File: function.custom_fields.php + * Type: function + * Name: custom_fields + * Purpose: Passes the custom field value to the named function + * ------------------------------------------------------------- + */ +function smarty_function_custom_fields($params, &$smarty) +{ + global $wpblog, $siteurl; + + extract( $params ); + $fields = get_post_custom(); + if( is_array( $fields ) ) + { + while( list( $func, $custom_params ) = each( $fields ) ) + { + $func = str_replace('../', '', $func); + $file = $smarty->plugins_dir . "/custom_fields." . $func . ".php"; + if( is_file( $file ) ) + { + include_once( $file ); + $func( $smarty, $params, $custom_params ); + } + } + } +} +?> |
