• Resolved mkl1

    (@mkl1)


    Hallo

    I would like to import the credit info together with the article
    I hoped for a simple ‘media_credit’ JSON parameter to /wp-json/wp/v2/media, but that did not work.

    I see there is a separate REST service, but no documentation for it
    /wp-json/v1/media-credit/v1/replace_in_content. What is that about?

    In the output from GET /wp-json/wp/v2/media/$id I find:

    
    'media_credit': {'fancy': 'Peter XX',
                      'plaintext': 'Peter XX',
                      'raw': {'flags': {'nofollow': False},
                              'freeform': 'Peter XX',
                              'url': '',
                              'user_id': 7},
                      'rendered': 'Peter XX'},
    

    Thanks
    M

    • This topic was modified 4 years, 2 months ago by mkl1.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author pepe

    (@pputzer)

    HI @mkl1,

    the “media” endpoint is documented via its schema. (Forget about the custom endpoint, that’s used internally instead of an AJAX call.)

    To edit the credit, POST the data to the 'media_credit': { 'raw': ... } fields. If freeform is set to anything other than the empty string or the display name of the user indicated by user_id, it will take precedence for setting the credit.

    Plugin Author pepe

    (@pputzer)

    Hi @mkl1, can I help you with anything else?

    Plugin Author pepe

    (@pputzer)

    I’m assuming the issue has been resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I Import the credit info via REST API?’ is closed to new replies.