WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#10287 closed enhancement (fixed)

split wp-includes/classes.php into single-class files

Reported by: dd32 Owned by: nacin
Milestone: 3.1 Priority: low
Severity: trivial Version:
Component: General Keywords:
Focuses: Cc:

Description

Right now, wp-includes/classes.php contains a selection of classes which WordPress uses internally. I'd like to see the file broken up into a few subclasses to ease integration with other software's which may use parts of the WordPress core.

Whilst i realise there are not too many there, the files 1600 lines long, It takes a bit to dig through it sometimes.. and like i said, it'd help integration with other software (Primarily thinking of the WP_Error stuff there)

Current classes:

    [138] => WP
    [139] => WP_Error
    [140] => Walker
    [141] => Walker_Page
    [142] => Walker_PageDropdown
    [143] => Walker_Category
    [144] => Walker_CategoryDropdown
    [145] => WP_Ajax_Response

The Walkers could all go in a single file.. the ajax response and WP could stay as one, and the error put into its own file too..

Just thoughts from me, seeking feedback from others.

(My whole reasoning for this ticket, is that i was hoping not to duplicate the code too much for just wanting to include WP_Error in a semi-standalone script which utilises a few of WordPress's helpful files)

Change History (12)

#1 @filosofo
12 years ago

+1

I've had the same thought many times.

#2 @ryan
12 years ago

I've always wanted to put the page and category walkers in the corresponding templates files alongside the functions that call them. That sound okay?

#3 @dd32
12 years ago

I've always wanted to put the page and category walkers in the corresponding templates files alongside the functions that call them. That sound okay?

Sounds good to me, I was going to do that for a future walker which i've got in a upcoming patch anyway :)

#4 @peaceablewhale
12 years ago

  • Milestone changed from Unassigned to Future Release

#5 @nacin
11 years ago

  • Milestone changed from Future Release to 3.1

#6 @nacin
10 years ago

  • Milestone changed from Awaiting Triage to Future Release
  • Owner set to nacin
  • Status changed from new to accepted

#7 @nacin
10 years ago

(In [16099]) Begin the dissolution of classes.php. see #10287.

#8 @nacin
10 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Future Release to 3.1

Need to write file-level phpdoc, move the walkers next to the callers, and svn rm classes.php.

#9 @nacin
10 years ago

(In [16100]) Move Walker_Page* to post-template, Walker_Category* to category-template, and rm classes.php. see #10287.

#10 @nacin
10 years ago

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

(In [16101]) File-level phpdoc for new class files. fixes #10287.

#11 @nacin
10 years ago

(In [16102]) Remove the classes.php include and delay the lesser important remnants of classes.php. fixes #10287.

#12 @hakre
10 years ago

Related: #15280

Note: See TracTickets for help on using tickets.