Skip to content

Instantly share code, notes, and snippets.

@Auke1810
Last active February 27, 2018 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Auke1810/c98657e29f1385d474bf5eeaed0bcf1f to your computer and use it in GitHub Desktop.
Save Auke1810/c98657e29f1385d474bf5eeaed0bcf1f to your computer and use it in GitHub Desktop.
We added the "wppfm_category_mapping_exclude", "wppfm_category_mapping_exclude_tree" and "wppfm_category_mapping_max_categories" filters. You can use these filters to limit the number of categories in the Category Mapping list on the Edit Feed page.
// If you want to remove the categories with ids 10, 12, 14 and 16 from the Category Mapping, including their children categories,
// you could use the following code in your functions.php file
// hook the remove_cats function to the wppfm_category_mapping_exclude_tree event
add_filter( 'wppfm_category_mapping_exclude_tree', 'remove_cats' );
function remove_cats() {
// return a comma separated string or an array with the category ids you want to exclude
return "10,12,14,16";
}
@Auke1810
Copy link
Author

We added the "wppfm_category_mapping_exclude", "wppfm_category_mapping_exclude_tree" and "wppfm_category_mapping_max_categories" filters. You can use these filters to limit the number of categories in the Category Mapping list on the Edit Feed page. Shops with very large numbers of categories can have issues with this Category Mapping list. By using one or more of the mentioned filters you can limit the number of categories and thus prevent issues with the Category Mapping list.

To use the first two filters you can return an array or a comma-separated string with category id's that you want to be removed from the Category Mapping list. The "wppfm_category_mapping_exclude" filter will only remove the categories with the given ids, the "wppfm_category_mapping_exclude_tree" filter will also remove the children categories from the list. With the "wppfm_category_mapping_max_categories" filter you can return a number to the filter that will limit the number of categories in the Category Mapping list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment