Category: Admin
Lead 2
Lead
Remove wordpress version
WPCode Add New Snippet Skip Library Screen
add_filter( ‘wpcode_add_snippet_show_library’, ‘__return_false’ );Continue reading
Move WPCode Status Column
add_filter( ‘wpcode_code_snippets_table_columns’, function ( $columns ) { if ( isset( $columns[‘status’] ) ) { $status = $columns[‘status’]; unset( $columns[‘status’] ); $columns = array_slice( $columns, 0, 1, true ) + array( ‘status’ => $status ) + array_slice( $columns, 1, count( $columns…Continue reading
Current Year
function current_year_shortcode() { return date(‘Y’); } add_shortcode(‘year’, ‘current_year_shortcode’);Continue reading
Display Shortcodes Inside HTML Fields (copy)
/** * Run shortcodes on HTML field content * * @link https://wpforms.com/developers/how-to-display-shortcodes-inside-the-html-field/ * * For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_dev_html_field_shortcodes( $field, $field_atts, $form_data ) { if ( ! empty( $field[ ‘code’ ] ) ) { $field[ ‘code’ ]…Continue reading
Including product tax to commission calculation
add_filter( ‘wcvendors_commission_rate’, ‘wcv_calculate_commission_include_product_tax’, 10, 5 ); function wcv_calculate_commission_include_product_tax( $commission, $product_id, $product_price, $order, $qty ) { $product = new WC_Product( $product_id ); $product_price_include_tax = wc_get_price_including_tax( $product ); $commission_rate = WCV_Commission::get_commission_rate( $product_id ); $commission = $product_price_include_tax * ( $commission_rate / 100 );…Continue reading
change the name of the Commission column
if ( ! function_exists( ‘wcv_change_commission_table_columns_name’ ) ) { /** * Change the name of the commission table columns. * * @param array $columns Columns. * @return array */ function wcv_change_commission_table_columns_name( $columns ) { $columns[‘total_due’] = __( ‘Whatever’, ‘wc-vendors’ ); return…Continue reading