0

while browsing Wordpress core I came across a file called noop.php that hosts a bunch of empty functions.

 /* Noop functions for load-scripts.php and load-styles.php */

/**
 * @ignore
 */
function home_url() {}

/**
 * @ignore
 */
function includes_url() {}
...

what's the logic behind these functions?
why does the admin section of Wordpress need them?.
thank you.

codedge
  • 4,754
  • 2
  • 22
  • 38
kapreski
  • 761
  • 5
  • 19

1 Answers1

0

You can see the explanation on trac.

Create a new file, wp-admin/includes/noop.php, which loads all of the noop functions for load-script|styles.php and is only loaded by those files. DRYs in the process.

DRY is for: Don't repeat yourself.

It provides methods which are implemented elsewhere and should not be removed.

codedge
  • 4,754
  • 2
  • 22
  • 38
  • thank you for your answer, I came across that on "Wordpress Exchange" but I was hoping for a bit more explanation, or maybe an example like: If this method wasn't available to this file/script this "bad thing" will happen, so this is why we used an empty implementation of it.. you know like a tiny walkthrough – kapreski May 22 '20 at 07:31
  • Got your point. I'll do some research, may be I can find sth. out. – codedge May 22 '20 at 07:37