How To Prevent The Function Running Multiple Times On Page Load
-
i’m using a very light plugin that will shorten a URL. The connection is made and I can see the URL being shortened in the frontend content.
My issue is when a new page is loaded on the front end, the function to shorten the link runs multiple times on every page load. I can’t seem to figure out how to have it run only once as each page loads
Here’s the breakdown. it’s stored in a plugin php file
function shrinkit { //shrinking the link using an api key } // Creates the shortcode next function shortcode_shrinkit($atts,$content){ return shrinkit($content); } // Register the shortcode add_shortcode("shrunk", "shortcode_shrinkit");
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How To Prevent The Function Running Multiple Times On Page Load’ is closed to new replies.