Plugin guidance wanted
I would like to add previous / next buttons. The way I read the docs, I can either use an action or a filter. An action would modify the post before it went into the database, whereas a filter modifies the post on the fly as it is sent to the client. Do I have that right?
Which is the preferred method? If I use action on save_post, I would need to read in the entire text of the post, parse out the images, and rewrite the href tags to include the appropriate tags for previous and next images. The advantage of this is that the post is only modified once, but it mucks about with the original post, which I am not entirely comfortable with…. Also, I have to recognize tags that I’ve already modified….
OTOH, a filter would be executed every time the post is requested, so CPU usage would be high…. But it leaves the original post untouched.
So…. Any guidance? Any other suggestions? I have not found any other image viewer plugins that implement prev/next buttons. Anything I am missing? It seems that a filter would be easier to implement, if less efficient…
- The topic ‘Plugin guidance wanted’ is closed to new replies.