• This plugin triggers the following error:

    contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

    You can remove the errormessage (and also the contextual help) by removing (put // in front of) line 52 of
    …/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php
    line 52:

    add_filter( 'contextual_help', array( __CLASS__, 'show_contextual_help' ), 10, 3 );
    
    • This topic was modified 4 years, 7 months ago by Jacob N. Breetvelt. Reason: added solution
Viewing 6 replies - 1 through 6 (of 6 total)
  • Natacha

    (@chickwithbob)

    We are also getting this same error since upgrading to WordPress 5.4 today.

    PHP Deprecated: contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

    I did a site-wide search and found your plugin uses ‘contextual_help’.
    I deactivate SendGrid only, and the error goes away, hence this error is definitely caused by SendGrid.

    To correct this change this file

    wp-content/plugins/sendgrid-email-delivery-simplified/lib/class-sendgrid-settings.php

    Change line 52 to

    add_filter( 'current_screen', array( __CLASS__, 'show_contextual_help' ), 10 );

    And the show_contextual_help method (starts on line 101)

      public static function show_contextual_help()
      {
        $screen = get_current_screen();
    
          if ( SENDGRID_PLUGIN_STATISTICS == $screen->id or SENDGRID_PLUGIN_SETTINGS == $screen->id ) {
        
              $screen->add_help_tab(
                                array(
                                  'id'      => 'sendgrid_help_tab',
                                  'title'   => __( 'Help' ),
                                  'content' => file_get_contents( dirname( __FILE__ ) . '/../view/sendgrid_contextual_help.php' )
                                  )
                              );
    
          }
    
      }

    Same error as well. Sendgrid Support has not responded.

    Been noticing the same error.

    Sent a ticket into SendGrid about this – I’ll update this post if I hear anything.

    • This reply was modified 4 years, 7 months ago by blockmonkey.

    Well they finally replied to the ticket.

    “At this time, our engineering team does not have any plans to update the WordPress plugin or make any additional changes. I sincerely apologize for any inconvenience caused.”

    inorman

    (@inorman)

    Thanks @chrome-orange for the solution.

    I deactivated the Sendgrid plugin, and edited the ~/lib/class-sendgrid-settings.php file with the built-in WordPress Plugin Editor with the code from your post (I replaced both line 52 and the show_contextual_help() function code as you outlined), updated the file and reactivated the plugin and it all seems to work now without the error.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Plugin uses depricated function’ is closed to new replies.