$entry) { $value[$key] = mkb_glossar_help_named_menu_paths($entry, $collection); } return $value; } if (!is_string($value)) return $value; // One older instruction uses > separators. Normalize that menu trail only. if (str_contains($value, 'Glossary >') || str_contains($value, 'Glossar >')) { $value = str_replace(' > ', ' → ', $value); } return str_replace( ['Glossary →', 'Glossar →'], [$collection . ' →', $collection . ' →'], $value ); } function mkb_glossar_help_url($section = '') { $url = add_query_arg( ['post_type' => 'mkb_glossar', 'page' => 'mkb-glossar-help'], admin_url('edit.php') ); // Only link to real handbook chapters and steps. Do not accept arbitrary // URL fragments or duplicate a second list of allowed step numbers here. $sections = ['start', 'terms', 'csv', 'linking', 'display', 'tooltips', 'troubleshooting']; if (!is_string($section)) return $url; if (in_array($section, $sections, true)) return $url . '#' . $section; if (preg_match('/^(start|terms|csv|linking|display|tooltips|troubleshooting)-step-([1-9][0-9]*)$/D', $section, $match)) { // Cache only chapter lengths; labels and the full handbook still use // the current installation's configured language and terminology. static $step_counts = null; if ($step_counts === null) { $step_counts = []; foreach (mkb_glossar_help_sections() as $key => $chapter) { $step_counts[$key] = count($chapter['steps']); } } $number = (int) $match[2]; if ($number <= ($step_counts[$match[1]] ?? 0)) return $url . '#' . $section; } return $url; } /** * The 15 foundation visuals have one placement registry. A chapter's step ID * is the same anchor used by the handbook navigation and contextual links. * Keep this list ordered: some steps deliberately contain two visuals. */ function mkb_glossar_help_render_step_visuals($chapter, $index) { static $placement = [ 'start-step-1' => ['mkb_glossar_render_help_terminology_preview'], 'terms-step-1' => ['mkb_glossar_help_visual_editor'], 'terms-step-2' => ['mkb_glossar_help_visual_topics'], 'terms-step-3' => ['mkb_glossar_help_visual_translations'], 'terms-step-7' => ['mkb_glossar_help_visual_elementor_details'], 'csv-step-2' => ['mkb_glossar_help_visual_csv_sheet'], 'csv-step-4' => ['mkb_glossar_help_visual_csv_format'], 'csv-step-6' => ['mkb_glossar_help_visual_csv_review'], 'linking-step-2' => ['mkb_glossar_help_visual_link_targets', 'mkb_glossar_help_visual_icon_choices'], 'linking-step-3' => ['mkb_glossar_help_visual_protected_passages'], 'display-step-1' => ['mkb_glossar_help_visual_placement'], 'display-step-4' => ['mkb_glossar_help_visual_search_flow'], 'tooltips-step-1' => ['mkb_glossar_help_visual_tooltip'], 'tooltips-step-3' => ['mkb_glossar_help_visual_tooltip_access'], 'troubleshooting-step-1' => ['mkb_glossar_help_visual_diagnosis'], ]; $anchor = $chapter . '-step-' . ((int) $index + 1); foreach ($placement[$anchor] ?? [] as $render) { $render(); // Only fixed, bundled help functions; never user-supplied names. } } function mkb_glossar_help_sections() { $names = mkb_glossar_display_names(); $collection = $names['collection']; $item = $names['item']; $sections = [ 'start' => [ 'icon' => 'welcome-learn-more', /* translators: %s is the site-configured collection or item name (for example, Wiki). */ 'title' => sprintf(__('Getting started: %s', 'mkb-glossar'), $collection), 'summary' => __('Choose your names first, then begin with one useful explanation.', 'mkb-glossar'), 'step_titles' => [ /* translators: Placeholders are the site-configured collection/item names or numerical counts shown in this message. */ sprintf(__('Choose names and create %s', 'mkb-glossar'), $item), __('Write a short explanation', 'mkb-glossar'), __('Add other names people use', 'mkb-glossar'), __('Add detail and publish', 'mkb-glossar'), __('Set the public URL base safely', 'mkb-glossar'), __('Check the result without turning on automation', 'mkb-glossar'), ], 'steps' => [ /* translators: %s is the configured singular name of an item (for example, Artikel). */ sprintf(__('Choose the names for your collection and its individual content first. On a new installation, confirm them in the setup assistant; later, you can change them under Settings → General. Then open the WordPress menu "%1$s" and select "%2$s".', 'mkb-glossar'), $collection, sprintf(__('Create %s', 'mkb-glossar'), $item)), __('Under “Short definition for tooltips”, write one or two clear sentences. These can appear right next to a linked word, so visitors get a quick answer without leaving the page.', 'mkb-glossar'), __('Do people use different words for the same thing? Add these under "Synonyms", one per line. If automatic linking is enabled, MKB Glossar can recognize these alternative names too.', 'mkb-glossar'), __('Use the longer description for examples and useful context. When everything looks right, publish the content. It receives its own page on your website.', 'mkb-glossar'), __('The public URL base is independent of your chosen names. On a new installation, set both in the first setup step; later, review the base under Settings → General. Technical shortcode names, CSV columns and IDs stay unchanged.', 'mkb-glossar'), __('Open the published page in your browser. Is the title clear and the text understandable? Next, add an overview to your website or enable automatic links when you are ready.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Choose a word from your website that some visitors might not know. For example, "accessibility" means making a website easy to use for as many people as possible. This is only an example: choose a word that really occurs on your own website.', 'mkb-glossar'), __('You do not need to fill the entire collection today. Start with three to five explanations for recurring questions.', 'mkb-glossar'), __('On a new installation, the setup assistant first asks for the labels and public URL base. Confirm the defaults or choose your own values before continuing. You can skip setup entirely or reopen the assistant later under Settings → General.', 'mkb-glossar'), ], 1 => [ __('Example: "Accessibility means that as many people as possible can use this website." This gives visitors a clear first answer. Explain your own terms as naturally as you would in a friendly conversation.', 'mkb-glossar'), __('If tooltips are switched off, the short explanation is still saved with the glossary term; it does not switch automatic linking on.', 'mkb-glossar'), ], 2 => [ __('Example: if your entry is called "Frequently asked questions", you could add "FAQ" as a synonym. FAQ is the common abbreviation for frequently asked questions. Only add words that truly mean the same thing; different meanings need separate entries.', 'mkb-glossar'), ], 3 => [ __('A short explanation helps in the middle of an article; the full term page is for visitors who want to know more. You maintain both in one glossary entry.', 'mkb-glossar'), ], 4 => [ __('The “URL base” is the section of the web address before a glossary entry. For example, the value “glossar” can produce an address like example.com/glossar/dein-begriff. Enter a short, readable word without spaces.', 'mkb-glossar'), __('Already have published glossary links? Do not casually change the URL base. Old links may need redirects; save WordPress permalink settings afterward if links stop working.', 'mkb-glossar'), ], 5 => [ __('Automatic linking starts switched off. That is intentional: you can build the glossary calmly and decide yourself when its explanations should appear in other articles.', 'mkb-glossar'), ], ], 'note' => __('Good to know: published pages and an overview remain available even while automatic linking is disabled.', 'mkb-glossar'), /* translators: %s is the configured singular name of an item (for example, Artikel). */ 'links' => [[ 'label' => __('General settings', 'mkb-glossar'), 'url' => add_query_arg(['post_type'=>'mkb_glossar','page'=>'mkb-glossar','tab'=>'general'],admin_url('edit.php')), 'cap'=>'manage_options' ], ['label' => sprintf(__('Create %s', 'mkb-glossar'), $item), 'url' => admin_url('admin.php?page=mkb-glossar-term-editor'), 'cap' => 'edit_posts' ]], ], 'terms' => [ 'icon' => 'book-alt', /* translators: %s is the site-configured collection or item name (for example, Wiki). */ 'title' => sprintf(__('Manage %s', 'mkb-glossar'), $item), 'summary' => __('Keep your explanations tidy as your website grows.', 'mkb-glossar'), 'step_titles' => [ __('Quick answer or detailed explanation?', 'mkb-glossar'), __('Organize content with topics', 'mkb-glossar'), __('Use your glossary in more than one language', 'mkb-glossar'), __('One language is perfectly fine', 'mkb-glossar'), __('Avoid duplicate or confusing names', 'mkb-glossar'), __('Import or export glossary data', 'mkb-glossar'), __('Connect related terms and reference your sources', 'mkb-glossar'), ], 'steps' => [ __('Think of each glossary entry as two ways to help: a short answer for someone who is reading quickly, and a detailed page for anyone who wants the whole story.', 'mkb-glossar'), __('Use the Topics checklist in the term editor to organize entries. You can also enter a new topic there; it is created when you save the term. For many topics, the list uses multiple columns. You can still manage all topics under Glossary → Topics.', 'mkb-glossar'), __('MKB Glossar uses WordPress translations (called i18n) for its menus and buttons. For websites with content in several languages, MKB Glossar also supports Polylang and WPML. Create an entry in each language, then connect the translations using your language plugin.', 'mkb-glossar'), __('Does your website have just one language? You do not need Polylang, WPML or any other language plugin to use MKB Glossar. Just create and publish your terms as usual.', 'mkb-glossar'), __('Before creating a new term, search the existing glossary. The same name or synonym in the same language should not accidentally point to two different explanations.', 'mkb-glossar'), __('Open Glossary → Import / Export. First download the sample CSV file if you need a starting point. Replace the example row with your own terms and upload it. Match the columns, review new terms and duplicates, then confirm. Existing terms are skipped unless you deliberately choose to update them. Imported terms can remain drafts until you check them.', 'mkb-glossar'), __('Open a term and use “References and related terms”. Find related glossary entries, add sources with a name and website address, and choose link options for each source. Sources appear below the explanation. Separately, an optional external destination replaces the usual link to this glossary entry only when you explicitly enable it.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Example: your website mentions "accessibility". In the small explanation window, you could say that it means making a website easier for as many people as possible to use. On the full glossary page, you can give examples such as readable text or using a website with a keyboard.', 'mkb-glossar'), ], 1 => [ __('Topics are for organizing glossary entries. They are not the WordPress post categories used under automatic-link exclusions.', 'mkb-glossar'), ], 2 => [ __('For example, “Opening hours” in English and “Öffnungszeiten” in German describe the same thing. If you maintain both language versions, connect them as translations instead of entering one as a synonym of the other.', 'mkb-glossar'), __('Check your published pages in every language you offer. MKB Glossar cannot set up your language switcher or translations for you; those are configured in WordPress and your multilingual plugin.', 'mkb-glossar'), ], 3 => [ __('Using another multilingual plugin? We cannot promise compatibility with every provider. Tell us which plugin you use. We will gladly help you check what is possible.', 'mkb-glossar'), ], 4 => [ __('Example: "Registration" can mean signing in to a user account or signing up for an event. If your website uses both meanings, create two clearly named entries instead of treating them as synonyms.', 'mkb-glossar'), ], 5 => [ __('CSV import supports column mapping, preview, language-aware duplicate checks, topics, references and relationships. The file is checked again when you confirm, and unassigned columns do not overwrite existing values. Try a small test import first.', 'mkb-glossar'), __('Review draft entries and translated terms after importing. Especially check linked translations and topic assignments when Polylang or WPML is active.', 'mkb-glossar'), ], 6 => [ __('Sources are external reading links shown under the explanation. Each source has a name, a web address and optional choices such as opening a new tab or nofollow. Entering example.com is enough; HTTPS is added automatically. An external destination is different: when explicitly enabled, it changes where glossary links lead instead of opening the definition.', 'mkb-glossar'), __('Turn on exact capitalization only when terms such as API must not match lowercase words. The normal case-insensitive recognition remains the default.', 'mkb-glossar'), __('Example: Your article mentions “Face Framing”. Usually the linked words open your Face Framing glossary page. Only if you explicitly enable an external destination do those links open another website. External glossary destinations open in a new tab by default; you can switch that off in Link options. You can also set nofollow, sponsored or ugc for those links independently of sources.', 'mkb-glossar'), __('Sources and related terms appear automatically on glossary pages with any WordPress theme. For one shared design in Elementor Free, save a container with the MKB Glossary Details widget, select an example glossary term in its preview control, and choose the container once under Glossary > Settings > General. The saved layout then uses the current term automatically on each glossary page. A complete Theme Builder Single template is a separate Elementor Pro feature.', 'mkb-glossar'), __('Web addresses are checked for their format, not for whether the destination website currently exists. A link may later stop working. You can edit or remove its source at any time.', 'mkb-glossar'), ], ], 'links' => [[ 'label' => __('All Terms', 'mkb-glossar'), 'url' => admin_url('edit.php?post_type=mkb_glossar'), 'cap' => 'edit_posts' ], ['label' => __('Topics', 'mkb-glossar'), 'url' => admin_url('edit-tags.php?taxonomy=mkb_glossar_topic&post_type=mkb_glossar'), 'cap' => 'manage_categories' ], ['label' => __('Import / Export', 'mkb-glossar'), 'url' => admin_url('edit.php?post_type=mkb_glossar&page=mkb-glossar-data'), 'cap' => 'manage_options' ]], ], 'csv' => [ 'icon' => 'media-spreadsheet', 'title' => __('Working with the CSV sample file', 'mkb-glossar'), 'summary' => __('Open, edit and save your glossary data without losing columns or special characters.', 'mkb-glossar'), 'step_titles' => [ __('Download the example and make a safety copy', 'mkb-glossar'), __('Open CSV correctly in Excel, Numbers or LibreOffice', 'mkb-glossar'), __('Understand the columns and add your terms', 'mkb-glossar'), __('Choose the correct character encoding and separator', 'mkb-glossar'), __('Save the file in CSV format, not as a spreadsheet', 'mkb-glossar'), __('Preview your import before making changes', 'mkb-glossar'), __('Solve common CSV problems', 'mkb-glossar'), ], 'steps' => [ __('Open Glossary → Import / Export and click “Download CSV sample file”. Keep the untouched original as a backup. Work on a copy, and replace the example row with your own terms. The sample row is intentionally a draft.', 'mkb-glossar'), __('Do not rely on double-clicking the file: your computer might put all values into one column. In Excel, choose Data → From Text/CSV (or Import Text), select UTF-8 and the semicolon separator. In Numbers, open the CSV and check the import settings. In LibreOffice Calc, open the CSV and choose UTF-8 and Semicolon in the text import dialog.', 'mkb-glossar'), __('Each line below the header describes one glossary term. The first line contains field names such as title, slug and summary; do not delete it. Use one term per row. Title is required. Leave an optional field empty when you do not use it. The sample contains 18 columns; the import page can match columns even if their order differs.', 'mkb-glossar'), __('Use UTF-8 for German umlauts, accents and other languages. The example is saved as UTF-8 with a BOM so many spreadsheet programs recognize it. Its separator is a semicolon (;), and double quotes protect cell content containing separators or line breaks. The importer also accepts comma-separated files. Do not manually split or delete the quotation marks inside the file.', 'mkb-glossar'), __('When finished, use Save As or Export and select CSV (.csv), character encoding UTF-8 and preferably semicolon as separator. If your program offers only comma-separated UTF-8 CSV, that also works. Confirm any notice about saving only the active sheet. A Word, Excel (.xlsx) or Numbers document cannot be uploaded directly as a CSV.', 'mkb-glossar'), __('Back under Glossary → Import / Export, choose the CSV and click “Check file and preview changes”. Check the field mapping and the list of new, existing or conflicting terms. For a first test, keep “Import as drafts” and “Skip existing terms” enabled. Only click “Import reviewed data” when the preview is correct.', 'mkb-glossar'), __('If everything appears in one column, reopen the CSV using the correct separator. If ä, ö or ü look wrong, choose UTF-8 before importing or exporting. If a row has too many columns, check separators and double quotes in free-text fields. If the import reports conflicts, correct the file and run the preview again; avoid overwriting existing terms by accident.', 'mkb-glossar'), ], 'details' => [ 2 => [ __('Useful starter fields: title is the visible name, slug is the URL-friendly name, summary is the short tooltip text, definition is the detailed explanation, synonyms are alternative names and status is draft or publish. The header names are technical column identifiers: keep them exactly as provided by the example.', 'mkb-glossar'), __('For several alternative names, use separate lines in the synonyms field. More advanced fields such as topics, sources, external URLs and translation groups can be left blank until you need them.', 'mkb-glossar'), ], 3 => [ __('Special characters need no separate HTML or Unicode codes: just enter words normally in the spreadsheet and save using UTF-8. The importer detects semicolons, commas or tab separators from the file.', 'mkb-glossar'), ], 4 => [ __('A CSV file is plain text with rows and separators. To inspect it safely, open it in a text editor: the first line should contain column names separated by semicolons or commas. Do not replace the file extension with .csv without actually exporting the file in CSV format.', 'mkb-glossar'), ], 5 => [ __('The upload accepts files up to 8 MB and 2,000 data rows. Importing as drafts lets you check every entry inside WordPress before publishing it.', 'mkb-glossar'), ], ], 'note' => __('Tip: first import one or two sample terms as drafts. After checking them, repeat the import with your finished CSV. The original WordPress data is not changed before you explicitly confirm the preview.', 'mkb-glossar'), 'links' => [[ 'label' => __('Open Import / Export', 'mkb-glossar'), 'url' => admin_url('edit.php?post_type=mkb_glossar&page=mkb-glossar-data'), 'cap' => 'manage_options' ]], ], 'linking' => [ 'icon' => 'admin-links', 'title' => __('Automatic links without a wall of blue text', 'mkb-glossar'), 'summary' => __('Let your explanations work across your website. You decide where and how often.', 'mkb-glossar'), 'step_titles' => [ __('Switch automatic linking on when you are ready', 'mkb-glossar'), __('Keep your text readable with link limits', 'mkb-glossar'), __('What MKB Glossar leaves alone', 'mkb-glossar'), __('Leave out one special page', 'mkb-glossar'), __('Leave out a whole category', 'mkb-glossar'), __('Leave out posts with certain tags', 'mkb-glossar'), __('Post formats: usually you can leave this empty', 'mkb-glossar'), __('Other content groups from plugins', 'mkb-glossar'), __('Where to find the numbers WordPress needs', 'mkb-glossar'), __('Save and check that the rule works', 'mkb-glossar'), ], 'steps' => [ __('Imagine a page on your website mentions "accessibility" – making a website easier for as many people as possible to use. If you have published a glossary entry for the word, MKB Glossar can recognize it in suitable texts and link to your explanation. Open Glossary → Settings → Linking, enable "Automatic linking" and save. You do not have to add every link by hand.', 'mkb-glossar'), __('More links are not always more helpful. Two settings keep an article easy to read. “Maximum links per content” limits the total number of automatic glossary links on one page. “Links per glossary term and page” limits how often the same term becomes a link on that page.', 'mkb-glossar'), __('You have already added a link by hand? MKB Glossar does not put another automatic link inside it. The same applies to buttons, code areas, headings and other protected elements.', 'mkb-glossar'), __('Your legal notice or privacy policy should not contain automatic glossary links? Open Glossary → Settings → Exclusions. Search by the page title, choose the correct result and add it to the exclusions list. Done.', 'mkb-glossar'), __('Perhaps you want glossary links in your advice articles, but not in your news posts. Under “Taxonomy rules → Categories”, enter the numeric ID of the category you want to exclude. Then click “Save taxonomy rules”.', 'mkb-glossar'), __('Tags are keywords you can assign to WordPress posts. Want to exclude posts with the tag "Updates"? Find the numeric ID of that tag and enter it in the "Tags" field.', 'mkb-glossar'), __('“Post formats” does NOT mean file formats like PDF or MP4. Some WordPress themes label posts as “Video”, “Audio” or “Gallery”. If you have never used that feature, leave this field empty. Nothing is missing.', 'mkb-glossar'), __('Do you see unfamiliar fields below the categories and tags? Other plugins or your theme may have added their own content groups. These are called “taxonomies” in WordPress. If you do not recognize or use one, leave the field empty.', 'mkb-glossar'), __('Every category and tag has its own number in WordPress. Open “Posts → Categories”, find the category you want and move the mouse pointer over “Edit” without clicking. Your browser usually shows the link address at the bottom of the window. Look for tag_ID=23: in this example, 23 is the number you enter in MKB Glossar. You can also click “Edit” and read the number in the browser address bar. For tags, follow the same steps under “Posts → Tags”.', 'mkb-glossar'), __('After entering the numbers, click “Save taxonomy rules”. Then open an affected article on your public website. Automatic glossary links should no longer appear there if the exclusion matches.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Below, select which content types may receive these links. “Posts” covers blog articles, “Pages” covers normal website pages. Tick only what makes sense for your website and save.', 'mkb-glossar'), __('Automatic linking is off by default. It does not change the original text you typed in the editor; links are added when eligible content is displayed.', 'mkb-glossar'), ], 1 => [ __('A good starting point is 3 for “Maximum links per content” and 1 for “Links per glossary term and page” – these are also the initial defaults. With this setup, at most three matching words become links, and the same word is linked at most once.', 'mkb-glossar'), __('Example: your text mentions "accessibility" three times and "FAQ" once. With a total limit of 3 links and 1 per glossary entry, "accessibility" is not linked again and again. What becomes a link depends on your published glossary entries and where the words appear.', 'mkb-glossar'), __('You can choose 1–100 total links and 1–10 links per term. These are maximum values, not a promise that links will appear. If no matching term exists, there is nothing to link.', 'mkb-glossar'), __('Want visitors to recognize links leading to another website? In Glossary → Settings → Linking, enable “Show a small external-link symbol”. Only terms with an explicitly chosen external destination receive the icon.', 'mkb-glossar'), __('Choose the external-link icon using the four illustrated options, or select your own image from the WordPress Media Library. The setting applies to all external glossary links.', 'mkb-glossar'), ], 2 => [ __('That means you stay in control of important calls to action. Still, check a sample page after enabling linking, especially if a page uses unusual editor widgets.', 'mkb-glossar'), __('For one passage without automatic links: in an Elementor Text Editor widget, enable “Disable automatic glossary links”. In Gutenberg, select a Paragraph or Group block and choose “Without automatic glossary links” under Styles. With the classic editor, wrap just the passage in [mkb_glossar_ohne_links]...[/mkb_glossar_ohne_links]. The rest of the page keeps its normal glossary links.', 'mkb-glossar'), ], 3 => [ __('Click “Remove” beside the entry if you want to allow automatic glossary links there again. The page itself remains published in either case.', 'mkb-glossar'), __('The same individual exclusion can also be set in the content editor. It affects automatic glossary links, not manually inserted links.', 'mkb-glossar'), ], 4 => [ __('For example, if the category “News” has ID 23 on YOUR website, enter 23. This excludes posts assigned to that category. The number 23 is only an example.', 'mkb-glossar'), __('If you use subcategories, remember: a post in the subcategory "Events" does not necessarily also belong to the parent category "News". Check which categories your posts actually have.', 'mkb-glossar'), ], 5 => [ __('Need more than one? Enter the numbers separated by commas, for example 23, 47. One matching tag is enough to exclude the whole post. Use the real numbers from your website.', 'mkb-glossar'), ], 6 => [ __('Only if you intentionally use these WordPress post formats and want to exclude them will you need their numeric post_format IDs. WordPress normally offers no convenient editing screen for these IDs, so ask your website administrator if you need them.', 'mkb-glossar'), __('An inserted video does not automatically turn a normal article into the WordPress “Video” post format. The ordinary “Standard” format has no format ID that can be entered here.', 'mkb-glossar'), ], 7 => [ __('Only fill one in when you know which posts belong to the group and want to exclude them from automatic linking. The glossary’s own topics are separate and are not offered here.', 'mkb-glossar'), ], 8 => [ __('You do not enter the category name, the whole web address or the ID of a glossary term: enter only the number. For several numbers, separate them with commas.', 'mkb-glossar'), __('No edit screen or no visible tag_ID? Do not guess. Leave the field empty and ask your website administrator to find the ID. The technical commands shown below are optional and not needed for everyday use.', 'mkb-glossar'), ], 9 => [ __('If you still see links, check three things: is it a link you placed by hand, is the article actually in the selected category or tag, and did you enter that group’s correct number?', 'mkb-glossar'), __('Leaving all fields empty is perfectly fine. The category and tag exclusions are optional; they never switch automatic linking on by themselves.', 'mkb-glossar'), ], ], 'note' => __('Important: these rules control automatic glossary links in your articles. They do not delete glossary entries, hide WordPress pages or remove links you added yourself.', 'mkb-glossar'), 'links' => [[ 'label' => __('Linking settings', 'mkb-glossar'), 'url' => add_query_arg(['post_type'=>'mkb_glossar','page'=>'mkb-glossar','tab'=>'linking'],admin_url('edit.php')), 'cap'=>'manage_options' ], ['label' => __('Exclusions', 'mkb-glossar'), 'url' => add_query_arg(['post_type'=>'mkb_glossar','page'=>'mkb-glossar','tab'=>'exclusions'],admin_url('edit.php')), 'cap'=>'manage_options' ]], ], 'display' => [ 'icon' => 'layout', 'title' => __('Put your glossary on your website', 'mkb-glossar'), 'summary' => __('Make your knowledge easy to find – exactly where your visitors need it.', 'mkb-glossar'), 'step_titles' => [ __('Use the Elementor glossary widget', 'mkb-glossar'), __('Use the Gutenberg block', 'mkb-glossar'), __('Copy and use the shortcode', 'mkb-glossar'), __('Help visitors find the right answer', 'mkb-glossar'), __('Decide what your overview should show', 'mkb-glossar'), __('Check the page as a visitor', 'mkb-glossar'), ], 'steps' => [ __('Do you build your pages with Elementor? Open the page in Elementor, search the widgets for “MKB Glossar”, and drag the glossary overview into your layout.', 'mkb-glossar'), __('Using the standard WordPress editor instead? Open the page, click the plus symbol to add a block, search for “MKB Glossar” and insert it.', 'mkb-glossar'), __('Want a simple way to insert the overview? Click “Copy shortcode” below, add a “Shortcode” block to your chosen page, paste the code and save. MKB Glossar displays the overview in that place.', 'mkb-glossar'), __('If you enable search, the alphabet and the topic filter in your overview, visitors can find explanations more quickly. For example, someone can type “FAQ” (short for frequently asked questions) into the search instead of scrolling through every entry.', 'mkb-glossar'), __('Use the editor controls in Elementor or Gutenberg for their layouts. With a shortcode, the documented attributes configure content and filtering; your theme CSS controls the appearance.', 'mkb-glossar'), __('After publishing, open the page outside the editor. Can you read the entries comfortably? Does the search work? Does clicking a term open its explanation? That is the test that matters.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Now you can adjust the overview using the widget’s content and design options. Check the preview and publish or update the page when you like the result.', 'mkb-glossar'), __('A separate "Knowledge" or "Glossary" page lets visitors return to your explanations whenever they encounter a word they do not know.', 'mkb-glossar'), ], 1 => [ __('Save or publish the page, then open it as a visitor to check the result. You do not need Elementor for this option.', 'mkb-glossar'), __('In Elementor Free, add the “MKB Glossary – Search” widget and choose your published glossary overview page. Without Elementor, place the matching WordPress widget under Appearance → Widgets. After two characters, up to three matching published terms appear. Select a suggestion to open its explanation or press Enter: exact and unique matches open directly, otherwise the filtered overview opens. The separate Search button is hidden by default and can be enabled in widget settings.', 'mkb-glossar'), ], 2 => [ __('A shortcode is a small instruction in square brackets. Start with the basic code; add an option only when you want to change how visitors use the overview.', 'mkb-glossar'), __('If the overview is missing, check whether the page was saved and whether you used a shortcode block or an editor area that supports shortcodes.', 'mkb-glossar'), ], 3 => [ __('A topic filter only helps when your entries have actually been assigned topics. The interactive search and filters need JavaScript; without it, visitors can still use ordinary glossary links.', 'mkb-glossar'), __('Choose the number of terms per loading batch under Glossary → Settings → Appearance & SEO. If your glossary has 100 published terms and you choose 50, visitors initially see 50 and can add another 50 with “Load more terms” on the same overview page. Search, alphabet and topics include all published terms in the current language.', 'mkb-glossar'), ], 4 => [ __('For a shortcode overview, start with search and alphabet enabled. Add show_topics only when your terms have visible topics. Adjust the appearance using your site CSS.', 'mkb-glossar'), __('The glossary overview and automatic links in ordinary articles are two different features. You can use either one or both.', 'mkb-glossar'), __('Open Glossary → Settings → Appearance & SEO to choose colors, corners and spacing for sources and related terms. One setting gives every glossary page a consistent look. You can also choose how many terms load at a time and help search engines understand published term explanations through DefinedTerm data. The preview shows your changes immediately.', 'mkb-glossar'), ], 5 => [ __('If the list is empty, first check that you have published glossary terms and that any active topic filter is not hiding them.', 'mkb-glossar'), ], ], 'code' => '[mkb_glossar]', ], 'tooltips' => [ 'icon' => 'format-chat', 'title' => __('Helpful explanations right in the text', 'mkb-glossar'), 'summary' => __('Visitors can get a quick answer without losing their place.', 'mkb-glossar'), 'step_titles' => [ __('What the little explanation window does', 'mkb-glossar'), __('What happens on a phone', 'mkb-glossar'), __('Using the keyboard', 'mkb-glossar'), __('Open the tooltip design settings', 'mkb-glossar'), __('Choose colors that are easy to read', 'mkb-glossar'), __('Choose a font and its size', 'mkb-glossar'), __('Make the window comfortable to read', 'mkb-glossar'), __('Reset changes or use Elementor design', 'mkb-glossar'), ], 'steps' => [ __('A tooltip is a small explanation window that can appear when someone points to a linked glossary word. It uses the short definition you entered for that term. Think of it as a friendly answer at exactly the right moment.', 'mkb-glossar'), __('Visitors do not need a mouse: the first tap on a linked glossary word shows its short explanation. A second tap on the same word opens the full glossary page.', 'mkb-glossar'), __('People who use a keyboard can focus a glossary link using the Tab key. Its short explanation can become visible on focus. Escape closes the explanation; Enter follows the normal link.', 'mkb-glossar'), __('Go to Glossary → Settings → Tooltips. On the left you will find the design fields; the preview shows how your changes can look. You can adapt the appearance to your website without editing CSS or writing code.', 'mkb-glossar'), __('“Background color” is the area behind the text. “Text color” controls the letters. “Border color” controls the thin frame. Click a color field or enter a color code such as #FFFFFF for white.', 'mkb-glossar'), __('“Font family” changes which font is used. “Font size (px)” controls how large the text appears. “Font weight” makes it lighter or bolder. If you use Elementor, fonts from the active Elementor design may also be offered.', 'mkb-glossar'), __('“Padding” is the space between the text and the edge of the box. “Maximum width” keeps a tooltip from becoming too wide. “Corner radius” rounds the corners, and “Border width” makes the frame thinner or thicker. These fields use pixels.', 'mkb-glossar'), __('An empty design field means MKB Glossar does not override that property. Use the individual “Reset” button to remove a setting you no longer want. If Elementor is available, the tooltip can inherit appropriate values from the active Elementor design.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Example: someone encounters the word "accessibility" on your website. The small explanation window can say that it means making the website usable for as many people as possible. Then the person can keep reading or open the full glossary entry.', 'mkb-glossar'), __('The tooltip option must be enabled for the relevant output, and the term needs a short definition. A tooltip does not create automatic links by itself.', 'mkb-glossar'), ], 1 => [ __('Try this yourself on a real phone. Remember that the behavior applies to actual glossary links, not every ordinary word in a text.', 'mkb-glossar'), ], 2 => [ __('That is why the tooltip should remain easy to read, with clear text and enough contrast between text and background.', 'mkb-glossar'), ], 3 => [ __('Change one thing at a time, inspect the preview and then click “Save settings”. If a field is left on “Inherit”, MKB Glossar uses the available inherited design instead of forcing its own value.', 'mkb-glossar'), ], 4 => [ __('Example: a light background and dark text are usually easier to read than pale text on a pale background. Pick colors that fit your website but keep the words clear.', 'mkb-glossar'), __('Want to return to the website design? Use “Reset” for that field instead of guessing the old color.', 'mkb-glossar'), ], 5 => [ __('Example: a value of 16 in a field labeled “(px)” means 16 pixels. If you are unsure, leave the field empty and let the existing design determine the size.', 'mkb-glossar'), __('“Line height” controls the space between text lines. Depending on the unit selector, you can enter a factor, pixels or percent. Small changes are easier to judge in the preview than drastic ones.', 'mkb-glossar'), ], 6 => [ __('Example: increase the padding a little if the explanation looks cramped. Then check on a phone that the tooltip still fits comfortably on screen.', 'mkb-glossar'), ], 7 => [ __('The Elementor global design controls shown in this area affect the Elementor Kit itself. Do not change global colors or fonts just to try out one tooltip; a global change can affect other parts of your website.', 'mkb-glossar'), __('When you only want to customize the tooltip, use its individual fields on the left.', 'mkb-glossar'), ], ], 'links' => [[ 'label' => __('Tooltip settings', 'mkb-glossar'), 'url' => add_query_arg(['post_type'=>'mkb_glossar','page'=>'mkb-glossar','tab'=>'tooltips'],admin_url('edit.php')), 'cap'=>'manage_options' ]], ], 'troubleshooting' => [ 'icon' => 'sos', 'title' => __('When something does not look right', 'mkb-glossar'), 'summary' => __('Most issues can be narrowed down with a few simple checks.', 'mkb-glossar'), 'step_titles' => [ __('No automatic links appear', 'mkb-glossar'), __('The wrong language appears', 'mkb-glossar'), __('The little explanation does not show', 'mkb-glossar'), __('A glossary link leads to an error page', 'mkb-glossar'), __('Ask MKB Glossar support for help', 'mkb-glossar'), __('Links appear on a page you wanted to exclude', 'mkb-glossar'), __('There are too many or too few links', 'mkb-glossar'), ], 'steps' => [ __('First check Glossary → Settings → Linking. Is automatic linking switched on? Is the content type, such as “Pages” or “Posts”, selected? Then check whether you excluded the page.', 'mkb-glossar'), __('If you use Polylang or WPML, open the page and the glossary term in WordPress and check the language assigned to each. Link the matching translations where necessary.', 'mkb-glossar'), __('First verify that the glossary term has a short definition. Then check whether tooltips are enabled for the output you are viewing. Finally, try an actual linked glossary word on the published page.', 'mkb-glossar'), __('Did you recently change the glossary URL base? Open WordPress → Settings → Permalinks and save the settings again. Then test a glossary term.', 'mkb-glossar'), __('Stuck or have a question? As a website administrator, use the support form below. Tell us what you wanted to do, what you tried and what happened instead. Technical details can be included if you choose to share them.', 'mkb-glossar'), __('Open Glossary → Settings → Exclusions. Does the page appear in “Currently excluded”? If you entered a category or tag number instead, check that the page actually belongs to that group.', 'mkb-glossar'), __('Open Glossary → Settings → Linking. Reduce “Maximum links per content” if a page looks too busy. Keep “Links per glossary term and page” at 1 if the same expression appears several times.', 'mkb-glossar'), ], 'details' => [ 0 => [ __('Also check that you published a glossary term and that its name actually occurs in your page text. Without a match there is nothing for MKB Glossar to link.', 'mkb-glossar'), __('Try an ordinary published page first, not a heading or a button, because those areas are protected from automatic linking.', 'mkb-glossar'), ], 1 => [ __('For example, an English page should use the matching English explanation, not simply a German term with an English-sounding synonym.', 'mkb-glossar'), __('If your website only uses one language, you normally do not need to adjust any of these settings.', 'mkb-glossar'), ], 2 => [ __('Moving over an ordinary word that is not a glossary link will not show a tooltip. On a phone, tap the linked word once.', 'mkb-glossar'), ], 3 => [ __('If you changed the public address of already published terms, old external links may still need redirects to the new addresses.', 'mkb-glossar'), ], 4 => [ __('You can describe what is on your screen, but never paste passwords, secret keys or personal information about other people into the form. The form does not upload screenshots or other files.', 'mkb-glossar'), ], 5 => [ __('Also distinguish automatic glossary links from links you placed manually. MKB Glossar does not delete your own links when you set an exclusion.', 'mkb-glossar'), ], 6 => [ __('If there are too few, check the limits and whether matching terms are published. Turning limits up cannot create links for terms that do not exist in your glossary.', 'mkb-glossar'), ], ], 'note' => __('Elementor, Polylang and WPML are optional. MKB Glossar also works with an ordinary WordPress website.', 'mkb-glossar'), ], ]; return mkb_glossar_help_named_menu_paths($sections, $collection); } /** A live, local and accessible visual showing the configured terminology. * All texts are translated before user-defined values are inserted and escaped. */ function mkb_glossar_render_help_terminology_preview() { $names = mkb_glossar_display_names(); /* translators: %s is the configured singular name of an item (for example, Artikel). */ $create = sprintf(__('Create %s', 'mkb-glossar'), $names['item']); echo '
'; echo '
' . esc_html__('Your names in this installation', 'mkb-glossar') . '
'; echo '
'; echo '
' . esc_html__('WordPress menu', 'mkb-glossar') . '' . esc_html($names['collection']) . '
'; echo ''; echo '
' . esc_html__('New content', 'mkb-glossar') . '' . esc_html($create) . '
'; echo ''; echo '
' . esc_html__('Example title', 'mkb-glossar') . '' . esc_html__('Accessibility', 'mkb-glossar') . '
'; echo '
'; echo '

' . esc_html__('Choose these names during your first setup or later under Settings → General. The visual updates after saving; your WordPress content is not modified.', 'mkb-glossar') . '

'; echo '
'; } add_action('admin_menu', static function () { add_submenu_page( 'edit.php?post_type=mkb_glossar', __('MKB Glossar Help', 'mkb-glossar'), __('Help', 'mkb-glossar'), 'edit_posts', 'mkb-glossar-help', 'mkb_glossar_render_help_page' ); }, 30); add_action('admin_enqueue_scripts', static function ($hook) { // Screen hook is sufficient; do not read request parameters to load CSS. if (!str_ends_with((string) $hook, '_page_mkb-glossar-help')) return; // CSS file hash changes on UI revisions even when the plugin DEV version stays the same. $stylesheet = MKB_GLOSSAR_PATH . 'assets/admin-help.css'; $version = is_file($stylesheet) ? (string) filemtime($stylesheet) : MKB_GLOSSAR_VERSION; wp_enqueue_style('mkb-glossar-admin-info', MKB_GLOSSAR_URL . 'assets/admin-info-box.css', [], MKB_GLOSSAR_VERSION); wp_enqueue_style('mkb-glossar-admin-help', MKB_GLOSSAR_URL . 'assets/admin-help.css', ['mkb-glossar-admin-info'], $version); $script = MKB_GLOSSAR_PATH . 'assets/admin-help.js'; $script_version = is_file($script) ? (string) filemtime($script) : MKB_GLOSSAR_VERSION; wp_enqueue_script('mkb-glossar-admin-help', MKB_GLOSSAR_URL . 'assets/admin-help.js', [], $script_version, true); $search_script = MKB_GLOSSAR_PATH . 'assets/admin-help-search.js'; $search_version = is_file($search_script) ? (string) filemtime($search_script) : MKB_GLOSSAR_VERSION; wp_enqueue_script('mkb-glossar-admin-help-search', MKB_GLOSSAR_URL . 'assets/admin-help-search.js', ['mkb-glossar-admin-help'], $search_version, true); }); /** * Semantic shortcode examples and parameters, shared by Handbook and Settings. * No CSS/design parameters are promoted as shortcode options. */ function mkb_glossar_shortcode_examples() { $collection = mkb_glossar_display_names()['collection']; $examples = [ [ 'title' => __('Search and select a topic', 'mkb-glossar'), 'description' => __('Add a topic selector to the search and alphabet. Topics appear only when visible topics contain published glossary terms.', 'mkb-glossar'), 'code' => '[mkb_glossar show_topics="true"]', ], [ 'title' => __('Show one topic with up to 12 terms', 'mkb-glossar'), 'description' => __('Replace beispiel-thema with the actual topic slug from Glossary → Topics. A fixed topic is a content filter, not the visitor\'s topic selector.', 'mkb-glossar'), 'code' => '[mkb_glossar topic="beispiel-thema" limit="12"]', ], [ 'title' => __('Show the glossary without search and alphabet', 'mkb-glossar'), 'description' => __('Display the term list without interactive search or alphabet buttons. Automatic glossary links in other articles are unaffected.', 'mkb-glossar'), 'code' => '[mkb_glossar show_search="false" show_alphabet="false"]', ], [ 'title' => __('A standalone search field outside the glossary overview', 'mkb-glossar'), 'description' => __('Visitors see up to three term suggestions while typing. Select a term to open it directly, or press Enter for an exact or unique match; other searches open the filtered overview. Choose the published overview page as the fallback. The separate Search button is hidden by default. For the shortcode, replace 123 with its page ID. Optional attributes: show_button="true", show_suggestions="false", suggestion_limit="1" (1–3).', 'mkb-glossar'), 'code' => '[mkb_glossar_search page_id="123"]', ], [ 'title' => __('Keep one text passage free of automatic links', 'mkb-glossar'), 'description' => __('Place just the protected text between these two shortcodes in the classic editor. Elementor and Gutenberg offer direct editing options instead.', 'mkb-glossar'), 'code' => '[mkb_glossar_ohne_links]Text[/mkb_glossar_ohne_links]', ], ]; return mkb_glossar_help_named_menu_paths($examples, $collection); } function mkb_glossar_shortcode_parameters() { return [ ['show_topics', '"true" / "false"', __('Display the topic selector. Default: false. Requires visible topics assigned to published terms.', 'mkb-glossar')], ['topic', '"beispiel-thema"', __('Show terms from one topic using its slug, not its name or numeric ID. Default: all topics.', 'mkb-glossar')], ['limit', '"12" / "-1"', __('Maximum number of terms: 1–500. Use -1 for all terms (default).', 'mkb-glossar')], ['show_search', '"true" / "false"', __('Display the search field. Default: true. Search covers names, synonyms, short definitions and term content.', 'mkb-glossar')], ['show_alphabet', '"true" / "false"', __('Display the alphabet buttons, including available non-Latin initials and numbers. Default: true.', 'mkb-glossar')], ['show_tooltips', '"true" / "false"', __('Enable short-definition tooltips for terms with a short definition. Default: true.', 'mkb-glossar')], ['show_search_label', '"true" / "false"', __('Show the visible label above the search field. Default: true; an accessible label remains when hidden.', 'mkb-glossar')], ['show_topic_label', '"true" / "false"', __('Show the visible label above the topic selector. Default: true.', 'mkb-glossar')], ['search_label', '"Search glossary"', __('Replace the visible search label; only shown when the search label is enabled.', 'mkb-glossar')], ['search_placeholder', '"Enter a term"', __('Replace the hint text inside the search field.', 'mkb-glossar')], ['topic_label', '"Choose a topic"', __('Replace the label above the topic selector.', 'mkb-glossar')], ['alphabet_all_label', '"All"', __('Replace the text of the alphabet button that shows all terms.', 'mkb-glossar')], ['empty_message', '"No terms found"', __('Replace the message shown when filters find no matching terms.', 'mkb-glossar')], ['reset_label', '"Reset filters"', __('Replace the text of the reset button for active filters.', 'mkb-glossar')], ]; } /** Print once per surface. Every example is individually copyable without scripts. */ function mkb_glossar_render_shortcode_reference($surface = 'help') { echo '
'; echo '

' . esc_html__('Useful shortcode examples', 'mkb-glossar') . '

'; echo '

' . esc_html__('The basic shortcode shows search and alphabet automatically. The topic selector is optional. Add only the options you need.', 'mkb-glossar') . '

'; foreach (mkb_glossar_shortcode_examples() as $example) { echo '
'; echo '' . esc_html($example['title']) . ''; $description = $example['description']; // Settings show only integrations that are currently usable; the full handbook // deliberately keeps Elementor guidance as an optional discovery path. if ($surface === 'settings' && function_exists('mkb_glossar_elementor_available') && !mkb_glossar_elementor_available() && $example['code'] === '[mkb_glossar_ohne_links]Text[/mkb_glossar_ohne_links]') { $description = __('Wrap only the protected text in these shortcodes in the classic editor. In Gutenberg you can disable automatic links using the block style.', 'mkb-glossar'); } echo '

' . esc_html($description) . '

'; mkb_glossar_render_shortcode_copy_control($example['code']); echo '
'; } echo '
'; echo '' . esc_html__('All functional shortcode parameters', 'mkb-glossar') . ''; echo '

' . esc_html__('Use true or false for on/off options. Separate attributes with spaces, and keep text values in quotation marks.', 'mkb-glossar') . '

'; echo '
'; echo ''; echo ''; foreach (mkb_glossar_shortcode_parameters() as $param) { echo ''; } echo '
' . esc_html__('Available functional shortcode parameters', 'mkb-glossar') . '
' . esc_html__('Parameter', 'mkb-glossar') . '' . esc_html__('Example value', 'mkb-glossar') . '' . esc_html__('What it changes', 'mkb-glossar') . '
' . esc_html($param[0]) . '' . esc_html($param[1]) . '' . esc_html($param[2]) . '
'; echo '
'; echo '
'; echo '' . esc_html($surface === 'settings' && !mkb_glossar_elementor_available() ? __('Place sources and related terms with a shortcode', 'mkb-glossar') : __('Place sources and related terms freely (also with Elementor Free)', 'mkb-glossar')) . ''; echo '

' . esc_html($surface === 'settings' && !mkb_glossar_elementor_available() ? __('On an individual content page, insert this shortcode in the description and disable automatic placement to prevent duplicates. On another page, use [mkb_glossar_details id="123"] with the correct ID.', 'mkb-glossar') : __('On the individual glossary page, add this shortcode inside the description or an Elementor Shortcode widget. Turn off automatic placement in the glossary editor to prevent duplicate sections. On another page, use [mkb_glossar_details id="123"] with the actual glossary term ID.', 'mkb-glossar')) . '

'; mkb_glossar_render_shortcode_copy_control('[mkb_glossar_details]'); echo '
'; echo '

' . esc_html__('The shortcode controls content and filtering, not colors, fonts or spacing. For visual changes use your theme\'s CSS, for example targeting .mkb-glossar.', 'mkb-glossar') . '

'; echo '
'; } /** One consistent, progressively enhanced shortcode-copy control for Help and Settings. */ function mkb_glossar_render_shortcode_copy_control($shortcode = '[mkb_glossar]') { echo '
'; echo '

' . esc_html($shortcode) . '

'; echo ''; echo '
'; } function mkb_glossar_render_help_page() { if (!current_user_can('edit_posts')) { wp_die(esc_html__('You do not have permission to view this help page.', 'mkb-glossar')); } $sections = mkb_glossar_help_sections(); echo '
'; echo '
'; // Native disclosure elements remain keyboard-operable without JavaScript. // Scroll synchronization only enhances this accessible HTML baseline. echo ''; // One linear document; no separate cards or pseudo-tab navigation. echo '
'; echo '
'; echo '

' . esc_html__('Handbook', 'mkb-glossar') . '

'; echo '

' . esc_html__('MKB Glossar Help', 'mkb-glossar') . '

'; $names = mkb_glossar_display_names(); /* translators: %s is the collection name configured in the glossary settings. */ echo '

' . esc_html(sprintf(__('From your first content item to the overview for "%s": this handbook explains the steps.', 'mkb-glossar'), $names['collection'])) . '

'; echo '
'; // Explain the benefit first, then the actual workflow; no SEO guarantees. echo '
'; echo '

' . esc_html__('What is MKB Glossar?', 'mkb-glossar') . '

'; echo '

' . esc_html(__('Visitors should not need a dictionary to understand your website. Some expressions are so familiar to you that you forget they may be new to someone else. MKB Glossar helps you explain them right where they appear – whether you write a personal blog, maintain a club website or run a business site.', 'mkb-glossar')) . '

'; echo '

' . esc_html(__('This can be much more than a list of words: a useful place for explanations, experiences and knowledge that matters on your website. Visitors can read a short explanation and, if they want, explore the full glossary entry.', 'mkb-glossar')) . '

'; echo '

' . esc_html(__('The real time-saver: you write an explanation once. If you turn on automatic linking, MKB Glossar can recognize matching terms in eligible articles and connect them to your glossary, instead of making you link everything by hand. You choose which pages are included and how many links are allowed.', 'mkb-glossar')) . '

'; echo '

' . esc_html(__('You can also create a glossary overview on its own page, using the Elementor widget, Gutenberg or a shortcode. A well-made glossary can invite people to explore your website, answer recurring questions and make your content easier to understand. Useful, well-structured explanations may also help search engines interpret your content – but no plugin can guarantee better rankings or more visitors.', 'mkb-glossar')) . '

'; echo '
'; echo '
' . esc_html(__('From an unfamiliar word to a useful answer', 'mkb-glossar')) . '
'; echo '
    '; echo '
  1. ' . esc_html(__('A visitor finds an unfamiliar word in your article.', 'mkb-glossar')) . '
  2. '; echo '
  3. ' . esc_html(__('A short explanation helps without interrupting the reading flow.', 'mkb-glossar')) . '
  4. '; echo '
  5. ' . esc_html(__('If they want more, they open your detailed glossary page.', 'mkb-glossar')) . '
  6. '; echo '
'; echo '

' . esc_html(__('What this could do for your website', 'mkb-glossar')) . '

'; echo '
    '; echo '
  • ' . esc_html(__('Answer common questions before visitors have to ask.', 'mkb-glossar')) . '
  • '; echo '
  • ' . esc_html(__('Show your knowledge without turning every page into a technical manual.', 'mkb-glossar')) . '
  • '; echo '
  • ' . esc_html(__('Maintain an explanation once and reuse it through optional automatic links.', 'mkb-glossar')) . '
  • '; echo '
  • ' . esc_html(__('Create an appealing knowledge page with Elementor, Gutenberg or a shortcode.', 'mkb-glossar')) . '
  • '; echo '
'; foreach ($sections as $id => $section) { echo '
'; echo '
'; echo ''; echo '

' . esc_html($section['title']) . '

'; echo '

' . esc_html($section['summary']) . '

'; foreach ($section['steps'] as $i => $step) { $subid = $id . '-step-' . ($i + 1); echo '
'; echo '

' . esc_html($section['step_titles'][$i]) . '

'; echo '

' . esc_html($step) . '

'; mkb_glossar_help_render_step_visuals($id, $i); foreach (($section['details'][$i] ?? []) as $detail) { echo '

' . esc_html($detail) . '

'; } if ($id === 'terms' && $i === 3) { echo ''; } if ($id === 'troubleshooting' && $i === 4) { mkb_glossar_render_support_form(); } if ($id === 'linking' && $i === 1) { echo '
'; echo '
' . esc_html((__('Example: 3 links in total, only 1 per glossary term', 'mkb-glossar'))) . '
'; echo '

' . esc_html((__('An article can mention the same term several times. With these settings, the text stays calmer:', 'mkb-glossar'))) . '

'; echo '
    '; foreach ([ [(__('First matching term', 'mkb-glossar')), (__('may become a glossary link', 'mkb-glossar'))], [(__('Another matching term', 'mkb-glossar')), (__('may also become a link, up to the total limit', 'mkb-glossar'))], [(__('A third different term', 'mkb-glossar')), (__('can be the third and final link with this total limit', 'mkb-glossar'))], [(__('The first term appears again', 'mkb-glossar')), (__('stays normal text because this term was already linked once', 'mkb-glossar'))], ] as $item) { echo '
  1. ' . esc_html($item[0]) . '' . esc_html($item[1]) . '
  2. '; } echo '
'; echo '

' . esc_html((__('These are maximum values, not a target. Your article may have fewer automatic links.', 'mkb-glossar'))) . '

'; } if ($id === 'linking' && $i === 8) { // An explanatory, non-interactive WordPress list preview. No links or scripts. echo '
'; echo '
' . esc_html__('Where the category number appears', 'mkb-glossar') . '
'; echo '

' . esc_html__('Example view – this is an illustration, not a clickable WordPress screen.', 'mkb-glossar') . '

'; echo '
'; echo '
' . esc_html__('Posts → Categories', 'mkb-glossar') . '
'; echo '
' . esc_html__('News', 'mkb-glossar') . '' . esc_html__('Edit', 'mkb-glossar') . '' . esc_html__('← Point here without clicking', 'mkb-glossar') . '
'; echo '
' . esc_html__('Link preview in the browser:', 'mkb-glossar') . 'example.com/wp-admin/term.php?taxonomy=category&tag_ID=23
'; echo '
'; echo '

' . esc_html__('Only enter the highlighted number 23 in the example – not the entire link. Your category may have a different number.', 'mkb-glossar') . '

'; } if ($id === 'linking' && $i === 8) { echo '
'; echo '

' . esc_html(__('Optional for experienced users: example numbers (replace with your own):', 'mkb-glossar')) . ' 23, 47

'; echo '

' . esc_html(__('You do not need these commands for normal website management. They only show another way to find the numbers in a WordPress terminal.', 'mkb-glossar')) . '

'; echo '
' . esc_html__('Find category IDs:', 'mkb-glossar') . '
wp term list category --fields=term_id,name,slug
'; echo '
' . esc_html__('Find tag IDs:', 'mkb-glossar') . '
wp term list post_tag --fields=term_id,name,slug
'; echo '
' . esc_html__('Find post format IDs:', 'mkb-glossar') . '
wp term list post_format --fields=term_id,name,slug
'; echo '
'; } if ($id === 'linking' && $i === 9) { echo '
'; echo '
' . esc_html__('How the exclusion decision works', 'mkb-glossar') . '
    '; // Literal gettext arguments keep these strings discoverable by WordPress i18n tools. // Escape at output, not at declaration; this also protects translated text. foreach ([ [__('Is automatic linking enabled for this content type?', 'mkb-glossar'), __('If not: no automatic links.', 'mkb-glossar')], [__('Is this page or post individually excluded?', 'mkb-glossar'), __('If yes: no automatic links.', 'mkb-glossar')], [__('Does any assigned category, tag, post format or other term match an exclusion rule?', 'mkb-glossar'), __('If yes: no automatic links.', 'mkb-glossar')], [__('Otherwise matching glossary terms can be linked, subject to the configured limits.', 'mkb-glossar'), null], ] as $item) { echo '
  1. ' . esc_html($item[0]) . ''; if ($item[1] !== null) echo '' . esc_html($item[1]) . ''; echo '
  2. '; } echo '

' . esc_html__('The diagram describes automatic links only, not manually inserted links.', 'mkb-glossar') . '

'; } if ($id === 'display' && $i === 2 && isset($section['code'])) { // Shared control: readable shortcode without JavaScript and one copy behavior. mkb_glossar_render_shortcode_copy_control($section['code']); mkb_glossar_render_shortcode_reference(); } echo '
'; } if (isset($section['note'])) { echo wp_kses(mkb_glossar_info_box($section['note'], 'mkb-glossar-help-note'), mkb_glossar_allowed_visual_markup()); } if (!empty($section['links'])) { echo '
'; foreach ($section['links'] as $link) { if (!current_user_can($link['cap'])) continue; echo '' . esc_html($link['label']) . ''; } echo '
'; } echo '
'; } echo '
'; } /** Shared, accessible informational note for the handbook and setup assistant. * The WordPress Help flyout is deliberately not registered: the integrated * Glossary Handbook is the single consistent help destination. */ function mkb_glossar_info_box($message, $extra_class = '') { $class = 'mkb-glossar-info-box'; if ($extra_class !== '') $class .= ' ' . sanitize_html_class($extra_class); return '
' . '' . '

' . esc_html($message) . '

'; }