• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / duplicate-post / 14725616456

29 Apr 2025 07:21AM UTC coverage: 45.469% (-4.7%) from 50.122%
14725616456

push

github

web-flow
Merge pull request #402 from Yoast/feature/drop-php-7.2-7.3

Drop support for Php 7.2 and 7.3

1164 of 2560 relevant lines covered (45.47%)

1.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/admin/views/options.php
1
<?php
2

3
namespace Yoast\WP\Duplicate_Post\Admin\Views;
4

5
if ( ! \defined( 'DUPLICATE_POST_CURRENT_VERSION' ) ) {
×
6
        \header( 'Status: 403 Forbidden' );
×
7
        \header( 'HTTP/1.1 403 Forbidden' );
×
8
        exit();
×
9
}
10

11
?>
12
<div class="wrap">
×
13
        <h1>
×
14
                <?php \esc_html_e( 'Duplicate Post Options', 'duplicate-post' ); ?>
×
15
        </h1>
×
16

17
        <form id="duplicate_post_settings_form" method="post" action="options.php" style="clear: both">
×
18
                <?php \settings_fields( 'duplicate_post_group' ); ?>
×
19

20
                <header role="tablist" aria-label="
×
21
                <?php
×
22
                        /* translators: Hidden accessibility text. */
23
                        \esc_attr_e( 'Settings sections', 'duplicate-post' );
×
24
                ?>
25
                " class="nav-tab-wrapper">
×
26
                        <button
×
27
                                        type="button"
×
28
                                        role="tab"
×
29
                                        class="nav-tab nav-tab-active"
×
30
                                        aria-selected="true"
×
31
                                        aria-controls="what-tab"
×
32
                                        id="what"><?php \esc_html_e( 'What to copy', 'duplicate-post' ); ?>
×
33
                        </button>
×
34
                        <button
×
35
                                        type="button"
×
36
                                        role="tab"
×
37
                                        class="nav-tab"
×
38
                                        aria-selected="false"
×
39
                                        aria-controls="who-tab"
×
40
                                        id="who"
×
41
                                        tabindex="-1"><?php \esc_html_e( 'Permissions', 'duplicate-post' ); ?>
×
42
                        </button>
×
43
                        <button
×
44
                                        type="button"
×
45
                                        role="tab"
×
46
                                        class="nav-tab"
×
47
                                        aria-selected="false"
×
48
                                        aria-controls="where-tab"
×
49
                                        id="where"
×
50
                                        tabindex="-1"><?php \esc_html_e( 'Display', 'duplicate-post' ); ?>
×
51
                        </button>
×
52
                </header>
×
53

54
                <section
×
55
                                tabindex="0"
×
56
                                role="tabpanel"
×
57
                                id="what-tab"
×
58
                                aria-labelledby="what">
×
59
                        <h2 class="hide-if-js"><?php \esc_html_e( 'What to copy', 'duplicate-post' ); ?></h2>
×
60
                        <table class="form-table" role="presentation">
61
                                <tr>
62
                                        <th scope="row"><?php \esc_html_e( 'Post/page elements to copy', 'duplicate-post' ); ?></th>
×
63
                                        <td>
64
                                                <fieldset>
65
                                                        <legend class="screen-reader-text"><?php \esc_html_e( 'Post/page elements to copy', 'duplicate-post' ); ?></legend>
×
66
                                                        <?php
67
                                                        // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
68
                                                        echo $this->generate_tab_inputs( 'what-to-copy', 'elements-to-copy' );
×
69
                                                        ?>
70
                                                </fieldset>
×
71
                                        </td>
×
72
                                </tr>
×
73
                                <tr>
×
74
                                        <th scope="row">
×
75
                                                <label for="duplicate-post-title-prefix"><?php \esc_html_e( 'Title prefix', 'duplicate-post' ); ?></label>
×
76
                                        </th>
77
                                        <td>
78
                                                <?php
79
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
80
                                                echo $this->generate_input( 'duplicate_post_title_prefix' );
×
81
                                                ?>
82
                                        </td>
×
83
                                </tr>
×
84
                                <tr>
×
85
                                        <th scope="row">
×
86
                                                <label for="duplicate-post-title-suffix"><?php \esc_html_e( 'Title suffix', 'duplicate-post' ); ?></label>
×
87
                                        </th>
88
                                        <td>
89
                                                <?php
90
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
91
                                                echo $this->generate_input( 'duplicate_post_title_suffix' );
×
92
                                                ?>
93
                                        </td>
×
94
                                </tr>
×
95
                                <tr>
×
96
                                        <th scope="row">
×
97
                                                <label for="duplicate-post-increase-menu-order-by"><?php \esc_html_e( 'Increase menu order by', 'duplicate-post' ); ?></label>
×
98
                                        </th>
99
                                        <td>
100
                                                <?php
101
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
102
                                                echo $this->generate_input( 'duplicate_post_increase_menu_order_by' );
×
103
                                                ?>
104

105
                                        </td>
×
106
                                </tr>
×
107
                                <tr>
×
108
                                        <th scope="row">
×
109
                                                <label for="duplicate-post-blacklist"><?php \esc_html_e( 'Do not copy these fields', 'duplicate-post' ); ?></label>
×
110
                                        </th>
111
                                        <td id="textfield">
112
                                                <?php
113
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
114
                                                echo $this->generate_input( 'duplicate_post_blacklist' );
×
115
                                                ?>
116
                                        </td>
×
117
                                </tr>
×
118
                                <tr>
×
119
                                        <th scope="row">
×
120
                                                <?php \esc_html_e( 'Do not copy these taxonomies', 'duplicate-post' ); ?><br/>
×
121
                                        </th>
122
                                        <td>
123
                                                <fieldset>
124
                                                        <legend class="screen-reader-text"><?php \esc_html_e( 'Do not copy these taxonomies', 'duplicate-post' ); ?></legend>
×
125
                                                        <?php
126
                                                        // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
127
                                                        echo $this->generate_input( 'duplicate_post_taxonomies_blacklist' );
×
128
                                                        ?>
129
                                                        <button type="button" class="button-link hide-if-no-js toggle-private-taxonomies"
×
130
                                                                        aria-expanded="false">
×
131
                                                                <?php \esc_html_e( 'Show/hide private taxonomies', 'duplicate-post' ); ?>
×
132
                                                        </button>
×
133
                                                </fieldset>
×
134
                                        </td>
×
135
                                </tr>
×
136
                        </table>
×
137
                </section>
×
138
                <section
×
139
                                tabindex="0"
×
140
                                role="tabpanel"
×
141
                                id="who-tab"
×
142
                                aria-labelledby="who"
×
143
                                hidden="hidden">
×
144
                        <h2 class="hide-if-js"><?php \esc_html_e( 'Permissions', 'duplicate-post' ); ?></h2>
×
145
                        <table class="form-table" role="presentation">
146
                                <?php if ( \current_user_can( 'promote_users' ) ) { ?>
×
147
                                        <tr>
×
148
                                                <th scope="row"><?php \esc_html_e( 'Roles allowed to copy', 'duplicate-post' ); ?></th>
×
149
                                                <td>
150
                                                        <fieldset>
151
                                                                <legend class="screen-reader-text"><?php \esc_html_e( 'Roles allowed to copy', 'duplicate-post' ); ?></legend>
×
152
                                                                <?php
153
                                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
154
                                                                echo $this->generate_input( 'duplicate_post_roles' );
×
155
                                                                ?>
156
                                                                <p>
×
157
                                                                        <?php \esc_html_e( 'Warning: users will be able to copy, rewrite and republish all posts, even those of other users.', 'duplicate-post' ); ?>
×
158
                                                                        <br/>
×
159
                                                                        <?php \esc_html_e( 'Passwords and contents of password-protected posts may become visible to undesired users and visitors.', 'duplicate-post' ); ?>
×
160
                                                                </p>
×
161
                                                        </fieldset>
×
162
                                                </td>
×
163
                                        </tr>
×
164
                                <?php } ?>
×
165
                                <tr>
×
166
                                        <th scope="row"><?php \esc_html_e( 'Enable for these post types', 'duplicate-post' ); ?>
×
167
                                        </th>
×
168
                                        <td>
×
169
                                                <fieldset>
×
170
                                                        <legend class="screen-reader-text"><?php \esc_html_e( 'Enable for these post types', 'duplicate-post' ); ?></legend>
×
171
                                                        <?php
172
                                                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
173
                                                        echo $this->generate_input( 'duplicate_post_types_enabled' );
×
174
                                                        ?>
175
                                                        <p>
×
176
                                                                <?php \esc_html_e( 'Select the post types you want the plugin to be enabled for.', 'duplicate-post' ); ?>
×
177
                                                                <br/>
×
178
                                                                <?php \esc_html_e( 'Whether the links are displayed for custom post types registered by themes or plugins depends on their use of standard WordPress UI elements.', 'duplicate-post' ); ?>
×
179
                                                        </p>
×
180
                                                </fieldset>
×
181
                                        </td>
×
182
                                </tr>
×
183
                        </table>
×
184
                </section>
×
185
                <section
×
186
                                tabindex="0"
×
187
                                role="tabpanel"
×
188
                                id="where-tab"
×
189
                                aria-labelledby="where"
×
190
                                hidden="hidden">
×
191
                        <h2 class="hide-if-js"><?php \esc_html_e( 'Display', 'duplicate-post' ); ?></h2>
×
192
                        <table class="form-table" role="presentation">
193
                                <tr>
194
                                        <th scope="row"><?php \esc_html_e( 'Show these links', 'duplicate-post' ); ?></th>
×
195
                                        <td>
196
                                                <fieldset>
197
                                                        <?php
198
                                                        // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
199
                                                        echo $this->generate_tab_inputs( 'display', 'show-links' );
×
200
                                                        ?>
201
                                                </fieldset>
×
202
                                        </td>
×
203
                                </tr>
×
204

205
                                <tr>
×
206
                                        <th scope="row"><?php \esc_html_e( 'Show links in', 'duplicate-post' ); ?></th>
×
207
                                        <td>
208
                                                <fieldset>
209
                                                        <?php
210
                                                        // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
211
                                                        echo $this->generate_tab_inputs( 'display', 'show-links-in' );
×
212
                                                        ?>
213
                                                </fieldset>
×
214
                                                <p>
×
215
                                                        <?php \esc_html_e( 'Whether the links are displayed for custom post types registered by themes or plugins depends on their use of standard WordPress UI elements.', 'duplicate-post' ); ?>
×
216
                                                        <br/>
×
217
                                                        <?php
×
218
                                                        \printf(
×
219
                                                                /* translators: 1: Code start tag, 2: Code closing tag, 3: Link start tag to the template tag documentation, 4: Link closing tag. */
220
                                                                \esc_html__( 'You can also use the template tag %1$sduplicate_post_clone_post_link( $link, $before, $after, $id )%2$s. %3$sMore info on the template tag%4$s.', 'duplicate-post' ),
×
221
                                                                '<code>',
×
222
                                                                '</code>',
×
223
                                                                '<a href="' . \esc_url( 'https://developer.yoast.com/duplicate-post/functions-template-tags#duplicate_post_clone_post_link' ) . '">',
×
224
                                                                '</a>'
×
225
                                                        );
×
226
                                                        ?>
227
                                                </p>
×
228
                                        </td>
×
229
                                </tr>
×
230
                                <tr>
×
231
                                        <th scope="row"><?php \esc_html_e( 'Show original item:', 'duplicate-post' ); ?></th>
×
232
                                        <td>
233
                                                <?php
234
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
235
                                                echo $this->generate_tab_inputs( 'display', 'show-original' );
×
236
                                                ?>
237
                                        </td>
×
238
                                </tr>
×
239
                                <tr>
×
240
                                        <th scope="row"><?php \esc_html_e( 'Welcome notice', 'duplicate-post' ); ?></th>
×
241
                                        <td>
242
                                                <?php
243
                                                // phpcs:ignore WordPress.Security.EscapeOutput -- Already escapes correctly.
244
                                                echo $this->generate_input( 'duplicate_post_show_notice' );
×
245
                                                ?>
246
                                        </td>
×
247
                                </tr>
×
248
                        </table>
×
249
                </section>
×
250
                <p class="submit">
×
251
                        <input type="submit" class="button button-primary" value="<?php \esc_attr_e( 'Save changes', 'duplicate-post' ); ?>"/>
×
252
                </p>
253
        </form>
254
</div>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc