Tag Info

Hot answers tagged

3

prepare() takes at least 2 parameters. Most of your calls to prepare() are not needed. For example: $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")); In this code, if the call to $wpdb->prepare() were valid, it wouldn't do anything. The function doesn't do anything to the first parameter. It manipulates the values ...


3

You need to match the $priority you used to hook the action: remove_action( 'save_post', array( $this, 'save_box' ), 20 /* Same as add_action call */ ); http://codex.wordpress.org/Function_Reference/remove_action Make sure you take the $post_id argument in your save_box method too: function save_box( $post_id ) { ... }


3

This is a variable scope, an pure PHP, problem at heart. I didn't close it because I am assuming that mistake is in turn due to a misunderstanding of the init hook, or hooks in general perhaps, which is WordPress specific. In PHP, a global must be declared global before the first time it is used. The init hook fires very early in page load, long before ...


2

Disable all plugins and switch to the default theme. It should be gone now. Then enable each addon step by step, until the problem comes back. You know the source now, let’s say a plugin. The plugin calls probably wp_enqueue_script too early. Find all occurrences of that function, then make sure they are bound to specific actions: wp_register_script() ...


2

You can do this with the woocommerce_add_error filter. Add the following to your functions.php file. // alter the subscriptions error function my_woocommerce_add_error( $error ) { if( 'The generic error message' == $error ) { $error = 'The shiny brand new error message'; } return $error; } add_filter( 'woocommerce_add_error', ...


2

This is not a WordPress message, it is either from a plugin or from your web hosting. Disable all plugins (per file access, eg. FTP), try again. If it is gone, enable all plugins separately until it happens again. Then remove the last plugin.


2

To hide strict errors you could use the solution provided by RadGH here http://goo.gl/EaVkSr: just put the following code in a must use plugin (a single php file under /wp-content/mu-plugins/) if (WP_DEBUG && WP_DEBUG_DISPLAY) { ini_set('error_reporting', E_ALL & ~E_STRICT & ~E_DEPRECATED); }


2

The code you posted has a major flaw*: it mixes HTML and PHP without properly setting them apart. This code chunk has a PHP function call followed by an HTML string, but since there's nothing telling the file that it should be treated as HTML, the parser says "Hey, <form isn't anything I recognize. I'm outta here!" * That nearly everyone gets hit by at ...


2

Just don’t set WP_DEBUG to TRUE. The error level is set in wp_debug_mode(), which is called in wp-settings.php before any plugins are loaded. If you leave the default values WordPress will set it to: error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | ...


2

Deactivate flash album gallery plugin then try again may be this plugin version not match to wordpress latest version. This plugin may not be compatible with wordpress 3.8, you must wait for the new release. Nonetheless, they are just notices you can simply hide these notices by going wp-config.php and toggle WP_DEBUG to false.


2

What you need is pretty much straight out of the Codex: $terms = get_the_terms( $post->ID, 'on-draught' ); if ( $terms && ! is_wp_error( $terms ) ) : $draught_links = array(); foreach ( $terms as $term ) { $draught_links[] = $term->name; } get_the_terms() can return a term object, false, or a WP_Error object. You are ...


1

It is usually because there are spaces, new lines, or other stuff before an opening tag, typically in wp-config.php. This could be true about some other file too, so please check the error message, as it will list the specific file name where the error occurred. Other Resources: PHP: Headers Already Sent


1

Monster Widget is a bit of a trap like that. Despite how it looks it doesn't actually place "real" widgets into sidebar. It is a single widgets that creates output of other widgets inside of itself. If you are significantly interfering with its expectations then it won't pick up on changes, since it's not engineered to do it. You will likely need to use ...


1

get_term can return a WP_Error object in addition to a falsy value for term not found or an actual term row. You fix this, by adding an additional check: if (!$term) { continue; } Becomes: if (!$term || is_wp_error($term)) { continue; } You should also do this above the get_term_link call. $term = get_term($value, $fieldSettings['taxonomy']); ...


1

There is a section that should look like this: defined( 'ABSPATH' ) || define( 'ABSPATH', __DIR__ . '/' ); require_once( ABSPATH . 'wp-settings.php' ); add_filter() is available after that, you are probably using it too early.


1

I believe from your error that you are using this code inside the loop. You should be using the_post_thumbnail(). The code you are using is used outside the loop. EDIT It is always good practice to always first check if you have a thumbnail to display So you should use <?php if(has_post_thumbnail( 'thumbnail')): ?> <a href="<?php ...


1

A scalar value is something you can put on a scale: an integer or float value (4 or 5.5) or a string. That means WPBMap::getParam('vc_row', 'el_class'); doesn’t return an array, but a number or a string, so you cannot treat $param as an array with $param ['description']. Find out why you don’t get an array.


1

Since you've used the true argument for get_post_meta, $blogimages will be a single array, not a multidimensional one. So instead of $blogimages[0]['blog-image-inside'], just use $blogimages['blog-image-inside']. For absolute sanity, you might also want to check $blogimages before you use it: 'exclude' => [ $thumb_ID, isset( ...


1

Did you also add wp_enqueue_script('media-upload') in functions.php ? I tried this and it's working: function load_admin_things() { wp_enqueue_script('media-upload'); wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); } add_action( 'admin_enqueue_scripts', 'load_admin_things' );


1

You should contact the plugin author, because plugin support is generally off topic on this site. But ... I got curious, peeked into the plugin code and found this line: add_action( 'wp_head', array('dc_jqverticalmegamenu', 'header') ); where the header() method is assumed static, but it's not: function header(){ // ... } That's why this strict ...


1

You can disable a plugin from the database as a last resort, here is a link to an article that will help if your familiar with MySQL http://perishablepress.com/quickly-disable-or-enable-all-wordpress-plugins-via-the-database/ If you are not familiar with MySQL, then I suggest you use a tool such as Sequel Pro for OS X or PHPMyAdmin to look for the ...


1

That is a seriously wonky plugin, my friend. Prologue Before we actually start, trash this conditional - it does absolutely nothing: if($_REQUEST['s'] != '') { } But really, more than likely, the original plugin developer had intended this conditional to actually do something by bailing out of the function if $_REQUEST['s'] is not set (seeings as ...


1

The problem doesn't actually occur with IE only, it only breaks page in IE. Your pages have circular 301 redirect between shortlink and permalink URLs — http://kyl.fi/ajankohtaista/ sends browser to http://kyl.fi/?p=16, which sends browser to ttp://kyl.fi/ajankohtaista/ and the circle have closed. Other browsers just decide to ignore this, ditch stupid ...


1

Look towards the end of your wp-config.php file, you should have the definition for ABSPATH looking something like: /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); If it's a static path instead of the code above, then this might not correspond to your current path. Either change ...


1

It's probably due to an unclosed curly brace somewhere. Can include more code? The line numbers in the error message are not always where the actual issue is.


1

Your path have an extra _ in between widget-plugin.php and /js/upload.js. BTW, your path should just be plugins_url( '/js/upload.js' , __FILE__ ), Go and check the following wp_enqueu_scripts wp_enqueue_script wp_register_script admin_enqueue_scripts


1

First, you need to to find out what your current version of MYSQL... WordPress requires MySQL 5.0 or greater Since its a VPS, I'm assuming its a linux installation. Just type mysql -V on the command line and it will return your MYSQL version. If the version is compatible with wordpress, this message may be a "plugin/theme related" message. Look at your ...


1

wp-login is the file used to send user passwords e.g. new user registrations user lost passwords It might be you're getting a lot of registration spam? Is registration turned off on your install (settings > general)?


1

This is a lazy low quality list generate by your hosting. It is hard to understand it without more context but basically it is just lists the files in which there is a "mail" string and it has very little to do with the actual place which send mail. This kind of list are rarely useful in practice as they flood you with so much details it becomes hard to ...


1

For those who stumble upon this later, use either option 1 or 2 found here: https://core.trac.wordpress.org/ticket/19373. “For other developers who run into this and need to work around it, either of these 2 options work: call wp_set_post_terms() to add your taxonomies after calling wp_insert_post() set up a "current user" in your script before calling ...



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