Wordpress PHP Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c)
You can try:
$taxonomy = get_the_terms($post->ID, (is_singular('post') ? 'category' : (is_singular('blog') ? 'category' : (is_singular('event') ? 'category' : 'vacancy_category'))))
However even though this doesn't ocupy too much space, I feel like it's hard to read. You could use an if else instead to make it more readable.
How to minimize PHP path cannot be found fatal error?
You'll see this error when you haven't provided a value for the GET parameter fname
(i.e., included ?fname='file.txt'
or similar at the end of your URL.)
You should guard against this fatal error by only executing your PHP code when $_GET['fname']
is set, using the aptly-named isset()
:
<?php
$fname = $_GET['fname'];
$menu = $_GET['menu'];
if (isset($_GET['fname'])) {
$fp = fopen($fname,"r") or die("File Not Found!!");
// rest of your code...
}
?>
How to manipulate the database after a fatal error in CodeIgniter?
As the user @DFriend stated in this question:
Extending CI_Log is not going to work if you need to access other
libraries. The reason is CI_Log is created long before $CI is created
so no "instance" is available for &get_instance() to return.$this->load doesn't work because $this is not a controller ($this and
$CI point to the same object) and the class load ('CI_Loader') hasn't
been created yet either.
The way I was proceeding doesn't look like the way to go. Since extending the CI_Log class has clear limitations as the modification of the core class itself.
For the moment and since it is a temporal modification I will proceed overriding the CI_Log class and using plain PHP to complete the task.
Related Topics
Query With Multiple Values in a Column
How to Change the Background Color of Dropdown List in Select Tag
How to Check If MySQL Results Returned Empty in PHP
How to Remove the Extra Square Bracket from Json Having Multiple Arrays
How to Get Data from Another Table Using Id from Another Table
How to Get Multiple Value from Post Variable Using Same Name
Calculate Size in Bytes of Json Payload Including It in the Json Payload in PHP
How to Resolve a Http 414 "Request Uri Too Long" Error
Extension Mysqli Is Missing, Phpmyadmin Doesn't Work
Laravel PHP Fatal Error: Require(): Failed Opening Required ... Bootstrap/Autoload.Php on Line 17
How to Generate Unique Random Value for Each User in Laravel and Add It to Database
Tell Composer to Use Different PHP Version
Why Shouldn't I Use MySQL_* Functions in PHP
PHP Parse/Syntax Errors; and How to Solve Them
Reference - What Does This Error Mean in PHP