try use global $post;
at the beginning of your function
Note that you’ve to run on a specific hook in order to work. see this post: https://www.ibenic.com/how-to-add-woocommerce-custom-product-fields/
function spinna360_nof() {
$noy=array(
'id' => '_select_noi',
'label' => __( 'Select number of images: ', 'spinna360' ),
'selected' => true,
'options' => [
'24' => __( '24', 'spinna360' ),
'36' => __( '36', 'spinna360' ),
'48' => __( '48', 'spinna360' )
]
);
woocommerce_wp_select($noy);
}
add_action( 'woocommerce_product_data_panels', 'spinna360_nof');
Related Posts:
- Woocommerce – How to populate custom select field with stored values on checkout page?
- How to toggle between two custom fields in WordPress woocommerce ‘WC Product Field Group’ plugin?
- Redirect to another page using contact form 7? [closed]
- Woocommerce – Change Variable Product Add to Cart to behave like external product using Custom Field (link) [closed]
- WordPress Phone Field Check (use numbers, spaces and pluses)
- Can export gallery but can’t import it Wp all import
- Problem Advanced Custom Fields PRO
- Meta Key array building with multiple input values from fields
- Custom product page’s style for printing
- Problem with conditional woocommerce custom checkout field
- How to Save settings of custom tab product page in admin side in a database?
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- additional fields based on the quantity of products selected
- Hide prices and checkout functionality in woocommerce
- Can’t set proper WooCommerce language translation [closed]
- Function to Set Product type in Woocommerce [closed]
- Updating WooCommerce variable product stock issue
- How can I show drafts in wp_dropdown_pages list?
- How to get custom field image url of specific size
- Datepicker not supporting timepicker
- Override core woocommerce class
- WooCommerce – Where is functions.php?
- Woocommerce Shipping module available only for type of products [closed]
- WooCommerce – Adding Custom Order Without No Product [closed]
- How WordPress autosave can save plugin fields?
- Plugin allowing for artists, events and venues
- How to remove duplicate Custom Fields?
- Make the checkbox meta field checked by default
- How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]
- Manually add order item with fixed product_id in WooCommerce
- Saving Custom Post types and fields to a custom table
- WooCommerce shop page orderby [closed]
- WooCommerce Custom Product to checkout
- Reduce Drop down Menu Width in WordPress
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- How to enable specific plugin only based around shop manager role?
- How to modify WCMP Rest API response?
- Woocommerce dependent plugin
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- How to create an input field, and base the output on spreadsheet data? [closed]
- Pre booking doesn’t work with custom bootstrap modul in woocommerce [closed]
- Custom Pages for Woocommerce Product-Category Pages
- Woocommerce Minimum Price for a Composite Product to add in cart
- Custom User meta field display
- Every new post/draft has a custom field variable “yst_is_cornerstone” showing
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- Add item to the woocommerce dashboard menu from a plugin
- Get orders of a specific customer woocommerce
- wc_get_template new template does not showing up
- Woocommerce – WordPress Roles & Capabilities
- Search users with custom meta data
- Is it possible to instantiate a new WC_Cart?
- How to change layout of shop page in wordpress? [closed]
- How can I add user profile fields to my mailpress mailout
- How to get custom minimum price in Woocommerce
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Edit all $wp_scripts at once to $in_footer = false
- Restrict posts to customers with complete WooCommerce orders only
- need to find duplicated meta value in custom filed and view the posts that have the same value
- product available stock day by day
- woocommerce – adding wrapper around custom made woocommerce form fields
- how to find out which plugin disable custom field for post
- Register PODS Custom Field with WPGraphQL [closed]
- How can i solve php upgrade problem
- Create multiple posts when a custom post is created
- How to Upload images to a custom folder in upload folder using media uploader
- I have English words in Kurdish pages
- One WooCommerce Store to multi distributor sites
- Google Maps for Woocommerce Checkout
- Custom form data not displaying in cart page?
- category page multiple products add to cart any plugin available for woocommerce
- “Enable Media Replace” plugin does not update serialized object in WPMeta
- WordPress eMails not working
- How Can I display Specific User Pages?
- Configuring default woo commerce login with modal popup
- fetch price from different table woocommerce
- Cannot save a custom meta field in quick edit
- If I am not writing a theme, how do I add custom fields to a user for a plugin
- how to make settings page for woocommerce plugin?
- redirect to a custom page
- Many to many relationship for variable products
- How can I call functions from a custom plugin?
- Change value of Points earned in product data
- How woo-commerce store Product Data value in DB?
- Not getting result using ajax on wordpress
- Need help getting a certain value out of a multi dimensional array
- Which WordPress version to use for improved plugin compatibility? [closed]
- Turning Existing Eccommerce Site into Multi-SIte
- How do I add custom fields to the “Edit page” admin screen?
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- Hook for single product thumbnail
- Translate text for empty product
- Create Custom Coupon Type
- Add different sizes packaging boxes to orders plugin
- Order custom post type by posts with most likes first
- A multi-section WordPress store [closed]