Skip to main content

Questions tagged [php]

For questions about the server-side programming language that the WordPress core, plugins and themes are written in. Questions about using PHP outside a WordPress context are off-topic but might be asked on Stack Overflow.

Filter by
Sorted by
Tagged with
0 votes
0 answers
4 views

Assembly Options at checkout

I want to add Assembly options at the checkout page like this https://imgur.com/a/WrzWCiO Anyone knows how to do it without plugin? Thanks
Tasnim's user avatar
  • 1
0 votes
1 answer
18 views

Wordpress admin area not sending mail (but works with WP Mail SMTP, Test Mail, and PHP mail() function)

My wordpress admin area does not seem to be able to send mails. For an example, I tried to change the admin mail address, but I never received the confirmation mail and had to use the plugin Change ...
John Kravicz's user avatar
0 votes
0 answers
8 views

Global update of records after import WP All Import Pro

friends. I have encountered a problem updating records. I am importing vacancies into the WP Job Board Pro plugin via the WP All Import Pro plugin. When importing, I have a field in wp_postmeta ...
Givanni Dev's user avatar
0 votes
1 answer
10 views

Redirect to non-Wordpress version of home page for search results via index.php customization overwritten

Because the Wordpress pages in my web site can have an extremely unacceptable 2000+ millisecond TTFB, non-Wordpress web pages has been my approach. By saving large HTML blocks in a couple of ...
Ted's user avatar
  • 1
0 votes
0 answers
8 views

Custom post type removing /page/2/ from URL when trying to access it

I made a shortcode to list form entry data that paginates using paginate_links(). I added this shortcode to a regular page and it works fine. If I click on page 2, it refreshes the page and adds the /...
Aristocles's user avatar
0 votes
1 answer
27 views

How to use Forms without actually sending email

I need users to be able to fill out a form without an email being sent anywhere. Instead, I want to capture the data entered with Javascript or PHP and act on the data entered in my custom plugin. I ...
Timbo's user avatar
  • 101
0 votes
0 answers
11 views

Wordpress site calling debug.log and .user.ini at certain hour

Im having a hard time understanding what is this behaviour. I have around 300 Wordpress Sites on two big servers. They normally work pretty well, but from some time to now, they started to have a ...
P4R0DY's user avatar
  • 1
0 votes
0 answers
18 views

Error message not appearing in error email or in the error log

I am developing a plugin. I am getting an error when activating, but I can't find out what is causing the error, even which file is causing the error. I don't receive an email for the fatal error, and ...
Sloan Thrasher's user avatar
0 votes
0 answers
19 views

Put ACF function output code the_terms

I would like to put an ACF field in the of my the_terms function, is this possible? Because I can't figure out how to put it. <?php $dev = get_field ('my_field', 'option');?> <?php ...
user avatar
0 votes
1 answer
29 views

Options for using custom PHP in a wordpress site? No FTP access

My professional background is backend engineering, but I volunteered to help a nonprofit, and their website runs on wordpress, so I wrote some php that solves a problem for them, which I tested by ...
eipxen's user avatar
  • 101
0 votes
0 answers
21 views

Get User By Email - Not Working with Variables (PHP)

I'm trying to return user data based on an email input, code is simply: $email = '[email protected]'; $user = get_user_by( 'email', $email ); This returns nothing and when I try filter_var($email, ...
Morts81's user avatar
  • 123
1 vote
1 answer
18 views

WooCommerce: Custom dropdown for variation selection

In WooCommerce, I have an attribute called License Type. This attribute has 2 terms: Single Site License Multi Site License With the above, I'm trying to create a custom select dropdown, where the ...
Freddy's user avatar
  • 157
0 votes
0 answers
30 views

Are there any legitimate reasons for a web browser to directly access wp-includes/*.php?

This question would appear similar to Deny php execution in /wp-includes - using .htaccess in /wp-includes VS root folder - but is different in that that question asserts the questioner has already ...
davidgo's user avatar
  • 222
1 vote
0 answers
9 views

Custom signup redirection to external URL not working

I am using User Registration plugin to register my users. I have created a widget to show a modal with Signup and Login form. I have one more API where the user gets created from this same form. So I ...
nazmul shuvo's user avatar
0 votes
0 answers
16 views

Same Custom Post Type Slug and Custom Taxonomy Slug, with hierarchial unique permalink structure

I am new to wordpress custom post type and re-writing urls'. I have created a Custom Post Type with slug 'industry' further re-writen to 'industries' and Custom Taxonomy associated to it with same ...
divy3993's user avatar
  • 103
1 vote
1 answer
37 views

Add custom data attribute to every core Gutenberg Blocks

I'm adding two custom attributes to core Gutenberg blocks, data-delay and data-duration. I want to add these attributes to manage animations blocks on my custom theme. I wrote this JS code into block-...
Stefano's user avatar
  • 33
-1 votes
0 answers
24 views

How To Convert a Downloaded Site Into a Theme [closed]

I have downloaded a website (appinventiv) using the HTTRACK tool, and once the downloading has completed I was trying to convert it into a WordPress theme, all the images are displaying well but css ...
Ridhi Garg's user avatar
2 votes
1 answer
32 views

Can't assign menu parent id or menu item breaks

I try to create a menu item for every new product category created, but it just creates an empty custom menu item (in the right place). If I however don't assign a menu-item-parent-id it works fine (...
WMMedia's user avatar
  • 51
0 votes
1 answer
25 views

Is there a way to get a path to the theme directory without the server name?

I need to use file_get_contents() in my theme to include an SVG file. As far as I know, an obvious way to do this would be the following: file_get_contents("https://example.com/wp-content/themes/...
Ivan Vetoshkin's user avatar
0 votes
0 answers
10 views

Capture the Selected Radio Button Value between two files in wordpress theme

$html_output .= '<div class="form-group"> <label><input type="radio" name="driver_type" value="society" checked required> ...
amine asfar's user avatar
0 votes
0 answers
32 views

Changing upload directory temporarily

I have various media file uploads that I need to section off into different subdirectories, for example: example.com/assets/Uploads example.com/assets/team They all go under "/assets" but if ...
user1702965's user avatar
2 votes
1 answer
21 views

Custom Search Function in WordPress Returns No Results

I'm trying to integrate a custom search function in my WordPress site where an external API is used to determine search results. The function is supposed to retrieve a list of post IDs from the API ...
Juned Adenwalla's user avatar
0 votes
1 answer
15 views

What is different about using admin-ajax.php in an endpoint and just submitting a form from the front end?

I have created an endpoint with the following php code. The code is currently allowing me to receive the correct pdf but none of the information from the $page is populated in the pdf. The $page is a ...
holty07's user avatar
0 votes
1 answer
14 views

Processing data and redirecting with query string

I am a WordPress and PHP newbie, or at least I haven't coded any PHP since PHP 5 (about 12 years). Our site needs a custom thank you page with a form embedded. I have done all the research I can and ...
pacmaninbw's user avatar
1 vote
1 answer
28 views

What is considered good practice for registering menu locations?

I decided to try my hand at creating my own WP theme from scratch. I've made a header, a navbar, and a footer so far. I've also registered a couple menus, so my navbar will be populated automatically ...
ArceusLegend50's user avatar
-1 votes
0 answers
14 views

blocked by CORS policy

I get error Access to fetch at '' from origin '' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on ...
Batuhan Özkan's user avatar
0 votes
0 answers
23 views

Getting table to format properly in RSS feed emails

I have a post with a tablepress table with many columns. When the post is added to RSS, Mailchimp emails it out, but the table is jumbled due to the many columns squeezed together. I found the table ...
somuser's user avatar
0 votes
0 answers
25 views

Hiding posts from main page/archive but not RSS feed [duplicate]

I'm trying to hide certain posts (either by ID or category) from my site's main post list, archive post list, and the custom search feature, -but- I need those posts to still show up in RSS feed. I've ...
somuser's user avatar
0 votes
1 answer
31 views

PHP Deprecated function Optional parameter $function

I get messages in the debug.log for PHP Deprecated: Optional parameter $function declared before required parameter $page is implicitly treated as a required parameter code function add_meta_box($id, ...
Vincenzo Piromalli's user avatar
0 votes
1 answer
33 views

Cannot register a custom WP-CLI command

I am working on a custom plugin and one of it's functionailities is to scan all the posts/pages on daily basis and update a meta-data in the database. I also wanted to create a custom WP-CLI command ...
Farhan Ali's user avatar
0 votes
1 answer
23 views

Show numbers of related post based on sub category and HIDE parent category

I removed my prev question since I have found the solution and it works as expected. Here's the code to show numbers of related posts based on sub category (cat child): <?php $categories = ...
ArduJimmy's user avatar
0 votes
0 answers
21 views

WordPress Create New Role Just to Manage Users?

I'm trying to create a new role where the only thing this role can do is manage/add/edit/delete users in the admin. add_role('test_role', 'TEST Role', array( 'read' => true, '...
Jon's user avatar
  • 323
0 votes
1 answer
11 views

Add an attribute on WP images attachment link

I have to add an attribute on WP images to add description on Spotlight lightbox. I tried the wp_get_attachment_link filter but it doesn't work. function add_data_description_link($content, $post_id) ...
Stefano's user avatar
  • 33
0 votes
1 answer
36 views

how to escape alert/window.location.replace with variable

I'm trying to write my first WordPress plugin and despite reading the documentation about escaping and reviewing other people's questions and answers I'm still not clear on how to do it in 2 cases the ...
Eitan's user avatar
  • 3
1 vote
1 answer
38 views

How to send user password reset link to their phone number instead of email

I want to send user password reset link to their phone number instead of email. I can use Twillo to send sms process. I tried below code but there is an error. Any suggestions ? function ...
Buddika's user avatar
  • 11
0 votes
2 answers
66 views

fetch from an external api call and display results in page

I have placed my external api call inside the functions.php file in the server and I created a shortcode for the api call. I'm familiar with React and I was expecting Wordpress to be somewhat similar. ...
bart lu's user avatar
0 votes
1 answer
39 views

WordPress CPT & Custom Taxonomy with the SAME Permalink Structure

I have a CPT: 'Guide' and Custom Taxonomy 'Guide Category'. What I want to achieve is: The CPT permalink structure is: example.com/guides/custom-taxonomy/post-name/ So that the following should ...
Elgameel's user avatar
0 votes
1 answer
50 views

Is there a way to pull remotely generated XML, process it, and display it on a Managed WordPress page?

Note: This is cross-posted on stackoverflow. I need to get some XSQL generated XML data from a remote server, process it, and display it on a GoDaddy Managed WordPress page. (This is the website my ...
Giric Red Wolf's user avatar
0 votes
1 answer
62 views

How to automatically flush permalinks?

Is it possible to write function that will trigger flush_rewrite_rules() on a timer? I would like for it to run every hour
John Saputo's user avatar
0 votes
1 answer
39 views

Adding extra cost to woocommerce flat rate based on shipping zone

i found solution here to count flat rate based on specific quantity steps in woocommerce, what i need additionally to add an extra specific amount based on shipping zone. for example : i charged ...
Shehab Zahran's user avatar
0 votes
1 answer
45 views

cURL running slow in Wordpress

I have the following code in one of my Wordpress page templates: $url = "https://xxxxxxxxxxxxxxx/"; $headers = array( 'Accept: application/json', 'Content-Type: application/json', ); $...
user1448031's user avatar
0 votes
0 answers
25 views

I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)

//this is my functions.php // Enqueue Styles function meraboiler_enqueue_styles() { wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Patua+One&family=Open+Sans:wght@...
Kashkumar Singh's user avatar
0 votes
0 answers
20 views

Show post in elementor based on views and specific category with query id feature in elementor

I have two functions for query filter: function my_query_filter_most_views( $query ) { $query->set( 'orderby', 'meta_value_num' ); $query->set( 'meta_key', 'entry_views' ); $...
Danial Sohail's user avatar
0 votes
0 answers
22 views

I want to move the one click accesbility button on bottom of my website screen,

I want to move the one-click accessibility button on bottom of my website screen,Kindly give me a code for that
user243103's user avatar
0 votes
0 answers
35 views

How can I display a Divi content inside a modal based on an AJAX request

This is my first question, please bear with me if I have forgotten any information. I want to show Divi content (saved as a WordPress project if it's important) inside an overlayed modal. For this I ...
cho's user avatar
  • 1
0 votes
0 answers
23 views

Start a long running PHP process via JS/Ajax and monitor progress on admin page

I am developing a plugin, which can import layouts for a certain theme from a remote URL. Those layouts often contain a good amount of images and sometimes even videos. I have a admin page where the ...
xxtesaxx's user avatar
  • 101
0 votes
1 answer
19 views

If user is Admin or another role

I have this code, which works perfectly: if (in_array('administrator', $user->roles)) { I need it to also check for another role, so that it would be an, 'if this or that' scenario, such as, ...
BarkingBird's user avatar
0 votes
0 answers
16 views

Endpoint exists and shows up in My Account dashboard. Need to add endpoint to My Account DROPDOWN menu in Porto theme

NOTE: StackOverflow closed this question claiming it was a duplicate but there isn't any similar questions. I looked through the other "similar" questions but those were in regards to adding ...
Mr. Victor's user avatar
0 votes
0 answers
20 views

Adding features to Gutenberg without theme.json

I am using a non-block theme for my website and am using Gutenberg for writing posts. I want to extend Gutenberg's functionality by adding the image lightbox feature. So I added a theme.json file to ...
Ryan's user avatar
  • 1
0 votes
0 answers
15 views

Wordpress : how to create onglet and remove it when only one

I have two extensions : Core where there all the common files and Wooster extension in Wordpress. In Wooster extension I have WoosterPartnerSetup.php and in the Core WoosterSetup.php. I am trying to ...
OceaneEMILE's user avatar

1
2 3 4 5
212