WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#28855 assigned defect (bug)

Commented add_actions and unused functions in wp-admin/includes/theme-install.php

Reported by: michalzuber Owned by: chriscct7
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.9
Component: Themes Keywords: needs-refresh has-patch
Focuses: administration Cc:

Description

Only install_themes_upload() is used inwp-admin/theme-install.php:134

mike@mike:~/Sites/wordpress-svn$ grep -r '// add_action' src/
src/wp-admin/includes/theme-install.php:135:// add_action('install_themes_dashboard', 'install_themes_dashboard');
src/wp-admin/includes/theme-install.php:147:// add_action('install_themes_upload', 'install_themes_upload', 10, 0);
src/wp-admin/includes/theme-install.php:179:// add_action('install_themes_search', 'display_themes');
src/wp-admin/includes/theme-install.php:180:// add_action('install_themes_featured', 'display_themes');
src/wp-admin/includes/theme-install.php:181:// add_action('install_themes_new', 'display_themes');
src/wp-admin/includes/theme-install.php:182:// add_action('install_themes_updated', 'display_themes');

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_dashboard src
src/wp-admin/includes/theme-install.php:96:function install_themes_dashboard() {
src/wp-admin/includes/theme-install.php:135:// add_action('install_themes_dashboard', 'install_themes_dashboard');

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_upload src
src/wp-admin/includes/theme-install.php:137:function install_themes_upload() {
src/wp-admin/includes/theme-install.php:147:// add_action('install_themes_upload', 'install_themes_upload', 10, 0);
src/wp-admin/theme-install.php:134:     <?php install_themes_upload(); ?>

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_search src
src/wp-admin/includes/theme-install.php:179:// add_action('install_themes_search', 'display_themes');

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_featured src
src/wp-admin/includes/theme-install.php:180:// add_action('install_themes_featured', 'display_themes');

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_new src
src/wp-admin/includes/theme-install.php:181:// add_action('install_themes_new', 'display_themes');

mike@mike:~/Sites/wordpress-svn$ grep -r install_themes_updated src
src/wp-admin/includes/theme-install.php:182:// add_action('install_themes_updated', 'display_themes');

display_themes is used only in the same file wp-admin/includes/theme-install.php, but in the commented add_actions. Should that function be deprecated?

mike@mike:~/Sites/wordpress-svn$ grep -r display_themes src
src/wp-admin/includes/theme-install.php:122:function display_themes() {
src/wp-admin/includes/theme-install.php:132:// add_action('install_themes_search', 'display_themes');
src/wp-admin/includes/theme-install.php:133:// add_action('install_themes_featured', 'display_themes');
src/wp-admin/includes/theme-install.php:134:// add_action('install_themes_new', 'display_themes');
src/wp-admin/includes/theme-install.php:135:// add_action('install_themes_updated', 'display_themes');

Attachments (1)

28855.patch (904 bytes) - added by michalzuber 3 years ago.
Removed commented add_action lines

Download all attachments as: .zip

Change History (4)

@michalzuber
3 years ago

Removed commented add_action lines

#1 @jdgrimes
3 years ago

  • Component changed from General to Themes
  • Focuses administration added
  • Version changed from trunk to 3.9

Looks like this comes from #27055 via [27499].

#3 @chriscct7
2 years ago

  • Keywords needs-refresh has-patch added
  • Owner set to chriscct7
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.