version}\n"; } if ( stripos( $line, ">define( 'WC_ADMIN_VERSION_NUMBER'," ) !== false ) { $line = "\t\t\$this->define( 'WC_ADMIN_VERSION_NUMBER', '{$package_json->version}' );\n"; } if ( stripos( $line, "const VERSION =" ) !== false ) { $line = "\tconst VERSION = '{$package_json->version}';\n"; } if ( stripos( $line, 'Stable tag: ' ) !== false ) { $line = "Stable tag: {$package_json->version}\n"; } if ( stripos( $line, '"name": "woocommerce/woocommerce-admin",' ) !== false ) { $line .= "\t\"version\": \"{$package_json->version}\",\n"; } $lines[] = $line; } file_put_contents( $filename, $lines ); } replace_version( 'woocommerce-admin.php', $package ); replace_version( 'src/FeaturePlugin.php', $package ); replace_version( 'src/Package.php', $package ); replace_version( 'readme.txt', $package ); replace_version( 'composer.json', $package );