MtApi.publishPost (postid, username, password)
mt.publishPost switches the status of a story to online

  • Parameter postid:
    String
  • Parameter username:
    String
  • Parameter password:
    String
  • Returns
    Boolean true if successful
Sourcecode in MtApi/moveabletypeAPI.js:
1:   function publishPost(postid, username, password) {
2:      var usr = root.blogger.getUser(username, password);
3:      var entry = root.storiesByID.get(postid.toString());
4:      if (!entry)
5:         throw("Couldn't find the story with id " + postid);
6:      try {
7:         entry.checkEdit(usr, entry.site.members.getMembershipLevel(usr));
8:      } catch (deny) {
9:         throw("You're not allowed to edit the story with id " + postid);
10:     }
11:     entry.publish = 2;
12:     return true;
13:  }