i am trying to get the html code of the description of a few themes from WordPress, i know this is possible to achieve in codecanyon, but can't get the hang of it in wordpress.org, i've read the api.wordpress.org documentation of theme and plugin section at https://codex.wordpress.org/WordPress.org_API and was able to achieve this with plugins https://api.wordpress.org/plugins/info/1.0/{slug}.json
, but themes aren't as clear. Can someone please help me out?
1 Answer
If you're in the admin site you can use themes_api()
$info = themes_api( 'theme_information', [ 'slug' => 'twentyten' ] );
echo esc_textarea( $info->sections['description'] );
but that's plain text, not HTML. The API request it generates is
You can see the parameters in there as multiple URL-encoded request[key]
parameters.
-
1
-
1