civicrm/civicrm-wordpress — pull request #59 by christianwach (2014-10-09 11:36:39+00:00)
Title: Civi shortcode button should appear only on those WordPress post types that support the editor

The PR implements the best of the code by @kcristiano in #37, #39, #52 and #58. It updates the deprecated `media_button_context` action to use `media_button` and adds two private methods:

* `get_post_types_with_editor()` is a generic method to check which WordPress post types support the editor (because there is no point adding the button to those that don't)
* `post_type_has_button()` is a method to assess whether a particular post type should show the Civi button above the editor

The latter method includes a filter so that WordPress plugins can easily choose which post types the button should appear on.