Support » Developing with WordPress » How to retrieve custom fields value with Json WP Rest Api?

  • Hi,

    I am using wordpress api and I am trying to retrieve custom field values from (for example) this page (localhosted):
    http://127.0.0.1:8080/wp-json/wp/v2/pages/25

    {
        "id": 25,
        "date": "2017-01-11T10:28:05",
        "date_gmt": "2017-01-11T09:28:05",
        "guid": {
            "rendered": "http:\/\/127.0.0.1:8080\/wordpress\/?page_id=25"
        },
        "modified": "2017-01-11T10:51:21",
        "modified_gmt": "2017-01-11T09:51:21",
        "slug": "bloc1",
        "type": "page",
        "link": "http:\/\/127.0.0.1:8080\/wordpress\/menu\/bloc1\/",
        "title": {
            "rendered": "bloc1"
        },
        "content": {
            "rendered": "<p>ezfezfez<\/p>\n",
            "protected": false
        },
        "excerpt": {
            "rendered": "<p>ezfezfez<\/p>\n",
            "protected": false
        },
        "author": 1,
        "featured_media": 0,
        "parent": 23,
        "menu_order": 0,
        "comment_status": "closed",
        "ping_status": "closed",
        "template": "",
        "meta": [],
        "_links": {
            "self": [
                {
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/pages\/25"
                }
            ],
            "collection": [
                {
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/pages"
                }
            ],
            "about": [
                {
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/types\/page"
                }
            ],
            "author": [
                {
                    "embeddable": true,
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/users\/1"
                }
            ],
            "replies": [
                {
                    "embeddable": true,
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/comments?post=25"
                }
            ],
            "version-history": [
                {
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/pages\/25\/revisions"
                }
            ],
            "up": [
                {
                    "embeddable": true,
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/pages\/23"
                }
            ],
            "wp:attachment": [
                {
                    "href": "http:\/\/127.0.0.1:8080\/wordpress\/wp-json\/wp\/v2\/media?parent=25"
                }
            ],
            "curies": [
                {
                    "name": "wp",
                    "href": "https:\/\/api.w.org\/{rel}",
                    "templated": true
                }
            ]
        }
    }

    This is what i got, and no custom field… :-(.

    Any help?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to retrieve custom fields value with Json WP Rest Api?’ is closed to new replies.