Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from quasel/patch-1
Browse files Browse the repository at this point in the history
Update set-post-title.php
  • Loading branch information
sc0ttkclark authored Jun 7, 2018
2 parents 549883c + 56e7a43 commit 02c379c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ function slug_set_title($pieces, $is_new_item) {

//get value of "beverage" if possible
if ( isset( $pieces[ 'fields' ][ 'beverage' ] ) && isset( $pieces[ 'fields'][ 'beverage' ][ 'value' ] ) && is_string( $pieces[ 'fields' ][ 'beverage' ][ 'value' ] ) ) {
$sandwich = $pieces[ 'fields' ][ 'sandwich' ][ 'value' ];
$beverage = $pieces[ 'fields' ][ 'beverage' ][ 'value' ];
}

//set post title using $sandwich and $beverage
$pieces[ 'fields' ][ 'post_title' ][ 'value' ] = $sandwich . ' and ' . $beverage;
$pieces[ 'object_fields' ][ 'post_title' ][ 'value' ] = $sandwich . ' and ' . $beverage;

//return $pieces to save
return $pieces;
Expand Down

0 comments on commit 02c379c

Please sign in to comment.