Skip to content

Instantly share code, notes, and snippets.

const { withDangerousMod, withPlugins } = require("@expo/config-plugins");
const {
mergeContents,
} = require("@expo/config-plugins/build/utils/generateCode");
const fs = require("fs");
const path = require("path");
async function readFileAsync(path) {
return fs.promises.readFile(path, "utf8");
}
@maugelves
maugelves / polylang.php
Last active June 11, 2021 05:56
This functions returns a WordPress page permalink for the current language by its slug.
<?php
/**
* This function returns a page permalink
* for the current website language.
*
* @author Mauricio Gelves <[email protected]>
* @param $page_slug string WordPress page slug
* @return string|false Page Permalink or false if the page is not found
*/