• سلام،
    من برنامه‌نویس
    PHP
    هستم و کدهای افزونه را بررسی کردم.

    برای توابع و افزونه یک باگ داره که هنگام غیرفعال بودن تنظیمات شمسی یا سایر ��الات غیرفعال بودن، به جای نمایش تاریخ، فرمت تاریخ را، مثلا
    j F Y
    را نمایش می‌دهد که باید به جایش
    $date
    رو نمایش بدهد.

    کد در مسیر
    wp-parsidate\includes\plugins\disable.php
    این مشکل را دارد که در زیر ارسال می‌کنم. عبارتِ
    return $format;
    باید بشود:
    return $date;
    علتش اینه که خود انجام اکشن هم برای تاریخ هست نه فرمت.

    function wpp_fix_i18n( $date, $format, $timestamp, $gmt ) {
    	global $post;
    	$post_id = isset( $post->ID ) ? $post->ID : null;
    
    	if ( ! disable_wpp() ) {
    		return $format;
    	}
    
    	if ( $post_id != null && get_post_type( $post_id ) == 'shop_order' && isset( $_GET['post'] ) ) // TODO: Remove after implement convert date for woocommerce
    	{
    		return $date;
    	} else {
    		return parsidate( $format, $timestamp, ! wpp_is_active( 'conv_dates' ) ? 'eng' : 'per' );
    	}
    }

    فانکشن بعدی:
    که باید همان فرمت بشه تاریخ.

    function wpp_fix_wp_date( $date, $format, $timestamp, $timezone ) {
    	if ( ! disable_wpp() ) {
    		return $format;
    	}
    
    	return parsidate( $format, $timestamp, ! wpp_is_active( 'conv_dates' ) ? 'eng' : 'per' );
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘باگ افزونه برای wp_date’ is closed to new replies.