Get array of all text block titles
-
Hi Hal – great plugin.
I’m trying to use your plugin on certain tag and category pages where the tag slug matches the Reusable Text Block title so if the url is:
https://www.domain.com/tag/cool-stuff and the text block title is “Cool Stuff” it will work via the php template code:
<?php if(function_exists(‘show_text_block’)) { echo show_text_block(‘cool-stuff’, true); } ?>
However, I’ll use a variable based on the current tag url segment instead of hardcoding ‘cool-stuff’.
My issue is that I need to be able to get an array of all of the text block titles that are currently in the database so I can write an if(in_array() ){} saying that if the user is on a tag page with a url segment that matches a title of the text box, then show the text box.
How can I get all of the titles into an array?
Thanks,
Erik
- The topic ‘Get array of all text block titles’ is closed to new replies.