-1

私はmetaweblog apiを使用して、言語としてc#を使用してワードプレスにブログを投稿しています。カスタム フィールド、タグ、カテゴリ、タイトルなどのすべての単語。問題は、画像をアップロードして、その画像をアイキャッチ画像として設定できないようです。私はすでに4日間答えを探していましたが、まだ運がありません. 多分あなたたちはこれについて私を助けることができます. どうもありがとうございました。

4

1 に答える 1

1

I found the answer to the problem. XML-RPC alone cannot set any uploaded image to featured image. Head over to this issue page http://core.trac.wordpress.org/ticket/15098. The patch allows returning the ID information of the uploaded image when using wp.uploadFile/metaWeblog.newMediaObject. Once the image ID(not the image URL) is returned, you can set it to wp_post_thumbnail and it should appear as featured image. Another workaround without going this route is by uploading the image first and you should be able to retrieve the URL of the image. Query ID information from wordpress database table called wp_posts where image id is equal to the name of the image uploaded. From there, you can then set the ID to wp_post_thumbnail. Thanks a lot.

于 2013-10-02T07:58:38.637 に答える