public static function get_birthday_timestamp($user_id) { $birthday = SB_User::get_meta($user_id, 'birthday'); if (empty($birthday)) { $birthday = SB_Core::get_current_datetime(); $birthday = strtotime($birthday); } return $birthday; }
public static function insert($args = array()) { $post_title = ''; $post_content = ''; $post_status = 'pending'; $post_type = 'post'; $post_author = 1; $first_admin = SB_User::get_first_admin(); if ($first_admin) { $post_author = $first_admin->ID; } $defaults = array('post_title' => $post_title, 'post_content' => $post_content, 'post_status' => $post_status, 'post_type' => $post_type, 'post_author' => $post_author, 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0); $args = wp_parse_args($args, $defaults); $args['post_title'] = wp_strip_all_tags($args['post_title']); $post_id = wp_insert_post($args); return $post_id; }
public static function is_support_post_favorites() { $users = SB_User::get_by_meta('favorites'); if (!is_array($users) || count($users) < 1) { return false; } return true; }