Using post excerpt and qTranslate plugin compatibility
-
I modified the plugin code
– to use self written post except
– to make it compatible with qTranslate-X plugin, but compatity is limited to self written exceptIf, and only if, you need one or both of it replace at the nomad-world-map/includes/nwm-frontend-functions.php the function nwm_collect_post_data with the following code. The changes I made are marked bold.
function nwm_collect_post_data( $nwm_location, $publish_date, $future, $date_format ) { ? <strong>?$the_post = get_page( $nwm_location->post_id ); ?if( $the_post->post_excerpt_ml ) { ??$excerpt = $the_post->post_excerpt_ml; ?} else if( $the_post->post_excerpt ) { ??$excerpt = $the_post->post_excerpt; ??if (strpos($excerpt , '[:') === false) { ???$excerpt = apply_filters( 'the_excerpt', $excerpt ); ??} ?} else { ??$excerpt = nwm_get_post_excerpt( $nwm_location->post_id ); ?} ?if( $the_post->post_title_ml ) { ??$title = $the_post->post_title_ml; ?} else { ??$title = $the_post->post_title; ??if (strpos($title, '[:') === false) { ???$title = apply_filters( 'the_title', $title, $nwm_location->post_id ); ??} ?}</strong> ?$permalink = get_permalink( $nwm_location->post_id ); ?$nwm_post_data = array( ??'nwm_id' => ( int ) $nwm_location->nwm_id, ??'thumb' => esc_url( nwm_get_thumb( $nwm_location->thumb_id ) ), ??'url' => esc_url( $permalink ), ??'content' => <strong>strtr(</strong> esc_html( <strong>strtr( </strong>$excerpt, <strong>'[]', '][' ) ), '[]', ']['),</strong> ??'title' => <strong>strtr(</strong> esc_html( <strong>strtr(</strong> $title, <strong>'[]', '][' ) ), '[]', ']['),</strong> ??'location' => esc_html( $nwm_location->location ), ??'date' => esc_html( $publish_date ), ??arrival' => esc_html( nwm_convert_date_format( $date_format, $nwm_location->arrival ) ), ??'departure' => esc_html( nwm_convert_date_format( $date_format, $nwm_location->departure ) ), ??'future' => esc_html( $future ) ?); ? ?return $nwm_post_data; }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using post excerpt and qTranslate plugin compatibility’ is closed to new replies.