Donghyeok kang
Forum Replies Created
-
KangSeungUk is my colleague.
Let me explain more.
It’s when a logged-in user buys.
A wordpress user can change his email and write another email in the ckeckout field.
In this case, multiple customer data will be inserted because of the different email.
But only one EDD_Customer instance is created to print the purchase history in the edd_get_users_purchases function.
This is critical and urgent in our project.
Please check it out.
Thanks in advance.I found what the problem is.
$blog_id is the global variable of WP.
It has the current blog id.
So, when I set $blog_id as something, I would change the current blog id without knowing it.
There are a lot of statements $GLOBALS[‘blog_id’] in the wp-includes/ms-blogs.php file.
It’s not safe to use $blog_id as a local variable.
I’ll change all the variable $blog_id to $blogid or something.I dont’t think it’s a good idea for the WP developers to take the blog_id as a global variable name, because it’s the name anyone can take.
Anyway I’ll close this topic.
I appreciate your concern, Ipstenu.
Hi.
get_blog_details() and wp_get_attachment_ur() are independent functions and should be independent.
But get_blog_details() affects another function.$post_id = 10; $url= wp_get_attachment_url(get_post_thumbnail_id($post_id)); echo $url;
prints wp-content/2013/10/image.jpg because the current site id is 1 and $post_id 10 belongs to the site 1.
wp-content/2013/10/image.jpg is correct.$url= wp_get_attachment_url( get_post_thumbnail_id($post_id) ); $blog_id = 42 $blog = get_blog_details($blog_id); echo $url;
prints wp-content/2013/10/image.jpg correctly, too.
But
$blog = get_blog_details($blog_id); $url= wp_get_attachment_url( get_post_thumbnail_id($post_id) ); echo $url;
prints /wp-content/sites/42/2013/10/image.jpg.
get_blog_details() changed the current site id to $blog_id 42 and makes the wrong attachment url.
get_blog_details() affects wp_get_attachment_url() indeed. Do you understand?
$blog_id is just the blog id like 42.
$blog = get_blog_details($blog_id); $url= wp_get_attachment_url( get_post_thumbnail_id($post_id) ); echo $url;
prints /wp-content/sites/42/2013/10/image.jpg.
I uploaded a file in the main site and Its path is /wp-content/2013/11/image.jpg.
$url= wp_get_attachment_url( get_post_thumbnail_id($post_id) ); $blog = get_blog_details($blog_id); echo $url;
The path of $url is /wp-content/2013/11/image.jpg. However,
$blog = get_blog_details($blog_id); $url= wp_get_attachment_url( get_post_thumbnail_id($post_id) ); echo $url;
The path is changed as /wp-content/sites/$blog_id/2013/10/image.jpg and makes 404 not found.
I think there’s something wrong in the restore_current_blog() function that the get_blog_detail() invokes.
It doesn’t restore all the settings of the current blog.Forum: Plugins
In reply to: [Timber] Something wrong in the TimberTerm.get_link() functionIt works. Thanks a lot.
Forum: Plugins
In reply to: [Timber] Something wrong in the TimberTerm.get_link() functionI think it makes trouble with a custom taxonomy.
This is my code.
$args = array( 'labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => false, 'hierarchical' => true, 'rewrite' => array('slug' => 'book-category', 'with_front' => false), 'query_var' => true ); register_taxonomy( 'dillybooks_category', array('dillybooks_book'), $args );
I set the rewrite rule using the slug, ‘book-category’.
But {{category.link}} doesn’t include ‘book-category’ but ‘dillybooks_category’.
For example, it makes a url like https://books.dillypress.com/blog/dillybooks_category/intermediate not https://books.dillypress.com/book-category/intermediate/.
The page, https://books.dillypress.com/blog/dillybooks_category/intermediate returns 404 not found.Please test and fix it.
Thanks.