• I know this plugin is discontinued and fully understand if you can’t help here. But a small question … Is it possible to change the shortcode input from:

    [dropcap]...[/dropcap]

    to

    <p>[dropcap]...[/dropcap]</p>

    Been trying to change the plugin files but haven’t been able to change the input.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Yudhistira Mauris

    (@maurisrx)

    Hi,

    You can add the wrapping html code directly in the editor without changing the shortcode input. You can do so like this: <p>[dropcap]This[/dropcap] is a text.</p>

    Thread Starter Lunis

    (@lunis)

    Thanks. I was looking for a way to make work like that automatically – when pressing the D-button in the Visual Editor, though.

    Best!

    Plugin Author Yudhistira Mauris

    (@maurisrx)

    You need to change the code in the file includes/js/shortcode-button.js:15 and includes/js/shortcode-button.js:18.

    Thread Starter Lunis

    (@lunis)

    Yeah. Tried to change the code from

    if( selected !== ' ' || selected !== null ) {
                        // if text is selected when button is clicked, wrap shortcode around it
                        content =  '[dropcap]' + selected + '[/dropcap]';
                    } else {
                    	// add shortcode without the selected text
                    	content = '[dropcap][/dropcap]';
                    }

    to

    if( selected !== ' ' || selected !== null ) {
                        // if text is selected when button is clicked, wrap shortcode around it
                        content =  '<p>[dropcap]' + selected + '[/dropcap]</p>';
                    } else {
                    	// add shortcode without the selected text
                    	content = '<p>[dropcap][/dropcap]</p>';
                    }

    But nothing’s changed. It still inserts [dropcap]…[dropcap] when pressing the shortcode button.

    I have almost no coding experience, sorry.

    • This reply was modified 5 years, 2 months ago by Lunis.
    • This reply was modified 5 years, 2 months ago by Lunis.
    Plugin Author Yudhistira Mauris

    (@maurisrx)

    Try to clear your site and browser cache. It seems the modified JS script hasn’t been loaded. Your modified file looks good.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change shortcode?’ is closed to new replies.