How does a File System handle an internal edit to a file?

When you edit information in a file, but you add in more information than was already present, how does the file system handle it without an overflow into the next section of the file?

Here’s an example. Consider having statements 1-12 in a 512-byte block, and you had statements 13-24 in the next 512-byte block. [Image 1] These blocks are both part of the same file. If you edited the first block, so you add another few New Statements [Image 2] past statement 12, this would overflow into the next block (statements 13-24). How would this condition be handled? Through shifting all the statements ahead of the added statement forward, or putting the new edit in a completely separate new block?

(sorry if the pictures or wording are a bit improper; this is my first time)

Unedited Blocks

Edited Blocks

change the dropdown content of author post meta in edit post – admin

I am trying to customize the author meta box in the post edit page, as you all know this dropdown is using to assign a post to a corresponding author.

I would like to change the dropdown content. Like currently, its showing display name(username). But i would like to show a user meta field rather than username. Is it possible?

So in the dropdown it will be like Display name(custom user meta field).

I have seen wp_dropdown_users, but no idea how to use it so that i can achieve.

Redirect to a subdirectory frontpage using without using a WP plugin- what files to edit, and how?


My situation

I have a multisite setup, where I use subdirectories for different languages. I use the main homepage for English and subdirectories for other languages, as follows:

mywesbite.com : English language frontpage

mywebsite.com/jp/ : Japanese language frontpage

What I want to do

I would like to redirect people who live in Japan to the Japanese language ffrontpage without using a WordPress plugin.

What I have tried

Using the geoplugin.com , as inspired by the 3rd answer of this stack I edited the theme header.php file by adding the following at the very beginning

$  a = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$  _SERVER['REMOTE_ADDR'])); $  countrycode= $  a['geoplugin_countryCode']; if ($  countrycode=='JP'){         header( 'Location: https://mywebsite.com/jp/' );         exit;     } 

The problem

However, I get the following error

The page isn’t redirecting properly

An error occurred during a connection to mywebsite.com.

This problem can sometimes be caused by disabling or refusing to accept cookies.

Note: the redirecting works fine with an external website, for example

$  a = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$  _SERVER['REMOTE_ADDR'])); $  countrycode= $  a['geoplugin_countryCode']; if ($  countrycode=='JP'){         header( 'Location: https://anotherwebsite.com' );         exit;     } 

Is there a way to fix this error?

I am also open to other solutions not using a WP plugin.

Institution can access my email (inbox/sent items/etc) and edit it? [migrated]

First of all, I have thoroughly read the answers to the following questions and none of them answer my queries:

  • Can Google Chrome read/scan my ProtonMail inbox page?
  • Can my IT department read my Google Hangouts chats while at work?
  • Does company email can access hangouts and private emails?

I am a student at one of the highest ranking universities of the UK (even though I avoid giving much credence to rankings). A couple of days ago, someone found a way to send emails to every single student, masquerading as the Vice Chancellor (the emails appeared to be from his own university email address).

The email body was basically a silly hoax, appearing to have been executed by teenagers (“Dear students, just got off the phone with the prime minister, the University of [censored] will close indefinitely, exams are cancelled, go out and party, etc“).

The same day after a few hours, all the received emails had been deleted from all of our inboxes; a few people had replied to that email though and still had the original ‘hoax’ email. The next day, the email they had sent was deleted as well.


The University evidently has access to our email accounts, but:

  1. Are they allowed to Access/View/Edit out accounts?
  2. Is this legal?
  3. Do I have any say in it? As in, can I refuse using the University email for any type of correspondence and can I demand that they contact me only through my personal email address? If not, is there any way I can preserve my privacy?
  4. If this was not disclosed clearly to any form of “Terms & Conditions” that I agree to by studying here, then what are my rights?
  5. Does GDPR have any effect here, or is the university allowed to do whatever they feel like?
  6. What else do they possibly have access to?

The university uses Office365 (Outlook).

Twenty Twenty edit “Read more” text

I am using wordpress Twenty Twenty theme. So i am trying to change the “Read more” text after each blog and this is the function i am trying to do it with.

function modify_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'; } add_filter( 'the_content_more_link', 'modify_read_more_link' ); 

I found this function (below) in functions.php, which i think is responsible for generating the “Read more” text?

function twentytwenty_read_more_tag( $  html ) { return preg_replace( '/<a(.*)>(.*)<\/a>/iU', sprintf( '<div class="read-more-button-wrap"><a$  1><span class="faux-button">$  2</span> <span class="screen-reader-text">"%1$  s"</span></a></div>', get_the_title( get_the_ID() ) ), $  html ); }  add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' ); 

I changed the first function add_filter to match the second one so now i have this code.

function modify_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Your Read More Link Text</a>'; } add_filter( 'the_content_more_link', 'twentytwenty_read_more_tag' ); 

But the text isn’t changing and if i change the function “modify_read_more_link” to match the original function i get this error.

Cannot redeclare twentytwenty_read_more_tag() (previously declared in /home3/shroomy/public_html/wp-content/themes/twentytwenty/functions.php:572)

I don’t think i even need to change the functions name, but i am completely new to this.

How to design edit version on a white background?

I’m working on a user profile design for a website. The information (name, email, username, etc) is on a pure white background.

The type of edit feature I want to use involves clicking an edit button and the information is instantly changed to editable fields such as text areas. My problem is that I’m not sure how to style the editable fields. One method I have seen used is a white field on a darker background to give the appearance of the edit field being sunken into the page, but since my background is already white, that doesn’t work. Dark styling makes it look like the fields are jumping off the page.

Are there any design styles I can use to make it plainly obvious that these fields are editable now?

Unable to set a People or Group field as Read-Only inside our edit form

I have a custom list inside sharepoint online site, and inside the list’s Edit form i want to disable a People or Group field named “Project Manager” using jQuery, but i am not sure if this is possible, here is a screen shot of the markup:-

enter image description here

now i already have a jQuery function added to my Edit form inside a script editor web part, and i am able to disable some Input and Select fields using the below code, but not sure how i need to disable the People or Group fields? as seems they do not have any input as shown in the above markup..

$  (function() {        $  ("input[id^='ProjectEstimatedDate_']").attr('disabled', 'disabled');       $  ("select[id^='ProjectPriority_']").attr('disabled', 'disabled');       //code goes here for other input and select fields     });