Blog: R7D11: #100DaysOfCode (More Posts)
Good day everyone. My latest post for the 100DaysOfCode challenge is as follows.
Yesterday was a British Bank Holiday so this is like my “Monday” post for Tuesday. 😇 So for this morning, I got to work on my Photography page as I normally do to start my week.
The latest changes to the photography website include
75-300mm Focal length
Added “best_of_rest” +12 making a total of 35
Added “Favourites” +6 making a total of 43
Added “others” +3 making a total of 13
Added “Animals” +4 making a total of 37
Added “Birds” +5 making a total of 79 (showing 80)
Added “Birds in flight” +1 making a total of 28
Added “Coastal:” +4 making a total of 21
Added “Flowers and Plants” +3 making a total of (44)
Added “wildlife on doorstep” +2 making a total of 31
Added woodland +3 making a total of 32
Photographic Adventures for 2021.
There are now 10 categories belonging to the photographic adventures for 2021 section. Today I’ve added
Roseberry Topping +13
Denemouth Coastal +20
You can see these updates 75-300 and 2021 right here.
In the second part of the day I made a bit of headway on some work with Plugin development. I set myself the goal of writing a plugin that simply displays a message to the screen on a given dashboard menu link that is added by the plugin.
That was simple enough. I echo some HTML to the screen with PHP and it works very nicely adding the text to the default options.php template. Quite possibly the easiest WordPress template anyone could ever make. (I was going to use the word develop but it’s barely that). 😉
For further practice, I set about expanding the plugin to work with 3 text fields and saving the value of those fields using the built-in options API. My main hangup was how I was supposed to be able to add the HTML to the plugin in something other than raw HTML. The tutorial I was following seems to suggest I could simply at the HTML and PHP to the callback function and that was it. I must have misunderstood somewhere because adding the code that way simply does not work as the browser does not recognise PHP keywords causing the plugin to completely breakdown until the code is removed.
The only way I can get anywhere at all with WordPress attempting to save the data is to echo the HTML as a multiline string.
At least I know I have a fallback to a functional albeit arbitrary plugin. There is something else I found though that I think might help me, which is this online generator that takes a few plugin details and outputs all the functions I might need to display HTML and form inputs for a functional and useful plugin… or at least the building blocks of one. I’m going to look forward to having more of a play with that as I learn more and more about plugin development with WordPress.
Related Links:


