wp/wp-admin/includes/class-wp-ms-themes-list-table.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   503 
   503 
   504 	/**
   504 	/**
   505 	 * Handles the checkbox column output.
   505 	 * Handles the checkbox column output.
   506 	 *
   506 	 *
   507 	 * @since 4.3.0
   507 	 * @since 4.3.0
   508 	 *
   508 	 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support.
   509 	 * @param WP_Theme $theme The current WP_Theme object.
   509 	 *
   510 	 */
   510 	 * @param WP_Theme $item The current WP_Theme object.
   511 	public function column_cb( $theme ) {
   511 	 */
       
   512 	public function column_cb( $item ) {
       
   513 		// Restores the more descriptive, specific name for use within this method.
       
   514 		$theme       = $item;
   512 		$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
   515 		$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
   513 		?>
   516 		?>
   514 		<input type="checkbox" name="checked[]" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" id="<?php echo $checkbox_id; ?>" />
   517 		<input type="checkbox" name="checked[]" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" id="<?php echo $checkbox_id; ?>" />
   515 		<label class="screen-reader-text" for="<?php echo $checkbox_id; ?>" ><?php _e( 'Select' ); ?>  <?php echo $theme->display( 'Name' ); ?></label>
   518 		<label class="screen-reader-text" for="<?php echo $checkbox_id; ?>" ><?php _e( 'Select' ); ?>  <?php echo $theme->display( 'Name' ); ?></label>
   516 		<?php
   519 		<?php
   716 		/* translators: %s: Theme author. */
   719 		/* translators: %s: Theme author. */
   717 		$theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );
   720 		$theme_meta[] = sprintf( __( 'By %s' ), $theme->display( 'Author' ) );
   718 
   721 
   719 		if ( $theme->get( 'ThemeURI' ) ) {
   722 		if ( $theme->get( 'ThemeURI' ) ) {
   720 			/* translators: %s: Theme name. */
   723 			/* translators: %s: Theme name. */
   721 			$aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) );
   724 			$aria_label = sprintf( __( 'Visit theme site for %s' ), $theme->display( 'Name' ) );
   722 
   725 
   723 			$theme_meta[] = sprintf(
   726 			$theme_meta[] = sprintf(
   724 				'<a href="%s" aria-label="%s">%s</a>',
   727 				'<a href="%s" aria-label="%s">%s</a>',
   725 				$theme->display( 'ThemeURI' ),
   728 				$theme->display( 'ThemeURI' ),
   726 				esc_attr( $aria_label ),
   729 				esc_attr( $aria_label ),
   853 
   856 
   854 	/**
   857 	/**
   855 	 * Handles default column output.
   858 	 * Handles default column output.
   856 	 *
   859 	 *
   857 	 * @since 4.3.0
   860 	 * @since 4.3.0
   858 	 *
   861 	 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support.
   859 	 * @param WP_Theme $theme       The current WP_Theme object.
   862 	 *
       
   863 	 * @param WP_Theme $item        The current WP_Theme object.
   860 	 * @param string   $column_name The current column name.
   864 	 * @param string   $column_name The current column name.
   861 	 */
   865 	 */
   862 	public function column_default( $theme, $column_name ) {
   866 	public function column_default( $item, $column_name ) {
   863 		$stylesheet = $theme->get_stylesheet();
       
   864 
       
   865 		/**
   867 		/**
   866 		 * Fires inside each custom column of the Multisite themes list table.
   868 		 * Fires inside each custom column of the Multisite themes list table.
   867 		 *
   869 		 *
   868 		 * @since 3.1.0
   870 		 * @since 3.1.0
   869 		 *
   871 		 *
   870 		 * @param string   $column_name Name of the column.
   872 		 * @param string   $column_name Name of the column.
   871 		 * @param string   $stylesheet  Directory name of the theme.
   873 		 * @param string   $stylesheet  Directory name of the theme.
   872 		 * @param WP_Theme $theme       Current WP_Theme object.
   874 		 * @param WP_Theme $theme       Current WP_Theme object.
   873 		 */
   875 		 */
   874 		do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
   876 		do_action(
       
   877 			'manage_themes_custom_column',
       
   878 			$column_name,
       
   879 			$item->get_stylesheet(), // Directory name of the theme.
       
   880 			$item // Theme object.
       
   881 		);
   875 	}
   882 	}
   876 
   883 
   877 	/**
   884 	/**
   878 	 * Handles the output for a single table row.
   885 	 * Handles the output for a single table row.
   879 	 *
   886 	 *