This simple Wordpress plugin shows a random line of any text in your blog.
This simple plugin is an extended version of the famous hello dolly plugin by Matt Mullenweg. Every human being has a special relationship to a particular song. And because of that, Hello Dolly For Your Song brings the lyric of your favourite song in the blog. But of course it can be used for any text. ;-)
- Display a random line of a custom text in your blog as gutenberg block
- Display a random line of a custom text in your blog as widget
- Display a random line of a custom text in your blog as shortcode
- Display a random line of a custom text in your theme as template tag
- Display a random line of a custom text in the blog administration
- Integration into WordPress REST API
- Hooks for Developers
- Options Page to define a custom song text
- Site Health Integration
- Hidden Options
- Languages: English, German, Spanish, French, Indonesian, Russian
- Download the plugin from the WordPress Plugin Repository
- Activate the plugin in WordPress
- Go to Settings > Hello Dolly Your Song to configure your songtext
- Maintain the songtext you love in the Settings.
- That is all!
Widgets
[hdfys]
hello_dolly_for_your_song()
get_hello_dolly_for_your_song()
http://yourblogdomain/wp-json/restful-hello-dolly-for-your-song/text
** hdfys_new_song ** This Action wil be fired, if a new text was maintained in the settings.
** hdfys_output_filter ** The filter will be applied before output of the gutenberg block, template tag and shortcode.
This is Hello Dolly by Louis Armstrong. If no text is maintained in the options, the programm uses the songtext of Hello Dolly.
You find the block in the category "widgets".
Type [hdfys] in a blank line in the WordPress editor.
You can define the title in the settings of the widget.
Use the template tag hello_dolly_for_your_song() in your theme file. The random line will directly printed embedded within a container.
I do only want to use the capabilities in the frontend and fade out the text in the admin panel. Is this possible?
You can use the hidden option for that! Please set the option "hdfys_admin_lyric" to 0 in the table wp_options within your WordPress database. Because of that the lyric in the admin panel will be faded out. Going back to standard settings, just set the value to 1.
Yes, you can. Each output of this plugin has individual css classes. Please use your debugging tools, to find the classes.
You can use the regular way on the plugin page. After deinstallation your wordpress is really clean.
Helly Dolly For Your Song works for texts in poem style. This means you need a text with word wraps after each line or sentence. If you want to use a continuous text in the plugin, you should add word wraps after each sentence.
You can access the random line with the function get_hello_dolly_for_your_song() in other plugin code or via functions.php. The function returns just one single random line without markup for further processing.
Yes! :-D You can access the endpoint with http://yourblogdomain/wp-json/restful-hello-dolly-for-your-song/text. The endpoint delivers one random line back. So it's not really REST, it's only "READ".
The HTML-oupt of the gutenberg block, template tag or shortcode can be manipulated. This will be made with the Filter hdfys_output_filter. Below you find a code example.
Several admin pages like settings are excluded, because some plugins do not use the wordpress standard layout. To avoid breaks in the user design, these pages are excluded.
This repository follows the git-flow workflow.
- master branch is the latest release
- develop branch is the current state of development
- feature branches contain dedicated features in development
- bugfix branches contain dedicated bugfixes in development
Hotfix and release branches will not be applied.
Releases in the WordPress Plugin Directory will be processed via SVN. The Version-to-Ship will be created manually on GitHub. See Release Section.
This project follows the inline code documentation standard of WordPress.
This project is licensed under the GPL3 License.
- Official Plugin Page (German)
- Why I have created this plugin? (German)
- ScreenCast showing almost all features (German)
- Source Code @ GitHub
- april 2024
- Security: Echo Escaping added
- april 2023
- Bugfix: LastChar is blank
- Bugfix: Installation Process
- Changed: Page Uploads excluded
- Others: Depreciated Authorization replaced
- may 2020
- Russian Translation
- Better Code Documentation
- Bugfix: Broken Plugin Administration Link
- Many internal improvements
- march 2020
- Site Health Integration
- Code Improvements
- january 2019
- Gutenberg Support
- Update Process Bugfix
- New Activation Criteria
- april 2018
- Random Line will printed on "classic" admin pages only
- 13 january 2018
- Gutenberg Plugin Support
- Automatic Removal of Empty Lines
- Plugin Actions
- Plugin Filters
- Code Improvement
- 16 july 2017
- Integration into WordPress REST API
- Source Code Comments to make wordpress plugin development concepts more transparent
- 04 april 2017
- Template Tag does not require Echo command anymore
- New Function available to get the raw random line for processing
- New Language: Indonesian
- 18 march 2017
- Options Link @ Plugin Page
- 26 december 2016
- French Language
- Hidden Options
- Security Improvements
- Internal Optimization
- 1 september 2016
- Template Tag
- New Labels
- Code Improvement
- 27 august 2016
- Settings API
- Update Process
- 09 august 2014
- Spanish Language
- 06 september 2013
- Shortcode
- Custom Widget Title
- 26 june 2013
- Widget
- Localization
- German language
- Clean deinstallation
- Bugfix: Processing of apostrophes
- 5 may 2013
- Structured and readable code
- First published version
- 4 may 2013
- Running version without errors
- 3 may 2013
- Running version