How to add WYSIWYG Editor to TextArea Custom Meta Box in WordPress?

Custom Meta Boxes are super fun. They are very essential when building Plugins or Themes which contain much more advanced functionalities.

So let’s see how to create a Custom Meta Box with Textarea input?

Part 1. Create the Meta Box

2. Add your Textarea input field

3. Function to fetch the Value of Meta Box

4. Function to Save the Values of Meta on Admin Screen

Now, these 4 Things will Ensure that we get a Textarea Metabox and its values are being properly saved and being output wherever we want.

Now the Problem with a textarea is that a regular user doesn’t know a lot of HTML code. So he cannot create stuff like unordered lists, or format the text easily. So we need to replace the textarea created in part 2 with a WYSIWYG Editor. Everything else remains the same.

Creating a WYSIWYG Editor

Delete the Code you added in STEP 2 and replace it with the following:

That’s it and the code is complete. Enjoy your WYSIWYG Custom Meta box, if you are facing any difficulty comment below and I will try to help you out.

MySQL Integer, Float & Decimal Data Types Differences

MySQL is the Most Popular Database Software when it comes to Websites. All Popular Content Management Systems work with MySQL like WordPress, vBulletin, Drupal, etc. But, you are probably reading this post because you are designing your own database wish to get a better understanding of the Number data types of MySQL, especially their size/capacity.
Continue reading

How to Use JScrollPane with Multiple Components in Java?

JScrollPane is one of the most Classy Features of Swings. I Had a really tough time figuring out how to use it with Many JRadioButtons. All I wanted to do was, to create a list of Many Radio Buttons and place them inside a ScrollPane. But, somehow the Scroll Pane wasn’t working. So, after some research on the net, I was able to figure out how to do that.
Continue reading