0

XMLRPC を使用してスレッドを Wordpress (3.5.2) に投稿しました。コードは次のとおりです。

public string newPost(string title, string content, string[] categoryIds)
    {
        this.Url = this.url ;
        Post post = new Post();
        post.post_date = DateTime.Now;
        post.post_title = title;
        post.post_content = content;
        post.post_status = "publish";

        XmlRpcStruct terms = new XmlRpcStruct();
        terms.Add("category", categoryIds);
        post.terms = terms;

        return newPost("0", this.username, this.password, post, true);
    }
    [XmlRpcMethod("wp.newPost ")]
    public string newPost(string blogId, string username, string password, Post content, bool pubish)
    {
        string s = "";
        try
        {
            s = (string)this.Invoke("newPost", new object[] { blogId, username, password, content, pubish });
        }
        catch (Exception ex)
        {
            s = ex.Message;
        }
        return s;
    }

しかし、アドニンからその投稿を確認すると、「Scheduled」と表示されています

何か案が?ありがとうございました。

4

1 に答える 1

4

Wordpress のインストールは、パブリッシング クライアント ワークステーションとは異なるタイムゾーンで構成されています。これにより、投稿に (WP の観点から) 将来の日付が付けられ、すぐに公開するのではなく、スケジュールされたステータスでマークされます。wp インストールのタイムゾーンが正しく設定されていることを確認してください (たとえば、PST GMT-8 ゾーンに住んでいる場合は、夏時間を計算できるように「アメリカ/ロサンゼルス」設定を使用してください)。

編集:「publish」ではなく「pubish」という名前のメソッドパラメーターにタイプミスがあります

于 2013-08-02T01:49:25.287 に答える