Questions tagged [wordpress]
WordPress is a free and open source blogging tool and a content-management system (CMS) based on PHP and MySQL.
140
questions
1
vote
0
answers
82
views
Add a Custom Billing Field to WooCommerce Checkout, Order Meta, and User Meta
I have implemented a custom WooCommerce checkout field to collect a Tax Exempt Number in the billing section. This field's value is stored in the user meta upon checkout to facilitate future orders.
...
1
vote
0
answers
37
views
PHP WordPress Code - Pricelist Template - refactored
I've been working on a refactoring my old WordPress pricing page template and would appreciate feedback on the code structure, organization, and any potential improvements. The template is used to ...
1
vote
2
answers
195
views
PHP WordPress Code - Pricelist Template
I've been working on a WordPress pricing page template and would appreciate feedback on the code structure, organization, and any potential improvements. The template is used to display a pricing list ...
1
vote
0
answers
80
views
Force free shipping for WooCommerce Subscription recurring orders only
I'm using WooCommerce Subscriptions and here's what I want to do:
Use free shipping for all recurring orders even if the minimum isn’t met.
Get rid of any other free shipping choices (like free ...
0
votes
1
answer
281
views
WordPress Plugin for WebP/AVIF Image Conversion
I'm looking for feedback on a WordPress plugin I developed for automatically converting images to WebP and AVIF formats. The goal is to optimize image loading performance.
The plugin has the following ...
2
votes
1
answer
243
views
Display WordPress Custom Post Types with ACF-Fields on a Google map
I am currently working on my first WordPress plugin. I display custom post types on a google map with pins. The custom post types also have additional information by ACF fields which are displayed in ...
0
votes
2
answers
530
views
Configuring SQLite3 for best efficiency as a persistent cache
I'm using SQLite3, via php's extension module, to create a persistent object cache for WordPress. It's intended for use on modestly sized sites that don't have access to redis or memcached. Why use ...
1
vote
2
answers
93
views
PHP function that checks if user should have access based on button click and yearly quarter
I have a function that has a few and/or operators in it. I'm sure there is a better way to write this but can't seem to figure it out. I thought I could use arrays but ran into an issue with having ...
0
votes
1
answer
256
views
Default to array when value is null or false
I'm working with ACF in WP which provides a get_field() function. The function can return an array of values, null or false. ...
0
votes
2
answers
115
views
Search between dates in a WP Query
In the posts I have a date field and a start and end date range. I need to query if it matches date or if it matches between the dates in the range. This Query works, but how can I optimize?
...
4
votes
2
answers
182
views
Modify a WordPress loop to show posts of certain categories, based on user roles
I've got some code that works as intended, but I have a feeling that it's messy. This code is modifying a wordpress loop and the goal is to check the roles of the current user and show posts of ...
2
votes
2
answers
196
views
Optimize PHP code for Wordpress shortcode (Star-Rating)
I am using WP with the Avada theme and the built in Star Rating element as well as ACF Pro.
Unfortunately I found out that the Star-Rating element adds a rating scheme to the footer of the website ...
3
votes
2
answers
108
views
Custom Block with ACF in WordPress
I'm learning and want to improve as much as possible. In doing so I have written this custom block that has an image on one side and an inner block on the other. It's using ACF to get the variables ...
1
vote
1
answer
51
views
Instantiating classes in WordPress plugin
the last couple of weeks i have been working on my own WordPress plugin. I am trying to do a class based codebase.
My plugin works correctly, but i don't really know if this is the correct way to ...
2
votes
0
answers
33
views
Added custom woocommerce product page hook
I inserted this code snippet in the functions.php of my child theme, to create the woocommerce single product page in the hook woocommerce_after_single_variation of the custom icons in line centered ...