Table editor for plugin-related data
-
I’m looking for some input on an idea for a plugin I’m working on for my own blog. The plugin is basically a souped-up shortcode to transform a simple string into a much more complex ensemble containing a few hyperlinks to repositry sites elsewhere plus some JavaScript to make it all visually appealing. In order for the text-to-link replacement to work I need to access two very simple associative arrays which basically tell what link corresponds to what string I enter in the shortcode. Those arrays are not large (right now, about a few hundred entries), but grow at a rate of, say, a few dozen per year.
I do not intend the plugin to be so smart that it figures out the correct link on its own when the shortcode contains a string which is not (yet) present in the associative arrays. The idea is that I look up the links once, store them, and then access them at will via the custom shortcode.
There are several ways I can code this idea. I could create two tables in the MySQL-database of my blog, and extract the information with a few stock-standard PHP function calls; or I can hardcode the data into a PHP-file as a sort-of header file and ‘include’ it within the actual plugin code. Using the data is not the issue. The issue is editing and adding to the data. I can fire up phpMyAdmin and manually add new entries to the database; or I can upload a new version of the ‘header file’ whenever necessary. But this is cumbersome; what I want is to be able to edit and add to the arrays from within WordPress itself. For this I’d ideally need a very simple table editor with the ability to dump the data into a database or a file of PHP code of my choosing.
- Does such a table editor exist in a prior plugin? If so, what is the plugin’s name?
- If such a table editor does not exist, what alternatives do I have? How about a plaintext editor which saves and reads CSV-data?
Thanks in advance for any points and tips.
- The topic ‘Table editor for plugin-related data’ is closed to new replies.