Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/woocomme.../includes
File: class-wc-shortcodes.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Shortcodes
[2] Fix | Delete
*
[3] Fix | Delete
* @package WooCommerce\Classes
[4] Fix | Delete
* @version 3.2.0
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
use Automattic\WooCommerce\Enums\ProductStatus;
[8] Fix | Delete
use Automattic\WooCommerce\Enums\ProductType;
[9] Fix | Delete
[10] Fix | Delete
defined( 'ABSPATH' ) || exit;
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* WooCommerce Shortcodes class.
[14] Fix | Delete
*/
[15] Fix | Delete
class WC_Shortcodes {
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* Init shortcodes.
[19] Fix | Delete
*/
[20] Fix | Delete
public static function init() {
[21] Fix | Delete
$shortcodes = array(
[22] Fix | Delete
'product' => __CLASS__ . '::product',
[23] Fix | Delete
'product_page' => __CLASS__ . '::product_page',
[24] Fix | Delete
'product_category' => __CLASS__ . '::product_category',
[25] Fix | Delete
'product_categories' => __CLASS__ . '::product_categories',
[26] Fix | Delete
'add_to_cart' => __CLASS__ . '::product_add_to_cart',
[27] Fix | Delete
'add_to_cart_url' => __CLASS__ . '::product_add_to_cart_url',
[28] Fix | Delete
'products' => __CLASS__ . '::products',
[29] Fix | Delete
'recent_products' => __CLASS__ . '::recent_products',
[30] Fix | Delete
'sale_products' => __CLASS__ . '::sale_products',
[31] Fix | Delete
'best_selling_products' => __CLASS__ . '::best_selling_products',
[32] Fix | Delete
'top_rated_products' => __CLASS__ . '::top_rated_products',
[33] Fix | Delete
'featured_products' => __CLASS__ . '::featured_products',
[34] Fix | Delete
'product_attribute' => __CLASS__ . '::product_attribute',
[35] Fix | Delete
'related_products' => __CLASS__ . '::related_products',
[36] Fix | Delete
'shop_messages' => __CLASS__ . '::shop_messages',
[37] Fix | Delete
'woocommerce_order_tracking' => __CLASS__ . '::order_tracking',
[38] Fix | Delete
'woocommerce_cart' => __CLASS__ . '::cart',
[39] Fix | Delete
'woocommerce_checkout' => __CLASS__ . '::checkout',
[40] Fix | Delete
'woocommerce_my_account' => __CLASS__ . '::my_account',
[41] Fix | Delete
);
[42] Fix | Delete
[43] Fix | Delete
foreach ( $shortcodes as $shortcode => $function ) {
[44] Fix | Delete
add_shortcode( apply_filters( "{$shortcode}_shortcode_tag", $shortcode ), $function );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
// Alias for pre 2.1 compatibility.
[48] Fix | Delete
add_shortcode( 'woocommerce_messages', __CLASS__ . '::shop_messages' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Shortcode Wrapper.
[53] Fix | Delete
*
[54] Fix | Delete
* @param string[] $function Callback function.
[55] Fix | Delete
* @param array $atts Attributes. Default to empty array.
[56] Fix | Delete
* @param array $wrapper Customer wrapper data.
[57] Fix | Delete
*
[58] Fix | Delete
* @return string
[59] Fix | Delete
*/
[60] Fix | Delete
public static function shortcode_wrapper(
[61] Fix | Delete
$function,
[62] Fix | Delete
$atts = array(),
[63] Fix | Delete
$wrapper = array(
[64] Fix | Delete
'class' => 'woocommerce',
[65] Fix | Delete
'before' => null,
[66] Fix | Delete
'after' => null,
[67] Fix | Delete
)
[68] Fix | Delete
) {
[69] Fix | Delete
ob_start();
[70] Fix | Delete
[71] Fix | Delete
// @codingStandardsIgnoreStart
[72] Fix | Delete
echo empty( $wrapper['before'] ) ? '<div class="' . esc_attr( $wrapper['class'] ) . '">' : $wrapper['before'];
[73] Fix | Delete
call_user_func( $function, $atts );
[74] Fix | Delete
echo empty( $wrapper['after'] ) ? '</div>' : $wrapper['after'];
[75] Fix | Delete
// @codingStandardsIgnoreEnd
[76] Fix | Delete
[77] Fix | Delete
return ob_get_clean();
[78] Fix | Delete
}
[79] Fix | Delete
[80] Fix | Delete
/**
[81] Fix | Delete
* Cart page shortcode.
[82] Fix | Delete
*
[83] Fix | Delete
* @return string
[84] Fix | Delete
*/
[85] Fix | Delete
public static function cart() {
[86] Fix | Delete
return is_null( WC()->cart ) ? '' : self::shortcode_wrapper( array( 'WC_Shortcode_Cart', 'output' ) );
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
/**
[90] Fix | Delete
* Checkout page shortcode.
[91] Fix | Delete
*
[92] Fix | Delete
* @param array $atts Attributes.
[93] Fix | Delete
* @return string
[94] Fix | Delete
*/
[95] Fix | Delete
public static function checkout( $atts ) {
[96] Fix | Delete
return self::shortcode_wrapper( array( 'WC_Shortcode_Checkout', 'output' ), $atts );
[97] Fix | Delete
}
[98] Fix | Delete
[99] Fix | Delete
/**
[100] Fix | Delete
* Order tracking page shortcode.
[101] Fix | Delete
*
[102] Fix | Delete
* @param array $atts Attributes.
[103] Fix | Delete
* @return string
[104] Fix | Delete
*/
[105] Fix | Delete
public static function order_tracking( $atts ) {
[106] Fix | Delete
return self::shortcode_wrapper( array( 'WC_Shortcode_Order_Tracking', 'output' ), $atts );
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* My account page shortcode.
[111] Fix | Delete
*
[112] Fix | Delete
* @param array $atts Attributes.
[113] Fix | Delete
* @return string
[114] Fix | Delete
*/
[115] Fix | Delete
public static function my_account( $atts ) {
[116] Fix | Delete
return self::shortcode_wrapper( array( 'WC_Shortcode_My_Account', 'output' ), $atts );
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
/**
[120] Fix | Delete
* List products in a category shortcode.
[121] Fix | Delete
*
[122] Fix | Delete
* @param array $atts Attributes.
[123] Fix | Delete
* @return string
[124] Fix | Delete
*/
[125] Fix | Delete
public static function product_category( $atts ) {
[126] Fix | Delete
if ( empty( $atts['category'] ) ) {
[127] Fix | Delete
return '';
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
$atts = array_merge(
[131] Fix | Delete
array(
[132] Fix | Delete
'limit' => '12',
[133] Fix | Delete
'columns' => '4',
[134] Fix | Delete
'orderby' => 'menu_order title',
[135] Fix | Delete
'order' => 'ASC',
[136] Fix | Delete
'category' => '',
[137] Fix | Delete
'cat_operator' => 'IN',
[138] Fix | Delete
),
[139] Fix | Delete
(array) $atts
[140] Fix | Delete
);
[141] Fix | Delete
[142] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'product_category' );
[143] Fix | Delete
[144] Fix | Delete
return $shortcode->get_content();
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
/**
[148] Fix | Delete
* List all (or limited) product categories.
[149] Fix | Delete
*
[150] Fix | Delete
* @param array $atts Attributes.
[151] Fix | Delete
* @return string
[152] Fix | Delete
*/
[153] Fix | Delete
public static function product_categories( $atts ) {
[154] Fix | Delete
if ( isset( $atts['number'] ) ) {
[155] Fix | Delete
$atts['limit'] = $atts['number'];
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
$atts = shortcode_atts(
[159] Fix | Delete
array(
[160] Fix | Delete
'limit' => '-1',
[161] Fix | Delete
'orderby' => 'name',
[162] Fix | Delete
'order' => 'ASC',
[163] Fix | Delete
'columns' => '4',
[164] Fix | Delete
'hide_empty' => 1,
[165] Fix | Delete
'parent' => '',
[166] Fix | Delete
'ids' => '',
[167] Fix | Delete
),
[168] Fix | Delete
$atts,
[169] Fix | Delete
'product_categories'
[170] Fix | Delete
);
[171] Fix | Delete
[172] Fix | Delete
$ids = array_filter( array_map( 'trim', explode( ',', $atts['ids'] ) ) );
[173] Fix | Delete
$hide_empty = ( true === $atts['hide_empty'] || 'true' === $atts['hide_empty'] || 1 === $atts['hide_empty'] || '1' === $atts['hide_empty'] ) ? 1 : 0;
[174] Fix | Delete
[175] Fix | Delete
// Get terms and workaround WP bug with parents/pad counts.
[176] Fix | Delete
$args = array(
[177] Fix | Delete
'orderby' => $atts['orderby'],
[178] Fix | Delete
'order' => $atts['order'],
[179] Fix | Delete
'hide_empty' => $hide_empty,
[180] Fix | Delete
'include' => $ids,
[181] Fix | Delete
'pad_counts' => true,
[182] Fix | Delete
'child_of' => $atts['parent'],
[183] Fix | Delete
);
[184] Fix | Delete
[185] Fix | Delete
$product_categories = apply_filters(
[186] Fix | Delete
'woocommerce_product_categories',
[187] Fix | Delete
get_terms( 'product_cat', $args )
[188] Fix | Delete
);
[189] Fix | Delete
[190] Fix | Delete
if ( '' !== $atts['parent'] ) {
[191] Fix | Delete
$product_categories = wp_list_filter(
[192] Fix | Delete
$product_categories,
[193] Fix | Delete
array(
[194] Fix | Delete
'parent' => $atts['parent'],
[195] Fix | Delete
)
[196] Fix | Delete
);
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
if ( $hide_empty ) {
[200] Fix | Delete
foreach ( $product_categories as $key => $category ) {
[201] Fix | Delete
if ( 0 === $category->count ) {
[202] Fix | Delete
unset( $product_categories[ $key ] );
[203] Fix | Delete
}
[204] Fix | Delete
}
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
$atts['limit'] = '-1' === $atts['limit'] ? null : intval( $atts['limit'] );
[208] Fix | Delete
if ( $atts['limit'] ) {
[209] Fix | Delete
$product_categories = array_slice( $product_categories, 0, $atts['limit'] );
[210] Fix | Delete
}
[211] Fix | Delete
[212] Fix | Delete
$columns = absint( $atts['columns'] );
[213] Fix | Delete
[214] Fix | Delete
wc_set_loop_prop( 'columns', $columns );
[215] Fix | Delete
wc_set_loop_prop( 'is_shortcode', true );
[216] Fix | Delete
[217] Fix | Delete
ob_start();
[218] Fix | Delete
[219] Fix | Delete
if ( $product_categories ) {
[220] Fix | Delete
woocommerce_product_loop_start();
[221] Fix | Delete
[222] Fix | Delete
foreach ( $product_categories as $category ) {
[223] Fix | Delete
wc_get_template(
[224] Fix | Delete
'content-product_cat.php',
[225] Fix | Delete
array(
[226] Fix | Delete
'category' => $category,
[227] Fix | Delete
)
[228] Fix | Delete
);
[229] Fix | Delete
}
[230] Fix | Delete
[231] Fix | Delete
woocommerce_product_loop_end();
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
wc_reset_loop();
[235] Fix | Delete
[236] Fix | Delete
return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
[237] Fix | Delete
}
[238] Fix | Delete
[239] Fix | Delete
/**
[240] Fix | Delete
* Recent Products shortcode.
[241] Fix | Delete
*
[242] Fix | Delete
* @param array $atts Attributes.
[243] Fix | Delete
* @return string
[244] Fix | Delete
*/
[245] Fix | Delete
public static function recent_products( $atts ) {
[246] Fix | Delete
$atts = array_merge(
[247] Fix | Delete
array(
[248] Fix | Delete
'limit' => '12',
[249] Fix | Delete
'columns' => '4',
[250] Fix | Delete
'orderby' => 'date',
[251] Fix | Delete
'order' => 'DESC',
[252] Fix | Delete
'category' => '',
[253] Fix | Delete
'cat_operator' => 'IN',
[254] Fix | Delete
),
[255] Fix | Delete
(array) $atts
[256] Fix | Delete
);
[257] Fix | Delete
[258] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'recent_products' );
[259] Fix | Delete
[260] Fix | Delete
return $shortcode->get_content();
[261] Fix | Delete
}
[262] Fix | Delete
[263] Fix | Delete
/**
[264] Fix | Delete
* List multiple products shortcode.
[265] Fix | Delete
*
[266] Fix | Delete
* @param array $atts Attributes.
[267] Fix | Delete
* @return string
[268] Fix | Delete
*/
[269] Fix | Delete
public static function products( $atts ) {
[270] Fix | Delete
$atts = (array) $atts;
[271] Fix | Delete
$type = 'products';
[272] Fix | Delete
[273] Fix | Delete
// Allow list product based on specific cases.
[274] Fix | Delete
if ( isset( $atts['on_sale'] ) && wc_string_to_bool( $atts['on_sale'] ) ) {
[275] Fix | Delete
$type = 'sale_products';
[276] Fix | Delete
} elseif ( isset( $atts['best_selling'] ) && wc_string_to_bool( $atts['best_selling'] ) ) {
[277] Fix | Delete
$type = 'best_selling_products';
[278] Fix | Delete
} elseif ( isset( $atts['top_rated'] ) && wc_string_to_bool( $atts['top_rated'] ) ) {
[279] Fix | Delete
$type = 'top_rated_products';
[280] Fix | Delete
}
[281] Fix | Delete
[282] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, $type );
[283] Fix | Delete
[284] Fix | Delete
return $shortcode->get_content();
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Display a single product.
[289] Fix | Delete
*
[290] Fix | Delete
* @param array $atts Attributes.
[291] Fix | Delete
* @return string
[292] Fix | Delete
*/
[293] Fix | Delete
public static function product( $atts ) {
[294] Fix | Delete
if ( empty( $atts ) ) {
[295] Fix | Delete
return '';
[296] Fix | Delete
}
[297] Fix | Delete
[298] Fix | Delete
$atts['skus'] = isset( $atts['sku'] ) ? $atts['sku'] : '';
[299] Fix | Delete
$atts['ids'] = isset( $atts['id'] ) ? $atts['id'] : '';
[300] Fix | Delete
$atts['limit'] = '1';
[301] Fix | Delete
$shortcode = new WC_Shortcode_Products( (array) $atts, 'product' );
[302] Fix | Delete
[303] Fix | Delete
return $shortcode->get_content();
[304] Fix | Delete
}
[305] Fix | Delete
[306] Fix | Delete
/**
[307] Fix | Delete
* Display a single product price + cart button.
[308] Fix | Delete
*
[309] Fix | Delete
* @param array $atts Attributes.
[310] Fix | Delete
* @return string
[311] Fix | Delete
*/
[312] Fix | Delete
public static function product_add_to_cart( $atts ) {
[313] Fix | Delete
global $post;
[314] Fix | Delete
[315] Fix | Delete
if ( empty( $atts ) ) {
[316] Fix | Delete
return '';
[317] Fix | Delete
}
[318] Fix | Delete
[319] Fix | Delete
$atts = shortcode_atts(
[320] Fix | Delete
array(
[321] Fix | Delete
'id' => '',
[322] Fix | Delete
'class' => '',
[323] Fix | Delete
'quantity' => '1',
[324] Fix | Delete
'sku' => '',
[325] Fix | Delete
'style' => 'border:4px solid #ccc; padding: 12px;',
[326] Fix | Delete
'show_price' => 'true',
[327] Fix | Delete
),
[328] Fix | Delete
$atts,
[329] Fix | Delete
'product_add_to_cart'
[330] Fix | Delete
);
[331] Fix | Delete
[332] Fix | Delete
if ( ! empty( $atts['id'] ) ) {
[333] Fix | Delete
$product_data = get_post( $atts['id'] );
[334] Fix | Delete
} elseif ( ! empty( $atts['sku'] ) ) {
[335] Fix | Delete
$product_id = wc_get_product_id_by_sku( $atts['sku'] );
[336] Fix | Delete
$product_data = get_post( $product_id );
[337] Fix | Delete
} else {
[338] Fix | Delete
return '';
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
$product = is_object( $product_data ) && in_array( $product_data->post_type, array( 'product', 'product_variation' ), true ) ? wc_setup_product_data( $product_data ) : false;
[342] Fix | Delete
[343] Fix | Delete
if ( ! $product ) {
[344] Fix | Delete
return '';
[345] Fix | Delete
}
[346] Fix | Delete
[347] Fix | Delete
ob_start();
[348] Fix | Delete
[349] Fix | Delete
echo '<p class="product woocommerce add_to_cart_inline ' . esc_attr( $atts['class'] ) . '" style="' . ( empty( $atts['style'] ) ? '' : esc_attr( $atts['style'] ) ) . '">';
[350] Fix | Delete
[351] Fix | Delete
if ( wc_string_to_bool( $atts['show_price'] ) ) {
[352] Fix | Delete
// @codingStandardsIgnoreStart
[353] Fix | Delete
echo $product->get_price_html();
[354] Fix | Delete
// @codingStandardsIgnoreEnd
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
woocommerce_template_loop_add_to_cart(
[358] Fix | Delete
array(
[359] Fix | Delete
'quantity' => $atts['quantity'],
[360] Fix | Delete
)
[361] Fix | Delete
);
[362] Fix | Delete
[363] Fix | Delete
echo '</p>';
[364] Fix | Delete
[365] Fix | Delete
// Restore Product global in case this is shown inside a product post.
[366] Fix | Delete
wc_setup_product_data( $post );
[367] Fix | Delete
[368] Fix | Delete
return ob_get_clean();
[369] Fix | Delete
}
[370] Fix | Delete
[371] Fix | Delete
/**
[372] Fix | Delete
* Get the add to cart URL for a product.
[373] Fix | Delete
*
[374] Fix | Delete
* @param array $atts Attributes.
[375] Fix | Delete
* @return string
[376] Fix | Delete
*/
[377] Fix | Delete
public static function product_add_to_cart_url( $atts ) {
[378] Fix | Delete
if ( empty( $atts ) ) {
[379] Fix | Delete
return '';
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
if ( isset( $atts['id'] ) ) {
[383] Fix | Delete
$product_data = get_post( $atts['id'] );
[384] Fix | Delete
} elseif ( isset( $atts['sku'] ) ) {
[385] Fix | Delete
$product_id = wc_get_product_id_by_sku( $atts['sku'] );
[386] Fix | Delete
$product_data = get_post( $product_id );
[387] Fix | Delete
} else {
[388] Fix | Delete
return '';
[389] Fix | Delete
}
[390] Fix | Delete
[391] Fix | Delete
$product = is_object( $product_data ) && in_array( $product_data->post_type, array( 'product', 'product_variation' ), true ) ? wc_setup_product_data( $product_data ) : false;
[392] Fix | Delete
[393] Fix | Delete
if ( ! $product ) {
[394] Fix | Delete
return '';
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
$_product = wc_get_product( $product_data );
[398] Fix | Delete
[399] Fix | Delete
return esc_url( $_product->add_to_cart_url() );
[400] Fix | Delete
}
[401] Fix | Delete
[402] Fix | Delete
/**
[403] Fix | Delete
* List all products on sale.
[404] Fix | Delete
*
[405] Fix | Delete
* @param array $atts Attributes.
[406] Fix | Delete
* @return string
[407] Fix | Delete
*/
[408] Fix | Delete
public static function sale_products( $atts ) {
[409] Fix | Delete
$atts = array_merge(
[410] Fix | Delete
array(
[411] Fix | Delete
'limit' => '12',
[412] Fix | Delete
'columns' => '4',
[413] Fix | Delete
'orderby' => 'title',
[414] Fix | Delete
'order' => 'ASC',
[415] Fix | Delete
'category' => '',
[416] Fix | Delete
'cat_operator' => 'IN',
[417] Fix | Delete
),
[418] Fix | Delete
(array) $atts
[419] Fix | Delete
);
[420] Fix | Delete
[421] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'sale_products' );
[422] Fix | Delete
[423] Fix | Delete
return $shortcode->get_content();
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* List best selling products on sale.
[428] Fix | Delete
*
[429] Fix | Delete
* @param array $atts Attributes.
[430] Fix | Delete
* @return string
[431] Fix | Delete
*/
[432] Fix | Delete
public static function best_selling_products( $atts ) {
[433] Fix | Delete
$atts = array_merge(
[434] Fix | Delete
array(
[435] Fix | Delete
'limit' => '12',
[436] Fix | Delete
'columns' => '4',
[437] Fix | Delete
'category' => '',
[438] Fix | Delete
'cat_operator' => 'IN',
[439] Fix | Delete
),
[440] Fix | Delete
(array) $atts
[441] Fix | Delete
);
[442] Fix | Delete
[443] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'best_selling_products' );
[444] Fix | Delete
[445] Fix | Delete
return $shortcode->get_content();
[446] Fix | Delete
}
[447] Fix | Delete
[448] Fix | Delete
/**
[449] Fix | Delete
* List top rated products on sale.
[450] Fix | Delete
*
[451] Fix | Delete
* @param array $atts Attributes.
[452] Fix | Delete
* @return string
[453] Fix | Delete
*/
[454] Fix | Delete
public static function top_rated_products( $atts ) {
[455] Fix | Delete
$atts = array_merge(
[456] Fix | Delete
array(
[457] Fix | Delete
'limit' => '12',
[458] Fix | Delete
'columns' => '4',
[459] Fix | Delete
'orderby' => 'title',
[460] Fix | Delete
'order' => 'ASC',
[461] Fix | Delete
'category' => '',
[462] Fix | Delete
'cat_operator' => 'IN',
[463] Fix | Delete
),
[464] Fix | Delete
(array) $atts
[465] Fix | Delete
);
[466] Fix | Delete
[467] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'top_rated_products' );
[468] Fix | Delete
[469] Fix | Delete
return $shortcode->get_content();
[470] Fix | Delete
}
[471] Fix | Delete
[472] Fix | Delete
/**
[473] Fix | Delete
* Output featured products.
[474] Fix | Delete
*
[475] Fix | Delete
* @param array $atts Attributes.
[476] Fix | Delete
* @return string
[477] Fix | Delete
*/
[478] Fix | Delete
public static function featured_products( $atts ) {
[479] Fix | Delete
$atts = array_merge(
[480] Fix | Delete
array(
[481] Fix | Delete
'limit' => '12',
[482] Fix | Delete
'columns' => '4',
[483] Fix | Delete
'orderby' => 'date',
[484] Fix | Delete
'order' => 'DESC',
[485] Fix | Delete
'category' => '',
[486] Fix | Delete
'cat_operator' => 'IN',
[487] Fix | Delete
),
[488] Fix | Delete
(array) $atts
[489] Fix | Delete
);
[490] Fix | Delete
[491] Fix | Delete
$atts['visibility'] = 'featured';
[492] Fix | Delete
[493] Fix | Delete
$shortcode = new WC_Shortcode_Products( $atts, 'featured_products' );
[494] Fix | Delete
[495] Fix | Delete
return $shortcode->get_content();
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
/**
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function