Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #284 from xwp/feature/improve-flow-method-names
Browse files Browse the repository at this point in the history
Rename createPost to startCreatePostFlow and editPost to startEditPostFlow
  • Loading branch information
westonruter authored Sep 19, 2016
2 parents 8c08d66 + 809c414 commit 3384041
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/customize-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@

editButton.on( 'click', function( e ) {
e.preventDefault();
component.editPost( {
component.startEditPostFlow( {
postId: parseInt( control.setting.get(), 10 ),
initiatingButton: $( this ),
originatingConstruct: control,
Expand All @@ -598,8 +598,7 @@
} );
createButton.on( 'click', function( e ) {
e.preventDefault();

component.createPost( {
component.startCreatePostFlow( {
postType: 'page',
initiatingButton: $( this ),
originatingConstruct: control,
Expand Down Expand Up @@ -633,7 +632,7 @@
* @param {Function} [args.breadcrumbReturnCallback] - Function that is called when breadcrumbs are followed back. The post setting is passed as its argument.
* @returns {jQuery.promise} Promise from wp.customize.Posts.insertAutoDraftPost().
*/
component.createPost = function createPost( args ) {
component.startCreatePostFlow = function startCreatePostFlow( args ) {
var promise, options, postTypeObj, errorCode = 'create_post_failure';

options = _.extend(
Expand Down Expand Up @@ -753,7 +752,7 @@
* @param {Function} [args.breadcrumbReturnCallback] - Function that is called when breadcrumbs are followed back. The post setting is passed as its argument.
* @returns {jQuery.promise} Promise from wp.customize.Posts.ensurePosts().
*/
component.editPost = function editPost( args ) {
component.startEditPostFlow = function startEditPostFlow( args ) {
var options, promise, errorCode = 'edit_post_failure';

options = _.extend(
Expand Down

0 comments on commit 3384041

Please sign in to comment.