WPCode Logo

WPCode Blog

Everything you need to know about the WPCode plugin

Introducing On-Demand PHP Snippets And More In WPCode v2.1.12

Introducing On-Demand PHP Snippets And More In WPCode v2.1.12 

Have you ever needed to execute a code snippet only once? 

If you answered yes, then this update is particularly special for you! WPCode v2.1.12 brings enhanced control and efficiency over PHP code snippets. 

You now have the ability to execute code snippets on demand or programmatically just when you need it.

Here’s what it means for you in detail. 

Introducing On-Demand Execution For PHP Code Snippets

Imagine being able to update user roles, perform database maintenance, or execute custom scripts with just a click—this is the power and convenience that the new “On Demand” insertion brings. 

This feature allows you to run PHP scripts exactly when you need them, providing a practical solution for operations that require manual initiation. 

You can programmatically control when to run a snippet and how many times you want it executed. This new ability also broadens the scope for integration and interaction between multiple snippets. 

The “On Demand” insertion location is available for both free and premium WPCode users. From the snippet editor, visit Insertion > Location >, and you’ll find “On Demand” in the list. When selected, a new Execute Snippet Now button will appear at the top next to the Update/Save Snippet button. 

Introducing On-Demand PHP Snippets And More In WPCode v2.1.12: On Demand Location Preview

Visit the documentation for more information on how to use the “On Demand” location. 

New Smart Tag For Permalink Management

Imagine you want to create a custom footer snippet that includes a “Bookmark this page” link. You can do that by using the Permalink Smart Tag, the URL for the bookmark link will automatically adjust to reflect the permalink of the page on which the footer appears. 

The smart tag for permalink allows you to manage and reference permalinks more effectively within your snippets, enhancing your site’s SEO and navigation capabilities. You’ll find the permalink smart tag in the WPCode Page Scripts metabox in the page-specific scripts. You can also use the {permalink} smart tag in Code Snippets. 

Introducing On-Demand PHP Snippets And More In WPCode v2.1.12: Permalink Smart Tag Preview

Visit the documentation for more information on how to use the Smart Tags. 

Summing Up

This update empowers you with more precise control over how and when PHP snippets are executed on your WordPress site. We can’t wait to see how the “On Demand” location and permalink smart tag enhance your snippet management capabilities.

Upgrade WPCode today to get more advanced controls that make your life easier!

Add A Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.


Get WPCode

Popular Resources

Get free tips and resources right in your inbox, along with 500+ others

Follow Us

Get Started Today & Add Your Own Snippets

Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.