Title: Error when logging into WordPress after installing plugin
Last modified: August 21, 2016

---

# Error when logging into WordPress after installing plugin

 *  Resolved [WebHolism](https://wordpress.org/support/users/webholism/)
 * (@webholism)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/)
 * Hi support,
 * Since installing the PDF & Print plugin, everything seemed to be going perfectly
   until I logged out and logged back in again to the WordPress administrator.
 * Every time I log in, I’m now greeted by several rows of:
 * “Warning: in_array() expects parameter 2 to be array, null given in /xxxxxxxxxx/
   wp-content/plugins/pdf-print/pdf-print.php on line 656”
 * Once I navigate away from the admin dashboard, everything seems to be fine. Unfortunately,
   as this is a client site, I can’t really just leave the errors to pop up every
   time the client logs into the admin area (which they do daily). 🙁
 * PDF & Print version: 1.7.2
 * Is there something I can tweak to make this error disappear?
 * Many thanks for your time!
 * [https://wordpress.org/plugins/pdf-print/](https://wordpress.org/plugins/pdf-print/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865324)
 * Hi,
 * Does it mean that this error occurs after logging in to the back-end of the site?
   
   Could you please provide screenshots of the plugin settings page and the error?
   A simple solution: please try via the Editor of the plugin’s files, hosting file
   manager or ftp, in the file pdf-print.php (wp-content/plugins/pdf-print/pdf-print.
   php) find line 656
 * if ( ! in_array( get_post_type( $post ), $pdfprnt_options_array[‘use_types_posts’]))
 * and change it for
 * if ( ! in_array( get_post_type( $post ), $pdfprnt_options_array[‘use_types_posts’])&&
   is_admin() )
 * Sincerely,
    BestWebSoft Support Team
 *  Thread Starter [WebHolism](https://wordpress.org/support/users/webholism/)
 * (@webholism)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865329)
 * Hi BestWebSoft Support Team,
 * Thanks for your response.
 * Yes, the error occurs when you log in to the back-end of the website, and then
   doesn’t appear if you navigate around the admin area. If you log out and log 
   back in again, the error shows again (please see screenshot 1.jpg listed below).
 * I tried the suggested code change, but it doesn’t seem to have made any difference
   to the error appearing 🙁
 * Please find screenshots available here:
 * [http://www.webholism.com/images/support/1.jpg](http://www.webholism.com/images/support/1.jpg)
   
   [http://www.webholism.com/images/support/2.png](http://www.webholism.com/images/support/2.png)
   [http://www.webholism.com/images/support/3.png](http://www.webholism.com/images/support/3.png)
   [http://www.webholism.com/images/support/4.png](http://www.webholism.com/images/support/4.png)
 * Many thanks in advance for your help.
 *  [yvonne621](https://wordpress.org/support/users/yvonne621/)
 * (@yvonne621)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865347)
 * I’m having the same problem. The code change unfortunately didn’t fix it for 
   me either. I also wouldn’t care except that I have users that have expressed 
   concern. Thank you!
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [12 years ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865365)
 * Hi,
 * Apologies, there was a mistake in the code, please try to change the line for
   the following one:
 * if ( ! in_array( get_post_type( $post ), $pdfprnt_options_array[‘use_types_posts’])
   || is_admin() )
 * Sincerely,
    BestWebSoft
 *  Thread Starter [WebHolism](https://wordpress.org/support/users/webholism/)
 * (@webholism)
 * [12 years ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865366)
 * Hi BestWebSoft Support Team,
 * Thanks for your amended code update, however even after implementing the new 
   code change, I’m still getting the same error unfortunately.
 * One thing I did notice: [http://www.example-domain.com/wp-admin/](http://www.example-domain.com/wp-admin/)
   caused the error to trigger, however [http://www.example-domain.com/wp-admin/](http://www.example-domain.com/wp-admin/)**
   index.php** does not.
 * Hopefully this might be some clue into the resolution?
 * Many thanks,
    Sara
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [12 years ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865371)
 * Hi Sara,
 * We have made the necessary changes in the code of the plugin, please update to
   the recent version and check if the error is displayed or not.
 * Sincerely,
    BestWebSoft Support Team
 *  Thread Starter [WebHolism](https://wordpress.org/support/users/webholism/)
 * (@webholism)
 * [12 years ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865372)
 * Hi BestWebSoft Support Team,
 * I’ve upgraded to your latest plugin version – 1.7.3 and the same problem is still
   occurring.
 * Are there any other code changes I can make to resolve this problem?
 * Thanks.
 *  [kmg454](https://wordpress.org/support/users/kmg454/)
 * (@kmg454)
 * [12 years ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865374)
 * The error is not gone after upgrading
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865380)
 * Hi all,
 * Unfortunately, we cannot reproduce the problem locally. Could you please provide
   credentials to your site so that we could analyze the problem and fix it?
    Please
   provide details on our support forumhttp://support.bestwebsoft.com/, it will 
   be a private ticket and the information will be available only for the support
   team. Please specify a link to this topic.
 * Sincerely,
    BestWebSoft Support Team
 *  Thread Starter [WebHolism](https://wordpress.org/support/users/webholism/)
 * (@webholism)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865381)
 * Hi all,
 * I managed to get our wonder developer to take a look and he’s made the following
   change which seems to have fixed the problem:
 * TO RESOLVE:
    Modify /wp-content/plugins/pdf-print/pdf-print.php
 * Find the below line (roughly line 658):
    if ( ! in_array( get_post_type( $post),
   $pdfprnt_options_array[‘use_types_posts’] ) )
 * And above it add:
    if (isset ($pdfprnt_options_array[‘use_types_posts’])){
 * Then also add a:
    } (should be line 661) after the code: return $content;
 * This problem is caused by the fact that the $pdfprnt_options_array[‘use_types_posts’]
   command is returning a NULL value and the second parameter of in_array is expected
   to be an array value.
 * Hope this helps!
 *  Plugin Author [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * (@bestwebsoft)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865383)
 * Hi again,
 * We have found out the cause of the error and it will be fixed in the next update
   of the plugin.
 * Sincerely,
    BestWebSoft Support Team

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Error when logging into WordPress after installing plugin’ is closed 
to new replies.

 * ![](https://ps.w.org/pdf-print/assets/icon-256x256.gif?rev=2580392)
 * [PDF & Print by BestWebSoft - WordPress Posts and Pages PDF Generator Plugin](https://wordpress.org/plugins/pdf-print/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pdf-print/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pdf-print/)
 * [Active Topics](https://wordpress.org/support/plugin/pdf-print/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pdf-print/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pdf-print/reviews/)

 * 11 replies
 * 4 participants
 * Last reply from: [bestwebsoft](https://wordpress.org/support/users/bestwebsoft/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/error-when-logging-into-wordpress-after-installing-plugin/#post-4865383)
 * Status: resolved