pixel016
Forum Replies Created
-
Forum: Plugins
In reply to: [Event Tickets and Registration] Conflict with WC VendorsNobody ?
Forum: Plugins
In reply to: [Contact Form 7] Calendar's date field missing ?Yes i’m ok with you, but with safari it doesn’t work too.
Forum: Plugins
In reply to: [JW Player for Flash & HTML5 Video] Youtube video no displayinghttps://bookingsystem.alwaysdata.net/
On the top of the agenda i have add the jw player
Forum: Plugins
In reply to: [JW Player for Flash & HTML5 Video] Youtube video no displayingNo because it’s on local server.
If i check on the front end i have the JW div like “<div id=”jwplayer-0″ class=”jwplayer”></div>”
But nothing inside
Forum: Hacks
In reply to: How to update imageMy problem is how to get the url of the new picture uploaded because i get it like this :
$filename = get_user_meta($current_user->ID, ‘image_profil’,true);
And my fonction is executed in the ‘profile_update’ hook.
Forum: Hacks
In reply to: How to update imageThis is my code
$wp_filetype = wp_check_filetype(basename(WP_CONTENT_DIR . '/uploads' . $filename), null ); $wp_upload_dir = wp_upload_dir(); $attachment = array( 'guid' => $wp_upload_dir['url'] . '/' . basename( WP_CONTENT_DIR . '/uploads' . $filename ), 'post_mime_type' => $wp_filetype['type'], 'post_title' => $userNickname, 'post_content' => $userDescription, 'post_status' => 'inherit' ); $thumbnail_id = get_post_thumbnail_id( $post_ID ); //error_log('thumbnail id : '.$thumbnail_id); error_log(wp_get_attachment_thumb_file( $post_ID )); if ($thumbnail_id == "") { // Si une image existe pas alors on l'ajoute error_log('ajout nouvelle image id : '.$thumbnail_id); $attach_id = wp_insert_attachment( $attachment, WP_CONTENT_DIR . '/uploads' . $filename, $post_ID); require_once( ABSPATH . 'wp-admin/includes/image.php' ); $attach_data = wp_generate_attachment_metadata( $attach_id, WP_CONTENT_DIR . '/uploads' . $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); set_post_thumbnail( $post_ID, $attach_id ); } elseif ( WP_CONTENT_DIR . '/uploads' . $filename != wp_get_attachment_thumb_file( $post_ID )) { // Sinon on la remplace error_log('remplacement image id : '.$thumbnail_id); wp_delete_attachment($thumbnail_id ); $attach_id = wp_insert_attachment( $attachment, WP_CONTENT_DIR . '/uploads' . $filename, $post_ID); require_once( ABSPATH . 'wp-admin/includes/image.php' ); $attach_data = wp_generate_attachment_metadata( $attach_id, WP_CONTENT_DIR . '/uploads' . $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); set_post_thumbnail( $post_ID, $attach_id ); }
But the condition is not fullfilled.
Forum: Hacks
In reply to: How to update imageYes but how to know that ?
Forum: Plugins
In reply to: [Vimeo Everywhere] Vimeo Album CachedSame problem …
I think the support know it but they don’t assist !!!
Forum: Hacks
In reply to: wp_generate_attachment_metadata does not workHo i’m so heedless lol.
Thank you so so much bcworkz for you help ??
Ok but i need a unique calendar of the artist who register.
Forum: Hacks
In reply to: wp_generate_attachment_metadata does not workForum: Hacks
In reply to: wp_generate_attachment_metadata does not workHi and tanks for your answer.
the value of $filename is : “/2014/01/4442451861_29185dfe82_b1-438×4381391070283.jpg”
I think attachment insertion work because i have my image on the media library (in wordpress admin). But this image has no dimension in the right block, and if I manually send an image from the administration so the same image will be many dimensions.
Forum: Fixing WordPress
In reply to: Featured Image added by programming is displayed with a size of 1pxPlease i’m really blocked ??
Forum: Fixing WordPress
In reply to: Featured Image added by programming is displayed with a size of 1pxAfter tests i think the “wp_generate_attachment_metadata” function doest not work because the result is an empty array.
Please help me ??
Forum: Fixing WordPress
In reply to: How to add featured picture on custom post ?Not bad idea but i want to force them to set an avatar when they create profile because a new “artist” (with the avatar) post is created.
i user this hook after registration
function createNewPost( $response ){ global $userMeta; $userID = $response->ID; $user = new WP_User( $userID ); $role = $userMeta->getUserRole(); if( $role = 'artiste' ){ $newPost = array( 'post_title' => $user->nickname, 'post_content' => $user->description, 'post_status' => 'pending', 'post_author' => $userID, 'post_type' => 'cpt_artists', 'tax_input' => array('artist-category' => array('6') )); $post_id = wp_insert_post( $newPost ); } }
But i don’t know how to add the avatar to featured image in the post.