diff --git a/packages/gatsby-source-wordpress/README.md b/packages/gatsby-source-wordpress/README.md index 8be41ed94ff2d..6b2144a8b8678 100644 --- a/packages/gatsby-source-wordpress/README.md +++ b/packages/gatsby-source-wordpress/README.md @@ -84,7 +84,7 @@ plugins: [ // It can help you debug specific API Endpoints problems verboseOutput: false, // Search and Replace Urls across WordPress content - searchAndReplaceURLs: { + searchAndReplaceContentUrls: { sourceUrl: "https://source-url.com", replacementUrl: "https://replacement-url.com" } diff --git a/packages/gatsby-source-wordpress/src/gatsby-node.js b/packages/gatsby-source-wordpress/src/gatsby-node.js index 10d7d6be979ad..8e5cf5493ded1 100644 --- a/packages/gatsby-source-wordpress/src/gatsby-node.js +++ b/packages/gatsby-source-wordpress/src/gatsby-node.js @@ -27,7 +27,7 @@ exports.sourceNodes = async ( auth = {}, verboseOutput, perPage = 100, - searchAndReplaceURLs = {}, + searchAndReplaceContentUrls = {}, } ) => { const { createNode } = boundActionCreators @@ -96,7 +96,7 @@ exports.sourceNodes = async ( // Search and replace Content Urls entities = normalize.searchReplaceContentUrls({ entities, - searchAndReplaceURLs, + searchAndReplaceContentUrls, }) // creates nodes for each entry diff --git a/packages/gatsby-source-wordpress/src/normalize.js b/packages/gatsby-source-wordpress/src/normalize.js index 94875df061652..c67c46f9f9600 100644 --- a/packages/gatsby-source-wordpress/src/normalize.js +++ b/packages/gatsby-source-wordpress/src/normalize.js @@ -234,19 +234,19 @@ exports.mapTagsCategoriesToTaxonomies = entities => return e }) -exports.searchReplaceContentUrls = function ({ entities, searchAndReplaceURLs }) { +exports.searchReplaceContentUrls = function ({ entities, searchAndReplaceContentUrls }) { if ( - !(_.isPlainObject(searchAndReplaceURLs)) || - !(_.has(searchAndReplaceURLs, `sourceUrl`)) || - !(_.has(searchAndReplaceURLs, `replacementUrl`)) || - typeof searchAndReplaceURLs.sourceUrl !== `string` || - typeof searchAndReplaceURLs.replacementUrl !== `string` + !(_.isPlainObject(searchAndReplaceContentUrls)) || + !(_.has(searchAndReplaceContentUrls, `sourceUrl`)) || + !(_.has(searchAndReplaceContentUrls, `replacementUrl`)) || + typeof searchAndReplaceContentUrls.sourceUrl !== `string` || + typeof searchAndReplaceContentUrls.replacementUrl !== `string` ) { return entities } - const { sourceUrl, replacementUrl } = searchAndReplaceURLs + const { sourceUrl, replacementUrl } = searchAndReplaceContentUrls const _blacklist = [ `_links`,