Update post meta not working on wp_postmeta

Well…. you could use the correct Field in the $_POST, which would be $_POST[‘post_id’], not $_POST[‘post-id’] 😉 Replace update_post_meta($_POST[‘post-id’], ‘whole_avg’,$whole_avg); with update_post_meta($_POST[‘post_id’], ‘whole_avg’,$whole_avg); etc. 😉 Happy Coding, Kuchenundkakao

Modifying WordPress XML-RPC Built-Ins

Figured it out. $post_obj[‘permalink’] = my_getDraftPermalink( $post_obj[‘post_id’] ); That’s the correct syntax for getting the post_id. Then a custom function that gets the permalink the same way as the post dashboard UI is required. The dashboard uses get_sample_permalink and not get_permalink, which will return the draft path if the post isn’t live. function my_getDraftPermalink ( … Read more

WordPress custom posttype meta values doesnot save

You forgot to declare global $post //Create Meta box function astest_add_metabox() { add_meta_box(“astestimonial_metaboxes”, “AS-Testimonial Client Information”, “astestimonial_meta_box”, “astestimonial”, “side”, “low”); } add_action(‘add_meta_boxes’,’astest_add_metabox’); //html code function astestimonial_meta_box() { global $post; wp_nonce_field(‘astest_meta_box’,’astest_meta_box_nonce’); $clientname = get_post_meta($post->ID,’clientname_value’,true); echo'<label for=”client_name_val”>’; _e(‘Name: ‘, ‘astestimonial_textdomain’); echo'</label>’; echo'<input type=”text” id=”clientname_value” name=”clientname_value” value=”‘.esc_attr($clientname).'” />’; } //save post function as_testi_save_data($post_id){ if(isset($_POST[‘post_type’]) && ($_POST[‘post_type’] == “astestimonial”)) … Read more

Error when renaming option

I think you need to set a default value when you use get_option function plugin_setting_url() { $options = get_option(‘plugin_options’, array(’embedded_url’=>”)); echo “”; } Unless plugin_options already exists, then you would need to use wp_parse_args to merge two arrays. function plugin_setting_url() { $options = wp_parse_args(get_option(‘plugin_options’,array()),array(’embedded_url’=>”)); echo “”; }

Adding an onchange event to a custom dropdown menu in WordPress

I have added a wrapper to your html output and then written a jQuery code that you can use – function embed_url() { $dropdown_menu = ‘<select><option>OptionDefault</option><option value=”?id=1″>Option1<option value=”?id=2″>Option2</option></select>’; $full_url=”<object type=”text/html” data=” . $embed_this_url . ‘ style=”width:100%; height:100%”><p> URL could not be loaded. </p> </object>’; return ‘<div class=”site-url”>’ . $dropdown_menu . $full_url . ‘</div>’; } jQuery … Read more