Code Monkey home page Code Monkey logo

Comments (3)

ArunPrakashG avatar ArunPrakashG commented on July 24, 2024 1

Hi @RoyalCoder88 ,

Thank you for your commendation.

I'd like to address the issue you're encountering. The absence of the featured image URL in the REST API response is due to the fact that the URL field is only present when the "rest api featured image url" plugin is active on your website. This is documented in the respective property's description:

/// Field generated by https://wordpress.org/plugins/rest-api-featured-image/ plugin
final String? featuredImageUrl;

If you prefer not to utilize this plugin, there are alternative solutions. You can modify the functions.php file to include this capability. Alternatively, you can use the ID from the featuredMedia property and make a retrieval request to the media interface using that ID. This method will provide you with comprehensive details about the featured image.

Thank you!

from wordpress_client.

ArunPrakashG avatar ArunPrakashG commented on July 24, 2024 1

@RoyalCoder88
Now that you mention it, i think i may have missed this edit. I had edited my wp installation on test environment to have that key.
I will correct it soon!

from wordpress_client.

RoyalCoder88 avatar RoyalCoder88 commented on July 24, 2024

Hi @ArunPrakashG,

Thanks for your solution, it's working now. Only one mention the field is featured_media_src_url not featured_image_url like in Post class. Thanks!

from wordpress_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.