Media Custom Fields – get a value with PHP

As taken from : http://wordpress.org/extend/plugins/media-custom-fields/faq/ How does this plugin handle my data? Media items are stored in WordPress just like regular posts. This enables us to use native WordPress functions to store and retrieve your custom fields. Due to this, your data is stored in a very future-proof way, in the postmeta table of the … Read more

how to add radio field on user meta on function.php?

You are using the wrong name on the radio inputs, radio-inline but when you try to get that value you are using $_POST[‘gender’] I’ve updated you code and made some improvement too, with the checked() function function show_extra_profile_fields( $user ) { $gender = get_user_meta( $user->ID, ‘gender’, true ); ?> <section> <label class=”label” for=”gender”>Gender</label> <div class=”inline-group”> … Read more

Add image custom attribute [closed]

You need to use the hooks attachment fields to edit / save to ad and save the fields. function add_attachment_field_credit( $form_fields, $post ) { $form_fields[‘paper-type’] = array( ‘label’ => ‘Paper type’, ‘input’ => ‘text’, ‘value’ => get_post_meta( $post->ID, ‘paper_type’, true ), ‘helps’ => ‘Photo paper type’ ); return $form_fields; } add_filter( ‘attachment_fields_to_edit’, ‘add_attachment_field_credit’, 10, 2 … Read more

woocommerce how in checkout to add my custom field check box, and when i check it hide the shipping adress and add tax 19% [closed]

CLARIFICATION FOR ALL : You use virtual products on your shop. On checkout page, you have created and set an additional checkbox for european VAT purpose. There is 3 cases related to this checkbox. Checkbox is hidden (default) Checkbox is visible when selected country is an european country: Checkbox disabled (default) => set the VAT … Read more

Add Custom field under the post title [closed]

The position param is responsible for that. You can find all params with descriptions here. So you’ll have to change that part of your code: ‘options’ => array ( ‘position’ => ‘normal’, ‘layout’ => ‘no_box’, ‘hide_on_screen’ => array ( ), ), to this: ‘options’ => array ( ‘position’ => ‘acf_after_title’, ‘layout’ => ‘no_box’, ‘hide_on_screen’ => … Read more

Change post status by custom fields

All you need to do is to use save_post hook. Here’s how: function change_post_status_based_on_custom_field( $post_id ) { // If this is just a revision, don’t do anything. if ( wp_is_post_revision( $post_id ) ) return; // Get field value $value = get_post_meta( $post_id, ‘played’, true ); $status = $value ? ‘publish’ : ‘draft’; // If status … Read more

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