/** * [rbm_pagesize description] * @param [type] $query [description] * @return [type] [description] */ function rbm_pagesize($query) { if (is_admin() || !$query->is_main_query()) { return; } if (is_post_type_archive('members') || is_tax('member-types')) { $query->set('posts_per_page', -1); return; } }
/** * / * @param Record $record [description] */ public function setUserData(Record $record) { $this->session->set('user.authenticated', true); $this->session->set('user.id', $record->get('id')); $this->session->set('user.username', $record->get('username')); $this->session->set('user.name', $record->get('name')); $this->session->set('user.email', $record->get('email')); }
/** * / * @return [type] [description] */ public function generate() { $token = md5(microtime() . 'm4a3l2t1z'); $this->session->set('token.nonce', $token); }
/** * [category_pagination description] * @param [type] $query [description] * @return [type] [description] */ function category_pagination($query) { if ($query->is_category() && $query->is_main_query()) { $query->set('posts_per_page', 6); } }
/** * exclude all categories that are locked for the visitor * * @author Lukas Juhas * @date 2016-02-05 * @param [type] $query [description] * @return [type] [description] */ public function update_shop_queries($query) { // don't run if it's admin if (is_admin()) { return; } // make sure it's main query if (!$query->is_main_query()) { return; } // make sure its archive page if (!$query->is_post_type_archive()) { return; } // get locked categories / taxonomies $locked = wcl_get_locked_categories(); // set query to exclude locked ones $query->set('tax_query', array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $locked, 'operator' => 'NOT IN'))); return $query; }
/** * A kezdőlapon megjelenítendő extra típusok * * @author NewPlayer * @since 2015-10-14 * * @param [type] $query [description] * @return [type] [description] */ function extraTypesInHomePage($query) { if (is_home() && $query->is_main_query() || is_feed()) { $query->set('post_type', array('post', 'download')); return $query; } }