Automattic / super-cool-ad-inserter-plugin

Insert ads, newsletter signup widgets, and calls to action in the middle of your posts!
https://wordpress.org/plugins/super-cool-ad-inserter/#description
32 stars 4 forks source link

Post filter that adds the scaip shortcode #2

Closed benlk closed 8 years ago

benlk commented 8 years ago

From CS-16 for WE-19:

Write a post content filter/action function that counts paragraphs and provides a filter for inserting arbitrary content (a widget, text, newsletter form, ad, etc) after every N paragraphs with a maximum number of X. The settings that determines values for N and X should be configured using constants (or some other hardcoded PHP data structure) to start.

  • [ ] shortcode appears after first N paragraphs
  • [ ] shortcode appears every N paragraphs for X times.
benlk commented 8 years ago

Should the SCAIP shortcode be invisibly inserted on page rendering time, or should the shortcodes be inserted at post-saving and be saved into the post? Should programmatically-inserted shortcodes be saved to the posts at all?

Saving the shortcode to the post would result faster display times, but with the downside of littering any future export with the empty shortcode.

benlk commented 8 years ago

No, programmatically-inserted shortcodes will not be saved.

benlk commented 8 years ago

It does.