Skip to content

Commit ef7ff39

Browse files
committed
Docs: update links to work on DevHub
1 parent 6cd5e74 commit ef7ff39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+193
-112
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
},
2121
"scripts": {
2222
"docs-manifest": "php docs/bin/generate-manifest.php",
23+
"docs-links": "php docs/bin/update-markdown-links.php",
2324
"docs": [
25+
"@docs-links",
2426
"@docs-manifest"
2527
]
2628
}

docs/bin/update-markdown-links.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env php
2+
<?php
3+
/**
4+
* Update markdown links to remove .md extensions and /index paths.
5+
*
6+
* @package wordpress/secure-custom-fields
7+
*/
8+
9+
// phpcs:disable WordPress.WP.AlternativeFunctions -- Using native PHP functions as this is a CLI script.
10+
11+
$root = dirname( __DIR__ );
12+
$paths = array(
13+
$root . '/*.md',
14+
$root . '/*/*.md',
15+
$root . '/*/*/*.md',
16+
$root . '/*/*/*/*.md',
17+
);
18+
19+
$updated_files = 0;
20+
$updated_links = 0;
21+
22+
foreach ( $paths as $path_pattern ) {
23+
foreach ( glob( $path_pattern ) as $file ) {
24+
if ( basename( $file ) === 'README.md' || basename( $file ) === 'META.md' ) {
25+
continue;
26+
}
27+
28+
$content = file_get_contents( $file );
29+
$original = $content;
30+
31+
// Replace links ending in .md
32+
$content = preg_replace( '/\]\(([^)]+)\.md\)/', ']($1)', $content );
33+
34+
// Replace links ending in /index
35+
$content = preg_replace( '/\]\(([^)]+)\/index\)/', ']($1)', $content );
36+
37+
if ( $content !== $original ) {
38+
file_put_contents( $file, $content );
39+
++$updated_files;
40+
$updated_links += substr_count( $original, '.md)' ) + substr_count( $original, '/index)' );
41+
}
42+
}
43+
}
44+
45+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
46+
printf( 'Updated %d links in %d files%s', $updated_links, $updated_files, PHP_EOL );

docs/concepts/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This section covers the fundamental concepts and architecture of Secure Custom F
44

55
## In This Section
66

7-
- [Architecture](architecture.md) - Understanding SCF's internal structure
8-
- [Security](security.md) - Security principles and best practices
7+
- [Architecture](architecture) - Understanding SCF's internal structure
8+
- [Security](security) - Security principles and best practices
99

1010
## Overview
1111

docs/features/fields/index.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ Each field type has its own documentation and tutorial showing how to implement
66

77
## Available Fields
88

9-
- [Accordion](accordion/index.md) - Group fields into collapsible sections
10-
- [Clone](clone/index.md) - Duplicate and reuse existing field configurations
11-
- [Button Group](button-group/index.md) - Select one option from a group of buttons
12-
- [Checkbox](checkbox/index.md) - Select one or more choices
13-
- [Color Picker](color-picker/index.md) - Choose colors with a visual picker
14-
- [Date Picker](date-picker/index.md) - Select dates from a calendar
15-
- [Date/Time Picker](date-time-picker/index.md) - Select dates and times
16-
- [Email](email/index.md) - Input and validate email addresses
17-
- [File](file/index.md) - Upload and manage files
18-
- [Flexible Content](flexible-content/index.md) - Create flexible content layouts
19-
- [Gallery](gallery/index.md) - Manage collections of images
20-
- [Google Map](google-map/index.md) - Add location data with Google Maps
21-
- [Group](group/index.md) - Group fields together
22-
- [Icon Picker](icon-picker/index.md) - Select from available icons
23-
- [Image](image/index.md) - Upload and manage images
24-
- [Link](link/index.md) - Create links with titles and targets
25-
- [Message](message/index.md) - Display instructional text
26-
- [Number](number/index.md) - Input numeric values
27-
- [oEmbed](oembed/index.md) - Embed external content
28-
- [Page Link](page-link/index.md) - Link to internal content
29-
- [Password](password/index.md) - Securely input passwords
30-
- [Post Object](post-object/index.md) - Relate to other posts
31-
- [Radio](radio/index.md) - Select one choice from options
32-
- [Range](range/index.md) - Select a numeric value with a slider
9+
- [Accordion](accordion) - Group fields into collapsible sections
10+
- [Clone](clone) - Duplicate and reuse existing field configurations
11+
- [Button Group](button-group) - Select one option from a group of buttons
12+
- [Checkbox](checkbox) - Select one or more choices
13+
- [Color Picker](color-picker) - Choose colors with a visual picker
14+
- [Date Picker](date-picker) - Select dates from a calendar
15+
- [Date/Time Picker](date-time-picker) - Select dates and times
16+
- [Email](email) - Input and validate email addresses
17+
- [File](file) - Upload and manage files
18+
- [Flexible Content](flexible-content) - Create flexible content layouts
19+
- [Gallery](gallery) - Manage collections of images
20+
- [Google Map](google-map) - Add location data with Google Maps
21+
- [Group](group) - Group fields together
22+
- [Icon Picker](icon-picker) - Select from available icons
23+
- [Image](image) - Upload and manage images
24+
- [Link](link) - Create links with titles and targets
25+
- [Message](message) - Display instructional text
26+
- [Number](number) - Input numeric values
27+
- [oEmbed](oembed) - Embed external content
28+
- [Page Link](page-link) - Link to internal content
29+
- [Password](password) - Securely input passwords
30+
- [Post Object](post-object) - Relate to other posts
31+
- [Radio](radio) - Select one choice from options
32+
- [Range](range) - Select a numeric value with a slider

docs/features/index.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This section details all features available in Secure Custom Fields.
44

55
## Core Features
66

7-
- [Post Types](post-types.md) - Create and manage custom post types
8-
- [Fields](fields/index.md) - Available field types and their usage
9-
- [API](api.md) - Programmatic access and integration
7+
- [Post Types](post-types) - Create and manage custom post types
8+
- [Fields](fields) - Available field types and their usage
9+
- [API](api) - Programmatic access and integration
1010

1111
## Feature Categories
1212

@@ -27,27 +27,27 @@ This section details all features available in Secure Custom Fields.
2727

2828
## Available Fields
2929

30-
- [Accordion](fields/accordion/index.md) - Group fields into collapsible sections
31-
- [Button Group](fields/button-group/index.md) - Select one option from a group of buttons
32-
- [Checkbox](fields/checkbox/index.md) - Select one or more choices
33-
- [Clone](fields/clone/index.md) - Duplicate and reuse existing field configurations
34-
- [Color Picker](fields/color-picker/index.md) - Choose colors with a visual picker
35-
- [Date Picker](fields/date-picker/index.md) - Select dates from a calendar
36-
- [Date/Time Picker](fields/date-time-picker/index.md) - Select dates and times
37-
- [Email](fields/email/index.md) - Input and validate email addresses
38-
- [File](fields/file/index.md) - Upload and manage files
39-
- [Flexible Content](fields/flexible-content/index.md) - Create flexible content layouts
40-
- [Gallery](fields/gallery/index.md) - Manage collections of images
41-
- [Google Map](fields/google-map/index.md) - Add location data with Google Maps
42-
- [Group](fields/group/index.md) - Group fields together
43-
- [Icon Picker](fields/icon-picker/index.md) - Select from available icons
44-
- [Image](fields/image/index.md) - Upload and manage images
45-
- [Link](fields/link/index.md) - Create links with titles and targets
46-
- [Message](fields/message/index.md) - Display instructional text
47-
- [Number](fields/number/index.md) - Input numeric values
48-
- [oEmbed](fields/oembed/index.md) - Embed external content
49-
- [Page Link](fields/page-link/index.md) - Link to internal content
50-
- [Password](fields/password/index.md) - Securely input passwords
51-
- [Post Object](fields/post-object/index.md) - Relate to other posts
52-
- [Radio](fields/radio/index.md) - Select one choice from options
53-
- [Range](fields/range/index.md) - Select a numeric value with a slider
30+
- [Accordion](fields/accordion) - Group fields into collapsible sections
31+
- [Button Group](fields/button-group) - Select one option from a group of buttons
32+
- [Checkbox](fields/checkbox) - Select one or more choices
33+
- [Clone](fields/clone) - Duplicate and reuse existing field configurations
34+
- [Color Picker](fields/color-picker) - Choose colors with a visual picker
35+
- [Date Picker](fields/date-picker) - Select dates from a calendar
36+
- [Date/Time Picker](fields/date-time-picker) - Select dates and times
37+
- [Email](fields/email) - Input and validate email addresses
38+
- [File](fields/file) - Upload and manage files
39+
- [Flexible Content](fields/flexible-content) - Create flexible content layouts
40+
- [Gallery](fields/gallery) - Manage collections of images
41+
- [Google Map](fields/google-map) - Add location data with Google Maps
42+
- [Group](fields/group) - Group fields together
43+
- [Icon Picker](fields/icon-picker) - Select from available icons
44+
- [Image](fields/image) - Upload and manage images
45+
- [Link](fields/link) - Create links with titles and targets
46+
- [Message](fields/message) - Display instructional text
47+
- [Number](fields/number) - Input numeric values
48+
- [oEmbed](fields/oembed) - Embed external content
49+
- [Page Link](fields/page-link) - Link to internal content
50+
- [Password](fields/password) - Securely input passwords
51+
- [Post Object](fields/post-object) - Relate to other posts
52+
- [Radio](fields/radio) - Select one choice from options
53+
- [Range](fields/range) - Select a numeric value with a slider

docs/getting-started/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This section helps you get up and running with Secure Custom Fields (SCF). Wheth
44

55
## In This Section
66

7-
- [Installation](installation.md) - How to install and activate SCF
8-
- [Quick Start](quick-start.md) - Create your first custom field group in minutes
7+
- [Installation](installation) - How to install and activate SCF
8+
- [Quick Start](quick-start) - Create your first custom field group in minutes
99

1010
## Prerequisites
1111

docs/getting-started/quick-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ Let's create a simple author bio field group:
2626

2727
## Next Steps
2828

29-
- Learn about [field types](../features/fields.md)
30-
- Explore [advanced features](../features/README.md)
31-
- Read the [security guidelines](../concepts/security.md)
29+
- Learn about [field types](../features/fields)
30+
- Explore [advanced features](../features/README)
31+
- Read the [security guidelines](../concepts/security)

docs/scf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Secure Custom Fields is a WordPress plugin that allows you to create custom fiel
44

55
## Features
66

7-
- [Fields](features/fields/index.md) - Create and manage custom fields.
7+
- [Fields](features/fields) - Create and manage custom fields.

docs/tutorials/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Step-by-step guides for working with Secure Custom Fields.
44

55
## Getting Started
66

7-
- [Creating Your First Post Type](first-post-type.md) - Basic post type setup
8-
- [Field Group Basics](field-group-basics.md) - Creating and configuring field groups
9-
- [Working with Fields](working-with-fields.md) - Using different field types
7+
- [Creating Your First Post Type](first-post-type) - Basic post type setup
8+
- [Field Group Basics](field-group-basics) - Creating and configuring field groups
9+
- [Working with Fields](working-with-fields) - Using different field types
1010

1111
## Advanced Topics
1212

includes/admin/views/acf-field-group/fields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
sprintf(
7272
/* translators: %s url to field types list */
7373
__( 'Choose from over 30 field types. <a href="%s" target="_blank">Learn more</a>.', 'secure-custom-fields' ),
74-
'https://www.advancedcustomfields.com/resources/'
74+
'https://developer.wordpress.org/secure-custom-fields/features/fields/'
7575
)
7676
);
7777
?>

0 commit comments

Comments
 (0)