admin管理员组文章数量:1402985
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, i've read the api.wordpress documentation of theme and plugin section at _API and was able to achieve this with plugins .0/{slug}.json
, but themes aren't as clear. Can someone please help me out?
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, i've read the api.wordpress documentation of theme and plugin section at https://codex.wordpress/WordPress_API and was able to achieve this with plugins https://api.wordpress/plugins/info/1.0/{slug}.json
, but themes aren't as clear. Can someone please help me out?
1 Answer
Reset to default 2If 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
https://api.wordpress/themes/info/1.2/?action=theme_information&request%5Bslug%5D=twentyten&request%5Blocale%5D=en_US&request%5Bwp_version%5D=5.3.2
You can see the parameters in there as multiple URL-encoded request[key]
parameters.
本文标签: pluginsHow to get theme39s info from wordpressorgthemes using apiwordpressorg
版权声明:本文标题:plugins - How to get theme's info from wordpress.orgthemes using api.wordpress.org? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744651776a2617727.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论