Changeset 3344141
- Timestamp:
- 08/13/2025 06:59:42 PM (8 months ago)
- Location:
- admin-help-docs
- Files:
-
- 65 added
- 8 edited
-
tags/1.4.1 (added)
-
tags/1.4.1/admin-help-docs.php (added)
-
tags/1.4.1/includes (added)
-
tags/1.4.1/includes/admin (added)
-
tags/1.4.1/includes/admin/admin-area.php (added)
-
tags/1.4.1/includes/admin/css (added)
-
tags/1.4.1/includes/admin/css/index.php (added)
-
tags/1.4.1/includes/admin/css/style.css (added)
-
tags/1.4.1/includes/admin/css/style.php (added)
-
tags/1.4.1/includes/admin/functions.php (added)
-
tags/1.4.1/includes/admin/global-options.php (added)
-
tags/1.4.1/includes/admin/header-page.php (added)
-
tags/1.4.1/includes/admin/header.php (added)
-
tags/1.4.1/includes/admin/img (added)
-
tags/1.4.1/includes/admin/img/broken-link-notifier.png (added)
-
tags/1.4.1/includes/admin/img/clear-cache-everywhere.png (added)
-
tags/1.4.1/includes/admin/img/dev-debug-tools.png (added)
-
tags/1.4.1/includes/admin/img/discord.png (added)
-
tags/1.4.1/includes/admin/img/eri-file-library.png (added)
-
tags/1.4.1/includes/admin/img/gf-discord.png (added)
-
tags/1.4.1/includes/admin/img/gf-msteams.png (added)
-
tags/1.4.1/includes/admin/img/gf-tools.png (added)
-
tags/1.4.1/includes/admin/img/gravity-zwr.png (added)
-
tags/1.4.1/includes/admin/img/icon_google.png (added)
-
tags/1.4.1/includes/admin/img/icon_stackex.png (added)
-
tags/1.4.1/includes/admin/img/index.php (added)
-
tags/1.4.1/includes/admin/img/loading-buffering.gif (added)
-
tags/1.4.1/includes/admin/img/logo.png (added)
-
tags/1.4.1/includes/admin/img/text-area-resizer-wh-large.png (added)
-
tags/1.4.1/includes/admin/img/text-area-resizer.png (added)
-
tags/1.4.1/includes/admin/img/text-area-resizer_wh_sm.png (added)
-
tags/1.4.1/includes/admin/img/text-area-resizer_wh_sm_trans.png (added)
-
tags/1.4.1/includes/admin/index.php (added)
-
tags/1.4.1/includes/admin/js (added)
-
tags/1.4.1/includes/admin/js/doc-editing.js (added)
-
tags/1.4.1/includes/admin/js/doc-sorting.js (added)
-
tags/1.4.1/includes/admin/js/index.php (added)
-
tags/1.4.1/includes/admin/js/settings.js (added)
-
tags/1.4.1/includes/admin/menu.php (added)
-
tags/1.4.1/includes/admin/option-about.php (added)
-
tags/1.4.1/includes/admin/option-changelog.php (added)
-
tags/1.4.1/includes/admin/option-developer.php (added)
-
tags/1.4.1/includes/admin/option-documentation.php (added)
-
tags/1.4.1/includes/admin/option-faq.php (added)
-
tags/1.4.1/includes/admin/option-settings.php (added)
-
tags/1.4.1/includes/admin/option-settingsie.php (added)
-
tags/1.4.1/includes/admin/options.php (added)
-
tags/1.4.1/includes/class-admin-help-docs.php (added)
-
tags/1.4.1/includes/classes (added)
-
tags/1.4.1/includes/classes/_class-TEMPLATE.php (added)
-
tags/1.4.1/includes/classes/class-admin-bar.php (added)
-
tags/1.4.1/includes/classes/class-api.php (added)
-
tags/1.4.1/includes/classes/class-colors.php (added)
-
tags/1.4.1/includes/classes/class-dashboard-toc.php (added)
-
tags/1.4.1/includes/classes/class-discord.php (added)
-
tags/1.4.1/includes/classes/class-documentation.php (added)
-
tags/1.4.1/includes/classes/class-gf-mergetags.php (added)
-
tags/1.4.1/includes/classes/class-imports.php (added)
-
tags/1.4.1/includes/classes/class-user-profile.php (added)
-
tags/1.4.1/includes/classes/index.php (added)
-
tags/1.4.1/includes/functions.php (added)
-
tags/1.4.1/includes/index.php (added)
-
tags/1.4.1/index.php (added)
-
tags/1.4.1/readme.txt (added)
-
trunk/admin-help-docs.php (modified) (1 diff)
-
trunk/includes/admin/admin-area.php (modified) (1 diff)
-
trunk/includes/admin/css/style.css (added)
-
trunk/includes/admin/css/style.php (modified) (2 diffs)
-
trunk/includes/admin/global-options.php (modified) (1 diff)
-
trunk/includes/admin/option-about.php (modified) (1 diff)
-
trunk/includes/admin/option-settings.php (modified) (1 diff)
-
trunk/includes/classes/class-documentation.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin-help-docs/trunk/admin-help-docs.php
r3305205 r3344141 4 4 * Plugin URI: https://pluginrx.com/plugin/admin-help-docs/ 5 5 * Description: Site developers and operators can easily create help documentation for the admin area 6 * Version: 1.4. 06 * Version: 1.4.1 7 7 * Requires at least: 5.9 8 8 * Tested up to: 6.8 -
admin-help-docs/trunk/includes/admin/admin-area.php
r3305205 r3344141 95 95 $row_meta = []; 96 96 foreach ( $our_links as $key => $link ) { 97 // translators: %1$s is the link label, %2$s is the plugin name.98 $aria_label = sprintf( __( '%1$s for %2$s', 'admin-help-docs' ), $link[ 'label' ], $plugin_name );99 $row_meta[ $key ] = '<a href="' . esc_url( $link[ 'url' ] ) . '" target="_blank" aria-label="' . esc_attr( $aria_label ) . '">' . esc_html( $link[ 'label' ] ) . '</a>';100 }97 // translators: %1$s is the link label, %2$s is the plugin name. 98 $aria_label = sprintf( __( '%1$s for %2$s', 'admin-help-docs' ), $link[ 'label' ], $plugin_name ); 99 $row_meta[ $key ] = '<a href="' . esc_url( $link[ 'url' ] ) . '" target="_blank" aria-label="' . esc_attr( $aria_label ) . '">' . esc_html( $link[ 'label' ] ) . '</a>'; 100 } 101 101 102 102 // Add the links -
admin-help-docs/trunk/includes/admin/css/style.php
r3059362 r3344141 89 89 padding-top: 0 !important; 90 90 } 91 92 #doc-viewer h3, 93 #doc-viewer .wrap h3 { 94 margin-top: revert !important; 95 border-top: revert !important; 96 padding-top: revert !important; 97 } 98 91 99 .wrap { 92 100 padding: 0 !important; … … 315 323 </style> 316 324 317 <?php } 325 <?php } ?> -
admin-help-docs/trunk/includes/admin/global-options.php
r3273773 r3344141 55 55 'admin_bar', 56 56 'dashboard_toc', 57 'gutenberg_editor', 58 'enqueue_frontend_styles', 57 59 'dashicon', 58 60 'logo', -
admin-help-docs/trunk/includes/admin/option-about.php
r3305205 r3344141 96 96 <br><br> 97 97 <h3>Plugin Support</h3> 98 99 <?php /* translators: 1: Text for the button (default: Join Our Support Server) */ 98 <?php 100 99 echo '<a class="button button-primary" href="'.esc_url( HELPDOCS_GUIDE_URL ).'" target="_blank">'.esc_html( __( 'How-To Guide', 'admin-help-docs' ) ).' »</a><br><br>'; 101 100 echo '<a class="button button-primary" href="'.esc_url( HELPDOCS_DOCS_URL ).'" target="_blank">'.esc_html( __( 'Developer Docs', 'admin-help-docs' ) ).' »</a><br><br>'; -
admin-help-docs/trunk/includes/admin/option-settings.php
r3273773 r3344141 136 136 137 137 <?php echo wp_kses( helpdocs_options_tr( 'dashboard_toc', 'Enable Dashboard TOC', 'checkbox', ' Adds a dashboard widget with a table of contents for the docs on the Main Documentation Page.' ), $allowed_html ); ?> 138 139 <?php echo wp_kses( helpdocs_options_tr( 'gutenberg_editor', 'Use Gutenberg Editor', 'checkbox', ' Adds support for the Gutenberg editor for the documentation. Default is the classic editor.' ), $allowed_html ); ?> 140 141 <?php echo wp_kses( helpdocs_options_tr( 'enqueue_frontend_styles', 'Use Frontend Styles', 'checkbox', ' Adds support for your frontend styles in the backend.' ), $allowed_html ); ?> 138 142 139 143 <?php $di = 'dashicons-'; -
admin-help-docs/trunk/includes/classes/class-documentation.php
r3289964 r3344141 115 115 $this->register_taxonomy(); 116 116 117 // Disable block editor 118 add_filter( 'use_block_editor_for_post_type', [ $this, 'disable_gutenberg' ], 10, 2 ); 117 // Either enqueue block editor styles or disable block editor 118 if ( ! get_option( 'helpdocs_gutenberg_editor' ) ) { 119 add_filter( 'use_block_editor_for_post_type', [ $this, 'disable_gutenberg' ], 10, 2 ); 120 } 121 122 // Enqueue back-end styles 123 add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_styles' ] ); 119 124 120 125 // Add the header to the top of the admin list page … … 242 247 243 248 /** 249 * Enqueue admin styles. 250 */ 251 public function enqueue_admin_styles() { 252 // Add block styles 253 if ( get_option( 'helpdocs_gutenberg_editor' ) ) { 254 wp_enqueue_style( 255 'wp-block-library-frontend', 256 includes_url( 'css/dist/block-library/style.css' ), 257 [], 258 false 259 ); 260 } 261 262 // Enqueuing frontend styles 263 if ( get_option( 'helpdocs_enqueue_frontend_styles' ) ) { 264 265 // Add theme styles 266 global $wp_styles; 267 268 do_action( 'wp_enqueue_scripts' ); 269 270 $skip = [ 'wp-block-library', 'wp-admin', 'colors', 'dashicons' ]; 271 272 foreach ( $wp_styles->queue as $handle ) { 273 if ( in_array( $handle, $skip, true ) ) { 274 continue; 275 } 276 277 $style = $wp_styles->registered[ $handle ] ?? null; 278 279 if ( $style && ! wp_style_is( $handle, 'enqueued' ) ) { 280 wp_enqueue_style( 281 $handle, 282 $style->src, 283 $style->deps, 284 $style->ver 285 ); 286 } 287 } 288 289 // Add our own fixes 290 wp_enqueue_style( 291 'helpdocs-backend-styles', 292 HELPDOCS_PLUGIN_CSS_PATH . 'style.css', 293 [], 294 false 295 ); 296 } 297 } // End enqueue_admin_styles() 298 299 300 /** 244 301 * Disable Gutenberg while allowing rest 245 302 * … … 252 309 // Disabled post types 253 310 $disabled_post_types = [ $this->post_type ]; 254 311 255 312 // Change $can_edit to false for any post types in the disabled post types array 256 313 if ( in_array( $post_type, $disabled_post_types, true ) ) { 257 314 $current_status = false; 258 315 } 259 316 260 317 return $current_status; 261 318 } // End disable_gutenberg() … … 489 546 490 547 // Skip separators 491 if ( str_starts_with( $m[2], 'separator' ) ) {548 if ( str_starts_with( $m[2], 'separator' ) || $m[2] == 'hp_separator' || ( isset( $m[4] ) && strpos( $m[4], 'wp-menu-separator' ) !== false ) ) { 492 549 continue; 493 550 } … … 511 568 512 569 // Strip html 513 $site_location_name = wp_strip_all_tags( $site_location_name );570 $site_location_name = $this->strip_admin_menu_counters( $site_location_name ); 514 571 515 572 // Add the parent location … … 545 602 546 603 // Strip html 547 $sublocation_name = wp_strip_all_tags( $sublocation_name );604 $sublocation_name = $this->strip_admin_menu_counters( $sublocation_name ); 548 605 549 606 // Get the url … … 921 978 922 979 } // End get_admin_menu_item_url() 980 981 982 /** 983 * Strip admin menu counters from a label 984 * 985 * @param string $label 986 * @return string 987 */ 988 private function strip_admin_menu_counters( $label ) { 989 if ( !is_string( $label ) ) { 990 return $label; 991 } 992 993 // Remove update badges (nested spans included) 994 $label = preg_replace( '/<span[^>]*class="[^"]*\b(update-plugins|awaiting-mod|count-[0-9]+|bubble)\b[^"]*"[^>]*>.*?<\/span>/i', '', $label ); 995 996 // Remove any remaining HTML 997 $label = wp_strip_all_tags( $label ); 998 999 // Decode entities then trim 1000 $label = trim( html_entity_decode( $label, ENT_QUOTES, 'UTF-8' ) ); 1001 1002 // Remove trailing counts like "85", "(85)", "[85]", "{85}" 1003 $label = preg_replace( '/(?:\s*[\(\[\{]\s*\d+\s*[\)\]\}])|\s*\d+\s*$/', '', $label ); 1004 1005 return trim( $label ); 1006 } // End strip_admin_menu_counters() 923 1007 924 1008 … … 979 1063 980 1064 // Set the child default name that is not changed 981 $child_default_name = $ s[0];1065 $child_default_name = $this->strip_admin_menu_counters( $s[0] ); 982 1066 983 1067 // Set the child name … … 1013 1097 $parent = $site_location_names[ $m[2] ]; 1014 1098 } else { 1015 $parent = $ m[0];1099 $parent = $this->strip_admin_menu_counters( $m[0] ); 1016 1100 } 1017 1101 } … … 1035 1119 $parent = $site_location_names[ base64_decode( $url ) ]; 1036 1120 } else { 1037 $parent = $ m[0];1121 $parent = $this->strip_admin_menu_counters( $m[0] ); 1038 1122 } 1039 1123 } … … 1049 1133 $parent = $site_location_names[ base64_decode( $url ) ]; 1050 1134 } else { 1051 $parent = $ m[0];1135 $parent = $this->strip_admin_menu_counters( $m[0] ); 1052 1136 } 1053 1137 } -
admin-help-docs/trunk/readme.txt
r3305247 r3344141 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.4. 07 Stable tag: 1.4.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 75 75 76 76 == Changelog == 77 = 1.4.1 = 78 * Update: Added support for enqueuing frontend stylesheets in the backend, option to enable it in settings 79 * Update: Added support for Gutenberg editor, option to enable it in settings (props @derek for suggestion) 80 77 81 = 1.4.0 = 78 82 * Update: Removed feedback form since it's not being utilized
Note: See TracChangeset
for help on using the changeset viewer.