Last modified: January 15, 2017

Generally bloggers tend to write custom php functions in theme function.php file. I was also used to practicing it until I lost my custom functions (saved in theme function file) when I forgot copy all functions before updating my blog theme. However, I recovered overwritten function.php file from the most recent backup copy of my blog. (I always take daily automatic backup of my blog files and database – read more).  But that incident took my time that I could have spent on other things. If I didn’t have backup, I would have done lot of work to recover several custom functions in theme function.php file. I realized the need to save all my custom functions in a separate plugin.

After that I decided to keep my custom WordPress PHP Code in any other place that was safe and updating WordPress core, themes or plugins couldn’t affect them. I had two choices;

Either keep all functions in database via a plugin

or Save theme in a plain plugin file that can be created easily

My Custom Functions by Arthur Gareginyan

It is an amazing simple plugin that lets you add all your custom functions in database. This plugin have its own interface to add custom functions. You can add unlimited custom functions with the help of this plugin. You might have been thinking that what will happen if you add wrong php array that may return a syntax error? We all know that we can’t access WordPress admin panel in most of php parse syntax error. If a plugin saves php code in database, it is pretty annoying to figure out that code in database using phpmyadmin. But it is not the case with this plugin. This plugin can’t submit a php code until it is valid. If you add a code piece that may trigger a syntax error, it will gently deny to submit the code and tells you the reason of denying.

Apart from that you can enable or disable custom functions any time with the help of an ON/OFF switch. This plugin uses php editor powered by CodeMirror that highlights syntax and also give number to lines.

Features of My Custom Functions plugin at a glance

  • Syntax error protection
  • saves PHP functions in database
  • uses PHP editor and syntax highlighter by CodeMirror

Download link is locked

Create a plugin

You can create a simple plugin to save all your custom php code. It is very easy to this. Simple open your pc notepad and put the following code in it;

Plugin code /Download link is locked

 

Save this file with the name and extension like this;

mycustomcode.php

Upload this file to your plugin directory

You can add your custom php functions between comment lines. You will have full control on this php file. All you need to do is activating this plugin. You can add custom code to this plugin using WordPress plugin editor, via FTP or hosting file manager.

You are free to change plugin name, URL, Description, Author, Author URL and version.

About Shams

Shams, a professional blogger, has expertise in WordPress and Web Hosting. He is used to playing around with WordPress plugins, themes, web hosting services and some other innovative stuff regarding web design. He sifts out good stuff for web designers and reviews it to help them choose what they really need.

Being an energetic tech enthusiast, he regularly pens down breaking news and tutorials related to technology particularly Smartphones and other gadgets. Sometimes writes tech tips too. It was the dawn of Internet age when he started dabbling in it and has since been delving into the realm of the internet. He occupies a permanent burrow in virtual world.

He can be reached at.- here

Related Post

Increase more than 700% of Email Subscribers!
Dolor aliquet augue augue sit magnis, magna aenean aenean et! Et tempor, facilisis cursus turpis tempor odio. Diam lorem auctor sit, a a? Lundium placerat mus massa nunc habitasse, arcu, etiam pulvinar.
  We hate spam and never share your details.
Blogging and Web Design
GET IT NOW
500% MORE SUBSCRIBERS
EFFICIENCY
BOOST YOUR SALES
CREATIVITY
INSPIRE YOUR VISITORS
BE UNIQUE
CREATE UNIQUE POPUPS
Get amazing content to your mailbox
We never bother our subscribers and, we deliver what they want
Your Information will never be shared with any third party.
You are successfully subscribed to webcusp newsletter. Please check your mail and confirm your subscription.
Subscribe for Updates
We never bother our subscribers and, we deliver what they want
Your Information will never be shared with any third party.
You are successfully subscribed to webcusp newsletter. Please check your mail and confirm your subscription.
Follow us for exclusive content