Select Page
br_get_woocommerce_version()

Public function to get WooCommerce version

return string. woocommerce version

br_get_template_part($name = ”)

Public function to get plugin’s template. Default templates places in plugin folder/templates

  • $name – template name

return void

br_is_filtered($filters = true, $limits = true, $price = true) 

Public function to check if any filters are used

  • $filters – is checking checkbox, radio and color type of filters
  • $limits – is checking slider type of filters
  • $price – is checking price filter

return boolean. true if any filters are used or false

br_get_cache( $key, $group, $cache_type ) 

Get cached data

  • $key – cached data name
  • $group – cached data group
  • $cache_type – type of cache ‘wordpress’ or ‘persistent’

return mixed. cached data

br_set_cache( $key, $value, $group, $expire, $cache_type ) 

Set data for caching

  • $key – caching data name
  • $value – caching data value(any type)
  • $group – caching data group
  • $expire – expiration time in seconds
  • $cache_type – type of cache ‘wordpress’ or ‘persistent’

return void

br_is_term_selected( $term, $checked = FALSE, $child_parent = FALSE, $depth = 0 ) 

Public function to check if term is selected

  • $term – term ID to check
  • $checked – if TRUE return ‘ checked=”checked”‘
  • $child_parent – if TRUE search child selected
  • $depth – current term depth in hierarchy

return string. ‘ selected=”selected”‘ if selected, empty string ” if not selected

br_get_selected_term( $taxonomy )

Public function to get all selected terms in taxonomy

  • $taxonomy – taxonomy name

return array. array with selected terms

br_aapf_get_attributes()

Get all possible woocommerce attribute taxonomies

return array. array with taxonomies

br_aapf_parse_order_by( &$args )

Parsing order by data and saving to $args array that was passed into this function

  • $args – arguments for wp_query

return void

br_aapf_args_parser( $args = array() )

Extend $args based on passed filters

  • $args – empty array or array with arguments for wp_query

return array

br_aapf_args_converter($query)

convert arguments in URL to normal filters

return void

g_fonts_list()

Get fonts list from google

return array

fa_icons_list()

Get font awesome list of icons name

return array

berocket_font_select_upload( $text, $id, $name, $value, $show_fa = true, $show_upload = true, $show_remove = true, $data_sc = ” )

Public function to add to plugin settings buttons to upload or select icons

  • $text – text above buttons
  • $id – input ID
  • $name – input name
  • $value – current value link or font awesome icon class
  • $show_fa – show font awesome button and generate font awesome icon table
  • $show_upload – show upload button that allow upload custom icons
  • $show_remove – show remove button that allow clear input
  • $data_sc – add data-sc options with this value into input

return string. HTML code with all needed blocks and buttons

br_get_post_meta_price( $object_id )

Public function to get price of product

  • $object_id – product id

return float. Product price

br_get_category_id( $value, $field = ‘slug’ )

Public function to get category id by $value in $field

  • $value – value for search
  • $field – by what field is search

return int. Category ID

br_get_category( $id )

Public function to get category by ID

  • $id – category ID

return object. Category

br_get_sub_categories( $field_value, $field_name = ‘slug’, $args = array() )

Public function to get sub categories from category

  • $field_value – value for search
  • $field_name – by what field is search
  • $args – array with arguments: ‘return’ – type of return data, ‘include_parent’ = include parent to cate gories list, ‘max_depth’ – max depth of sub category

return string|array|object. Categories

br_wp_get_object_terms( $object_id, $taxonomy, $args = array() )

Public function to get terms by id and taxonomy

  • $object_id – term ID
  • $taxonomy – taxonomy

return array. Terms