本文整理匯總了PHP中WPFB_Core::file_browser_item方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPFB_Core::file_browser_item方法的具體用法?PHP WPFB_Core::file_browser_item怎麽用?PHP WPFB_Core::file_browser_item使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPFB_Core
的用法示例。
在下文中一共展示了WPFB_Core::file_browser_item方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ParseQuery
static function ParseQuery(&$query)
{
// conditional loading of the search hooks
global $wp_query;
if (!empty($wp_query->query_vars['s'])) {
wpfb_loadclass('Search');
}
if (!empty($_GET['wpfb_s']) || !empty($_GET['s'])) {
WPFB_Core::$file_browser_search = true;
add_filter('the_excerpt', array(__CLASS__, 'SearchExcerptFilter'), 100);
// must be lower than 11 (before do_shortcode) and after wpautop (>9)
}
// check if current post is file browser
if (($id = self::GetPostId($query)) == WPFB_Core::$settings->file_browser_post_id) {
wpfb_loadclass('File', 'Category');
if (!empty($_GET['wpfb_file'])) {
self::$file_browser_item = WPFB_File::GetFile($_GET['wpfb_file']);
} elseif (!empty($_GET['wpfb_cat'])) {
self::$file_browser_item = WPFB_Category::GetCat($_GET['wpfb_cat']);
} else {
$url = (is_ssl() ? 'https' : 'http') . '://' . $_SERVER["HTTP_HOST"] . stripslashes($_SERVER['REQUEST_URI']);
if (($qs = strpos($url, '?')) !== false) {
$url = substr($url, 0, $qs);
}
// remove query string
$path = trim(substr($url, strlen(WPFB_Core::GetPostUrl($id))), '/');
if (!empty($path)) {
self::$file_browser_item = WPFB_Item::GetByPath(urldecode($path));
if (is_null(self::$file_browser_item)) {
self::$file_browser_item = WPFB_Item::GetByPath($path);
}
}
}
}
}