While configuring Ctags to recognize WordPress functions, I came across the noop.php file. Here is an excerpt:

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

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

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

Why does this file exist? Can I remove it to let VIM better navigate the code?

2 s
2

The description on top of the page you have linked gives an explanation:

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. See #33813.

Additionally there is the trac ticket #33813 linked, which gives some additional insight. You generally shouldn’t delete core files so consider noop.php as a necessary file.

Leave a Reply

Your email address will not be published. Required fields are marked *