Tag Info

Hot answers tagged

6

You are calling the function too early. The functions.php is included before current_user_can() is defined. Never do anything before the hook 'after_setup_theme': Example for the functions.php add_action( 'after_setup_theme', array( 'WPSE_14041_Base', 'setup' ) ); class WPSE_14041_Base { public static function setup() { ! isset ( ...


5

The only way that function returns an instance of WP_Error is if $cat (in your example) has an empty value. You need to check the return before doing anything with it. Replacing that line with this should fix the problem: echo is_wp_error( $cat_parents = get_category_parents($cat, TRUE, '' . $delimiter . '') ) ? '' : $cat_parents;


4

In almost all cases you can simply delete the plugin and it will be switched off automatically, and in fact that is advice I've given many times to help reel in broken sites. The same is true for themes. Some plugins are actually more complicated than that and require additional steps. Notably, the caching plugins tend to fall into that category as some add ...


3

"the errors (…) don't show a stack trace" - they would if you were using xdebug. It means $wpdb is not loaded yet, not loaded properly, or gone: If you added code that calls it to your wp-config file or something to that order, remove it. If you've a db.php file in wp-content, it's probably broken so rename it. If you're messing around with things on a ...


3

Why exactly are you trying to redeclare that function? You can either edit the original function, or, better yet, use remove_action to remove add_action( 'widgets_init', 'twentyeleven_widgets_init' ); and then reattach your own function add_action('widgets_init', 'your_widgets_init_function' );


3

Don't mess around with changing those files directly. It will break when that file gets changed in an update. Do this instead. add_filter( 'wp_mail_from', 'override_mail_from_address' ); add_filter( 'wp_mail_from_name', 'override_mail_from_name' ); function override_mail_from_address($email_address) { $from_array = explode('@', $email_address); ...


3

The Health Check plugin is triggering the first error. Is this when you're running 2.7? get_transient() was only introduced in 2.8, which would explain it's absence. The second failure is merely a failed HTTP request. This can happen every now and then (mainly due to timeouts). It shouldn't interrupt the normal functioning of WordPress (the HTTP request was ...


3

You're getting the error because the Facebook and All In One Event Calendar plugins are both declaring the fb_admin_dialog() function, but PHP only allows a function to be declared once. To fix the immediate problem, log in to your server with S/FTP and rename the wp-content/plugins/all-in-one-event-calendar directory to something like ...


2

This issue usually stems from PHP configuration issues, APC caching, and/or a call to an incompatible XML library. From what I've seen, it is usually a combination of php 5.2.X and caching. If you're using caching on your site, try switching from APC/memcached cache to disk caching and see if it clears up. 9/10 times, disabling APC at the server level ...


2

wp() is quite essential function. It resides in functions.php file (don't confuse with functions.php in theme, different thing) and I don't think you can load WP without passing require directive for that file at some point. So your install seems very broken - either functions.php file in core is damaged or something else is broken and makes it skip loading ...


2

Fatal errors point to bad syntax, or bad naming conventions. WordPress does a good job of not activating plugins that throw fatal errors. However, once a plugin is activated, all bets are off. If you've created a function or a class, it's best to follow good naming conventions and namespace properly. For example, a function called post_extras() would not be ...


2

wp_mail() is defined in wp-includes/pluggable.php. This file is loaded after the plugins are loaded, but before the hook plugins_loaded has been fired. So the answer is: wait. add_action( 'plugins_loaded', 'renderHTML' ); On a side note: prefix your function names and your global variables.


2

Ok, solved my own issue... This might be very specific, but in case anyone ever finds a similar issue: to catch unexpected output errors I had another function: add_action('activated_plugin','save_error'); function save_error(){ $file = "unexpected-output.txt"; $fh = fopen($file, 'w') or die("can't open file"); $error = ob_get_contents(); ...


2

You failed to update the files in the root of WordPress. I don't know why, but a lot of people make this simple mistake. It is not enough to upgrade only the wp-admin and wp-includes directories. The files in the root directory, such as wp-settings.php and all the other wp-* files there, also must be upgraded. WordPress 3.1 no longer contains a ...


1

The CSS for my parent theme (core) was incorrectly formatted. The code at the top read: Theme Name: Core Theme URI: http://www.domain.co.uk Description: The core theme. Author: Squideyes Author URI: http://www.domain.co.uk Template: Core Version: 1.0.0 Tags: clean, simple, easy The Template: tag should only appear in the child theme css. This is what ...


1

You can try to use functions.php to handle the form submission and send the data via AJAX. Add a hidden field in your form with the action to be taken (on functions.php): <input type="hidden" name="action" value="save_contact"/> In you footer.php add the jQuery code to handle the AJAX request: jQuery('#your-form').submit(ajaxSubmit); function ...


1

I had the same problem but it occured while importing the theme-unit-test-data.xml along with its attachments. I am using WP 3.8.1. It's a WordPress issue so editing the php.ini has no effect. WP uses a hardcoded value (60 secs) for http_request_timeout of WP_Http in class-http.php. To solve it, place this code in functions.php of your currently active ...


1

Unfortunately, it looks like the WordPress update failed. The good news is that it's an easy fix. Simply download the files and re-upload them. You can follow the instructions here: http://codex.wordpress.org/Updating_WordPress#Manual_Update


1

How to do remote requests in WordPress: Use the appropriate API First, there's the WP HTTP API, which should be used for such tasks. And second, one should never ever use the @ operator, as this one suppresses error messages or notices and will successfully lock you out from troubleshooting your bugs. Just because you can't see it, doesn't mean that it's ...


1

You have found a bug in Genesis. Your Xdebug stack trace fingers the culprit as the genesis_save_custom_fields() function which calls current_user_can() with a singular capability (edit_post and edit_page) which also requires an additional argument, in this case the post ID which is missing. current_user_can() calls has_cap() which calls map_meta_cap() ...


1

About the Error Exception thrown without a stack frame Means that someone's code threw and exception in a place where it wasn't allowed to throw an exception. For instance, one cannot throw an exception in an object's destructor. There's a fairly good example of how this might happen in the php docs. In short, if you have an exception handler ...


1

Your function must return the variable $errors – even when there is no new error in your logic. 'registration_errors' is a filter, and filters always expect a return value. Without that your function returns NULL, and that is what var_dump() found. So the basic function body should be: function add_user_to_SF($errors, $sanitized_user_login, $user_email ) ...


1

If there are hooks in place that will do the job, as in @XIROXAS answer, I think that using those is the best solution, but pluggable.php contains functions that are meant to be overwritten. If, for example, you want to alter get_user_by, which you mention in the question, just create your own function with that name in a plugin file and it will be used ...


1

Q1: [H]ow to fix the error? Stop calling the do_settings() function in this line. It is not a WordPress function and it is apparently not a function that you have defined. Perhaps you meant to use one of these functions. <?php do_settings( 'mhomepage_option_group' ); ?> Q2: [W]hat is the correct file name in <form method="post" ...


1

Well it looks like it's running ok from front end. I did get a notice saying that your Wordpress Database needed upgrading though. I'd suggest you visit: http://www.azraar.com/wp-admin and click that (after backing up your DB as previously suggested) as it might fix your problem. Good luck


1

Probably the update wasn't complete and some files are missing. If you have FTP access, follow these steps. Download you wp-config.php and save it somewhere. In the wp folder on server delete everything but the wp-content folder Have a DB backup, if you can Download from wordpress.org the zip of wordpress and extract it At this moment remove the ...


1

To diagnose a load-intensive (either CPU cycles or memory) Plugin, start by deactivating all Plugins. Ensure that, with no Plugins active, you do not observe the same issues. If you observe the same issues with all Plugins deactivated, then the problem is somewhere else, either with your Theme, your database, or your server configuration. If you don't ...


1

The error indicates that your file "floater.php" is being called outside of a WordPress generated page. Add this to the top of the file to be able to use WordPress functions. EDIT: See Brian Fegter response on using the server path for your include. if ( !function_exists( 'get_bloginfo' ) ) require( '../../../wp-blog-header.php' ); // check path leads ...


1

You should include using the server path rather than the URL. This will give you access to WordPress functionality. include('extras/floater.php'); Update: The following is to further explain why it's a bad practice to include the file via URL. Here's what's happening: There is an innate inheritance when you include a file via server path. It has access ...


1

There really is nothing anyone here can do for you with such limited information. It is obviously something within your recent changes. If you use a version control system (as everybody really should), I would roll back the changes and then from there slowly re-implement the changes that were causing this error to track it down and get rid of it.



Only top voted, non community-wiki answers of a minimum length are eligible