Tag Info

Hot answers tagged

6

It means that the declaration of the start_lvl method in wp_bootstrap_navwalker should match the declaration of the method in Walker_Nav_Menu. It doesn't. function start_lvl( &$output, $depth ) { VS. function start_lvl( &$output, $depth = 0, $args = array() ) { Make the arguments match exactly and you should be fine. And you should probably ...


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

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 ...


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 ) { ... }


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

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

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

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

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.


1

Replace that line with the following: if(!is_object($val) && !is_array($val)){ $this->p->$c = trim(stripslashes($val)); } else { $this->p->$c = $val; } This is just a temporary solution so the error will go away. All this does is check the variable to see if it's an object or an array. If it is the variable just gets saved to ...


1

Since you cannot access the WordPress Dashboard with your user account you will need to use FTP or SSH to access the wp-content/plugins directory for your site and rename the plugin folder for wp-customer-reviews. Example: wp-content/plugins/wp-customer-reviews becomes wp-content/plugins/wp-customer-reviews-broken This will disable the plugin and allow ...


1

File operations should use the WP_Filesystem methods instead of direct PHP filesystem calls. The WordPress coding styles require that you make use of the WP Filesystem instead of using direct PHP file functions. You can replace your file_get_contents call easily with: $response = wp_remote_get($feed_url); $file_content = $response['body']; For more ...


1

Sounds like a server configuration problem, not a WordPress thing. You said you were using Rackspace? I don't have personal experience with Rackspace but it appears that they have some known issues with the default PHP mail() function. See: http://feedback.rackspace.com/forums/71021-product-feedback/suggestions/1873281-fully-support-php-mail-function- ...


1

use single quotes outside of the following statement, why you are getting this error because you are using double quotes for class attribute "</span><span class="meta-sep">|</span>" and also wrapping it in double quotes. replace this "</span><span class="meta-sep">|</span>" with '</span><span ...


1

Check the docs. file_get_contents() and wp_remote_get() are not equivalent. file_get_contents() returns a string. wp_remote_get() returns either an array or a WP_Error object. You need to look at wp_remote_post() to see the format of that array: Array ( [headers] => Array ( [date] => Thu, 30 Sep 2010 15:16:36 GMT ...


1

One way to do this is to use the status_header filter. Adding the following to the functions.php file or your theme (or an appropriate plugin file) would do the trick: add_filter( 'status_header', 'your_status_header_function', 10, 2 ); /** * Substitutes a 202 Accepted header for 404s. * * @param string $status_header The complete status header string ...


1

so you need to correct your nonce field add a second pram nonce name, more information on WordPress codex here // wp nonce field wp_nonce_field( $action, $name, $referer, $echo ); // replace yours with below wp_nonce_field( 'ind_pricing_table_box_nonce', 'ind_pricing_nonce' ); now verify your nonce, more info here wp_verify_nonce( $nonce, $action ); // ...


1

There are multiple ways to fix this. You can either remove the if-condition containing SHOW TABLES LIKE (remove lines: 117, 135 and 137, 157). That should work as the dbDelta function checks itself if the tables are already presend. Or you could just add some single quotes to the table names in the lines 117 and 137: "SHOW TABLES LIKE '$jsrm_menu_table'"


1

Thanks to @Pat J i removed the syntax that was causing me problems. For those who are interested, inside the Search Everything plugin, on line 198 - 221 there is the following function: function se_search_default() { global $wpdb; $n = ( isset( $this->query_instance->query_vars['exact'] ) && ...


1

The approach in the answer by Scuba Kay is technically possible but easy to get wrong. Small mistakes will cause the data to fail to unserialize correctly. You are better off "editing" the serialized data with PHP: $str = 'a:4:{i:0;s:23:"bandpress/bootstrap.php";i:3;s:56:"posts-from-single-category-widget/post_from_category.php";i:4;s:15:"something else ...


1

This is an issue when installing mod_security2. The solution is as simple as disabling mod_security or allowing that page to POST that request. The issue is that mod_security thinks someone is trying to hack into your site.


1

It is hard to read but that error is a common one and it is also common to find no obvious cause. Try renaming the file, I see a special character in it. Double check the image is not actually uploaded because sometimes it will upload despite the error. Try uploading other images of different file-types to establish more information for troubleshooting. If ...


1

Themes are required to use add_theme_page() in the Wordpress Theme Directory. You need: add_theme_page( $this->strings['page_title'], // Page title $this->strings['menu_title'], // Menu title 'edit_theme_options', // Capability $this->menu, // Menu slug array( ...


1

isnt' it good practise to never be current with latest build, but rather one release behind, that way the plugins are more likely to be compatible (it takes time for developers to catch up with the latest WP builds)? This has been my practise, to minimize compatibility (with plugins) issues which is where 90% of your site issues will reside. If you just go ...


1

How often should Wordpress be updated? WP should always be kept up to date. You should update it as soon as possible after an update is released. What is the best way to do it? Always have a current backup - and know how to restore it if you have to (or have someone handy who can). Do you make an income from the site? If so, you can set up an exact ...


1

You set the cookie too late. You can use any action before template_include to set a cookie, after that there is already HTML output, and no further headers can be set. Example: add_action( 'template_redirect', function() { setcookie( 'test', 1 ); });


1

You have active a plugin or theme, that include scripts or styles via function wp_enqueue_style and wp_enqueue_script. Since version 3.3 is it not possible to enqueue script and styles without a hook. Find the source and fix this, is easy to do that. The codex have for this topic a fine documentation. /** * Proper way to enqueue scripts and styles */ ...


1

Your exception isn't caught by the try{} catch(){} block, because it isn't thrown inside the try catch block. This demonstrates a lack of understanding of asynchronous events and the WordPress hook/action/event system. The methods of your object are attached to the init action hook, and are thrown when the init hook is fired, not when the object is created, ...


1

I'm experiencing the same problem. It turns out that my IP address has been blocked by my web host. So each time this happens, I'll have to request them to whitelist my IP (as my ISP gives out dynamic IP addresses to broadband users in residential area, so it changes every now and then) Hope this helps.. Thanks.



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