Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_validate_site_data

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
509       *
510       * @since 5.1.0
511       *
512       * @param WP_Error     $errors   Error object to add validation errors to.
513       * @param array        $data     Associative array of complete site data. See {@see wp_insert_site()}
514       *                               for the included data.
515       * @param WP_Site|null $old_site The old site object if the data belongs to a site being updated,
516       *                               or null if it is a new site being inserted.
517       */
518      do_action( 'wp_validate_site_data', $errors, $data, $old_site );
519
520      if ( ! empty( $errors->errors ) ) {
521           return $errors;
522      }
523
524      // Prepare for database.
525      $data['site_id'] = $data['network_id'];
526      unset( $data['network_id'] );
527