Allow user to create instances of custom field
you can make repeating fields with the WP alchemy class http://www.farinspace.com/wpalchemy-metabox/#have_fields_and_multi
you can make repeating fields with the WP alchemy class http://www.farinspace.com/wpalchemy-metabox/#have_fields_and_multi
take a look at the reference docs for the WP_Query class: http://codex.wordpress.org/Class_Reference/WP_Query something like this: $args = array( //some key/value pairs…whatever ‘meta_query => array( array( ‘key’ => somekey, ‘value’ => somevalue, ‘compare’ => some comparison operator ), array( ‘key’ => some other key, ‘value’ => some other value, ‘compare’ => some comparison operator ) ) … Read more
I see your problem in the javascript. I’ve done something similar using the “on close” event of the wp.media object. You can use the “select event”, as you are actually doing, but I would use “on select” event mainly for events within the modal window (but it is just preference, you can use the “on … Read more
The short answer is that there isn’t any straightforward way to do this, since the custom field metabox was not written with extensibility in mind. You could add the additional field using JavaScript and hijack the Add button to send the data to your custom AJAX handler that would store them as you want.
To add a field to the profile/user edit page you need to use the edit_user_profile hook and show_user_profile hook so: add_action( ‘show_user_profile’, ‘my_extra_user_fields’ ); add_action( ‘edit_user_profile’, ‘my_extra_user_fields’ ); function my_extra_user_fields( $user ) { ?> <h3>User avatar</h3> <table class=”form-table”> <tr> <th><label for=”user_avatar”>User avatar</label></th> <td> <input id=”user_avatar” name=”user_avatar” type=”text” value=” <?php $user_avatar = get_the_author_meta( ‘user_avatar’, $user->ID ); … Read more
I figured I’ll leave the meta values saving on multiple fields in the db, because I’ve been doing allot of pre_get_post query filtering. Some of the features in there are for searching/filtering on post meta data and would it start making things very difficult if I was to start saving values into doubly serialized values. … Read more
You could do two things: A) replace the search with a SQL query that only searches the postmeta table (faster as there’s no JOIN involved – you can get the post via it’s ID later on, when displaying the results). B) Split the string right after WHERE 1=1 and drop the later part. You can … Read more
In this example of repeatable custom fields, we can see that the following jQuery is needed: $(‘#repeatable-fieldset-one tbody’).sortable({ opacity: 0.6, revert: true, cursor: ‘move’, handle: ‘.sort’ }); And the HTML it controls is (simplified): <table id=”repeatable-fieldset-one” width=”100%”> <thead> <tr> <th width=”2%”></th> <th width=”30%”>Name</th> <th width=”60%”>URL</th> <th width=”2%”></th> </tr> </thead> <tbody> <?php if ( $repeatable_fields ) … Read more
As far as I know the custom key-value pairs are kept in the wp_postmeta table. You can simply examine (and delete) them in the database directly. SELECT * FROM wp_postmeta WHERE meta_key LIKE ‘%you_old_key_name%’ The ACF configuration of the fields is another story, but you say that you don’t even have the field in the … Read more
Sorry, bad news. If you look in the code-base of WP 3.9 for the responsible PHP file (which is site-new.php) you’ll unfortunately see that this is all hardcoded, like a lot of stuff in wp-admin, which IMHO totally sucks. 🙁 The only thing you can do is to build your own page for site creation … Read more