Skip to main content

Questions tagged [wp-error]

`WP_Error` is a PHP class used by the WordPress core for error reporting.

Filter by
Sorted by
Tagged with
8 votes
1 answer
20k views

get_term_children for immediate children only (not grandchildren)

I want to display term children of a custom taxonomy. Currently, I am able to do this using get_term_children, but using this, it displays children and grandchildren, I want to avoid this and make ...
b0nd's user avatar
  • 147
6 votes
2 answers
18k views

Error timed out with succesfull wp_remote_post

What I'm trying to do: Passing POST data by using wp_remote_post. foreach ( $articles as $article_id ) { $postarray = array( 'method' => 'POST', 'timeout' => 5, '...
Nich's user avatar
  • 171
5 votes
1 answer
8k views

Issue with wp_insert_post and post_content field error Could not update post in the database

I'm having issues creating an import / caching script to be used within a WordPress site. This feed comes from a single text file that is then parsed and returned as an array. When running through ...
Jamie's user avatar
  • 96
3 votes
1 answer
28k views

How to display error messages using WP_Error class?

I have registration form code in my functions.php file like this if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['action'] == 'registration') { $...
PrivateUser's user avatar
  • 3,459
2 votes
1 answer
3k views

How to check if wp_update_post was successful

I want to update a post using wp_update_post( $my_post ); How can I check if it was successful? Should it return the post ID on successful update? I'm trying this: $post_id = wp_update_post( $...
jay's user avatar
  • 23
2 votes
2 answers
377 views

Core error when calling remove_menu_page

During developent, my error log keeps getting polluted by errors from core WP. Since they are coming from core WP, I cannot fix them(technically I can, but I don't think that's a good idea). I wanted ...
HiMyNameIs's user avatar
2 votes
1 answer
403 views

Why when I instantiate wp_error in a validation method my user registration method stops working?

I would really, really, appreciate any insight I can get here. I'm working on a WordPress plugin that registers users in WordPress and want to validate data submitted through the form. I have a class ...
ryanaindimer's user avatar
2 votes
1 answer
635 views

How to group multiple wp_errors together?

I have created a custom registration form on wordpress. There is validation errors for each field and wordpresss just dumps all errors above the form. I tried to separate these errors into multiple ...
alhoseany's user avatar
  • 1,201
2 votes
1 answer
11k views

Cannot use object of type WP_Error as array

Using a WordPress Plugin WPML I have been getting this error on saving a draft post: PHP Fatal error: Cannot use object of type WP_Error as array in /home/user/domain.com/wp-content/plugins/...
rhand's user avatar
  • 352
2 votes
1 answer
1k views

Cannot use object of type WP_Error

function im_add_new_term($name,$tax){ if($tax == "genre"){ return wp_insert_term($name,$tax,array("slug"=>array_search ($name, $genres)))["term_id"]; } else { ...
ali's user avatar
  • 45
2 votes
2 answers
2k views

Unable to show error message using wp_login action

My goal is to show an error message when i check if the user is locked or not, the problem is that when the function ends, it redirects to the page that must appear after succesfull login. Objectives:...
Jose Manuel Lascasas Jimenez's user avatar
2 votes
0 answers
147 views

How can I add hyperlink in WP_Error message?

I using below code for showing error message to users in my WordPress website if ( $wp_error ) { return new WP_Error( 'you_cannot_vote_on_restricted', __( 'Voting on restricted posts are not ...
mohammad's user avatar
  • 131
1 vote
1 answer
12k views

Why is_wp_error() is not returning false even there's no defined error

On the form submission I'm taking user comment for a custom purpose for my plugin. I'm checking whether the comment field is empty or not, and the comment field is filled with at least 30 characters. ...
Mayeenul Islam's user avatar
1 vote
1 answer
2k views

How to customize the critical error message?

How to customize the critical error message saying: There has been a critical error on your website. Learn more about debugging in WordPress. Instead of using CSS to hide the message it would be ...
RafaSashi's user avatar
  • 477
1 vote
1 answer
16k views

Object of class WP_Error could not be converted to string

After deleting some categories (shouldn't have done this), I get the following error Catchable fatal error: Object of class WP_Error could not be converted to string in [FILENAME] on line 45 ...
yumba's user avatar
  • 473
1 vote
1 answer
4k views

Handling nonce generation in AJAX registration process

I am currently working on a multi-steps registration system, based on the new Wordpress Rest API and I got an issue related to the nonce generation and verifying. My first step is to ask the user ...
Balessan's user avatar
  • 153
1 vote
2 answers
2k views

WP_Error not displaying errors

I am trying to utilize WP_Error for my plugin, but nothing happens. Is this too late for WP_Error? Too early? Or am I doing something else wrong? function cpt_pre_post_publish(){ return new ...
jasonaburton's user avatar
1 vote
1 answer
639 views

WP_Error Object in wp_remote_post & wp_remote_get

I am using localhost and working on a wordpress plugin, I try to get and post data with wp_remote_get and wp_remote_post,i installed lmfwc and i create a rest-api-key, as you can see i used consumer ...
pooyan golkar's user avatar
1 vote
1 answer
2k views

Return WP_Error as WP_REST_Response

I have a http request to WP REST API that can resolve in a success or a failure status The success gets handled by WP_REST_Response, and if any error occurs this is handled by WP_Error, both returned ...
GWorking's user avatar
  • 165
1 vote
1 answer
190 views

Is there an equivalent to WP_Error object I can return in the case of a successful REST request?

In the case of an error at a REST endpoint I've set up, I am accustomed to returning a WP_Error object, which is convenient because I can include a code, a message, and an HTTP status into a single ...
Isaac Lubow's user avatar
1 vote
1 answer
3k views

Checking return with WP Error

I've seen other people with similar problems, and I know that I need to check the return when calling for the child items in my custom taxonomy "hhie_artists". I'm not sure how to echo my output to ...
JMB's user avatar
  • 628
1 vote
0 answers
22 views

images not loading on wordpress website hosted on aws ec2

I have successfully deployed my wordpress website on AWS EC2 , directed to the custom domain, with SSL installed through load balancer and route 53 records but now the images are not being shown in ...
celina kapoor's user avatar
1 vote
0 answers
23 views

WordPress notification reports

I had to make a standalone dashboard for WordPress. I designed an interface to notify users of information messages (eg wrong user password) such as verification of forms and files or errors. But I ...
km onur's user avatar
  • 129
1 vote
1 answer
796 views

WordPress customizer Preview not loading

I'm creating a WordPress website, today I have tried to add some new features but I'm not able to add because customizer live preview is not loading I have done some steps Update all theme and plugin ...
shubham's user avatar
  • 11
1 vote
0 answers
22 views

error Trying to get property of non-object and Cannot use object of type WP_Error as array in

function im_check_term($name,$tax){ $term = get_term_by("\x6e\x61\x6d\x65", $name,$tax); return !is_wp_error($term) ? $term->term_id : false; } function im_add_new_term($name,$...
ali's user avatar
  • 45
1 vote
0 answers
54 views

Handle new created WP_Error

Is it possible to set up a global function for catching new created WP_Error instances? I would like to catch all of them and send error logs to Sentry
Michał Mazur's user avatar
1 vote
0 answers
760 views

How do iterate through all errors for a WP_Error object?

I have a block of code that I know contains multiple errors which come from the wpmu_validate_blog_signup function. The error object is part of the $result array. $result = wpmu_validate_blog_signup($...
user658182's user avatar
1 vote
1 answer
287 views

Template administration Error after WP 4.8 update

We are using UpStream template on our WP site. After the last WP 4.8 update, we are getting an error message on the administration panel, which does not allow us to use the slideshow. The error is the ...
auroryx's user avatar
  • 13
1 vote
1 answer
451 views

WP_Error with multiple form validation message

I'm working on a front-end form plug-in and having trouble getting validation error message work with WP_Error. I spent hours to find a problem but still have no idea. Below code is actually working ...
Ohsik's user avatar
  • 407
1 vote
1 answer
3k views

Get errors from WP_Error to different variables

I have added multiple errors in the WP_ERROR. I want to get those errors separately in different variables. With the following code I can get all errors with foreach loop, but how can I assign them to ...
jay's user avatar
  • 61
0 votes
2 answers
623 views

How do I turn off WordPress errors and just have regular old php errors?

If I use the constants, I still get the WP errors. I don’t want WP shadowed box and custom messages and all that. Just plain old PHP errors. In wp-config.php I have this: define('WP_DEBUG', false); ...
Doug Cassidy's user avatar
0 votes
2 answers
778 views

WP_Http response throws "Cannot use object of type WP_Error as array"

My plugin is throwing the error "Cannot use object of type WP_Error as array". The line in question is... $http = new WP_Http(); $response = $http->request( $url, array('timeout' => 20)); if( ...
Bryan's user avatar
  • 41
0 votes
1 answer
265 views

Catchable fatal error on 3.6 update

Trying to debug the situation. Getting close, but will need a little help!! Here is the error: Catchable fatal error: Object of class WP_Error could not be converted to string in /home/website/...
eberswine's user avatar
  • 145
0 votes
1 answer
3k views

How to generate "WP_Error" Object for user login?

I want to return the Login Error Message even user key-in their privileges correctly. In other words, to terminate the login and show the error message. When we key-in wrong passwords, wordpress ...
夏期劇場's user avatar
0 votes
1 answer
28 views

How to hook into debug.log?

I know that WordPress somehow with propers flags in wp-config.php direct errors to `error.log. I want to get notified when an error happens and logged in this file. I was going to monitor it, but if ...
DAMAR225's user avatar
  • 103
0 votes
1 answer
393 views

"CRITICAL Object of class WP_Error could not be converted to string" using templates with twig

I'm getting the fatal error "Critical Object of class WP_Error could not be converted to string". The theme is developed with twig and php files, to separate logic from visual. Somehow, in ...
Romeu Costa's user avatar
0 votes
1 answer
48 views

How to use filter in this situation, can not modify the structure using filter

plugins/idx-broker-platinum/idx/shortcodes/register-impress-shortcodes.php This is the plugin file where I need to use a filter to override the structure. Filter name: impress_showcase_property_html ...
Ravi's user avatar
  • 247
0 votes
1 answer
1k views

Please Help Me, How to Fix PHP Error Undefined Array Key "srcset"

please help me, my website notice error Message. On error.log notice Undefined Array Key "srcset" This is my code on WordPress, and i'am use PHP Version 8.0. function ...
Cilacap Info TV's user avatar
0 votes
1 answer
5k views

plugin generated unexpected output during activation, but it is empty

I am getting this error what is already answered in several threads here with same problem. Here the error message: The plugin generated 3 characters of unexpected output during activation. If you ...
Hermants's user avatar
  • 501
0 votes
2 answers
667 views

Email Exists ERROR into Ajax registration form

My problem is that I can't verify if some user insert an existing email into AJAX registration form. However my form is working fine, it's registering users and it's giving all other errors, like "...
middlelady's user avatar
0 votes
2 answers
1k views

Featured Image not shown and getting error "Object of class WP_Error could not be converted to int"

First of all I'm using twentyeleven theme, I created a custom template page to insert posts. It has 4 submit forms. it is working well, also setting feature image is ok for 3 forms except the first ...
usama sulaiman's user avatar
0 votes
1 answer
2k views

How To Pass Array To get_the_category_by_ID() and Get An Array Back?

I am trying to pass an array of category IDs to get_category_by_ID() in order to get an array of category names back. Since I'm still trying to get this to work I'm just using var_dump() on the output....
JPollock's user avatar
  • 1,248
0 votes
1 answer
232 views

Wordpress video js error this.mediaElement.play is not a function

I am using the video.js library in WordPress it causes an error (ERROR: TypeError: this.mediaElement.play is not a function) since I have installed themify builder plugin. Error picture attached. Can ...
ubaid ismail's user avatar
0 votes
1 answer
86 views

"Welcome to WordPress" Plugin Required Error

I'm getting this error every time I install or update a plugin on WordPress. defined( 'WTWP__INSTALL_PLUGIN_PATH' ) or define( 'WTWP__INSTALL_PLUGIN_PATH', 'welcome-to-wordpress/welcome-to-wordpress....
omarthegeek's user avatar
0 votes
0 answers
1k views

Fatal error in wordpress htdocs

I need help with this Fatal error: Array and string offset access syntax with curly braces is no longer supported in /homepages/25/d502821911/htdocs/...../wp-includes/script-loader.php on line 757
Vane's user avatar
  • 1
0 votes
0 answers
167 views

How to ignore WP_ERROR caused by "get_the_excerpt" method in an AJAX call?

function get_post_data(){ $post_id = $_POST['post_id']; ... $data['title'] = get_the_title( $post_id ); ... $data['excerpt'] = get_the_excerpt( $post_id ); ... ...
Tom's user avatar
  • 13
0 votes
1 answer
129 views

WordPress admin panel not working

Today I added all the codes to the new server and I am getting the issue like the below image. WordPress admin panel not working. I tried below code define('CONCATENATE_SCRIPTS', false); then I am ...
Naren Verma's user avatar
0 votes
0 answers
1k views

WP_Fatal_Error_Handler OR WP_Error OR try/catch

A process into my plugin provoke a fatal error in Linux Server which I have not access, for example to define a WP_DEBUG_LOG. I could identified the conflict in the event related to generate an jpeg ...
Zyncho's user avatar
  • 111
0 votes
1 answer
32 views

To stylize WP_Error messages or not?

I hate, despise forcing markup/stylization on anyone that extends my system because I'm making assumptions about how my code is going to be used and force people to play around my decision-making. ...
Daniel M's user avatar
0 votes
0 answers
34 views

I can't view the orders on the woocomerce dashboard with the brainblocks plugin

I'm trying to make a website that accepts the nano cryptocurrency and I've encountered an error. I'm using woocomerce+brainblocks plugin and whenever I tested paying with nano it did not show up in ...
pete's user avatar
  • 1