I am having the hardest time programmatically creating an order in WooCommerce. I am using the code below and is DOES create an order BUT I cannot get customer information OR product line items added to the order. The new order that is create is simply as Guest with no items, user information, etc. The issue seems to be that
Tag: wordpress
Get user role by ID WordPress
I need to somehow check someone’s role with only their id. I have found the current_user_can() check. But this only works for people that are logged in. How would I check for this if that user isn’t the current user? I am using a phone order system but that uses the admin/specific account to order for other people. Answer To
wp_nav_menu filter, removing a specific link
I’m trying to remove a specific link from my wordpress menu: <li class="ubermenu-item ubermenu-item-type-post_type ubermenu-item-object-page ubermenu-item-1 ubermenu-item-level-0 ubermenu-column …
Create sub page of sub pages using “fake pages”
I found this tutorial to make so called fake pages, so I could dynamically create pages with custom fields. It works very well, but I need to tweak it to fit my needs. Like if for example a book have …
set urls with parameter to noindex in wordpress?
I’m looking for a solution to set all URLs which uses the parameter ‘?’ to noindex. I look for a php solution which I could use in the header.php in Wordpress or in the .htaccess. I tryed this: This solution did not work and URLs with the parameter ‘?’ didn’t get a noindex attribute. Best regards Answer You can use
strpos(): Empty needle WordPress Plugin
I’ve just finished building my first plugin and have tested it with various plugins on my personal site with no errors. However some users are saying the plugin is causing the following errors for them: strpos(): Empty needle in /west/XXXXX/public_html/wp-content/plugins/bot-block/bot-plugin.php on line 200 On line 200 I have this: Now I can’t see a problem with that line so I’ll
Calling a PHP function on button click?
I have a html button which has an onclick method. The function which is ran onclick has a php function in but is called in JS, like below. The page this code is on is a wordpress admin page. When the page loads, the php function is ran anyway instead of waiting for the button click event. Is there a
WordPress get attachment image caption
I tried to get attachment meta caption value as mentioned here, but couldn`t get any output. Other meta arrays like [created_timestamp] or [iso] gave their values. This issue happens to both and [title]. Any help is much appreciated. Answer The caption and title you are looking to get from wp_get_attachment_metadata are not the title and caption you add in WordPress
How to replace meta title and meta description in wordpress?
Sorry if my question was basic or stupid but please help me to solve this issue. I’m trying to change
WordPress Woocommerce Redirect Argument
When I enable my site automatically show argument ?v= like this How can I fix this? Answer String to all urls ?v=XXXXXXXXXXXX. That URL is coming from standard base address setting in Woocommerce. When you choose geolocation with caching support for page, it will add that ?v=xxxx string because it’s capturing the visitors base address TO fix it goto woocommerce->settings->Default