• Resolved Luis Braschi

    (@casper-braske)


    This is actually a code in WCFM, but it affects this plug-in.
    The filter wcfm_marketplace_settings_fields_general is called twice in wc-frontend-manager/views/settings/wcfm-view-wcfmmarketplace-settings.php

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    The filter wcfm_marketplace_settings_fields_general is called twice in

    – Yeah right and that is intentional, not bug.

    What issue you are getting due to this?

    You have to write code by checking whether field exists or not! Like this –

    add_filter( 'wcfm_marketplace_settings_fields_general', function( $store_name_fields ) {
    	if( isset( $store_name_fields['store_name'] ) ) {
    		$store_name_fields['store_name']['attributes'] = array( 'maxlength' => 10 );
    	}
    	return $store_name_fields;
    });

    Thank you

    Thread Starter Luis Braschi

    (@casper-braske)

    Well. That’s odd design. ??
    Using different filters for different sections would keep you from checking the presence of a field.
    Thank you for your response.

    Plugin Author WC Lovers

    (@wclovers)

    HI,

    Well, these are not actionable filters, so have kept same name to reduce number of filters.

    Thank You

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[bug] Same filter called twice’ is closed to new replies.