What does PHP mean?
if (defined (' Wp_use_themes ') && wp_use_themes):
$template = false;
if (is_404 () && $template = Get_404_template ()):
ElseIf (Is_search () && $template = Get_search_template ()):
ElseIf (Is_front_page () && $template = Get_front_page_template ()):
ElseIf (Is_home () && $template = Get_home_template ()):
ElseIf (is_post_type_archive () && $template = Get_post_type_archive_template ()):
ElseIf (Is_tax () && $template = Get_taxonomy_template ()):
ElseIf (Is_attachment () && $template = Get_attachment_template ()):
Remove_filter (' the_content ', ' prepend_attachment ');
ElseIf (Is_single () && $template = Get_single_template ()):
ElseIf (Is_page () && $template = Get_page_template ()):
ElseIf (Is_category () && $template = Get_category_template ()):
ElseIf (Is_tag () && $template = Get_tag_template ()):
ElseIf (Is_author () && $template = Get_author_template ()):
ElseIf (Is_date () && $template = Get_date_template ()):
ElseIf (is_archive () && $template = Get_archive_template ()):
ElseIf (Is_comments_popup () && $template = Get_comments_popup_template ()):
ElseIf (is_paged () && $template = Get_paged_template ()):
else:
$template = Get_index_template ();
endif
/**
* Filter The path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
if ($template = apply_filters (' template_include ', $template))
Include ($template);
Return
endif
------Solution--------------------
Very simple,&& in front of the judge-true/False, followed by the assignment, must be true
For reasons of shortcut, if the first half of && is false, the second half will not need to be judged.
That is, only the first half of the paragraph is judged to be true.
Because the purpose of the program is to assign values, there is no need for the actual statement after the colon.
------Solution--------------------
Can be understood as
It's a three-dimensional lazy notation.
$template = (is_404 ())? Get_404_template (): false;
Or
if (is_404 ()) $template = Get_404_template ();
else $template = false;