PluginProbe ʕ •ᴥ•ʔ
Admin Help Docs / 2.0.0.1
Admin Help Docs v2.0.0.1
2.0.1.1 trunk 1.4.3.2 2.0.0 2.0.0.1 2.0.0.2 2.0.1
admin-help-docs / inc / tabs / faq.php
admin-help-docs / inc / tabs Last commit date
css 3 months ago js 3 months ago admin-menu.php 3 months ago documentation.php 3 months ago faq.php 3 months ago import.php 3 months ago settings.php 3 months ago support.php 3 months ago
faq.php
162 lines
1 <?php
2 /**
3 * FAQ Tab Loader
4 */
5
6 namespace PluginRx\AdminHelpDocs;
7
8 if ( ! defined( 'ABSPATH' ) ) exit;
9
10 class FAQ {
11
12 /**
13 * The single instance of the class
14 *
15 * @var self|null
16 */
17 private static ?FAQ $instance = null;
18
19
20 /**
21 * Get the singleton instance
22 *
23 * @return self
24 */
25 public static function instance() : self {
26 return self::$instance ??= new self();
27 } // End instance()
28
29
30 /**
31 * Render the tab
32 */
33 public function render_tab() {
34 ?>
35 <div class="helpdocs-full-width-box">
36 <h3>How do I add a document?</h3>
37 <ul>
38 <li>Head over to the <a href="<?php echo esc_url( Bootstrap::tab_url( 'manage' ) ); ?>">Manage</a> tab and add a new Help Document.</li>
39 <li>Include the title and content for the document.</li>
40 <li>The "Location" box is where you specify where you want the document to show up.</li>
41 <li><strong>Site Location</strong> includes all pages that are in your admin menu:
42 <ul>
43 <li><strong>Main Documentation Page:</strong> <?php echo esc_attr( Helpers::get_menu_title() ); ?> > <a href="<?php echo esc_url( Bootstrap::tab_url( 'documentation' ) ); ?>">Documentation</a></li>
44 <li><strong>Admin Bar Menu:</strong> Added to your top admin bar if enabled in <a href="<?php echo esc_url( Bootstrap::tab_url( 'settings' ) ); ?>">Settings</a></li>
45 <li><strong>WordPress Dashboard:</strong> Adds a meta box to your WordPress <a href="<?php echo esc_url( Bootstrap::admin_url( 'index.php' ) ); ?>">dashboard</a></li>
46 <li><strong>Function: admin_help_doc( id ):</strong> Developers can use this function to display a specific help document by its ID.</li>
47 <li><strong>Post/Page Edit Screen:</strong> The screen where you edit posts, pages, and other custom post types</li>
48 <li><strong>Post/Page Admin List Screen:</strong> The screen that lists all of your posts, pages, and other custom post types</li>
49 <li><strong><em>Other items from your menu...</em></strong></li>
50 <li><strong>Other/Custom Page:</strong> Use this if the screen you want isn't listed or isn't working properly</li>
51 </ul>
52 </li>
53 <li><strong>Page Location</strong> specifies the exact location on the screen where the document should appear.
54 <ul>
55 <li><strong>Contextual Help Tab:</strong> Shows up in the Help tab at the top-right of the screen</li>
56 <li><strong>Top:</strong> Displays at the top of the page - you can change the top location placement in settings</li>
57 <li><strong>Bottom:</strong> Displays at the bottom of the page</li>
58 <li><strong>Side:</strong> Displays at the top of the sidebar on the post edit screen only</li>
59 <li><strong>Element:</strong> Developers can display the doc immediately after a specific element on the page - enter the CSS selector - does not include logo and title like other docs</li>
60 </ul>
61 </li>
62 <li>If you cannot find a menu item in the Site Location dropdown, then it is probably a custom post type; therefore, try selecting one of the Post/Page screens to see if it shows up in the list of post types.</li>
63 <li>Publish the document and look for it in the location you set. That's it! :)</li>
64 </ul>
65
66 <br><br>
67 <h3>Why isn't my document showing up?</h3>
68 <ul>
69 <li>When adding or updating a document, make sure the "Location" box is filled out correctly. By default, the site location is set to "None" so that you don't accidentally post something you didn't mean to. Furthermore, if you are using Post/Page screens, be sure you are setting the correct post type(s); these can be confusing sometimes.</li>
70 <li><em>Note: it is recommended to test adding a document to common locations to ensure that you're setting everything correctly.</em></li>
71 </ul>
72
73 <br><br>
74 <h3>How do I use the same documentation across multiple sites?</h3>
75 <ul>
76 <li>On the site that has the document you want to share, edit the document and set "Allow Public" to "Yes". Alternatively, you may allow all of your documents to be public by default from <a href="<?php echo esc_url( Bootstrap::tab_url( 'settings' ) ); ?>">Settings</a>. You can also optionally generate an API key in Settings for secure access.</li>
77 <li>On the site in which you want to display the document, go to the <a href="<?php echo esc_url( Bootstrap::tab_url( 'imports' ) ); ?>">Imports</a> tab, add a new import, and enter the site URL of the site the document is coming from. Then hit "Fetch Docs."</li>
78 <li>When the docs appear, you may choose to automatically feed all of them that are public from the other site, or you can feed specific docs only. You also have the option to copy it locally so you don't have to feed it remotely.</li>
79 </ul>
80
81 <br>
82 <h3>How do I add documents to the admin bar menu?</h3>
83 <ul>
84 <li>First, enable the admin bar menu from <a href="<?php echo esc_url( Bootstrap::tab_url( 'settings' ) ); ?>">Settings</a>.</li>
85 <li>From the document edit screen, choose "Admin Bar Menu" from the Site Location dropdown, and then save it. That's it!</li>
86 <li>The submenu item will display as "Document Title — Document Content" with all html tags stripped out. Note that the document content can be turned on or off in Settings.</li>
87 <li>If you just want to link the menu item to a page, paste only the URL in the content box without anything else.</li>
88 </ul>
89
90 <br><br>
91 <h3>The Gutenberg editor doesn't allow the contextual help tab to be shown; can I still add help docs?</h3>
92 <ul>
93 <li>Yes, if you choose contextual help from the Page Location dropdown, a "Help" button will appear at the top right of the Gutenberg editor.</li>
94 </ul>
95
96 <br><br>
97 <h3>How do I change the order of the documents on the main documentation page?</h3>
98 <ul>
99 <li>You can do so by dragging the menu items in the left column up or down.</li>
100 </ul>
101
102 <br><br>
103 <h3>How do I add documents to folders on the main documentation page?</h3>
104 <ul>
105 <li>To create a folder, you can do so in the <a href="<?php echo esc_url( Bootstrap::tab_url( 'folders' ) ); ?>">Folders</a> tab.</li>
106 <li>Go back to the main docs page and drag and drop documents into different folders.</li>
107 </ul>
108
109 <br><br>
110 <h3>If I delete a folder with documents, will I lose all of the documents inside the folder?</h3>
111 <ul>
112 <li>No. Deleting a folder simply removes the documents from the folder and places them outside of the folder area on the main documentation page.</li>
113 </ul>
114
115 <br><br>
116 <h3>How do I display a shortcode without executing it?</h3>
117 <ul>
118 <li>
119 <strong>Primary Method:</strong> Wrap your shortcode within the enclosing tags. This is the most reliable way to handle complex shortcodes.
120 <br />
121 Usage: <code>&#91;dont_do_shortcode&#93;&#91;your_shortcode_here&#93;&#91;/dont_do_shortcode&#93;</code>
122 </li>
123 <li>
124 <strong>Legacy Method:</strong> You may also pass the content as an attribute. When using this method, replace the square brackets of your target shortcode with curly braces <code>{ }</code>.
125 <br />
126 Usage: <code>&#91;dont_do_shortcode content='{shortcode_name param="value"}'&#93;</code>
127 </li>
128 <li>
129 <strong>Important:</strong> Do <strong>NOT</strong> mix these two methods. Use either the enclosing tags or the <code>content</code> attribute. Combining them will cause the shortcode to break.
130 </li>
131 <li>
132 <strong>Note:</strong> When using the legacy attribute method, ensure you use single quotes (<code>'</code>) for the <code>content</code> parameter so you can safely use double quotes (<code>"</code>) inside the shortcode attributes.
133 </li>
134 <li>
135 <strong>Options:</strong>
136 <ul>
137 <li>Disable click-to-copy functionality by adding <code>click_to_copy="false"</code>.</li>
138 <li>Change the wrapper from a code block to a standard span by adding <code>code="false"</code>.</li>
139 </ul>
140 </li>
141 </ul>
142
143 <br><br>
144 <h3>How do I add custom CSS to documents?</h3>
145 <ul>
146 <li>As of version 2.0, the old <code>[helpdocs_css]</code> shortcode is deprecated.</li>
147 <li>Add your CSS from the Settings tab.</li>
148 </ul>
149 <?php
150 } // End render_tab()
151
152
153 /**
154 * Prevent cloning and unserializing
155 */
156 public function __clone() {}
157 public function __wakeup() {}
158
159 }
160
161
162 FAQ::instance();