Address fields are controlled by the WC_Countries
class and can be filtered via:
$address_fields = apply_filters( 'woocommerce_' . $type . 'fields', $address_fields, $country );
where there are 2 $types: billing and shipping. Once you’ve found that it is just PHP array manipulation:
function reorder_shipping_fields( $address_fields ){
if ( isset( $address_fields['shipping_company'] ) ){
$shipping_company = $address_fields['shipping_company'];
unset( $address_fields['shipping_company'] );
$address_fields['shipping_company'] = $shipping_company;
}
return $address_fields;
}
add_filter( 'woocommerce_shipping_fields', 'reorder_shipping_fields' );
Related Posts:
- Turn Off Auto Update for Single Plugin
- Is there a way to use latex \cite{reference} in wordpress?
- Why is “plugins_loaded” not called/fired?
- How to check plugin compatibility before upgrading WordPress
- How do I unlock a post programmatically?
- Force Plugin to English Translation
- How to parse nested shortcodes?
- Custom wp_nav_menu output (displaying all child elements of top menu element in current branch)
- Is it possible to have screenshots in any other section rather than the screenshots section?
- Removing user contact methods works from functions.php but not from a plugin
- Subscribe2 Configuration
- Dynamic HTML not displaying at respective place
- I need to Remove this line
- Should I global $wpdb outside of any of my plugin’s functions scope?
- Filter or action hook to insert content on admin pages before tag
- How do I change the default WordPress e-mail ID for sent e-mail?
- How to create a word press user with hashedpassword
- Display specific WooCommerce products to different types of users
- merging an array to an existing array using add_filter
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Is it possible to set up multistore in Woocommerce? [closed]
- Leveraging WordPress Comments on Custom Plugin Object page
- Woocommmerce show SKU in cart page
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Show HTML form before WordPress plugin deletion
- Redeclare theme’s function in a plugin
- Check if we’re viewing an event
- Show price with Geo IP location
- Menus, but not by theme location
- How to get 1 or 2 specific posts on top of my wordpress blog?
- Getting value from dymanic text variable into Contact Form 7
- className not populating in custom block
- Will Gutenberg Have a Negative Impact on Page Speed?
- How to export post 2 posts WordPress plugin data [closed]
- import posts with dutch/special letters
- Does plugin’s uninstall.php file have access to the plugin ‘s object?
- Display custom content using page.php from theme
- Use $_GET inside a shortcode print empty Array
- Implementing an “Email this” button?
- How to customize a title by passing query string?
- Remove Advanced Custom Fields plugin for client?
- How to check if an email was sent from or originated from a specific plugin?
- Gutenberg Blocks – Cannot retrieve block saved attributes in edit post
- How to add fields in the WordPress editor?
- Migrating WordPress – New domain entry, links broken
- Search Results Page filter by page title
- Activate and deactivate plugin automatically
- WooCommerce: after install hook
- Theme My Login Shortcode Doesn’t Return Anything
- wp_redirect not working on plugin
- Is there a better way of handling AJAX requests in WordPress?
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Change website directory safely to add a static page on startup
- add_meta_box creating default form field types
- Plugin permissions for Editor role
- How to handle a WordPress blog with articles in different languages?
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- After installing JetPack, can I delete the WordPress stats plugin?
- how to render dashboard widgets conditionaly in wordpress admin
- Redirect plugin after form submit or show errors
- how to create hierachial taxonomy and manage under single post type?
- Button and Countdown overlapping mobile menu
- How to data add to table when update post wordpress? when we clicked!
- can’t unzip file
- Check if theme supports sidebar
- Change plugin descriptions
- update_option_{$option} not working (do function after options are saved)
- Looking for WordPress PDF Converter with Custom Templates?
- How get horizontal div instead vertical CSS
- ACF Fields are not showing up on Homepage
- WordPress not encoding “é”
- I enabled debugging but I still get the same message: There has been a critical error on your website
- Out of date plugins not showing ugrade link
- Use Case: Multiple Shipping Methods per Order
- Showing how many times is plugin activated or deactivated
- Implementing Scrollable Images
- Can’t add or delete plugins – but I’m an admin [closed]
- WordPress Categories as a Grid
- How to setup same post slug for different categories?
- get/show Last ID
- Why is WP template_include overwritting all templates rather than specified page?
- Undefined index – get_option
- Plugins don’t show up after renaming plugins folder
- How to prevent query strings persisting on certain page templates
- Use of apply_filter in plugin/widget class
- Edit Buddypress Groups Activity Page Text [closed]
- GravityForms to Salesforce API, problem with people who leave out company [closed]
- Non english charcters support for WP Customer Reviews
- Access to wordpress method inside of classes
- Activate plugins by a theme’s functions.php?
- WordPress User Portal
- How to include a custom thumbnail with my WordPress plugin?
- Can anyone tell some online tuts for plugin development for beginner? [closed]
- Slider Plugins for header [closed]
- iframe not showing on frontend when using a CMB2 field
- Am having issues intergrating this api into my wordpress site, any help please?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- How to Deobfuscate a sourcecop protected WordPress plugin?