Frontend Feature image upload not work

Use the following code. <?php // Upload image to wordpress media and save image url to custom field. if(isset($_FILES[‘images’])) { // These files need to be included as dependencies when on the front end. require_once( ABSPATH . ‘wp-admin/includes/image.php’ ); require_once( ABSPATH . ‘wp-admin/includes/file.php’ ); require_once( ABSPATH . ‘wp-admin/includes/media.php’ ); require_once( ABSPATH . ‘wp-admin/includes/admin.php’ ); $file_return … Read more

Delete post meta front end

For anyone else looking for guidance on how to do this, I created another custom field called event_status and by using the save_post action in wordpress set a condition that once this changes to then the run delete_post_meta action as follows: function event_status_is_updated($post_id){ if(get_post_meta($post_id,’event_status’,true)==’not_complete’){ delete_post_meta($post_id,’date_dun’); } } add_action(‘save_post_event’,’event_status_is_updated’);

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