PluginProbe ʕ •ᴥ•ʔ
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.5
27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 19.1 19.10 19.11 19.12 19.13 19.14 19.2 19.3 19.4 19.5 19.5.1 19.6 19.6.1 19.7 19.7.1 19.7.2 19.8 19.9 20.0 20.1 20.10 20.11 20.12 20.13 20.2 20.2.1 20.3 20.4 20.5 20.6 20.7 20.8 20.9 21.0 21.1 21.2 21.3 21.4 21.5 21.6 21.7 21.8 21.8.1 21.9 21.9.1 22.0 22.1 22.2 22.3 22.4 22.5 22.6 22.7 22.8 22.9 23.0 23.1 23.2 23.3 23.4 23.5 23.6 23.7 23.8 23.9 24.0 24.1 24.2 24.3 24.4 24.5 24.6 24.7 24.8 24.8.1 24.9 25.0 25.1 25.2 25.3 25.3.1 25.4 25.5 25.6 25.7 25.8 25.9 26.0 26.1 26.1.1 26.2 26.3 26.4 26.5 26.6 26.7 26.8 26.9 27.0 27.1 27.1.1 27.2 27.3 27.4
wordpress-seo / admin / views / tool-bulk-editor.php
wordpress-seo / admin / views Last commit date
form 5 years ago tabs 3 months ago class-yoast-feature-toggle.php 1 year ago class-yoast-feature-toggles.php 3 months ago class-yoast-input-select.php 2 years ago class-yoast-integration-toggles.php 3 months ago interface-yoast-form-element.php 8 years ago js-templates-primary-term.php 3 months ago paper-collapsible.php 3 months ago partial-notifications-errors.php 3 months ago partial-notifications-template.php 3 months ago partial-notifications-warnings.php 3 months ago redirects.php 10 months ago tool-bulk-editor.php 3 months ago tool-file-editor.php 3 months ago tool-import-export.php 1 year ago
tool-bulk-editor.php
121 lines
1 <?php
2 /**
3 * WPSEO plugin file.
4 *
5 * @package WPSEO\Admin
6 * @since 1.5.0
7 */
8
9 if ( ! defined( 'WPSEO_VERSION' ) ) {
10 header( 'Status: 403 Forbidden' );
11 header( 'HTTP/1.1 403 Forbidden' );
12 exit();
13 }
14
15 /**
16 * Sanitizes the parameters that have been sent.
17 *
18 * @return array The sanitized fields.
19 */
20 function yoast_free_bulk_sanitize_input_fields() {
21 $possible_params = [
22 'type',
23 'paged',
24 'post_type_filter',
25 'post_status',
26 'order',
27 'orderby',
28 ];
29
30 $input_get = [];
31 foreach ( $possible_params as $param_name ) {
32 if ( isset( $_GET[ $param_name ] ) ) {
33 $input_get[ $param_name ] = sanitize_text_field( wp_unslash( $_GET[ $param_name ] ) );
34 }
35 }
36
37 return $input_get;
38 }
39
40 $yoast_free_input_fields = yoast_free_bulk_sanitize_input_fields();
41
42 // Verifies the nonce.
43 if ( ! empty( $yoast_free_input_fields ) ) {
44 check_admin_referer( 'bulk-editor-table', 'nonce' );
45 }
46
47 // If type is empty, fill it with value of first tab (title).
48 if ( ! isset( $yoast_free_input_fields['type'] ) ) {
49 $yoast_free_input_fields['type'] = 'title';
50 }
51
52 $yoast_bulk_editor_arguments = [
53 'input_fields' => $yoast_free_input_fields,
54 'nonce' => wp_create_nonce( 'bulk-editor-table' ),
55 ];
56
57 $wpseo_bulk_titles_table = new WPSEO_Bulk_Title_Editor_List_Table( $yoast_bulk_editor_arguments );
58 $wpseo_bulk_description_table = new WPSEO_Bulk_Description_List_Table( $yoast_bulk_editor_arguments );
59
60 $yoast_free_screen_reader_content = [
61 'heading_views' => __( 'Filter posts list', 'wordpress-seo' ),
62 'heading_pagination' => __( 'Posts list navigation', 'wordpress-seo' ),
63 'heading_list' => __( 'Posts list', 'wordpress-seo' ),
64 ];
65 get_current_screen()->set_screen_reader_content( $yoast_free_screen_reader_content );
66
67 if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI'] ) ) {
68 $request_uri = sanitize_file_name( wp_unslash( $_SERVER['REQUEST_URI'] ) );
69
70 wp_redirect(
71 remove_query_arg(
72 [ '_wp_http_referer', '_wpnonce' ],
73 $request_uri,
74 ),
75 );
76 exit();
77 }
78
79 /**
80 * Renders a bulk editor tab.
81 *
82 * @param WPSEO_Bulk_List_Table $table The table to render.
83 * @param string $id The id for the tab.
84 *
85 * @return void
86 */
87 function wpseo_get_rendered_tab( $table, $id ) {
88 ?>
89 <div id="<?php echo esc_attr( $id ); ?>" class="wpseotab">
90 <?php
91 $table->show_page();
92 ?>
93 </div>
94 <?php
95 }
96
97 ?>
98 <script>
99 <?php /* phpcs:ignore WordPress.Security.EscapeOutput -- WPSEO_Utils::format_json_encode is safe. */ ?>
100 var wpseoBulkEditorNonce = <?php echo WPSEO_Utils::format_json_encode( wp_create_nonce( 'wpseo-bulk-editor' ) ); ?>;
101
102 // eslint-disable-next-line
103 var wpseo_bulk_editor_nonce = wpseoBulkEditorNonce;
104 </script>
105
106 <br/><br/>
107
108 <div class="wpseo_table_page">
109
110 <h2 class="nav-tab-wrapper" id="wpseo-tabs">
111 <a class="nav-tab" id="title-tab" href="#top#title"><?php esc_html_e( 'Title', 'wordpress-seo' ); ?></a>
112 <a class="nav-tab" id="description-tab"
113 href="#top#description"><?php esc_html_e( 'Description', 'wordpress-seo' ); ?></a>
114 </h2>
115
116 <div class="tabwrapper">
117 <?php wpseo_get_rendered_tab( $wpseo_bulk_titles_table, 'title' ); ?>
118 <?php wpseo_get_rendered_tab( $wpseo_bulk_description_table, 'description' ); ?>
119 </div>
120 </div>
121