Gravity Custom Code

/* ————————————————————————- * * Gravity Form: Replace custom merge tags /* ————————————————————————- */ add_filter( ‘gform_replace_merge_tags’, function ( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) { if ( strpos( $text, ‘{current_hour}’ ) !== false ) { $text = str_replace( ‘{current_hour}’,…Continue reading

Allow JS Files Upload

/** * Allow JS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Allow CSS Files Upload

/** * Allow CSS uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading

Add Orders link to the top admin toolbar

function add_link_to_admin_bar($admin_bar) { $args = array( ‘id’ => ‘orders’, ‘title’ => ‘~ ORDERS ~’, ‘href’ => esc_url( admin_url( ‘edit.php?post_type=shop_order’ ) ) ); $admin_bar->add_node($args); } add_action(‘admin_bar_menu’, ‘add_link_to_admin_bar’, 999);Continue reading

Add Orders link to the top admin toolbar

function add_link_to_admin_bar($admin_bar) { $args = array( ‘id’ => ‘orders’, ‘title’ => ‘~ ORDERS ~’, ‘href’ => esc_url( admin_url( ‘edit.php?post_type=shop_order’ ) ) ); $admin_bar->add_node($args); } add_action(‘admin_bar_menu’, ‘add_link_to_admin_bar’, 999);Continue reading

Add Products Link to the Top Admin Toolbar

function add_link_to_admin_bar_2($admin_bar) { $args = array( ‘id’ => ‘products’, ‘title’ => ‘# PRODUCTS #’, ‘href’ => esc_url( admin_url( ‘edit.php?post_type=product’ ) ) ); $admin_bar->add_node($args); } add_action(‘admin_bar_menu’, ‘add_link_to_admin_bar_2’, 999);Continue reading

Add Products Link to the Top Admin Toolbar

function add_link_to_admin_bar_2($admin_bar) { $args = array( ‘id’ => ‘products’, ‘title’ => ‘# PRODUCTS #’, ‘href’ => esc_url( admin_url( ‘edit.php?post_type=product’ ) ) ); $admin_bar->add_node($args); } add_action(‘admin_bar_menu’, ‘add_link_to_admin_bar_2’, 999);Continue reading