Banner Opengraph

Filter facet query string

/facet/query_string This filter is called before the content is queried from WP_Query, WP_Term_Query or WP_User_Query It allows to filter content by adding facet slug/values in the query string. This filter is pretty useful to prefilter content on load. Argument Type Description $query_string array Holds query strings parameters $grid_id mixed Grid ID or template ID/name $action…

Banner Opengraph

Filter blocks

/blocks This filter is called when the card builder retrieves available blocks and when a card renders custom blocks. It allows to add your own blocks in the card builder in order to output custom content with your own markup and logic. Argument Type Description $blocks array Holds custom block definitions [pastacode lang=”php” manual=”function%20prefix_register_block(%20%24blocks%20)%20%7B%0A%0A%09%2F%2F%20’my_block’%20corresponds%20to%20the%20block%20slug.%0A%09%24blocks%5B’my_block’%5D%20%3D%20%5B%0A%09%09’name’%20%3D%3E%20__(%20’My%20Block’%2C%20’text-domain’%20)%2C%0A%09%09’render_callback’%20%3D%3E%20’prefix_my_block_render’%2C%0A%09%5D%3B%0A%0A%09return%20%24blocks%3B%0A%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Fblocks’%2C%20’prefix_register_block’%2C%2010%2C%201%20)%3B%0A%0A%2F%2F%20The%20render%20callback%20function%20allows%20to%20output%20content%20in%20cards.%0Afunction%20prefix_my_block_render()%20%7B%0A%0A%09%2F%2F%20Get%20current%20post%2C%20term%2C%20or%20user%20object.%0A%09%24post%20%3D%20wpgb_get_post()%3B%0A%0A%0A%09%2F%2F%20Output%20the%20post%20title.%20%0A%09echo%20’%3Ch3%3E’%20.%20esc_html(%20%24post-%3Epost_title%20)%20.%20’%3C%2Fh3%3E’%3B%0A%7D” message=””…

Banner Opengraph

Filter facet settings

/facet/settings This filter is called every time facet settings are queried. It allows to dynamically change or add setting parameter(s) to a specific facet in order to change its behaviour. Argument Type Description $settings array Holds facet settings [pastacode lang=”php” manual=”function%20prefix_facet_settings(%20%24settings%20)%20%7B%20%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%201%2C%20change%20facet%20display%20order.%0A%09if%20(%201%20%3D%3D%3D%20%24settings%5B’id’%5D%20)%20%7B%0A%09%09%24settings%5B’orderby’%5D%20%3D%20’count’%3B%0A%09%7D%0A%0A%0A%09%2F%2F%20If%20it%20matches%20facet%20id%202%2C%20hide%20facet%20children.%0A%09if%20(%202%20%3D%3D%3D%20%24settings%5B’id’%5D%20)%20%7B%0A%09%09%24settings%5B’children’%5D%20%3D%200%3B%0A%09%7D%20%0A%0A%09return%20%24settings%3B%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Ffacet%2Fsettings’%2C%20’prefix_facet_settings’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]

Banner Opengraph

Function render facet

wpgb_render_facet This function allows to render a facet by passing as argument its id and the grid id to filter. Argument Type Description id integer Facet id grid integer|string Grid id or template id/name to filter [pastacode lang=”php” manual=”%2F%2F%20Render%20facet%20id%201%20to%20filter%20grid%20id%202.%0Awpgb_render_facet(%0A%09%5B%20%0A%0A%09%09’id’%20%3D%3E%201%2C%20%2F%2F%20Facet%20id.%0A%09%09’grid’%20%3D%3E%202%2C%20%2F%2F%20Grid%20or%20template%20id.%20%0A%09%5D%0A)%3B” message=”” highlight=”” provider=”manual”/]

Banner Opengraph

Filter grid settings

/grid/settings This filter is called every time grid settings are queried before to render or refresh grid (when filering with facets). It allows to dynamically modifies settings of a grid. It can be pretty useful to use the same grid on different pages/posts with different behaviours. Argument Type Description $settings array Holds grid settings [pastacode…

Banner Opengraph

filter user capability

/user_capability This filter is called everytime an action verifies the user role/capability. User role/capability check is done in order to authorize certain users to access and act on plugin data (like editing/deleting/importing). Argument Type Description $capability string Default user capability manage_options [pastacode lang=”php” manual=”function%20prefix_set_user_capability(%20%24capability%20)%20%7B%0A%09%0A%09%2F%2F%20Allow%20Editors%20to%20manage%20the%20plugin.%0A%09if%20(%20current_user_can(%20’editor’%20)%20)%20%7B%0A%09%09%24capability%20%3D%20’editor’%3B%0A%09%7D%20%0A%0A%09return%20%24capability%3B%0A%09%0A%7D%0A%0Aadd_filter(%20’wp_grid_builder%2Fuser_capability’%2C%20’prefix_set_user_capability’%2C%2010%2C%201%20)%3B” message=”” highlight=”” provider=”manual”/]

Banner Opengraph

function render grid

wpgb_render_grid This function allows to render a grid by passing as argument its id. Argument Type Description $grid_id|$args integer|array Grid id | Grid arguments [pastacode lang=”php” manual=”%2F%2F%20Render%20grid%20id%201.%0Awpgb_render_grid(%201%20)%3B” message=”” highlight=”” provider=”manual”/] This function can also replace the main loop of the archive.php, index.php or search.php files. In this case you need to pass as argument an array to define the grid…