a42
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Ho to use media_sideload_image the right way ?The best thing is to solve the problems your self ?? My ‘final’ code:
$total_i = (string)$car->PictureCount ? (string)$car->PictureCount : '' ; if ($total_i) { if ( !function_exists('media_handle_upload') ) { require_once(ABSPATH . 'wp-admin/includes/media.php'); require_once(ABSPATH . 'wp-admin/includes/file.php'); require_once(ABSPATH . 'wp-admin/includes/image.php'); } for($i = 0; $i < $total_i; $i++ ) { $image = ''; $url = (string)$car->Pictures->Url[$i] ? (string)$car->Pictures->Url[$i] : '' ;; $tmp = download_url( $url ); if( is_wp_error( $tmp ) ){ // download failed, handle error log_me('download_url lykkedes ikke...'.$tmp); } if($tmp) { } $file_array = array(); preg_match('/[^\?]+\.(jpg|jpe|jpeg|gif|png)/i', $url, $matches); $file_array['name'] = basename($matches[0]); $file_array['tmp_name'] = $tmp; // If error storing temporarily, unlink if ( is_wp_error( $tmp ) ) { @unlink($file_array['tmp_name']); } $image = media_handle_sideload($file_array, $post_id, $title); // If error storing permanently, unlink if ( is_wp_error($image) ) { @unlink($file_array['tmp_name']); return $image; } $img_id = wp_get_attachment_url( $image ); log_me($img_id); update_post_meta( $post_id, 'gallery_images' , $img_id ); update_field( 'gallery_images', $img_id, $post_id); } $image1 = get_post_meta($post_id, 'gallery_images[1]'); set_post_thumbnail( $post_id, $image1 ); log_me('gallery_image indsat'); }
Forum: Plugins
In reply to: [Front End Users] Reset password not workingafter some investigation I did discovered that the login process are pretty confussing: To get a password match you have to have User_Email_Confirmed row in the EWD_FEUP_Users table to return a Yes, otherwise $Passwords_Match = false;. On the option page you give the admin the possibility to say yes or no to this option and …
The variable $Use_Crypt always has to be “Yes” otherwise the $Passwords_Match = false; – this is also an opt out on the option page…
plus when you are logged in the login form is still displayed and when inserting the [logout] shortcode in the header.php the user are automatic always logged out ? Is there another way to show the logut and hide the login form when a user are logged in ?
/Adam
Forum: Plugins
In reply to: [Front End Users] Reset password not working@etoilewebdesign On top of this does the forgot password function not update the password in the database … and login does not seem to work – are you aware of this issue ?
Forum: Plugins
In reply to: [Front End Users] Reset password not workingI solved this problem by replacing line 135 in front-end-only-users/Function/Process_Front_End_Forms.php:
$message .= __(“If you want to reset the password, please visit “, ‘EWD_FEUP’).site_url().”/”.$_POST[‘ewd-feup-reset-email-url’].”&add=”. $User_Email.”&rc=”.$resetcode.”\n”;
with:
$message .= __(“If you want to reset the password, please visit “, ‘EWD_FEUP’).site_url().”/”.$_POST[‘ewd-feup-reset-email-url’].”?add=”. $User_Email.”&rc=”.$resetcode.”\n”;
Hint! it should be ?add= in stead of &add.
Cheers,
AdamHi there,
I did manage to change – dynamically – the wdm_admin_email variable but where can change the variable wdm_form_dataset[user_email] ?
Cheers,
AdamI have tried to update the admin_email by these steps:
function enquiry_to_vendor( $email ) {
global $product;$vendors = get_product_vendors( $product->id );
if( $vendors ) {
foreach( $vendors as $vendor ) {
$email = $vendor->paypal_email;
}
return $email;
}}
function vendor_admin () {
if( is_page(‘product’)) {
add_filter( ‘pre_option_admin_email’, ‘enquiry_to_vendor’ );
}
}add_action( ‘init’, ‘vendor_admin’ );
But it is still the site admin email which appears in the variable wdm_admin_email…
What to do ?
Cheers,
Adamso what I could do instead is to override the admin_email but how ?
Forum: Plugins
In reply to: [Product Enquiry for WooCommerce] Mail not receivedIf you still have the problem then I would suggest you to install the WP Mail Logging plugin – very useful ??
Forum: Plugins
In reply to: [Q and A FAQ and Knowledge Base for WordPress] single page template*closing topic*
Forum: Plugins
In reply to: [Q and A FAQ and Knowledge Base for WordPress] single page templateThat’s indeed a great find ??
Cheers
Adam
Forum: Plugins
In reply to: [Q and A FAQ and Knowledge Base for WordPress] single page template*bump* still no one who can help us out ?
@nowton the single post type template can be customized fairly simple… look there >> https://codex.www.ads-software.com/Post_Type_Templates for explaination of the post type templates.
Cheers,
AdamForum: Fixing WordPress
In reply to: can't get tags of post …Hi Steven
Yes I do call the $post (it’s inside a loop I try to get the tags)
If I use the function the_tags() I get nothing… (?)
Cheers,
AdamForum: Plugins
In reply to: [Opening Hours] Opening hours in select box with date dayHi Janizde
To determine the weekday of today I would use the date(); function:
$weekday = date('L');
and the date today:
$date = date("d/m/Y");
But how to get the array of opening hours into a loop outside the context of the plugin puzzles me…
I want to make a loop ten times using range (0, 10) where the starting point is the day of today…
Cheers,
AdamForum: Plugins
In reply to: [Contact Form 7] Send form to variable email ?Yes, I have seen that tag…
But ff I use that tag would it not then be the author of the page (contact page) which would recive the mail and not the author of the page from which the request comes from ?
//Adam
Forum: Plugins
In reply to: [Q and A FAQ and Knowledge Base for WordPress] Template file and child themesHi Susan,
The plugin / shortcode is working now… ??
Can you recommend another faq plugin ?
Cheers,
Adam