Make WordPress Core

Opened 16 years ago

Closed 15 years ago

#9815 closed defect (bug) (fixed)

Remove vestige what_to_show

Reported by: filosofo's profile filosofo Owned by:
Milestone: 2.8 Priority: normal
Severity: minor Version: 3.0.1
Component: Database Keywords: has-patch tested commit
Focuses: Cc:

Description

Apparently, the "what_to_show" query variable hasn't done anything since 2.0, but it's been lurking around.

Unless I'm missing something.

Attachments (1)

remove_vestige_what_to_show.9815.diff (5.6 KB) - added by filosofo 16 years ago.

Download all attachments as: .zip

Change History (9)

#1 @Denis-de-Bernardy
16 years ago

I see it in 9 files:

DB:~/Sites/wp $ grep -R what_to_show *
wp-admin/.svn/text-base/admin.php.svn-base:$what_to_show = get_option('what_to_show');
wp-admin/.svn/text-base/edit-pages.php.svn-base:$query = array('post_type' => 'page', 'orderby' => 'menu_order title', 'what_to_show' => 'posts',
wp-admin/admin.php:$what_to_show = get_option('what_to_show');
wp-admin/edit-pages.php:$query = array('post_type' => 'page', 'orderby' => 'menu_order title', 'what_to_show' => 'posts',
wp-admin/includes/.svn/text-base/dashboard.php.svn-base:			'what_to_show' => 'posts',
wp-admin/includes/.svn/text-base/dashboard.php.svn-base:			'what_to_show' => 'posts',
wp-admin/includes/.svn/text-base/post.php.svn-base:	wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");
wp-admin/includes/.svn/text-base/schema.php.svn-base:	'what_to_show' => 'posts',
wp-admin/includes/.svn/text-base/upgrade.php.svn-base:	// The "paged" option for what_to_show is no more.
wp-admin/includes/.svn/text-base/upgrade.php.svn-base:	if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged')
wp-admin/includes/.svn/text-base/upgrade.php.svn-base:		$wpdb->update( $wpdb->options, array('option_value' => 'posts'), array('option_name' => 'what_to_show') );
wp-admin/includes/dashboard.php:				'what_to_show' => 'posts',
wp-admin/includes/dashboard.php:			'what_to_show' => 'posts',
wp-admin/includes/post.php:	wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");
wp-admin/includes/schema.php:	'what_to_show' => 'posts',
wp-admin/includes/upgrade.php:	// The "paged" option for what_to_show is no more.
wp-admin/includes/upgrade.php:	if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged')
wp-admin/includes/upgrade.php:		$wpdb->update( $wpdb->options, array('option_value' => 'posts'), array('option_name' => 'what_to_show') );
wp-app.php:		wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) . '&orderby=modified'));
wp-includes/.svn/text-base/classes.php.svn-base:	var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page');
wp-includes/.svn/text-base/default-widgets.php.svn-base:		$r = new WP_Query(array('showposts' => $number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));
wp-includes/classes.php:	var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'what_to_show', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page');
wp-includes/default-widgets.php:		$r = new WP_Query(array('showposts' => $number, 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));

#2 @filosofo
16 years ago

I mentioned this in IRC, but some of the lines above show old subversion files.

My patch does leave intact its appearance in wp-admin/includes/schema.php and wp-admin/includes/upgrade.php

#3 @filosofo
16 years ago

At Denis's suggestion, I refreshed the patch to remove the schema and upgrade stuff.

#4 @Denis-de-Bernardy
16 years ago

  • Keywords tested commit added; what_to_show removed

Haven't tested at all beyond making sure the site worked upon getting rid of the option, but since grep reveals no usage of this option whatsoever, it can only be clutter and can be safely removed.

#5 @ryan
16 years ago

It's left over from when we had an option to show x number of posts per page or x number of days. We dropped the days.

#6 @ryan
16 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11318]) Remove vestiges of what_to_show. Props filosofo. fixes #9815

#7 @gazouteast
15 years ago

  • Cc gazouteast added
  • Component changed from Query to Database
  • Resolution fixed deleted
  • Severity changed from normal to minor
  • Status changed from closed to reopened
  • Version changed from 2.8 to 3.0.1

Nice work guys but only 98% complete

It's still lurking in wp_options table as of v3.0.1 (I'm on a de-bloating crusade).

Could probably do with having a "check for and remove" in the database modifications of v3.1.x (all of them - to be sure as many as possible get caught and killed) but might need a recursive hunt through the code as per plugin Clean Options to be sure a plugin hasn't added back the support code for what_to_show after deprecation.

#8 @automattor
15 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [16092]) Kill what_to_show on upgrade. fixes #9815.

Note: See TracTickets for help on using tickets.