WPCode Add New Snippet Skip Library Screen
add_filter( ‘wpcode_add_snippet_show_library’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘wpcode_add_snippet_show_library’, ‘__return_false’ );Continue reading
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
function current_year_shortcode() { return date(‘Y’); } add_shortcode(‘year’, ‘current_year_shortcode’);Continue reading
function mepr_override_protection( $protect, $post ) { if( has_category( ‘category_slug_here’, $post ) ) { $protect = false; } return $protect; } function mepr_override_content_protection( $protect, $post, $uri ) { return mepr_override_protection( $protect, $post ); } function mepr_override_redirection_protection( $protect, $uri, $delim ) {…Continue reading
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
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
if ( ! function_exists( ‘wcv_hide_everywhere_else’ ) ) { /** * Hide the “Everywhere else” option in the countries dropdown. * * @param array $regions Array of countries. */ function wcv_hide_everywhere_else( $regions ) { unset( $regions[‘EWE’] ); return $regions; } add_filter(…Continue reading
/** * Add CSS class to apply for vendor label in a registration * * @param string $class CSS classes. * @return string */ function wcv_add_apply_vendor_label_css_class( $class ) { $class .= ‘example_css_class’; return $class; } add_filter( ‘wcvendors_vendor_registration_apply_label_css_classes’, ‘wcv_add_apply_vendor_label_css_class’, 10, 1…Continue reading