Allow PHP in Posts and Pages WordPress Plugin

Allow PHP in posts and pages adds the functionality to include PHP in your WordPress posts and pages by adding a shortcode [php] your code [/php] the coding is very most popular, why coding is popular, because many websites using the coding as per the PHP, HTML, CSS, If anybody wanted to without any write like a content without any skills just getting the money, has been ideas in this on Coding.

I’m sharing the plugin with yours, Finally, I get the inside plugin to working on your website with any posts,

This plugin attempts to strip away the automatically generated WordPress <p> og <br/> tags but still allows the addition of your own <p> og <br/> tags using a form of BBcode items such [p][/p] og [br /]

You can also save your most used bits of code as snippets for use across multiple pages.

With Version 2.2, the older tag replacement system has been revamped, hopefully reducing the need to escape some characters for example: [ og ] that shouldn’t be changed < og >

With Version 2.3 comes an experimental advanced filter feature which allows you to use standard PHP code while taking advantages of variables throughout the entire post content, and functions, as well as no pesky tag replacement.

With Version 3 comes entirely re-written code with support for code snippets being used in conjunction with the advanced filter feature as well as a class variable to share variables between saved snippets and code blocks. This version also comes with UI updates.

How To Allow PHP Posts and Pages

Before you get this plugin as per your website and install now with active. The PHP coding post using now. Allow PHP in Posts and Pages, Here a link,

Here some steps show below listed

  1. Install the plugin
  2. Click to active button

USAGE

Using the plugin couldn’t be simpler; the plugin has 2 variants of shortcode available, [php] og [allowphp] other versions of the shortcode may exist but are not fully supported.

To add the PHP code to your post or page simply place any PHP code inside the shortcode tags as follows:

Here the code.

[php]      global $user_ID;      if($user_ID == 1){          echo "Hello World";      }  [/php]  This code will output Hello World to only user id #1, and no one else    

The shortcode can take some additional attributes to assist with PHP writing

  • “debug” – [1/0] – Turns on error reporting and display errors for snippets
  • “silent debut” – [1/0] – When used with “debug” shows errors in the source code only
  • “mode” – [“old”/”new] – Maintained for backwards compatibility only – When set to “old” enables the pre version 2.2.0 code replacement system for that shortcode, when set to “new” with the preparse option enabled it uses the newer code replacement system for that shortcode
 

You’re Done, you have learnt a very great lesson today on how to use PHP within posts and pages in a WordPress blog. Good Luck.

CODE SNIPPETS

In addition to these attributes, a new one has been added called “function”. The function attribute allows the addition of user defined code snippets into the content. The shortcode for snippets is [php function=x] or [allowphp function=x]

To integrate the snippets with the advanced filter, the shortcode should not contain any additional attributes or spaces

Code snippets can be added in the plugin’s options page and can be re-used on as many pages as you like

You May Also Like

About the Author: mujeer

WikiWon.com is a blog which aims to provide quality guidance to Bloggers, Webmasters, and Web Developers. It covers Free Web Development Resources, WordPress Tutorials, WordPress Plugins, WordPress How-to Guides, WordPress Page Speed Optimization, WordPress SEO, Android Tutorials, Android Applications and Much More. Within 6 months is about to hit 8000+ subscribers and still counting.

Leave a Reply

Your email address will not be published. Required fields are marked *

Optimization WordPress Plugins & Solutions by W3 EDGE