1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin * @since 1.5.0 */
if ( ! defined( 'WPSEO_VERSION' ) ) { header( 'Status: 403 Forbidden' ); header( 'HTTP/1.1 403 Forbidden' ); exit(); }
/** * Sanitizes the parameters that have been sent. * * @return array The sanitized fields. */ function yoast_free_bulk_sanitize_input_fields() { $possible_params = array( 'type', 'paged', 'post_type_filter', 'post_status', 'order', 'orderby', );
$input_get = array(); foreach ( $possible_params as $param_name ) { if ( isset( $_GET[ $param_name ] ) ) { $input_get[ $param_name ] = sanitize_text_field( wp_unslash( $_GET[ $param_name ] ) ); } }
return $input_get; }
$yoast_free_input_fields = yoast_free_bulk_sanitize_input_fields();
// Verifies the nonce. if ( ! empty( $yoast_free_input_fields ) ) { check_admin_referer( 'bulk-editor-table', 'nonce' ); }
// If type is empty, fill it with value of first tab (title). if ( ! isset( $yoast_free_input_fields['type'] ) ) { $yoast_free_input_fields['type'] = 'title'; }
$yoast_bulk_editor_arguments = array( 'input_fields' => $yoast_free_input_fields, 'nonce' => wp_create_nonce( 'bulk-editor-table' ), );
$wpseo_bulk_titles_table = new WPSEO_Bulk_Title_Editor_List_Table( $yoast_bulk_editor_arguments ); $wpseo_bulk_description_table = new WPSEO_Bulk_Description_List_Table( $yoast_bulk_editor_arguments );
$yoast_free_screen_reader_content = array( 'heading_views' => __( 'Filter posts list', 'wordpress-seo' ), 'heading_pagination' => __( 'Posts list navigation', 'wordpress-seo' ), 'heading_list' => __( 'Posts list', 'wordpress-seo' ), ); get_current_screen()->set_screen_reader_content( $yoast_free_screen_reader_content );
if ( ! empty( $_REQUEST['_wp_http_referer'] ) && isset( $_SERVER['REQUEST_URI'] ) ) { $request_uri = sanitize_file_name( wp_unslash( $_SERVER['REQUEST_URI'] ) );
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), $request_uri ) ); exit; }
/** * Outputs a help center. */ function wpseo_render_help_center() { $tabs = new WPSEO_Option_Tabs( '', '' );
$bulk_editor_tab_title = new WPSEO_Option_Tab( 'title', __( 'Bulk editor', 'wordpress-seo' ), array( 'video_url' => WPSEO_Shortlinker::get( 'https://yoa.st/screencast-tools-bulk-editor' ) ) ); $tabs->add_tab( $bulk_editor_tab_title );
$bulk_editor_tab_description = new WPSEO_Option_Tab( 'description', __( 'Bulk editor', 'wordpress-seo' ), array( 'video_url' => WPSEO_Shortlinker::get( 'https://yoa.st/screencast-tools-bulk-editor' ) ) ); $tabs->add_tab( $bulk_editor_tab_description );
$helpcenter = new WPSEO_Help_Center( '', $tabs, WPSEO_Utils::is_yoast_seo_premium() ); $helpcenter->localize_data(); $helpcenter->mount(); }
/** * Renders a bulk editor tab. * * @param WPSEO_Bulk_List_Table $table The table to render. * @param string $id The id for the tab. */ function wpseo_get_rendered_tab( $table, $id ) { ?> <div id="<?php echo esc_attr( $id ); ?>" class="wpseotab"> <?php $table->show_page(); ?> </div> <?php }
?> <script> var wpseoBulkEditorNonce = <?php echo WPSEO_Utils::format_json_encode( wp_create_nonce( 'wpseo-bulk-editor' ) ); ?>;
// eslint-disable-next-line var wpseo_bulk_editor_nonce = wpseoBulkEditorNonce; </script>
<br/><br/>
<div class="wpseo_table_page">
<h2 class="nav-tab-wrapper" id="wpseo-tabs"> <a class="nav-tab" id="title-tab" href="#top#title"><?php esc_html_e( 'Title', 'wordpress-seo' ); ?></a> <a class="nav-tab" id="description-tab" href="#top#description"><?php esc_html_e( 'Description', 'wordpress-seo' ); ?></a> </h2>
<?php wpseo_render_help_center(); ?>
<div class="tabwrapper"> <?php wpseo_get_rendered_tab( $wpseo_bulk_titles_table, 'title' ); ?> <?php wpseo_get_rendered_tab( $wpseo_bulk_description_table, 'description' ); ?> </div> </div>
|