• 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 except

    If, 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;
    }
    
    • This topic was modified 9 years, 8 months ago by hessi9.
    • This topic was modified 9 years, 8 months ago by hessi9.
Viewing 1 replies (of 1 total)
  • Thread Starter hessi9

    (@hessi9)

    Ok marking changes is not working – so copy this code if you need it:

    function nwm_collect_post_data( $nwm_location, $publish_date, $future, $date_format ) { 
     
     $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 );
      }
     }
     $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' => strtr( esc_html( strtr( $excerpt, '[]', '][' ) ), '[]', ']['),
      'title' => strtr( esc_html( strtr( $title, '[]', '][' ) ), '[]', ']['),
      '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)

The topic ‘Using post excerpt and qTranslate plugin compatibility’ is closed to new replies.