Print-O-Matic Print Previous Element

The idea behind this feature comes form walpap on this thread.

Well, let’s see what it would take to do this. First we need to have a few paragraphs of text, this being the first. The idea is that after this sentence we will place a print-me shortcode and some funky targeting placeholder that will tell the function to print the element immediately preceding the print button.

Our first idea was to use %prev% as a place holder that sets the target to the element above the print button. We could also define %next% to print the element immediately following a print button.

This is an example of a text block that can be printed by clicking the print button placed at the start of this sentence. Now first lets see what this all looks like when the buttons are placed inline like that. One thing to keep in mind when using next, is the text to print must be placed in an element. For example between two p or span tags.