[wp-trac] [WordPress Trac] #29933: Undefined index: hook_suffix on WP_List_Table

WordPress Trac noreply at wordpress.org
Sun Oct 12 00:12:04 UTC 2014


#29933: Undefined index: hook_suffix on WP_List_Table
-------------------------------+------------------------------
 Reporter:  z43 Studio         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Administration     |     Version:  4.0
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => reporter-feedback
 * focuses:  performance => administration
 * component:  Plugins => Administration


Old description:

> Using WP_List_Table subclasses in a plugin, I am receiving this error:
>
> ( ! ) Notice: Undefined index: hook_suffix in ~~~~/wp-
> admin/includes/screen.php on line 388
> Call Stack
> #       Time    Memory  Function        Location
> 1       0.0006  297776  {main}( )       ../admin.php:0
> 2       0.2897  20948360        do_action( )
> 3       0.2940  21103488        call_user_func_array:{~~~~/wp-
> includes/plugin.php:505} ( )      ../plugin.php:505
> 4       0.2940  21103680        ~~~~~~~~~~~~~~~
> 5       0.2989  21469928        ~~~~~~~~~~~~~~~
> 6       0.2989  21470832        WP_List_Table->__construct( )   ../my-
> table-subclass.php:20
> 7       0.2989  21471512        convert_to_screen( )    ../class-wp-list-
> table.php:101
> 8       0.2989  21471920        WP_Screen::get( )
> ../template.php:2079

New description:

 Using WP_List_Table subclasses in a plugin, I am receiving this error:
 {{{
 ( ! ) Notice: Undefined index: hook_suffix in ~~~~/wp-
 admin/includes/screen.php on line 388
 Call Stack
 #       Time    Memory  Function        Location
 1       0.0006  297776  {main}( )       ../admin.php:0
 2       0.2897  20948360        do_action( )
 3       0.2940  21103488        call_user_func_array:{~~~~/wp-
 includes/plugin.php:505} ( )      ../plugin.php:505
 4       0.2940  21103680        ~~~~~~~~~~~~~~~
 5       0.2989  21469928        ~~~~~~~~~~~~~~~
 6       0.2989  21470832        WP_List_Table->__construct( )   ../my-
 table-subclass.php:20
 7       0.2989  21471512        convert_to_screen( )    ../class-wp-list-
 table.php:101
 8       0.2989  21471920        WP_Screen::get( )
 ../template.php:2079
 }}}

--

Comment:

 Could you provide a piece of code to reproduce the issue?

 `$hook_suffix` is only set after `admin_init`, you're probably calling
 `WP_Screen::get()` too early.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29933#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list