Error in Shortcodes.php file [Solution Inside]
-
My IDXPress installs have been getting the following errors:
PHP Notice: Use of undefined constant mlsnumber - assumed 'mlsnumber' in /wp-content/plugins/dsidxpress/shortcodes.php on line 45
Tried to get in contact with Diverse Solutions who wanted my WordPress logins which is entirely unnecessary to fix a PHP error, so here’s the solution:
On line 45 of
shortcodes.php
in the root of the plugin we see this:return '<p class="dsidx-error">'.sprintf(DSIDXPRESS_INVALID_MLSID_MESSAGE, $atts[mlsnumber]).'</p>';
It’s trying to access an array index by a PHP constant which doesn’t exist – it needs to be changed to this:
return '<p class="dsidx-error">'.sprintf(DSIDXPRESS_INVALID_MLSID_MESSAGE, $atts["mlsnumber"]).'</p>';
And the problem is solved.
- The topic ‘Error in Shortcodes.php file [Solution Inside]’ is closed to new replies.