开发者 | jpcordial |
---|---|
更新时间 | 2013年8月24日 03:02 |
PHP版本: | 3.5 及以上 |
WordPress版本: | 3.5.1 |
版权: | GPLv2 |
版权网址: | 版权信息 |
Yes, you can!
In your theme's functions.php file, you can use a filter to add whatever data you need.
add_filter("get_json_meta", "my_metadata_function"); function my_metadata_function($metadata){ $myData = ""; //Add your data here. array_push($metadata, $myData); }
Every post type also has it's own meta data filter. If you need to add metadata only to a single post type,
add_filter("get_json_meta_{post_type}", "my_metadata_function"); function my_metadata_function($metadata){ $myData = ""; //Add your data here. array_push($metadata, $myData); }
Any data you push onto the array will be available in {post}.meta section of the JSON feed.
Sure can! You can change that in the plug in settings. Settings can be accessed from Settings->JSON Data Feed.
Why yes, you can! Once again, through the magic of filters, anything is possible!
add_filter("get_json_bloginfo", "my_bloginfo_function"); function my_bloginfo_function($bloginfo){ $myData = ""; //Add your data here. array_push($bloginfo, $myData); }