تابع ووکامرسی wc_get_permalink_structure دریافت ساختار لینک دهی با توجه به تنظیمات

تابع ووکامرسی wc_get_permalink_structure – دریافت ساختار لینک دهی با توجه به تنظیمات
Syntax – سینتکس
(array) wc_get_permalink_structure();
Usage – نحوه استفاده
if ( !function_exists( 'wc_get_permalink_structure' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_get_permalink_structure();
Defined – محل تعریف
/includes/wc-core-functions.php
function wc_get_permalink_structure() {
if ( function_exists( 'switch_to_locale' ) && did_action( 'admin_init' ) ) {
switch_to_locale( get_locale() );
}
$permalinks = wp_parse_args( (array) get_option( 'woocommerce_permalinks', array() ), array(
'product_base' => '',
'category_base' => '',
'tag_base' => '',
'attribute_base' => '',
'use_verbose_page_rules' => false,
) );
// Ensure rewrite slugs are set.
$permalinks['product_rewrite_slug'] = untrailingslashit( empty( $permalinks['product_base'] ) ? _x( 'product', 'slug', woocommerce ) : $permalinks['product_base'] );
$permalinks['category_rewrite_slug'] = untrailingslashit( empty( $permalinks['category_base'] ) ? _x( 'product-category', 'slug', woocommerce ) : $permalinks['category_base'] );
$permalinks['tag_rewrite_slug'] = untrailingslashit( empty( $permalinks['tag_base'] ) ? _x( 'product-tag', 'slug', woocommerce ) : $permalinks['tag_base'] );
$permalinks['attribute_rewrite_slug'] = untrailingslashit( empty( $permalinks['attribute_base'] ) ? '' : $permalinks['attribute_base'] );
if ( function_exists( 'restore_current_locale' ) && did_action( 'admin_init' ) ) {
restore_current_locale();
}
return $permalinks;
}
versions – نسخه ها
از نسخه : 3.0.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر