Can remove parent assignment as its not used

This commit is contained in:
Shiva Poudel 2016-02-12 23:50:06 +05:45
parent f6698006ce
commit 70c755c09e
1 changed files with 3 additions and 4 deletions

View File

@ -202,9 +202,8 @@ function wc_get_featured_product_ids() {
/**
* Filter to allow product_cat in the permalinks for products.
*
* @access public
* @param string $permalink The existing permalink URL.
* @param WP_Post $post
* @param string $permalink The existing permalink URL.
* @param WP_Post $post
* @return string
*/
function wc_product_post_type_link( $permalink, $post ) {
@ -228,7 +227,7 @@ function wc_product_post_type_link( $permalink, $post ) {
$category_object = get_term( $category_object, 'product_cat' );
$product_cat = $category_object->slug;
if ( $parent = $category_object->parent ) {
if ( $category_object->parent ) {
$ancestors = get_ancestors( $category_object->term_id, 'product_cat' );
foreach ( $ancestors as $ancestor ) {
$ancestor_object = get_term( $ancestor, 'product_cat' );