WordPress.org

Forums

Feed JSON
Add support for custom field (1 post)

  1. Samuel_soubeyran
    Member
    Posted 1 year ago #

    I needed support for custom field.

    I modified your code and added this to feed-json/template/feed-json.php:

    //custom_fields
    $custom_fields = get_post_custom();
    foreach($custom_fields AS $key => $value) {
    	if(substr($key, 0, 1) != "_") {
    		foreach($value AS $_value) {
    			$_value = trim($_value);
    			if($_value) {
    				$single[$key]=$_value;
    			}
    		}
    	}
    }

    after section // tags

    Might be interesting for others

    https://wordpress.org/plugins/feed-json/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Feed JSON
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic