0

The whole error:

Fatal error: Can't use function return value in write context in /www/.../wp-content/themes/.../includes/meta.page.php on line 178

'desc' => esc_html__('Default value on Theme Options: ', 'consultaid') . 
((isset(Themeton_Std::getopt('social_sharevisibility')[$post_type.'s']) && 
Themeton_Std::getopt('social_sharevisibility')[$post_type.'s'] == '0') ? 
esc_attr__('Hidden', 'consultaid') : esc_attr__('Show', 'consultaid')),

1 Answer 1

1

Try taking the call to the static class out of the isset check. Set a variable then use that in the isset() function.

$var = Themeton_Std::getopt('social_sharevisibility')[$post_type.'s'];

'desc' => esc_html__('Default value on Theme Options: ', 'consultaid') . 
((isset($var) && Themeton_Std::getopt('social_sharevisibility')[$post_type.'s'] == '0') ? 
 esc_attr__('Hidden', 'consultaid') : esc_attr__('Show', 'consultaid')),
Sign up to request clarification or add additional context in comments.

3 Comments

Do you think this error is happening because the PHP version in the server is PHP 5.2.6?
In my experience I have gotten that error when PHP does not support running a certain function inside of another function. Since that is a ternary operation it makes it a little hard to follow. Can you show us the whole function?
The PHP version on the server was 5.2.6,and I think the theme(Wordpress theme) wasn't supporting earlier versions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.