PHP errors
-
The following error produces PHP warnings in debug mode:
file: gotowp_personal.php
function: gotowp_has_shortcode
line: 891This code can be called on pages without $post content, such as 404 pages which have sidebars that use post data. As such, line 891:
if( has_shortcode( $post->post_content, $shortcode) )
will create a notice for the missing object
$post
.fix: Add this code after line 888:
if ( empty($post) ) return $found;
—
In addition, it looks like the custom function you include at line 908,
gotowp_custom_has_shortcode
is missing the parameter in the function declaration:function gotowp_custom_has_shortcode(){
Should be:
function gotowp_custom_has_shortcode( $shortcode ){
- The topic ‘PHP errors’ is closed to new replies.