[Python] Wordpress how to get advanced custom field content using python and the REST API

Discussão em 'Python' iniciado por Stack, Janeiro 27, 2025.

  1. Stack

    Stack Membro Participativo

    I am using a REST API with Python to get custom field content from WordPress. When I pull a non custom field like "Title", I can successfully render this with the code:

    post_title = post_data_dict.get('title', {}).get('rendered', '')


    However, with a custom field, I haven't been able to figure this out. Right now my code looks like this:

    video_content = post_data_dict.get('acf', {}).get('content', '')


    However this contains the HTML formatting.

    Any hints would be greatly appreciated. Thank you.

    Continue reading...

Compartilhe esta Página