WordPress.org

Ready to get started?Download WordPress

Forums

Feed JSON
Add support for custom field (1 post)

  1. Samuel_soubeyran
    Member
    Posted 5 months 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/

Reply

You must log in to post.

About this Plugin

About this Topic