WP_DEBUG=true but no message is shown
-
Hi
I’ve turn on WP_DEBUG in wp-config.php://define('WP_DEBUG', false); define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); ini_set('display_errors', 0);
I want to get a warn in cases like this:
$qry=new WP_Query([ 'posttye' => 'post', 'category_name' => 'featured' ]); ?> <?php if (have_posts()):?> <?php while($qry->have_posts()):$qry->the_post();?> <?php echo $qry->current_post();?> <?php endwhile;?> <?php endif;?>
the problem is there : $qry->current_post(),current_post is not method is just a field,correct
is : $qry->current_postin case of incorrect syntax it is echo empty string,I want a warning/error
I’ve tested a php script
class myClass{ var $field1="value 1"; function Method1(){ echo("field1 is :".$this->field1()); // correct is echo("field1 is :".$this->field1); } } $obj=new myClass(); $obj->Method1();
and I got
Fatal error: Uncaught Error: Call to undefined method myClass::field1() in index.php on line 6
( ! ) Error: Call to undefined method myClass::field1() in index.php on line 6how to have this in WP too
thanks!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘WP_DEBUG=true but no message is shown’ is closed to new replies.