• Hi!

    I don’t find the solution to my problem anywhere, so I am asking here:
    I have a shortcode created in my theme through my functions.php, which I need to write down in the editor every time I want to use it. The format of the shortcode is [shortcodename url="http://www.blabla.com"]

    Instead of writing that down everytime, I would like to add a button in my visual editor, that would call a small pop up where I would fill the url, and the shortcode would be generated this way.

    Is that something possible? If yes, how do I do that?

    Thanks for your help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’ve been Googling around for a solution to this very problem for almost an hour now. I’ve been able to add buttons to the HTML editor but I desperately need to be able to add it to the Visual editor (most of my authors use the visual editor). Anyone have any ideas?

    What’s wrong with the URL/Link button provided as standard, can you not simply select the text, click the link button, enter the URL, and you have your text linked…

    Is that not essentially the same thing, only difference being that one uses shortcode, the other does not… the end result is the same..

    well my shortcode happens to be a completely complex PHP function. I’m just in search of a way to make a button my authors can use on the Visual editor.

    I’ve found multiple ways to get custom buttons working when the author has the HTML editor open but once the visual editor (tinymce) is activated my buttons no longer work. any ideas?

    specifically I’ve got a function that accepts a youtube ID and spits out preformed embed for the desktop site but just a link to the video on the mobile site. I’ve also got a complex blockquote/cite/link layout I’d like the authors to use and think a button that drops in the code they need might help things along.

    Open up tinymce advanced and see how they do it… (the additional buttons that is)..
    http://wordpress.org/extend/plugins/tinymce-advanced/

    That’s where i’d start… 🙂

    bhomatude

    (@bhomatude)

    I found a solution with this plugin:

    http://wordpress.org/extend/plugins/post-editor-buttons/

    or:

    http://orenyomtov.com/topic/projects/wordpress-plugins/post-editor-buttons

    Name your button in the “caption” window and drop the shortcode (or anything else) into the “before” window. The button shows up in the HTML editor toolbar.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add button to visual editor to create shortcode’ is closed to new replies.