custom-fields

How to add text input to dropzone upload

天涯浪子 提交于 2019-11-30 12:01:37
问题 I'd like to allow users to submit a title for each file that is dragged into Dropzone that will be inputted into a text input. But i don't know how to add it. Everyone can help me? This is my html code code <form id="my-awesome-dropzone" class="dropzone"> <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. --> <!-- Now setup your input fields --> <input type="email" name="username" id="username" /> <input type="password" name="password" id="password" />

Wordpress Query order by custom field missing posts

ぃ、小莉子 提交于 2019-11-30 09:21:38
问题 This is my current query: query_posts(array_merge(array('tag' => $pagetag,'meta_key'=>priority,'orderby' =>meta_value, 'order' =>'ASC','paged' => get_query_var('paged')))); My problem is that the query shows me only the post that has values for my 'meta_key' meaning that 'priority' is not NULL. How can I improve this query so that it will still orderby my meta_key but will show all the posts that aren't NULL as well? Thanks in advance! 回答1: The problem is that WordPress adds an INNER JOIN to

How to add text input to dropzone upload

*爱你&永不变心* 提交于 2019-11-30 01:54:47
I'd like to allow users to submit a title for each file that is dragged into Dropzone that will be inputted into a text input. But i don't know how to add it. Everyone can help me? This is my html code code <form id="my-awesome-dropzone" class="dropzone"> <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. --> <!-- Now setup your input fields --> <input type="email" name="username" id="username" /> <input type="password" name="password" id="password" /> <button type="submit">Submit data and files!</button> </form> And this is my script code <script> Dropzone

migrating django-model field-name change without losing data

回眸只為那壹抹淺笑 提交于 2019-11-29 23:54:58
I have a django project with a database table that already contains data. I'd like to change the field name without losing any of the data in that column. My original plan was to simply change the model field name in a way that would not actually alter the name of the db table (using the db_column column parameter): The original model: class Foo(models.Model): orig_name = models.CharField(max_length=50) The new model: class Foo(models.Model): name = models.CharField(max_length=50, db_column='orig_name') But, running South's schemamigration --auto produces a migration script that deletes the

Add and save admin product variations custom field in Woocommerce

丶灬走出姿态 提交于 2019-11-29 15:57:08
So I've got the following code which makes me add a Barcode field to the Inventory Options of a product. Now I also want to add this to each variations so I can easily add Variation Products when I scan the Barcode of the product via the WooCommerce Point of Sale plugin. Here is what I got currently: // Add Barcode field in simple product inventory options add_action('woocommerce_product_options_sku','add_barcode',10,0); function add_barcode(){ global $woocommerce,$post; woocommerce_wp_text_input( array( 'id' => '_barcode', 'label' => __('Barcode','woocommerce'), 'placeholder' => 'Scan Barcode

Wordpress Query order by custom field missing posts

ⅰ亾dé卋堺 提交于 2019-11-29 15:18:47
This is my current query: query_posts(array_merge(array('tag' => $pagetag,'meta_key'=>priority,'orderby' =>meta_value, 'order' =>'ASC','paged' => get_query_var('paged')))); My problem is that the query shows me only the post that has values for my 'meta_key' meaning that 'priority' is not NULL. How can I improve this query so that it will still orderby my meta_key but will show all the posts that aren't NULL as well? Thanks in advance! The problem is that WordPress adds an INNER JOIN to the wp_postmeta table as soon as you mention meta_key in your conditions. One way around the problem is to

How to get Advanced Custom Fields field key from WordPress database?

前提是你 提交于 2019-11-29 11:47:13
问题 I’m using Advanced Custom Fields with post-type. I have some select custom fields, and I want to show all the label choices from each field. I’ve tried this way. $field = get_field_object('hair_color'); $hair = $field["choices"]; foreach($hair as $value){ Doing a var_dump($field) it appears empty: array(18) { ["key"] => string(16) "field_hair_color" ["label"] => string(0) "" ["name"] => string(10) "hair_color" ["_name"] => string(10) "hair_color" ["type"]=> string(4) "text" ["order_no"]=> int

migrating django-model field-name change without losing data

江枫思渺然 提交于 2019-11-28 19:49:10
问题 I have a django project with a database table that already contains data. I'd like to change the field name without losing any of the data in that column. My original plan was to simply change the model field name in a way that would not actually alter the name of the db table (using the db_column column parameter): The original model: class Foo(models.Model): orig_name = models.CharField(max_length=50) The new model: class Foo(models.Model): name = models.CharField(max_length=50, db_column=

Change cart item prices based on custom cart item data in Woocommerce

独自空忆成欢 提交于 2019-11-28 14:06:03
currently i create a form in product single page so that customer can enter height and width of the product . So the product price vary based on the entered height and width . I created this form in woocommerce->single-product->add-to-cart->simple.php Before modification the form is <form class="cart" method="post" enctype='multipart/form-data'> <?php /** * @since 2.1.0. */ do_action( 'woocommerce_before_add_to_cart_button' ); /** * @since 3.0.0. */ do_action( 'woocommerce_before_add_to_cart_quantity' ); woocommerce_quantity_input( array( 'min_value' => apply_filters( 'woocommerce_quantity

Adding user custom field value to order items details

房东的猫 提交于 2019-11-28 12:47:45
Developing a WooCommerce webshop with vendors (WC Vendors). I need to display a custom field that I have created in vendors profile. It shoud be displayed under the item and vendor name in order-details.php . How to display profile field by that seller/vendor id? Anybody could help me? Here's a screenshot of what I would lie to have: Profile Custom Fields Adding custom fields to user profile page add_action( 'show_user_profile', 'wp_added_user_profile_fields' ); function wp_added_user_profile_fields( $user ) { ?> <table class="form-table"> <tr> <th><label for="billing_enumber"><?php _e(