• Resolved Tunn

    (@iuriem)


    I have the next two notices with this shortcode:

    [spoiler title="Introducere"]
    Ce este psihoterapia?
    [/spoiler]

    Notice: Use of undefined constant title – assumed ‘title’ in /…/wp-content/plugins/simple-spoiler/simple-spoiler.php on line 87

    Notice: Use of undefined constant title – assumed ‘title’ in /…/wp-content/plugins/simple-spoiler/simple-spoiler.php on line 90

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tunn

    (@iuriem)

    Solved: Put title between quotation marks – "title".

    function simple_spoiler_shortcode($atts, $content) {
        if ( ! isset($atts["title"]) ) {
            $sp_name = __( 'Spoiler', 'simple-spoiler' );
        } else {
            $sp_name = $atts["title"];
        }
            return '<div class="spoiler-wrap">
                    <div class="spoiler-head folded">'.$sp_name.'</div>
                    <div class="spoiler-body">'.$content.'</div>
                </div>';
    }
    add_shortcode( 'spoiler', 'simple_spoiler_shortcode' );
    Plugin Author Webliberty

    (@webliberty)

    Hello, Iurie Malai!

    Thank you for message! Changes have been made, a new version of the plugin has been released.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: Use of undefined constant title’ is closed to new replies.