admin管理员组文章数量:1317909
I have own class which extends WP_List_Table class and everything works just fine but bulk actions have some issue. They performs well (delete the row in the table, change state of the item etc.) however while they reloads it feils with following errors and notices:
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 773
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 813
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 818
Notice: Undefined offset: 1 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 818
Warning: Cannot modify header information - headers already sent by (output started at /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/formatting.php:5081) in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/pluggable.php on line 1179
I have find out thet it has to do something with $args
of page, I tried to figure out what's wrong with my redirect and nothing found:
public function process_bulk_action() {
//Detect when a bulk action is being triggered...
if ( 'delete' === $this->current_action() ) {
// In our file that handles the request, verify the nonce.
$nonce = esc_attr( $_REQUEST['_wpnonce'] );
if ( ! wp_verify_nonce( $nonce, 'sp_smazat_objednavku' ) ) {
die( 'Go get a life script kiddies' );
}
else {
self::smazat_objednavku( absint( $_GET['customer'] ) );
// esc_url_raw() is used to prevent converting ampersand in url to "#038;"
// add_query_arg() return the current url$
wp_redirect( esc_url_raw(add_query_arg()) );
exit;
}
}
//[...]
}
Could you see anything? If needed whole code is here:
I have own class which extends WP_List_Table class and everything works just fine but bulk actions have some issue. They performs well (delete the row in the table, change state of the item etc.) however while they reloads it feils with following errors and notices:
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 773
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 813
Notice: Undefined offset: 0 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 818
Notice: Undefined offset: 1 in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/functions.php on line 818
Warning: Cannot modify header information - headers already sent by (output started at /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/formatting.php:5081) in /home/www/interier-ricany.cz/www/bonus.interier-ricany.cz/wp-includes/pluggable.php on line 1179
I have find out thet it has to do something with $args
of page, I tried to figure out what's wrong with my redirect and nothing found:
public function process_bulk_action() {
//Detect when a bulk action is being triggered...
if ( 'delete' === $this->current_action() ) {
// In our file that handles the request, verify the nonce.
$nonce = esc_attr( $_REQUEST['_wpnonce'] );
if ( ! wp_verify_nonce( $nonce, 'sp_smazat_objednavku' ) ) {
die( 'Go get a life script kiddies' );
}
else {
self::smazat_objednavku( absint( $_GET['customer'] ) );
// esc_url_raw() is used to prevent converting ampersand in url to "#038;"
// add_query_arg() return the current url$
wp_redirect( esc_url_raw(add_query_arg()) );
exit;
}
}
//[...]
}
Could you see anything? If needed whole code is here: https://pastebin/D5mprA9x
Share Improve this question asked Apr 3, 2017 at 10:53 Karolína VyskočilováKarolína Vyskočilová 4291 gold badge8 silver badges23 bronze badges 3 |1 Answer
Reset to default 2with add_query_arg
the first paramater is required and it must be an array when it is alone :
add_query_arg([])
more informations here : http://developer.wordpress/reference/functions/add_query_arg
本文标签: wp list tableWPListTable bulk actions notice amp warning
版权声明:本文标题:wp list table - WP_List_Table bulk actions notice & warning 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742027498a2415821.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
add_query_arg
the first paramater is required : developer.wordpress/reference/functions/add_query_arg – mmm Commented Apr 3, 2017 at 11:09add_query_arg('')
or there iswp_redirect()
only, the problem remains – Karolína Vyskočilová Commented Apr 3, 2017 at 11:20