Option to exclude Button
-
In my setup I do not want to actually use the button from the plugin. I rather have included my own custom link and with add_query_args() I add the required args (format=pdf).
This works great but the plugin only allows me to display the button above and below, above or below. An Option for “None” would be great here.
Altough the button doesn’t get displayed (since I’ve unchecked “Front End”) it still displays an empty div with a min-height of 30px.
The following code solves this for me, but I guess you probably want to implement a more proper solution.
function ptp_add_pdf_link($content) { $button = $this->ptp_pdf_icon (); if ('beforeandafter' == $this->options ['content_placement']) { $content = '<div style="min-height: 30px;">' . $button . '</div>' . $content . '<div style="min-height: 30px;">' . $button . '</div>'; } elseif ('after' == $this->options ['content_placement']) { $content = $content . '<div style="min-height: 30px;">' . $button . '</div>'; } elseif ('before' == $this->options ['content_placement']) { $content = '<div style="min-height: 30px;">' . $button . '</div>' . $content; } else { $content = ''; } return $content; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Option to exclude Button’ is closed to new replies.