All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
30 views

Wordpress not available to file using wp-env for xdebug requests

I'm using Wp-env to develop a plugin as it's a pretty robust wrapper for Docker that includes phpunit and xdebug. However, I have been struggling to get xDebug working. From my_plugin directory run ...
  • 549
0 votes
1 answer
12 views

How to set menu Display location

I have created a menu and I have the ID. $menu_id = wp_create_nav_menu( 'Main Menu' ); And I have registered a navigation menu location: register_nav_menus( array( 'menu-header' => '...
  • 125
0 votes
0 answers
28 views

Get comment number by date range?

I want to add a fire icon to the posts that have received more than 10 comments in the last 7 days. The function to retrieve comment numbers get_comments_number() doesn't have a date range. So how do ...
0 votes
0 answers
22 views

How can I delete the options from DB when the plugin is deleted?

I am saving my plugin's data under the wp_options tables. How can I delete my plugin's data and saved options from there when the user deletes my plugin? I know I can delete tables while plugin ...
0 votes
0 answers
17 views

register_activation_hook not working

I have a main file for my plugin that contains the following: <?php /** Plugin info */ define( 'PLUGIN__DIR', plugin_dir_path( __FILE__ ) ); require_once( PLUGIN__DIR . 'class.properties.php' ); ...
0 votes
1 answer
32 views

plugin translations not reflected in admin dashboard

I have a plugin which has all strings originally in English, now translations to Arabic have been done at 100% and are appearing on the project link. When I check the plugin's page in Arabic, it is ...
-1 votes
0 answers
13 views

Warning: Illegal string offset 'post' and 'page'

if ( !function_exists( 'plumbing_parts_post_list_post_types' ) ) { //add_filter('plumbing_parts_filter_list_post_types', 'plumbing_parts_post_list_post_types', 9, 1); function ...
-1 votes
0 answers
22 views

How to turn off pages for user uploaded files?

My client has a Members Portal where members are able to upload files (certificates and the like). These files get stashed into a custom folder but are otherwise meant to be private. IIRC they use a ...
  • 109
-1 votes
0 answers
13 views

jQuery Add/Remove Classes Not Working

I am trying to use jQuery to add/remove classes in my custom WP theme. The file is enqueued correctly in my functions.php, and the alert is loading on the page. My CSS is correctly set up (I've tested ...
0 votes
0 answers
18 views

Nested ShortCode works inside the_content, but not outside of it

community; I've spent all weekend trying to crack a problem that so far eludes me. On a multisite implementation, I'm using a simple homegrown plugin to include textbits that are the same across ...
  • 3
0 votes
1 answer
44 views

Website Developer has gone missing! How to gain full access of your code from a Wordpress website?

I have hired a website developer to create a Wordpress website for me. The website is nearly finished, but the website developer has gone missing! I have admin access to the Wordpress dashboard. How ...
  • 3
0 votes
1 answer
24 views

Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?

Suppose you register the following endpoint in your application on example.org: register_rest_route( 'sample/v1', '/test', [ [ 'methods' => 'POST', ...
  • 401
-2 votes
0 answers
23 views

Enter data to wp_postmeta

I have a number of posts with the following specifications I want to enter a record with the following conditions in the wp_postmeta table for all ID How can I enter this data with sql ?
  • 1
0 votes
0 answers
11 views

WP_Query – order with usort by custom meta

I have a custom post type location which has different categories (e.g. museums, theatres, shopping) and I want to output each of these categories and order within these categories by distance which ...
  • 1
-1 votes
1 answer
23 views

Reading the inside of <head>

I am writing this because I am confused about whether it is possible to read the head tags when I'm in admin. Searching for queries like "reading wordpress" return how to add code to ...
0 votes
0 answers
11 views

Get a customer's phone number by woocommerce

I have been researching for days how to obtain the telephone number of a user who registers on my website or places an order, and that this telephone number is added to the users tab with a column ...
0 votes
0 answers
22 views

WordPress Ajax send response on every iteration of a loop

I am trying to get an ajax request to update the response as it goes through a loop, similar to a progress bar. A bit of background on this snippet. Here is the JS Ajax request: // ------------...
0 votes
1 answer
16 views

List posts grouped by children of a custom taxonomy

I am successfully listing posts grouped by category from a custom taxonomy like so: Category 1 Post Post Post Category 2 Post Post Post Category 3 Post Post Post Category 4 Post Post Post I am ...
0 votes
1 answer
8 views

Error Message when logging into WordPress on Xampp

I have two Wordpress sites running on Xampp. I am getting an error when logging into the second site I set up, it say's 'username is not registered on this site. If you are unsure of your username, ...
  • 1
0 votes
0 answers
7 views

Updating order meta to have a meta entry from an item in the order

I have a created a simple gift wrapping plugin, which adds a gift wrap product to the user cart and when they enter a message it adds it as meta data to the line item, this is fine for the woocommerce ...
  • 209
0 votes
0 answers
24 views

How do I remove the recurring total from thank you for your order email?

How do I remove the recurring total from thank you for your order email with the subscription email?
0 votes
1 answer
17 views

Wordpress website links redirect to homepage

I have created a wordpress.com website and have added a navigation that links my pages and external links. The external links are working fine but all in-site links to other pages re-direct me to the ...
  • 1
0 votes
0 answers
12 views

Insert a custom field as a second email address to a completed order in WooCommerce

I'm looking to use a custom field from "Checkout Field Editor for WooCommerce" to use as a second email address to a completed order in WooCommerce. I started by using this code which works ...
  • 1
0 votes
0 answers
21 views

Wordpress Customizer not loading

I am trying to switch my Wordpress site to a new theme. I could reproduce the initial issue on my live site as well but did all the following testing in my local staging environment. Issue: As long as ...
0 votes
0 answers
10 views

How to edit a non logged in page?

Having difficulty editing a 'non logged in' page on wordpress using elementor. Every time I logon to wordpress it only shows me the logged on view but I need to edit a page that is logged out. I know ...
0 votes
0 answers
23 views

Wordpress get_the_term_list include class name for heirachy

I have a custom post type which uses custom categories (taxonomy) - called project-type with 2 levels of heirachy which are tagged to different posts. When viewing the custom post page I want a way to ...
  • 101
0 votes
0 answers
7 views

Log in and Register link should disappear after a user log in successfully into the dashboard page

Im working on a email verification in php using phpmailer. Everything works fine except after a user authencation is successful and user log in the log in and the register link should not display but ...
0 votes
0 answers
9 views

Losing Session ID and sessionStorage when navigating to other domains on Multisite

I'm working on a WP Multisite install with the following directory structure: The site on main-domain.com has navigation links that open the "ebar.com" and "efoo.com" sites (which ...
0 votes
0 answers
28 views

PHP warning $post->ID is null

I've been having some difficulty with the following error, and my PHP skills are pretty non-existent. Whenever I try to create a new page, I get the following error: PHP Warning: Attempt to read ...
0 votes
0 answers
9 views

Add custom PHP (no-SQL) filter to WP_query

The WP_Query has many filtering availabilities, but they all come down to filtering with the SQL query. I need to make a complex filter, which can't be done with SQL or with the filters WP_Query ...
0 votes
1 answer
14 views

PHP Creating a formula from mysql db values and db stored math operator

I am trying to use variables stored in a DB and math operator (e.g. * + - /) to allow users to build formulas e.g. (Night Shift Hours*Night Shift Time Rate)*0.2 The formula string is build from ...
1 vote
0 answers
45 views

Blocking the direct access to images in the upload folder WordPress

To prevent direct access for images in upload folder we have following configuration in Nginx configuration: location ~* \.(jpg|jpeg|png|gif)$ { valid_referers example.com https://example.com; ...
  • 11
0 votes
0 answers
22 views

Display all categories (with link) of custom post type - Wordpress

I have custom post type "case study". Inside it i have few categories. I want to display all existing categories from this "case study" CPT. I successfully listed items from CPT on ...
-1 votes
0 answers
14 views

how do I exclude a category foreach

I have this code and would like to exclude a parent category with all subcategories associated with it, can you help me? I've been trying to fix it for a while but I can't $cat_array = array(); ...
0 votes
0 answers
16 views

Swap domains of two sites with each other in multisite

Looking for advice on the best way to swap the domains of two sites with each other in a multisite instance. Yet to find good info on my particular situation: I created a new site (subdomain) as an ...
0 votes
0 answers
13 views

PHPUnit Testing Installation Issue

I'm trying to setup PHPUnit testing and thought I would begin with the basics. So using this tutorial https://www.smashingmagazine.com/2017/12/automated-testing-wordpress-plugins-phpunit/ I have ...
0 votes
1 answer
11 views

Unable to login my subdirectory WordPress site

I am trying to build a new website in my existing website's subdirectory folder. I have installed WordPress to www.fitfix.ca/new subdirectory. I can access to the page but when try to login fitfix.ca/...
0 votes
1 answer
28 views

Settings API not Saving to Database or Display

I am developing a payments gateway, and wanted to have a page with a form to save authentication credentials for reaching out to an external API used for payment. I made a settings page using ...
0 votes
0 answers
14 views

Trying to set up a range filter for related custom post types

I have set up two CPTs, "Property" and "Suite". Each Property has a number of Suites assigned to it via an ACF bidirectional relationship.  Each suite has a set size (in square ...
0 votes
0 answers
29 views

How to fix wp-env: "error: Your local changes to the following files would be overwritten by checkout"

I have been using @wordpress/env for a few weeks, starting it with npm run wp-env start. Since this morning, that now fails with: > wp-env "start" ✖ error: Your local changes to the ...
0 votes
0 answers
16 views

Contact form with dynamic dropdown and filter

A client wants to create a contact form for a moto parts store that allows users to choose their moto make-model-year. They want this information to provide better assistance after the contact. They ...
0 votes
1 answer
23 views

Using useSelect creates "minified React error"

I'm working on a Gutenberg block that will be a dropdown menu of all posts on the site. I used @wordpress/create-block (version 4.4.0) for the scaffolding. When I try to use the useSelect function, ...
-1 votes
1 answer
18 views

Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel

I would like to create a simple static page in my theme which would then show some practical information on a certain event. The page would be served on the path /practical. For now, there are no ...
  • 101
0 votes
1 answer
20 views

how can a plugin return an error message on activation?

I'm developing a plugin that needs a certain php extension (sqlite3) to be available, or it can't work correctly. Is there a way I can present an error message to the site owner when they try to ...
  • 451
0 votes
1 answer
27 views

Redirect all pages to the custom login page except for the registration page

I have redirected all non logged in users to my login page but on the page there is an option for them to register and that navigates back to my login page and I want to exclude that register page ...
0 votes
1 answer
29 views

How can I send api calls from my plugin?

I have a collection of REST APIs that our android app uses. We use POSTMAN to send requests and troubleshoot them. Now, I am working on a plugin where I am trying to send API calls to all the ...
0 votes
0 answers
12 views

Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)

Here is my code, currently when viewing a post it ends displaying posts from second child category(second in hyracichal while we have 4 stages). I want it to display posts from 4th child category, if ...
0 votes
0 answers
19 views

Custom field fetch error on woocommerce pdf invoice

I want to do some modifications to a template of WooCommerce, but I'm rather ZERO in PHP, so that is why I'm asking some guidance so I could perform my small modifications, which I'm sure are not too ...
0 votes
0 answers
46 views

How to add custom menu to block theme?

I'm creating a theme based on the 2023 block theme from WordPress 6.1. I need to create a custom menu as the built-in one is too limited for me. I initially thought I can just enter the menu under &...
  • 121
-1 votes
1 answer
17 views

Show number of posts AND number on current page (cannot make it work)

I have looked over the following but still cannot make this work; Show number of posts AND number on current page Show number of posts and number on current page (revisited) This is what I currently ...

15 30 50 per page
1
3 4
5
6 7
2274