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

Commit 3384041

Browse files
authored
Merge pull request #284 from xwp/feature/improve-flow-method-names
Rename createPost to startCreatePostFlow and editPost to startEditPostFlow
2 parents 8c08d66 + 809c414 commit 3384041

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

js/customize-posts.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@
588588

589589
editButton.on( 'click', function( e ) {
590590
e.preventDefault();
591-
component.editPost( {
591+
component.startEditPostFlow( {
592592
postId: parseInt( control.setting.get(), 10 ),
593593
initiatingButton: $( this ),
594594
originatingConstruct: control,
@@ -598,8 +598,7 @@
598598
} );
599599
createButton.on( 'click', function( e ) {
600600
e.preventDefault();
601-
602-
component.createPost( {
601+
component.startCreatePostFlow( {
603602
postType: 'page',
604603
initiatingButton: $( this ),
605604
originatingConstruct: control,
@@ -633,7 +632,7 @@
633632
* @param {Function} [args.breadcrumbReturnCallback] - Function that is called when breadcrumbs are followed back. The post setting is passed as its argument.
634633
* @returns {jQuery.promise} Promise from wp.customize.Posts.insertAutoDraftPost().
635634
*/
636-
component.createPost = function createPost( args ) {
635+
component.startCreatePostFlow = function startCreatePostFlow( args ) {
637636
var promise, options, postTypeObj, errorCode = 'create_post_failure';
638637

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

759758
options = _.extend(

0 commit comments

Comments
 (0)