Overview

Namespaces

  • None
  • VSP
    • Core
      • Abstracts
      • Interfaces
      • Traits
        • WC_Compatibility
    • Deprecation
    • Helper
    • Modules
      • Addons
      • Logger

Classes

  • Ajax
  • Ajaxer
  • Base
  • Cache
  • Error
  • Framework
  • Framework_Admin
  • Framework_Base
  • Framework_Modules
  • Helper
  • Setup
  • WC_Compatibility
  • Overview
  • Namespace
  • Class

Class Helper

Class Helper

VSP\Helper uses VSP\Core\Traits\WP, VSP\Core\Traits\WC_Helper, VSP\Core\Traits\Array_Helper, VSP\Core\Traits\URL, VSP\Core\Traits\String_Helper
Final
Namespace: VSP
Package: VSP
Author: Varun Sridharan varunsridharan23@gmail.com
Located at includes/class-helper.php
Methods summary
protected static string|boolean|boolean
# global_vars( string $key )

Gets the key value from globals.

Gets the key value from globals.

Parameters

$key

Returns

string|boolean|boolean
public static boolean
# multibyte_loaded( )

Helper method to check if the multibyte extension is loaded, which indicates it's safe to use the mb_*() string methods

Helper method to check if the multibyte extension is loaded, which indicates it's safe to use the mb_*() string methods

Returns

boolean
public static string
# rand_md5( )

Generates A Rand MD5 String and returns it.

Generates A Rand MD5 String and returns it.

Returns

string
public static string
# human_time( integer $seconds )

Convert number of seconds to 'X {units}'

Convert number of seconds to 'X {units}'

E.g. 123 => '2 minutes' then you can use this string how you want, for e.g. append ' ago' => '2 minutes ago'

Parameters

$seconds

Returns

string
public static
# vsp_error_to_wc_notice( VSP\Error $vsp_error )

Converts VSP Error To WC Notice.

Converts VSP Error To WC Notice.

Parameters

$vsp_error

Since

0.8.7
Methods used from VSP\Core\Traits\WP
current_user(), current_user_id(), filter_roles(), get_site_name(), get_user_roles(), is_user_role(), user_role_title(), user_roles_lists()
Methods used from VSP\Core\Traits\WC_Helper
wc_clear_cart(), wc_clear_cart_if_notempty(), wc_get_product_ids_in_cart(), wc_get_tax_classes(), wc_has_product_in_cart(), wc_is_cart_empty(), wc_payment_methods(), wc_product_sky_by_id(), wc_shipping_methods(), wc_shipping_methods_by_instance()
Methods used from VSP\Core\Traits\Array_Helper
array_group_by(), array_has_duplicates(), filter_array_data(), json_to(), parse_args()
Methods used from VSP\Core\Traits\URL
auto_link(), generate_safe_slug(), get_first_segment(), get_port(), segment_uri()
Methods used from VSP\Core\Traits\String_Helper
str_ends_with(), str_exists(), str_starts_with(), str_to_ascii(), str_truncate(), to_human_bytes()
Properties used from VSP\Core\Traits\String_Helper
$mb_enc
API documentation generated by ApiGen