WPML

סקירת התקלה

בעת יצירת תפריט והקצאתו למיקום תחת עיצובתפריטים, רענון העמוד מסיר את הסימון מתיבת הסימון של המיקום. עם זאת, התפריט עדיין מוצג כראוי בצד הלקוח.

בעיה זו מתרחשת כאשר מזהי (ID) של מונחים אינם שווים למזהי (ID) של טקסונומיית המונחים, דבר שיכול לקרות באתרים המריצים את WordPress מאז גרסה 4.1 או גרסאות ישנות יותר, כפי שמוסבר כאן (נפתח בלשונית חדשה).

פתרון עוקף

בעיה זו תוקנה ב־WPML 4.6.4. עדכון פותר זאת באתר שלך, לכן אתה זקוק לפתרון העוקף הזה רק אם עדיין אינך יכול לעדכן.

הקפד לבצע גיבוי מלא של האתר לפני שתמשיך.

  1. פתח את …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php.
  2. חפש את שורה 118.
  3. שנה:
    PHP
    private function maybe_warm_term_id_cache() {
    
    	if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) {
    
    		$data           = $this->wpdb->get_results( "	SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy
    												 " . $this->get_element_join() . "
    												 JOIN {$this->wpdb->terms} terms
    												  ON terms.term_id = tax.term_id
    												 WHERE tax.term_id != tax.term_taxonomy_id",
    		                                      ARRAY_A );
    		$this->term_ids = array();
    		$this->ttids    = array();
    		foreach ( $data as $row ) {
    			$this->ttids[ $row['term_id'] ]                     = isset( $this->ttids[ $row['term_id'] ] )
    				? $this->ttids[ $row['term_id'] ] : array();
    			$this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = $row['element_id'];
    			$this->term_ids[ $row['element_id'] ]               = $row['term_id'];
    		}
    	}
    }
    ל:
    PHP
    private function maybe_warm_term_id_cache() {
    
    	if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) {
    
    		$data           = $this->wpdb->get_results( "	SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy
    												 " . $this->get_element_join() . "
    												 JOIN {$this->wpdb->terms} terms
    												  ON terms.term_id = tax.term_id
    												 WHERE tax.term_id != tax.term_taxonomy_id",
    		                                      ARRAY_A );
    		$this->term_ids = array();
    		$this->ttids    = array();
    		foreach ( $data as $row ) {
    			$this->ttids[ $row['term_id'] ]                     = isset( $this->ttids[ $row['term_id'] ] )
    				? absint($this->ttids[ $row['term_id'] ]) : array();
    			$this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = absint($row['element_id']);
    			$this->term_ids[ $row['element_id'] ]               = absint($row['term_id']);
    		}
    	}
    }

כל התקלות הידועות

עדיין נתקל בבעיה זו?

אם העדכון אינו פותר זאת, פתח פנייה לתמיכה ואנו נבדוק זאת יחד איתך.