static function printPrefixFilter($query) { static $loop_already_started; if ($loop_already_started) { return; } # If this is feed we bail out if (Is_Feed()) { return; } # If the current query is not a post query we bail out if (!(GetType($query) == 'object' && Get_Class($query) == 'WP_Query')) { return; } global $wp_current_filter; if (In_Array('wp_head', $wp_current_filter)) { return; } # Conditions if ($query->Is_Main_Query() && !$query->Get('suppress_filters')) { $is_archive_filter = self::isGlossaryArchive($query) && Options::Get('prefix_filter_for_archives'); $is_singular_filter = $query->Is_Singular(Post_Type::$post_type_name) && Options::Get('prefix_filter_for_singulars'); # Get the Filter depth $filter_depth = False; if ($is_archive_filter) { $filter_depth = Options::Get('prefix_filter_archive_depth'); } elseif ($is_singular_filter) { $filter_depth = Options::Get('prefix_filter_singular_depth'); } if ($is_archive_filter || $is_singular_filter) { Prefix_Filter::printFilter($filter_depth); $loop_already_started = True; } } }
<p>This class was created to query game server which use the Source query protocol, this includes all source games, half-life 1 engine games and Call of Duty: Modern Warfare 3</p> <p> <a class="btn btn-large btn-primary" href="http://xpaw.ru">Made by xPaw</a> <a class="btn btn-large btn-primary" href="https://github.com/xPaw/PHP-Source-Query-Class">View on GitHub</a> <a class="btn btn-large btn-danger" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">CC BY-NC-SA 3.0</a> </p> </div> <?php if (isset($Exception)) { ?> <div class="panel panel-primary"> <div class="panel-heading"><?php echo Get_Class($Exception); ?> at line <?php echo $Exception->getLine(); ?> </div> <p><b><?php echo htmlspecialchars($Exception->getMessage()); ?> </b></p> <p><?php echo nl2br($e->getTraceAsString(), false); ?> </p> </div> <?php
/** * * @param Object $Value * @return boolean Возвращает true, если $Value является исключением и false в противном случае */ function Is_Exception($Value) { #------------------------------------------------------------------------------- return Is_Object($Value) && Get_Class($Value) == 'gException'; #------------------------------------------------------------------------------- }