Skip to content

Commit 6edbe1d

Browse files
committed
Add attachment pages setting to media options
1 parent 2eeea95 commit 6edbe1d

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/wp-admin/options-media.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@
9898
<?php do_settings_fields( 'media', 'default' ); ?>
9999
</table>
100100

101+
<h2 class="title"><?php _e( 'Attachment pages' ); ?></h2>
102+
<table class="form-table" role="presentation">
103+
<tr>
104+
<th scope="row"><?php _e( 'Attachment pages' ); ?></th>
105+
<td>
106+
<fieldset>
107+
<legend class="screen-reader-text"><span><?php _e( 'Attachment pages' ); ?></span></legend>
108+
<label for="wp_attachment_pages_enabled">
109+
<input name="wp_attachment_pages_enabled" type="checkbox" id="wp_attachment_pages_enabled" value="1" <?php checked( '1', (string) get_option( 'wp_attachment_pages_enabled' ) ); ?> />
110+
<?php _e( 'Enable attachment pages for uploaded media files' ); ?>
111+
</label>
112+
<p class="description"><?php _e( 'When disabled, attachment page URLs redirect to the media file URL.' ); ?></p>
113+
</fieldset>
114+
</td>
115+
</tr>
116+
</table>
117+
101118
<?php
102119
/**
103120
* @global array $wp_settings

src/wp-admin/options.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
'image_default_size',
139139
'image_default_align',
140140
'image_default_link_type',
141+
'wp_attachment_pages_enabled',
141142
),
142143
'reading' => array(
143144
'posts_per_page',

0 commit comments

Comments
 (0)