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

Diff for: composer.json

+2
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
}

Diff for: docs/bin/update-markdown-links.php

+46
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 );

Diff for: docs/concepts/index.md

+2-2
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

Diff for: docs/features/fields/index.md

+24-24
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

Diff for: docs/features/index.md

+27-27
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

Diff for: docs/getting-started/index.md

+2-2
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

Diff for: docs/getting-started/quick-start.md

+3-3
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)

Diff for: docs/scf.md

+1-1
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.

Diff for: docs/tutorials/index.md

+3-3
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

Diff for: includes/admin/views/acf-field-group/fields.php

+1-1
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
?>

Diff for: includes/fields.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -414,40 +414,40 @@ function acf_get_pro_field_types() {
414414
'clone' => array(
415415
'name' => 'clone',
416416
'label' => _x( 'Clone', 'noun', 'secure-custom-fields' ),
417-
'doc_url' => 'https://www.advancedcustomfields.com/resources/clone/',
417+
'doc_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/clone/',
418418
'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-clone.png',
419419
'description' => __( 'This allows you to select and display existing fields. It does not duplicate any fields in the database, but loads and displays the selected fields at run-time. The Clone field can either replace itself with the selected fields or display the selected fields as a group of subfields.', 'secure-custom-fields' ),
420-
'tutorial_url' => 'https://www.advancedcustomfields.com/resources/how-to-use-the-clone-field/',
420+
'tutorial_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/clone/clone-tutorial/',
421421
'category' => 'layout',
422422
'pro' => false,
423423
),
424424
'flexible_content' => array(
425425
'name' => 'flexible_content',
426426
'label' => __( 'Flexible Content', 'secure-custom-fields' ),
427-
'doc_url' => 'https://www.advancedcustomfields.com/resources/flexible-content/',
427+
'doc_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/flexible-content/',
428428
'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-flexible-content.png',
429429
'description' => __( 'This provides a simple, structured, layout-based editor. The Flexible Content field allows you to define, create and manage content with total control by using layouts and subfields to design the available blocks.', 'secure-custom-fields' ),
430-
'tutorial_url' => 'https://www.advancedcustomfields.com/resources/building-layouts-with-the-flexible-content-field-in-a-theme/',
430+
'tutorial_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/flexible-content/flexible-content-tutorial/',
431431
'category' => 'layout',
432432
'pro' => false,
433433
),
434434
'gallery' => array(
435435
'name' => 'gallery',
436436
'label' => __( 'Gallery', 'secure-custom-fields' ),
437-
'doc_url' => 'https://www.advancedcustomfields.com/resources/gallery/',
437+
'doc_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/gallery/',
438438
'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-gallery.png',
439439
'description' => __( 'This provides an interactive interface for managing a collection of attachments. Most settings are similar to the Image field type. Additional settings allow you to specify where new attachments are added in the gallery and the minimum/maximum number of attachments allowed.', 'secure-custom-fields' ),
440-
'tutorial_url' => 'https://www.advancedcustomfields.com/resources/how-to-use-the-gallery-field/',
440+
'tutorial_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/gallery/gallery-tutorial/',
441441
'category' => 'content',
442442
'pro' => false,
443443
),
444444
'repeater' => array(
445445
'name' => 'repeater',
446446
'label' => __( 'Repeater', 'secure-custom-fields' ),
447-
'doc_url' => 'https://www.advancedcustomfields.com/resources/repeater/',
447+
'doc_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/repeater/',
448448
'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-repeater.png',
449449
'description' => __( 'This provides a solution for repeating content such as slides, team members, and call-to-action tiles, by acting as a parent to a set of subfields which can be repeated again and again.', 'secure-custom-fields' ),
450-
'tutorial_url' => 'https://www.advancedcustomfields.com/resources/repeater/how-to-use-the-repeater-field/',
450+
'tutorial_url' => 'https://developer.wordpress.org/secure-custom-fields/features/fields/repeater/repeater-tutorial/',
451451
'category' => 'layout',
452452
'pro' => false,
453453
),

Diff for: includes/fields/class-acf-field-accordion.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ function initialize() {
2525
$this->category = 'layout';
2626
$this->description = __( 'Allows you to group and organize custom fields into collapsable panels that are shown while editing content. Useful for keeping large datasets tidy.', 'secure-custom-fields' );
2727
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-accordion.png';
28-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/accordion/';
28+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/accordion/';
29+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/accordion/accordion-tutorial/';
2930
$this->supports = array(
3031
'required' => false,
3132
'bindings' => false,

Diff for: includes/fields/class-acf-field-button-group.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ function initialize() {
2424
$this->category = 'choice';
2525
$this->description = __( 'A group of buttons with values that you specify, users can choose one option from the values provided.', 'secure-custom-fields' );
2626
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-button-group.png';
27-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/button-group/';
27+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/button-group/';
28+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/button-group/button-group-tutorial/';
2829
$this->defaults = array(
2930
'choices' => array(),
3031
'default_value' => '',

Diff for: includes/fields/class-acf-field-checkbox.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function initialize() {
2323
$this->category = 'choice';
2424
$this->description = __( 'A group of checkbox inputs that allow the user to select one, or multiple values that you specify.', 'secure-custom-fields' );
2525
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-checkbox.png';
26-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/checkbox/';
26+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/checkbox/';
27+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/checkbox/checkbox-tutorial/';
2728
$this->defaults = array(
2829
'layout' => 'vertical',
2930
'choices' => array(),

Diff for: includes/fields/class-acf-field-clone.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function initialize() {
3535
$this->category = 'layout';
3636
$this->description = __( 'Allows you to select and display existing fields. It does not duplicate any fields in the database, but loads and displays the selected fields at run-time. The Clone field can either replace itself with the selected fields or display the selected fields as a group of subfields.', 'secure-custom-fields' );
3737
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-clone.png';
38-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/clone/';
39-
$this->tutorial_url = 'https://www.advancedcustomfields.com/resources/how-to-use-the-clone-field/';
38+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/clone/';
39+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/clone/clone-tutorial/';
4040
$this->pro = true;
4141
$this->supports = array( 'bindings' => false );
4242
$this->defaults = array(

Diff for: includes/fields/class-acf-field-color_picker.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function initialize() {
2323
$this->category = 'advanced';
2424
$this->description = __( 'An interactive UI for selecting a color, or specifying a Hex value.', 'secure-custom-fields' );
2525
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-color-picker.png';
26-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/color-picker/';
26+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/color-picker/';
27+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/color-picker/color-picker-tutorial/';
2728
$this->defaults = array(
2829
'default_value' => '',
2930
'enable_opacity' => false,

Diff for: includes/fields/class-acf-field-date_picker.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function initialize() {
2323
$this->category = 'advanced';
2424
$this->description = __( 'An interactive UI for picking a date. The date return format can be customized using the field settings.', 'secure-custom-fields' );
2525
$this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-date-picker.png';
26-
$this->doc_url = 'https://www.advancedcustomfields.com/resources/date-picker/';
26+
$this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/date-picker/';
27+
$this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/date-picker/date-picker-tutorial/';
2728
$this->defaults = array(
2829
'display_format' => 'd/m/Y',
2930
'return_format' => 'd/m/Y',

0 commit comments

Comments
 (0)