Setup SMTP setting in wordpress

WordPress uses PHPMailer class and has an action hook that you can use to configure it. For example: add_action( ‘phpmailer_init’, ‘cyb_smtp_config’ ); function cyb_smtp_config( $phpmailer ) { $phpmailer->IsSMTP(); $phpmailer->Host=”smtp.mailer.com”; $phpmailer->Port = 25; $phpmailer->Username=”username”; $phpmailer->Password = ‘password’; } Be sure that you need a custom SMTP connection instead of configuring the SMTP service in your hosting. … Read more

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