• 22-09-2017, 14:26:05
    #1
    Merhabalar, debug yaptığımda aşağıdaki kod satırında "Undefined variable" ve "Trying to get property of non-object" hatasını alıyorum. Nasıl düzeltebilirim acaba?

    Hatalı kod satırı:
    . get_the_time(get_option('date_format'), $this->post->ID) . ' ' . get_the_time('', $post->ID) .'</span><span class="tarih-2">'
    Kod satırının bulunduğu fonksiyonun tamamı:
        function get_date($show_stars_on_review = true) {
            $visibility_class = '';
            if (td_util::get_option('tds_p_show_date') == 'hide') {
                $visibility_class = ' td-visibility-hidden';
            }
            // used in ionMag to hide the date "." when the post comment count is off
            // it does nothing on newspaper & newsmag
            $td_post_date_no_dot = '';
            if ( td_util::get_option('tds_p_show_comments') == 'hide' ) {
                $td_post_date_no_dot = ' td-post-date-no-dot';
            }
            $buffy = '';
            if ($this->is_review and $show_stars_on_review === true) {
                //if review show stars
                $buffy .= '<div class="entry-review-stars">';
                $buffy .=  td_review::render_stars($this->td_review);
                $buffy .= '</div>';
            } else {
                if (td_util::get_option('tds_p_show_date') != 'hide') {
                    $td_article_date_unix = get_the_time('U', $this->post->ID);
                    $buffy .= '<span class="td-post-date">';
                    $buffy .= '<time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . date(DATE_W3C, $td_article_date_unix) . '" ><span class="tarih-1">'
                    . get_the_time(get_option('date_format'), $this->post->ID) . ' ' . get_the_time('', $post->ID) .'</span><span class="tarih-2">'
                    . human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' önce yayımlandı.</span>';
                    '</time>';
                    $buffy .= '</span>';
                }
            }
            return $buffy;
        }
  • 23-09-2017, 16:51:37
    #2
    Üyeliği durduruldu
    Undefined variable hatası değişkenin olmadığı söyler, Değişkenleri kontrol etmeniz gerekir
  • 23-09-2017, 17:42:22
    #3
    MorNetAjans adlı üyeden alıntı: mesajı görüntüle
    Undefined variable hatası değişkenin olmadığı söyler, Değişkenleri kontrol etmeniz gerekir
    PHp konusunda çok az bilgiye sahibim, daha detaylı yerdımcı olabilir misiniz acaba? Nasıl kontrol ederim..vs