本文整理汇总了PHP中FW_Request::get方法的典型用法代码示例。如果您正苦于以下问题:PHP FW_Request::get方法的具体用法?PHP FW_Request::get怎么用?PHP FW_Request::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FW_Request
的用法示例。
在下文中一共展示了FW_Request::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_posts_where
/**
* Filter posts active only in enabled languages.
*
* @param $where
*
* @return string
*/
public function filter_posts_where($where)
{
global $pagenow, $wpdb;
if ('edit.php' === $pagenow && !is_null(FW_Request::get('fw_all_languages')) && $this->is_public_post_type()) {
$where .= " AND {$wpdb->postmeta}.meta_value IN ( '" . implode("','", array_keys($this->get_parent()->get_enabled_languages())) . "' )";
}
return $where;
}
开发者ID:albertso,项目名称:Unyson-Translation-Extension,代码行数:15,代码来源:class-fw-extension-translate-posts.php
示例2: change_admin_terms_query
/**
* Filter terms in frontend and backend by active language.
*
* @param $query
*
* @return mixed
*/
public function change_admin_terms_query($query)
{
global $pagenow;
global $wpdb;
//filter backend
if ($this->is_public_tax_type()) {
if ('edit-tags.php' === $pagenow and is_null(FW_Request::get('fw_all_languages'))) {
$active_lang = FW_Request::GET('fw_translate_to', $this->get_parent()->get_admin_active_language());
$query['join'] .= " INNER JOIN {$wpdb->fw_termmeta} AS fw_tm\n\t\t\t\t\t\t\t\tON t.term_id = fw_tm.fw_term_id AND\n\t\t\t\t\t\t\t\tfw_tm.meta_key = 'translation_lang' AND\n\t\t\t\t\t\t\t\tfw_tm.meta_value = '" . $active_lang . "'";
}
if ('edit-tags.php' === $pagenow and !is_null(FW_Request::get('fw_all_languages'))) {
$query['join'] .= " INNER JOIN {$wpdb->fw_termmeta} AS fw_tm\n\t\t\t\t\t\t\t\tON t.term_id = fw_tm.fw_term_id AND\n\t\t\t\t\t\t\t\tfw_tm.meta_key = 'translation_lang'";
$query['where'] .= " AND fw_tm.meta_value IN ( '" . implode("','", array_keys($this->get_parent()->get_enabled_languages())) . "' )";
}
}
return $query;
}
开发者ID:albertso,项目名称:Unyson-Translation-Extension,代码行数:24,代码来源:class-fw-extension-translate-terms.php