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

Function for Post Creation plugin for Gravity Forms

add_action('gform_after_submission_33', 'customize_submission_values_for_custom_post_type', 10, 2); function customize_submission_values_for_custom_post_type($entry, $form) { if ($form['id'] != ...
JoaMika's user avatar
  • 668
0 votes
0 answers
21 views

Hot to show custom post type taxonomies on archive page

I have a custom port type 'apartments' and each apartment has several parametres which I made into custom taxonomies, like 'number of rooms', 'area', 'region', 'status', etc. The task is to show all ...
Ava Northon's user avatar
-1 votes
0 answers
9 views

How can I make a custom field in my Custom Post Type that will redirect the user to a different URL When clicking on post?

I'm looking to make a simple PHP scxript to help me redirect my "newsletter" custom post types to a URL without using a clunky redirect plugin. That way, I can easily display the articles ...
webdevbro's user avatar
0 votes
0 answers
8 views

Learndash - how do i force lessons and/or courses to complete via shortcode when all topics are done [closed]

Im having a bit of issue with learndash course autocomplete for some reason lessons are not being marked as completed anymore after all topics are finished. Im trying to achieve this function using ...
Steven Shrewsbury's user avatar
0 votes
0 answers
10 views

How to access admin menu labels and links on front-end?

I am trying to retrieve a list of all the admin menu labels and links on the front-end so I can add them to my admin bar menu. I don't need the submenus. I was hoping to access global $menu, but it ...
Aristocles's user avatar
0 votes
0 answers
11 views

success Message not Displaying

I have made one form on WP-admin side when i approved and reject the form working well but not sure why I'm not able to show my success Message on right place. if i echo it working well but not right ...
Atiq Rev's user avatar
1 vote
0 answers
14 views

wordpress-plugin (widget) that performs a Neaby-search on the openstreetmap-endpoint: around x find y

i am about to create a wordpress-plugin that offers the output of the following data ... the data of a a Neaby-search: can we create a quewry that shows up all the schools that are in the near - in ...
thannen's user avatar
  • 111
0 votes
0 answers
6 views

Integrate a Custom Post Type with Learndash Plugin

I've registered a custom post type already in wordpress. I am looking for a solution to display that custom post type in learndash course Hierarchy.
Shaharyar Ansari's user avatar
0 votes
0 answers
16 views

How to create advanced custom fields for backend content

Is there a straightforward way to create custom fields for module-based content on WordPress? Example: User Creates page Creates Page content sections through forms Row 1: Column 1 - Content A ...
Jeremy Thomas's user avatar
0 votes
0 answers
4 views

child category under correct parent

I have a side bar that is showing my custom post type categories and sub categories, its build to show categories and the child if not present in the current custom post type as categories is used ...
Beep's user avatar
  • 29
1 vote
0 answers
13 views

Updating a remote media library plugin, wich breaks on php 8.1 update [closed]

We use the (now abandonware) plugin Remote media libary, with the Flickr add-on. It allows the user to see the wordpress photos and albums in the media library. https://wordpress.org/plugins/remote-...
user3263070's user avatar
0 votes
0 answers
15 views

how to assign javascript variable value to php variable in wordpress

I use following way to fetch the value of gtag if it already exists in the code: <script> const regex = /googletagmanager\.com\/gtag\/js\?id=([^\s'"]+)/gi; const ...
ahmedwp's user avatar
0 votes
0 answers
14 views

WPCode - Modified date comparison with post date not working properly

I am working in WPCode to get the modified/updated timestamp of a post to show alongside the author of the article. So far the code will print "Last Updated On: <Month day, year> by X" ...
user3853980's user avatar
0 votes
0 answers
30 views

i am getting this error: Warning: Undefined variable $sql on line 257 [closed]

Warning: Undefined variable $sql on line 257 Fatal error: Uncaught ValueError: mysqli::query(): Argument #1 ($query) cannot be empty in C:\xampp\htdocs\volunteer.php:257 Stack trace: #0 C:\xampp\...
Ali's user avatar
  • 1
0 votes
0 answers
33 views

REST API Plugin Update call back not updating the plugin

I am working on a custom CRM which includes keeping an eye on my clients WordPress sites so I have created some custom REST API endpoints to collect different types of data like the installed plugins &...
Eoin H's user avatar
  • 131
0 votes
1 answer
16 views

adding firstname and lastname on registration

So i'm making a extension plugin FOR another plugin. What i want to achieve is that i upon registration they are required to add their Firstname and Lastname, so i added the fields for it, i did the ...
Pixelhouse's user avatar
0 votes
0 answers
26 views

Undefined constant ABSPATH

Only when I access the main url does this WordPress error appear and the content I edited does not appear I looked in the error.log file and the following error appears PHP Fatal error: Uncaught ...
Tauane Rodrigues's user avatar
0 votes
1 answer
24 views

How can I catch WordPress custom settings page slug has already changed?

I created a custom settings page like below. add_menu_page( __('Management', 'domain'), __('Management', 'domain'), 'activate_plugins', 'management', // <--- ...
G.D.i's user avatar
  • 23
0 votes
0 answers
24 views

Plugin question, How to insert a colon in a value box

I would like to be able to insert a colon into my number box. In this case, I would like to put a colon between 15 and 1 instead of the decimal, since it is describing a ratio, but when I do this it ...
zshutoski's user avatar
1 vote
1 answer
57 views

Trying to find where %3$s is defined [closed]

I have this bit of code that creates the menu items: $menu_classes = apply_filters( 'astra_' . $theme_location . '_menu_classes', array( 'main-header-menu', 'ast-menu-shadow', 'ast-nav-menu', 'ast-...
Mr_G's user avatar
  • 13
0 votes
0 answers
31 views

I'm getting this 'PHP Deprecated' issue

PHP Deprecated: Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead. in /container/application/...
Kleirk Acordon-Gacula's user avatar
0 votes
0 answers
17 views

Editing stylehseet url in head section of WordPress

In our website, in the <head> section there is a call to a stylesheet and the URL is unsecured (HTTP). I would like to edit this to be https, but I'm not sure what file to edit to achieve this. ...
Ecigs Can's user avatar
0 votes
0 answers
18 views

Help writing out comments and replies

I'm working on creating a comment system for an event plugin I am creating. I have the commenting and replies forms working correctly, I just need help with writing them out to the site. I am on MySql ...
Darth Mikey D's user avatar
1 vote
1 answer
30 views

External WP_Query call from PHP crashed after version update

I have an external script that does some DB maintenance through WP_Query and similar functions. It used to work great, but now after a PHP version update (from 7 to 8) it stopped working. The ...
Binyomin's user avatar
  • 113
0 votes
0 answers
42 views

PHP Warning: Undefined array key “HTTP_REFERER”

I tried to read similar questions, but not easy for me to understand. I have hundreds, maybe thousands, of those warnings my error_log, generated multiple times each day. That’s the error. [14-Jan-...
Ioria's user avatar
  • 29
0 votes
0 answers
19 views

how switching from italian to german from internal to internal URL

Now when I’m on an internal page of the italian version if I select “deutsch” I land to the home page in german. Is it possible landing to the same internal page in german? my website:test.sacconicase....
Andrea Sacconi's user avatar
0 votes
1 answer
24 views

Wordpress broken dashboard with ninja-shell text

I am facing some strange behavior on my bluehost hosted wordpress site. Here's what I am facing: I see blank white page when I browse my website in a browser I was unable to access to my site using ...
Adil's user avatar
  • 101
1 vote
0 answers
14 views

Modifying Slider Function for Decimal Precision

I'm working with the WordPress Traveler theme. In the Tour option, there is a slider used for Max People. Max People will be used for another purpose and should work with a precision of 0.1 instead of ...
tbo812's user avatar
  • 11
0 votes
0 answers
18 views

How can I change text on my SearchWP search results page, as this is not an editable page in Wordpress?

I just want to change the text "Search results for:" to something else e.g. "All results for:" The class is .page-title. I can't find this anywhere and I cant edit the page html as ...
Joseph Lewis's user avatar
0 votes
0 answers
33 views

JQuery UI Autocomplete showing as bullets

The JQuery UI Demo page for autocomplete has a nice looking search box and drop down. When I implement it in my plugin, I end up with a bulleted list. How do I get my drop down of suggestions to look ...
Tuba Saif's user avatar
1 vote
0 answers
19 views

Assign a value (got from an xml file) to an attribute of Woocommerce products

Good morning, I should need to assign a value (value) from an xml file (that I export from my Warehouse Management System to My wordpress site) to an attribute I have already created 'unita'. And each ...
Giak's user avatar
  • 11
0 votes
0 answers
26 views

make my custom theme support polylang plugin

I created my own custom theme with wordpress and now I want to add english language to my site (defualt is persian rtl). for this I installed polylang. I create menu in wordpress like this: functuions....
Alipvd's user avatar
  • 3
0 votes
1 answer
36 views

YouTube embeds Cross-Origin Request Blocked (CORB) error

I am new to the WordPress world, please bare with me. On my website have embedded some YouTube videos using the video block. I am seeing this error in the console: Cross-Origin Request Blocked: The ...
kocjs's user avatar
  • 23
1 vote
0 answers
31 views

Why jquery arrray return 0 value

The array in this function return 0. I am unable to figure out what the problem is. function custom_woocommerce_auto_suggest() { $search_query = sanitize_text_field($_POST['search_query']); $...
Tuba Saif's user avatar
1 vote
1 answer
34 views

Translating the "Everything" filter menu in Quicksand jquery file

I have been using QuickSand Jquery to display my WordPress portfolio. Everything is working well. I just added the polylang plugin and would like to be able to translate the first item of the filter ...
made leod's user avatar
1 vote
1 answer
18 views

On profile update check if user is Subscribed to emails?

I want to check if user is subscribed to email is checked. It uses "email_subscriber" meta key from a plugin. If subscribed then assign role Email-Subscriber otherwise remove from role list....
Ali's user avatar
  • 11
0 votes
1 answer
15 views

How to create a build for quickly deploying a server with WP?

I have been looking for automation of a routine task for a long time: deploying a customized WP server with a pre-installed theme and plugins. The server must be on Nginx (optional OpenLightSpeed) + ...
Astraport's user avatar
  • 121
0 votes
0 answers
25 views

Issue with modifying attributes on a Wordpress website (PHP)

I have a script responsible for the layout on a Wordpress page using the Traveler theme. I modified the order so that additional attributes appear below the description rather than at the bottom. The ...
tbone's user avatar
  • 101
0 votes
0 answers
13 views

Woocommerce product search result page layout

I am creating a custom search bar with a category dropdown in my woo-commerce site so how do I fetch the exact design(HTML, CSS) of products in my search result as I am getting through shortcodes like ...
Tuba Saif's user avatar
0 votes
1 answer
16 views

Help with commenting system

I am working on creating a commenting system for pages that are populated from a database. I have the main commenting portion working fine, what I need help with now is allowing replies. What I was ...
Darth Mikey D's user avatar
0 votes
1 answer
27 views

FATAL ERROR when I try to change the .php according to required and optional items rule

hope to find a solution here. After having updated out php to PHP 8.0, we are having DEPRECATED alert. Most of them regards a required parameter that follows an optional one (making the second as ...
Federica Cilli's user avatar
0 votes
1 answer
16 views

Nav Menu Short code Not working When non Login

I have made a toggle button with short-code for dark/light mode code below function dark_light_toggle_button_shortcode() { ob_start(); ?> <!-- new button --> <div id="...
Atiq Rev's user avatar
0 votes
1 answer
54 views

stop resize button for wordpress media

The images in my WooCommerce product gallery do not need to be resized I only need the original image to display. Is there a way to add a toggle button to wordpress media to tell it to generate other ...
VtrN's user avatar
  • 13
1 vote
0 answers
46 views

Responsive images, per image type?

I am new to understand responsive images. Unfortunately the resources out in the internet did not help me to fully understand the concept, so please bare with me. I would like to know hdavidow if it ...
kocjs's user avatar
  • 23
0 votes
0 answers
34 views

regsiter a new user through WordPress API with Google SSO doesn't work properly

I have a code that sends a Google's user data from NodeJS to WordPress and I can see the email registered but first of all it doesn't do auto-login and doesn't set a Name so I just see the email who ...
Mostafa Ezzat's user avatar
0 votes
1 answer
35 views

Send Webhook WordPress PHP

How do I send this line of code to the webhook? That is, when it gives the activate alarm, it should be sent to the webhook WordPress PHP: register_activation_hook( __FILE__, function(){ $...
RezaEllaros's user avatar
0 votes
0 answers
28 views

Single wordpress multi website down need help factoring what it is

A single website has gone down in our WordPress website multi-site. All the other sites work even using the same theme. Solutions attempted Plugins removed Theme changed and removed. https://www....
Jeremy Thomas's user avatar
0 votes
0 answers
12 views

Woocommerce attatch files and custom input meta to cart items and then to order

I have a product designer plugin to Print t-shirts and mugs. The plugin makes the Design in base64 but doesn't save the uploaded images to the media library. So I came up with a custom Ajax function ...
mysticalghoul's user avatar
0 votes
0 answers
23 views

Display endpoint's return into a file (file_put_contents())

I've created a form (using WS FORM RUN WORDPRESS HOOK) than when submitted triggers a php script that grabs all the submitted data written on the fields and save them into $variables and everything ...
WinterCold's user avatar
0 votes
0 answers
22 views

How to make this shortcode not refresh the whole page when i use it on frontend

everyone, I have this code that makes all the files in a folder visible and downloadable on the frontend through a shortcode. But I want to put it in Essential Addons' Advanced Tabs, and they don't ...
Maellion's user avatar

1
2 3 4 5
210