Automattic / camptix

Moved to https://github.com/WordPress/wordcamp.org/
176 stars 94 forks source link

New hooks for programmers #231

Closed EliW closed 6 years ago

EliW commented 6 years ago

This includes what I originally had sent PRs for under #199 and #201 ... but now the 'right way'.

Basically, I'd submitted originally a couple of feature enhancements, that give you controls to do the following two things:

  1. Control whether camptix removed all page content before & after the [camptix] shortcode, which it does by default on any subpage.
  2. Control some additional paypal checkout configuration, such as whether to ask for a shipping address.

The #1 feedback I got from @coreymckrill was that the camptix team would prefer to add hooks into camptix, to allow such features to exist in plugins. Rather than complicate the base camptix install with more and more features.

Makes sense!

So this PR adds in the missing hooks that didn't allow these two features to exist in a plugin.

It adds a filter, that gets the post_content and shortcode_str, and by default does what camptix always does... but now allows a programmer to change anything about the output there.

And it adds a configuration filter to the paypal payload, allowing you to change or add any paypal configuration features that aren't normally within your control via the UI.