Saving Custom Field in Attachment Window in WordPress 3.5

I wanted to be able to add author information to my attachments and merged this code: http://www.billerickson.net/wordpress-add-custom-fields-media-gallery/ with the one you refer to. I Got it to work fully in the modal window via AJAX. The modified code is as follows: /** * Add Author Name and URL fields to media uploader * * @param … Read more

Date, Time, and Timezones

What is the purpose of the timezone setting in the Admin -> Settings section? Since WordPress handles time zone on its own (separately from native PHP functionality) that is where the setting made and result is stored in options. Whenever anything that works with timezones needs to happen, the time zone setting is retrieved and … Read more

If Custom Field is empty don’t display div

Try this: <?php $business_services = get_field( “services_for_businesses” ); //etc… ?> <div class=”section-title”>Services for Individuals</div> <div class=”section-text”> <?php the_field(‘services_for_individuals’) ?> </div> <?php if ( $business_services ) : ?> <div class=”section-title-business”>Services for Businesses</div> <div class=”section-text”> <?php echo $business_services; ?> </div> </div> <?php endif; ?> </div> Further abstract the code to meet your needs if you have more … Read more

How to handle a custom form in wordpress to submit to another page?

<form action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>” method=”post”> <input type=”hidden” name=”action” value=”your_action_name”> Add these in your form. Where admin-post.php will process your form. In that case based on the value of your_action_name that is provided by you, an action hook will get involved. Say for example if you add a hook like the following in … Read more

How do I search an array stored in a custom-field using WP_Query?

Searching inside a serialized array is difficult and inefficient– ie. slow. The following pure SQL will do it: SELECT * FROM `wp_postmeta` WHERE `meta_key` LIKE ‘daysonair’ AND `meta_value` LIKE ‘%thursday%’ LIMIT 0 , 100 Something like this should get WP_Query to do something similar: $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ … Read more

Why isn’t my code to save custom fields in quick edit working?

I downloaded and activated the code referenced on GitHub, then added custom post type registration code for movies to match the original example. I noticed that the code on GitHub had a bug where the switch statement in manage_wp_posts_be_qe_bulk_quick_edit_custom_box() checks for release_date, coming_soon, and film_rating instead of release_date_column, coming_soon_column, and film_rating_column, so I fixed those … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)