Callback functionality to better handle full html output
-
Dear Gagan
greetings from the land of the Tamils.
I hope this message finds you well. I wanted to share with you some development I did on your plugin….
I wanted a little more flexibility in using your new Shortcode menu item which is very user friendly but limited when needing more functionality to implement full html output.
So I decided to add a similar menu item as yours based on PHP Callback functionality.
You can find a copy of my changes in GitHub which I can labelled v2.1-callback.
Feel free to use if you think this is a good idea 🙂
Usage is very simple: you add the following text to the description field:
Callback=my_function
key1=value1
key2=value2
key3=value3and this will call a function:
my_function($nav_label, $title, $link_target, $args){ //do something }where the
$nav_labelis the Navigation Label fileld value, the$titleis the Title field value, and$link_targetis thetargetattribute value for the<a>link element.$argsis array with key/value pairs passed in the description, namely `(‘key1’=>’value1′,’key2’=>’value2′,’key3’=>’value3’) as given above.
-
I think if you need to use full HTML, you can do that by using the ShortCode box in the menus instead of custom link using shortcode and even provide the arguments like you do while using shortcodes, have you tried to use that?
If thats somehow inadequate to handle what you’re trying to do, please let me know, maybe we can make it better instead.Dear Gagan
my only concern with the FULL HTML option of the Shortcode is the fact that 2 field in the menu form are used up to configure the code.
The description field for the shortcode + the title field for the indication that this is a FULL HTML. I know if it a minor point really, but it means a lot to a client who feels more intuitive to use the title field for a sub-title.
otherwise I agree with you, it gives little extra benefit 🙂
Aurovrata Venet
Sorry for the delayed reply, got caught up in work and wasn’t able to go through the code entirely. Now, your issue is you want to use FULL HTML but don’t want to display the title in the menus as “FULL HTML OUTPUT”, well, that had already been taken care of in the plugin since version 2 I guess. You can use the Shortcode in menu as mentioned in first 4 screenshots, instead of using the Custom Link menu item. I hope it resolves your issue.
Please let me know if I’m mistaken about what you’re trying to implement.
Since this functionality is already in the plugin, I haven’t merged your code with the main plugin yet. Also, if you plan to make changes in the plugin, try forking the plugin on GitHub, instead of creating a repo from the scratch, that way, I’ll be able to merge any pull request you send, directly to the plugin’s repo on Github, with the click of a button 🙂
Dear Gagan
thanks for the reply…and yes you’re right I should’ve forked your repo.
Shall fix this for future mods.
The topic ‘Callback functionality to better handle full html output’ is closed to new replies.