Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Munro

    (@sumobi)

    Hi, this plugin is set up for translation as WordPress standards outline. WPML has a funny way of translating, you’ll probably need to either submit the plugin so they can build a bridge or find another translation plugin.

    Thread Starter realC

    (@realc)

    I found a way to fix this. Not perfectly elegant, but does the job. The categories from all languages will show up in the settings. You can select all the one’s you like. I had to change the pluggin code to: (notice the two remove_filter and the two add_filter lines)

    public function settings( $settings ) {

    global $sitepress;
    remove_filter(‘get_term’, array($sitepress,’get_term_adjust_id’), 1, 1);
    remove_filter(‘terms_clauses’, array($sitepress, ‘terms_clauses’));

    $new_settings = array(
    array(
    ‘id’ => ‘edd_das_header’,
    ‘name’ => ‘‘ . __( ‘Downloads As Services’, ‘edd-das’ ) . ‘‘,
    ‘type’ => ‘header’
    ),
    array(
    ‘id’ => ‘edd_das_service_categories’,
    ‘name’ => __( ‘Select Service Categories’, ‘edd-das’ ),
    ‘desc’ => __( ‘Select the categories that contain “services”‘, ‘edd-das’ ),
    ‘type’ => ‘multicheck’,
    ‘options’ => $this->get_terms(‘taxonomy’)
    ),
    );

    add_filter(‘get_term’, array($sitepress,’get_term_adjust_id’), 1, 1);
    add_filter( ‘terms_clauses’, array( $sitepress, ‘terms_clauses’ ), 10, 4 );

    return array_merge( $settings, $new_settings );
    }

    Thread Starter realC

    (@realc)

    You may also have to add the following as above:
    remove_filter( ‘list_terms_exclusions’, array( $sitepress, ‘exclude_other_terms’ ), 1 );

    code ….

    add_filter( ‘list_terms_exclusions’, array( $sitepress, ‘exclude_other_terms’ ), 1, 2 );

    Thread Starter realC

    (@realc)

    The final answer ends up being so much simpler than all this. Simply select all languages when making modifications to the categories that are to be selected as services. Categories from all languages will be displayed, made selectable and saved. It works perfectly. No code had to be modified.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using WPML service categories issue’ is closed to new replies.