Skip to content

Instantly share code, notes, and snippets.

@ahmadawais

ahmadawais/wp.js Secret

Created May 21, 2018 18:03
Show Gist options
  • Save ahmadawais/432f285e2ec7dc70bac6973d7f23a1ff to your computer and use it in GitHub Desktop.
Save ahmadawais/432f285e2ec7dc70bac6973d7f23a1ff to your computer and use it in GitHub Desktop.
wp.js
var WP = require( 'wordpress-rest-api' );
var _ = require( 'lodash' );
var config = _.pick( require( './config' ).wordpress, [
// Whitelist valid config keys
'username',
'password',
'endpoint'
]);
var wp = new WP( config );
module.exports = wp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment