class-tp-dev-uploads.php
function placehold( $rules ) {
		if( 'development' == WP_ENV || 'staging' == WP_ENV ) {
			$dir = wp_upload_dir();

			$uploads_rel_path = str_replace( trailingslashit( home_url() ), '', $dir['baseurl'] );

			$tp_images_rules = array(
				'',
				'# BEGIN TP Development uploads',
				'RewriteCond %{REQUEST_FILENAME} !-f',
				'RewriteRule ^' . $uploads_rel_path . '/(.*)-([0-9]+)x([0-9]+).(gif|jpe?g|png|bmp)$ http://www.placehold.it/$2x$3 [NC,L]',
				'RewriteCond %{REQUEST_FILENAME} !-f',
				'RewriteRule ^' . $uploads_rel_path . '/(.*)(gif|jpe?g|png|bmp)$ http://www.placehold.it/600x600 [NC,L]',
				'# END TP Development uploads',
				'',
			);

			$rules = explode( "\n", $rules );
			$rules = wp_parse_args( $rules, $tp_images_rules );
			$rules = implode( "\n", $rules );
		}

		return $rules;
	}
function placehold( $rules ) {
		if( 'development' == WP_ENV || 'staging' == WP_ENV ) {
			$dir = wp_upload_dir();

			$uploads_rel_path = str_replace( trailingslashit( home_url() ), '', $dir['baseurl'] );

			$tp_images_rules = array(
				'',
				'# BEGIN TP Development uploads',
				'RewriteCond %{REQUEST_FILENAME} !-f',
				'RewriteRule ^' . $uploads_rel_path . '/(.*)-([0-9]+)x([0-9]+).(gif|jpe?g|png|bmp)$ http://www.placehold.it/$2x$3 [NC,L]',
				'RewriteCond %{REQUEST_FILENAME} !-f',
				'RewriteRule ^' . $uploads_rel_path . '/(.*)(gif|jpe?g|png|bmp)$ http://www.placehold.it/600x600 [NC,L]',
				'# END TP Development uploads',
				'',
			);

			$rules = explode( "\n", $rules );
			$rules = wp_parse_args( $rules, $tp_images_rules );
			$rules = implode( "\n", $rules );
		}

		return $rules;
	}
function placehold ( $ rules ) { if ( 'development' == WP_ENV || 'staging' == WP_ENV ) { $ dir = wp_upload_dir ( ) ; $ uploads_rel_path = str_replace ( trailingslashit ( home_url ( ) ) , '' , $ dir [ 'baseurl' ] ) ; $ tp_images_rules = array ( '' , '# BEGIN TP Development uploads' , 'RewriteCond %{REQUEST_FILENAME} !-f' , 'RewriteRule ^' . $ uploads_rel_path . '/(.*)-([0-9]+)x([0-9]+).(gif|jpe?g|png|bmp)$ http://www.placehold.it/$2x$3 [NC,L]' , 'RewriteCond %{REQUEST_FILENAME} !-f' , 'RewriteRule ^' . $ uploads_rel_path . '/(.*)(gif|jpe?g|png|bmp)$ http://www.placehold.it/600x600 [NC,L]' , '# END TP Development uploads' , '' , ) ; $ rules = explode ( "\n" , $ rules ) ; $ rules = wp_parse_args ( $ rules , $ tp_images_rules ) ; $ rules = implode ( "\n" , $ rules ) ; } return $ rules ; }
Redirect images from uploads to placehold.it on develop and release environments if they don't exist

@param  string $rules WordPress' own rules
@return string        New rules
Redirect images from uploads to placehold . it on develop and release environments if they don t exist