Title: Undefined variable: mpr_version_number
Last modified: October 31, 2018

---

# Undefined variable: mpr_version_number

 *  Resolved [roman75](https://wordpress.org/support/users/roman75/)
 * (@roman75)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/undefined-variable-mpr_version_number/)
 * Hello,
 * we’re using the plugin and in “debug” mode we got the error
 * Notice: Undefined variable: mpr_version_number in /[…]/plugins/multisite-post-
   reader/multisite-post-reader.php on line 197
 * To fix this I added the following line bofore the line 197
    `$mpr_version_number
   = "2.2.0";` so the error was fixed.
 * best regards,
    Roman

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

 *  Plugin Author [Rick Hellewell](https://wordpress.org/support/users/rhellewellgmailcom/)
 * (@rhellewellgmailcom)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/undefined-variable-mpr_version_number/#post-10835291)
 * Whoops! You are right, of course!
 * The more correct fix is to put this in the beginning of the`mpr_shortcodes_init()`
   function (about line 193)
 * `global $mpr_version ;`
 * That way, the proper value of the variable is only defined once (at the beginning
   of the file).
 * I just posted version 2.21, which includes that fix (and gave you credit in the
   readme). Thanks!
 *  Thread Starter [roman75](https://wordpress.org/support/users/roman75/)
 * (@roman75)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/undefined-variable-mpr_version_number/#post-10849180)
 * Thank you for the credits.
 * Because we needed some customizations i made some changes to your plugin.
 * Feel free to integrate the following code:
 * 1) Added Shortcode for hiding the post date and show the post thumbnail image
 *     ```
       // hide post date with [ ... showdate=no]
       // line ~ 459
       	if ( isset ($atts['showdate']))
       	{
       		$showdate = false ;
       	}
       	else
       	{
       		$showdate = true ;
       	}
   
       // show thumbnail
       	if ( isset ($atts['showthumbnail']))
       	{
       		$showthumbnail = true ;
       	}
       	else
       	{
       		$showthumbnail = false ;
       	} 
       [...]
       // line ~522 after title:
       </a></strong>
       	<?php
       	if($showdate)
              {
       	  echo "&nbsp;&nbsp;&nbsp;(" .  $x->post_date  . ")";
       	}
       [...]
       if ($atts['showall'])
       			{
       				echo "<em>(status = " . $x->post_status . ")</em>" ;
       			}
       			echo "<br>" ;
   
       // show thumbnail with class "globalImageStyle"
       			if($showthumbnail)
       			{
       				echo get_the_post_thumbnail( $page->ID, 'thumbnail', array( 'class' => 'globalImageStyle' ) );
   
       			}
       ```
   

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

The topic ‘Undefined variable: mpr_version_number’ is closed to new replies.

 * ![](https://ps.w.org/multisite-post-reader/assets/icon-256x256.png?rev=2880157)
 * [Multisite Post Reader](https://wordpress.org/plugins/multisite-post-reader/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multisite-post-reader/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multisite-post-reader/)
 * [Active Topics](https://wordpress.org/support/plugin/multisite-post-reader/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multisite-post-reader/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multisite-post-reader/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [roman75](https://wordpress.org/support/users/roman75/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/undefined-variable-mpr_version_number/#post-10849180)
 * Status: resolved