Last active
February 27, 2018 09:36
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.