Not working on WordPress 6.0: https://thealliance.health/for-providers/resources/provider-news-archives/ Working dev site on WordPress 5.9.3: https://ccahdev.wpengine.com/for-providers/resources/provider-news-archives/ Here is the function if somebody can spot what may have been deprecated: function wpb_postsbycategory2022() { $posts = get_posts( array( 'category_name' => 'Provider News', 'nopaging' => true, 'orderby' => 'date', 'order' => 'DESC', // it's DESC; not DSC // There's no use setting posts_per_page when nopaging is enabled. // Because posts_per_page will be ignored when nopaging is enabled. ) ); $_year_year = ''; // previous years value …
I'm having an issue where debug messages refer to lines of code in /wp-includes/functions.php instead of the lines in the child-theme or plugin actually causing the issue. The lines referred to (most often) appear to simply be the logic that generates the error messages for deprecated code: /wp-includes/functions.php on line 5316 Is this just the way that deprecated code errors work or have I stepped on my own foot with a setting somewhere non-obvious? I triggered an undefined function error …
Background: Creating Custom Gutenberg Blocks and the Challenges with Breaking Changes I am new to creating custom Gutenberg blocks (each block is a separate plugin) and have recently ran into the issue of breaking changes when I update the blocks' code. I learned how block depreciation can help solve the issue of breaking code changes, but I still have the challenge of finding the specific pages and posts where these blocks are used. Reason for the Question: To Find All …
I downloaded a quantity increment plugin (themeszone Woocommerce ajax quantity) for my Wordpress site. Some of the Jquery was outdated this line specifically; $('.tz-qty-cont').live('click', function(){ I found out .live was deprecated and needed to be changed to .on so i changed the line to $(document.body).on('click', '.tz-qty-cont', function(){ However, I pushed the change to the server and inspected it with google console, I noticed my Wordpress site is not detecting the change? I'm on WP 5.7 and I'm pretty sure Jquery …
Was just checking the error logs on a new install of 5.4.1 and see a lot: Got error 'PHP message: PHP Deprecated: media_buttons_context is <strong>deprecated</strong> since version 3.5.0! Use media_buttons instead. in /var/www/susites/evozyne/htdocs/wp-includes/functions.php on line 5088', referer: https://evozyne.highgatewebworks.com/wp-admin/post.php?post=8&action=edit I can't find any mention of this anywhere except in an old WordPress Core discussion. Can anyone shed some light on this? Brad
I've been using this piece of code for years on one of my websites: <?php if (is_category()) { $this_category = get_category($cat); if (get_category_children($this_category->cat_ID) != "") { echo "<ul class='subsubcats'>"; wp_list_categories('orderby=title&show_count=0&title_li= &use_desc_for_title=1&child_of='.$this_category->cat_ID); echo "</ul>"; } else { get_template_part('loop'); // if no sub categories exist, show the posts } } ?> This shows all sub categories in a category overview page. And if there are no sub categories, it will show the containing posts. I noticed with WP Debug that this code …
I have an older plugin installed that is firing all these PHP Deprecated and PHP Notices in my debug.log every time a page loads. Is it possible to mute PHP Deprecated and PHP Notices but ONLY for files in my plugins directory? I value a clean debug.log as it helps with making sure my code is error-free during development, but this kind of stuff makes it all messy. More Details: I don't want to turn off all PHP notices because …
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/gorilla911/public_html/wp-includes/wp-db.php on line 1520 Notice: Undefined index: acb5ec in /home/gorilla911/public_html/wp-content/plugins/user-role-editor/includes/class-ure-screen-help.php on line 1 I checked my PHP version and it's 5.6.31. Also, I can not access wp-admin.
I would like to display only authors own posts in dashboard all posts section. As of now it displays everything. I found some code here which is written by @t31os Its working correctly. function posts_for_current_author($query) { global $user_level; if($query->is_admin && $user_level < 5) { global $user_ID; $query->set('author', $user_ID); unset($user_ID); } unset($user_level); return $query; } add_filter('pre_get_posts', 'posts_for_current_author'); But user_level is deprecated. So can anyone modify the code for new version? Thanks
The following function that we have in a plugin a developer helped us create (he is no longer available) is giving errors when debugging is on once we updated the site from WP 4.9 to WP 5.3. Wondering if anything obvious is incorrect or deprecated now? add_action( 'wp_login_failed', array( $this, 'handle_failed_login' ) ); function handle_failed_login() { $referrer = $_SERVER['HTTP_REFERER']; if ( ! empty( $referrer ) && ! strstr( $referrer,'wp-login' ) && !strstr( $referrer,'wp-admin' ) ) { $url = $this->parse_build_failed_login_url( $referrer …
I overwrote the index.php file in the main directory of wordpress. I was working on something else and uploaded an index.php file from a different project. I didn't realize and no-one pointed it out to me for about a week. I replaced it with the one on my hard drive and got lots of Notice and Deprecated errors. I thought maybe my version was too old, so I checked wp-includes/versions.php and found the site was reporting $wp_version = '5.2.3'; I …
I have some problems matching this message in my WordPress network update page: You have the latest version of WordPress. Future security updates will be applied automatically. If you need to re-install version 4.9.4, you can do so here: With the one I just noticed after temporarily enabling debug mode: Notice: wpdb::escape is deprecated since version 3.6.0! Use wpdb::prepare() or esc_sql() instead. in /home/user/public_html/blog.network/wp-includes/functions.php on line 3846 Notice: get_current_site_name is deprecated since version 3.9.0! Use get_current_site() instead. in /home/user/public_html/blog.network/wp-includes/functions.php on …
I recently updated WooCommerce on a site that I didn't make myself. After doing this, then I saw the following line in the error-log: woocommerce_get_price is deprecated since version 3.0.0! Use woocommerce_product_get_price instead. But when I google woocommerce_get_price, then I can find no documentation on it, besides for this hookr-page and this page, where it just says that it's deprecated. But I can find no information about input and output for woocommerce_get_price and woocommerce_product_get_price. It feels like that it's simply …
I deleted everything in my directory to "start over" When I install wordpress it says : Your PHP installation appears to be missing the MySQL extension which is required by WordPress. I tried changing the php version but it makes no difference. here is a scrnsht of my home dir : is there somthing I'm missing. Also I had downloaded a full site backup b4 I deleted here's a scrsht of what the folders are : what backup files should …
One of the functions I'm using in my plugin is polluting the global scope with a name that could collide with another function (used in another plugin). So, I guess I should deprecate it. But how should I go about that? function foo() { echo 'bar'; } I'm aware of _deprecate_function() but would be grateful for an example showing all the steps I should take in order to remove the function from my plugin's core. Ref: https://developer.wordpress.org/reference/functions/_deprecated_function/
I am new in WordPress Development. I updated version of my WordPress site to 4.6.1. Then I found this error in debug.log Notice: The called constructor method for WP_Widget in C_Widget_Gallery is deprecated since version 4.3.0! Use __construct() instead. in /home/spslive/public_html/wp-includes/functions.php on line 3767 I tried to find out C_Widget_Gallery in functions.php. But could not find it out. What is the remedy of this Notice ??
I use a premium plugin (for theme dev.) that has included the WordPress Importer plugin and I get a deprecated notice: "wp_get_http has been deprecated. Use WP_Http instead" But the WP_Http send me to this function. The question is how to use wp_http_supports in the following code instead of wp_get_http: function fetch_remote_file( $url, $post ) { // extract the file name and extension from the url $file_name = basename( $url ); // get placeholder file in the upload dir with …
Based upon this I have tried to write the following code as: Custom Page template: /* Template Name: product_filter */ get_header(); do_action( 'pre_get_posts', 'COOLING'); Functions.php add_action('pre_get_posts','shop_filter_cat',10,1); function shop_filter_cat($query, $arg) { if (!is_admin() && is_post_type_archive( 'product' ) && $query->is_main_query()) { $query->set('tax_query', array( array ('taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $arg ) ) ); } } But I have got following warning: Warning: Missing argument 2 for shop_filter_cat(), called in E:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 600 and defined in E:\xampp\htdocs\wordpress\wp-content\themes\storefront\functions.php on line …
My server is updating to PHP 5.6 next week. I manage about 30 WordPress websites. I looked for a plugin that would check if any of the code throughout the other plugins and theme would break with the update. I tried using the log deprecated notices plugin but it didn't seem very conclusive as to whether one of the deprecated calls would actually break the site or not ( or maybe it's impossible to know which things would actually break …
Was trying to use this today: WP Create Category https://codex.wordpress.org/Function_Reference/wp_create_category Trying that (which I also assume it's only going to add terms to the built in "Categories" taxonomy) throws this error: Fatal error: Call to undefined function wp_create_category() in /yourwebsite/wp-content/themes/fitt/functions.php on line 123 Though I do see it in /wp-admin/includes/taxonomy.php on line 45: /** * Add a new category to the database if it does not already exist. * * @since 2.0.0 * * @param int|string $cat_name * @param int …