WordPress.org

Making WordPress.org


Ignore:
Timestamp:
12/18/2017 06:36:37 PM (19 months ago)
Author:
obenland
Message:

Plugins: Make FAQ topics linkable.

Allows for faq topics to be linked to directly, and show up expanded and scrolled to.

Props joostdevalk for initial patch.
Fixes #3319.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php

    r5841 r6285  
    401401                $this->sections['faq'] .= "\n<dl>\n";
    402402                foreach ( $this->faq as $question => $answer ) {
    403                     $this->sections['faq'] .= "<dt>{$question}</dt>\n<dd>{$answer}</dd>\n";
     403                    $question_slug = sanitize_title_with_dashes( $question );
     404                    $this->sections['faq'] .= "<dt id='{$question_slug}'>{$question}</dt>\n<dd>{$answer}</dd>\n";
    404405                }
    405406                $this->sections['faq'] .= "\n</dl>\n";
Note: See TracChangeset for help on using the changeset viewer.