Skip to content

Instantly share code, notes, and snippets.

@wpt00ls
Last active July 10, 2020 16:34
Show Gist options
  • Save wpt00ls/f7a7ba11050039aef6401e0aecfdd005 to your computer and use it in GitHub Desktop.
Save wpt00ls/f7a7ba11050039aef6401e0aecfdd005 to your computer and use it in GitHub Desktop.
Change the order for the categories for the faq block in faq-manager-with-structured-data plugin. Used mainly for gutenberg block.
<?php
add_filter('wpt_faq_manager_shortcode_categories', function (
// categoryIds from shortcode . for example [5, 8, 3 ]
$categoryIds,
// page on which the faq gutenberg block, divi module or shortcode is used.
$page,
// the counter of the faq block/divi module/shortcode on the page.
$shortcode_count
) {
// one can do a page ID check + check on shortcode code.
// if you use a faq block/shortcode/divi module more than once on your website, it becomes
// neccessary to check for page and or shortcode count.
return [8, 3, 5];
}, 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment