erayalakese / slack-wordpress

WordPress Integration for Slack
MIT License
44 stars 12 forks source link

Update plugin.class.php #6

Closed likol closed 9 years ago

likol commented 9 years ago

adds hook method to differentiate post/page is new publish or updated.

erayalakese commented 9 years ago

Hello @likol

Thank you for patch . I'll merge it after tests.

erayalakese commented 9 years ago

@likol

`add_action('draft_to_publish', array($this, 'publish_post_hook'));``

draft_to_publish won't work while posting new post. Post update function is working but i'm trying to resolve new post problem.

likol commented 9 years ago

Hi @erayalakese I tested on all-new WP4.1.1 and "draft_to_publish" it's work fine for me.

https://codex.wordpress.org/Post_Status_Transitions

if the new post/page has only title, the post_status will be auto-draft, if content not empty, it will be draft

I saw your new hook metmod, look great :+1:

erayalakese commented 9 years ago

Hello @likol ,

This new method seems more stable, thank you for your patch. I've merged your patch and made my changes over your commit.

If you want to support this plugin on wordpress.org can you please give a review ?

Thank you.