Title: Fatal Error When Updating PHP
Last modified: July 16, 2025

---

# Fatal Error When Updating PHP

 *  Resolved [junkes](https://wordpress.org/support/users/junkes/)
 * (@junkes)
 * [11 months ago](https://wordpress.org/support/topic/fatal-error-when-updating-php/)
 * Hey,
 * So, I needed a relationship custom field meta value in a macro couple years ago
   and you guys helped me a lot with a function in this topic -> [Custom Relationship Field Macro | WordPress.org](https://wordpress.org/support/topic/custom-relationship-field-macro/).
 * This is working fine, but site crashes when I try to update its PHP to anything
   after 8 (it is currently 7.4). I get “PHP Fatal error: Uncaught TypeError: Cannot
   access offset of type string on string” on line 10 of this code (I bolded line
   10):
 *     ```wp-block-code
       add_action( 'smartcrawl_known_macros', function( $replacements ){        global $post;        $pods_field_slug = "artist"; // please adjust based on your relationship field's actual slug        $value = get_post_meta($post->ID, $pods_field_slug, true);        $replacements['%%pods_relationship_id%%'] = $value['ID'];        $replacements['%%pods_relationship_title%%'] = $value['post_title'];        return $replacements;} );
       ```
   
 * P.S.: I changed yours ‘wds-known_macros’ for ‘smartcrawl_known_macros’ because
   there was some “deprecated” warning; I was having the problem before that change,
   obviously.

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

 *  Plugin Support [Jair – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport15/)
 * (@wpmudevsupport15)
 * [11 months ago](https://wordpress.org/support/topic/fatal-error-when-updating-php/#post-18558924)
 * Hello [@junkes](https://wordpress.org/support/users/junkes/)
 * The code we provided back then is almost 4 years old, and the functions it uses
   may not be compatible with the current, supported PHP versions. I’m afraid that
   creating or fixing this code will be outside the scope of support we can provide
   here. To fix that, you’ll need to hire a developer to provide the required custom
   code for you. WordPress provides a jobs directory here [https://jobs.wordpress.net/](https://jobs.wordpress.net/)
 * If you need further advice about it, feel free to email `wpsupport@incsub.com`
   with this subject: 
   ATTN: WPMU DEV support – wp.org
 * Kind regards,
   Jair.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [10 months, 2 weeks ago](https://wordpress.org/support/topic/fatal-error-when-updating-php/#post-18571988)
 * Hi [@junkes](https://wordpress.org/support/users/junkes/)
 * We haven’t heard from you in a while, I’ll go and mark this thread as resolved.
   If you have any additional questions or require further help, please let us know!
 * Best Regards
    Patrick Freitas

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

The topic ‘Fatal Error When Updating PHP’ is closed to new replies.

 * ![](https://ps.w.org/smartcrawl-seo/assets/icon-256x256.gif?rev=3446894)
 * [SmartCrawl SEO checker, analyzer & optimizer](https://wordpress.org/plugins/smartcrawl-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smartcrawl-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smartcrawl-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/smartcrawl-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smartcrawl-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smartcrawl-seo/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * Last activity: [10 months, 2 weeks ago](https://wordpress.org/support/topic/fatal-error-when-updating-php/#post-18571988)
 * Status: resolved