WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#3616 closed enhancement (wontfix)

source code style: url handlers

Reported by: Xmion Owned by: Ryan
Milestone: Priority: normal
Severity: normal Version:
Component: Optimization Keywords: URL Sourcecode reporter-feedback
Focuses: Cc:

Description

Why not make all this url handlers in one file instead of having double things that means same things.
I don’t really get it but it’s in a lot of files mostly every admin php file and take a look in the root and in wp-includes it’s everywhere.

It will make some ease of easyness for everything in the future. should be a nice cleanup anyway. And have a urlhandler.php or url.php in wp-includes/ that have all this so it’s more simple for every developer to make nice changes and updates for wp core and future i think this is a good priority for 2.1 of wp.

And this is just for an examples:

Exempel 01

Should be more simple just to have this

<?php echo $admin_dir; ?>header
<?php echo $admin_dir; ?>css/
<?php echo $admin_dir; ?>js/

And there is this two that i found around in all files for same thing

<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css
<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css

Exempel 02

Should be more simple just to have this

<?php echo $admin_dir; ?>admin-ajax.php

And there is this two that i found around in all files for same thing

<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php';
<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php";

There should be a better solution for this to

$admin_dir = 'wp-admin/';
$adminurl = get_option('siteurl') . '/wp-admin';
$redirect_to = 'wp-admin/'
$link = 'wp-admin/install.php';
// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
$import_root = ABSPATH.$import_loc;
$imports_dir = @ dir($import_root);

This is of course is correct but i think the admin files can be fixed with more ease.

include_once(ABSPATH . 'wp-admin/?????.php');
include_once(ABSPATH . WPINC . '?????.php');

Change History (5)

comment:1 @foolswisdom8 years ago

  • Keywords reporter-feedback added
  • Milestone changed from 2.1 to 2.2
  • Priority changed from high to normal
  • Type changed from defect to enhancement

Hi Xmion, if you could attach a patch for one of the scenarios that would be great!

comment:2 @foolswisdom8 years ago

  • Summary changed from Double things that means same things to source code style: url handlers

comment:3 @foolswisdom8 years ago

  • Milestone changed from 2.2 to 2.3

comment:4 @Nazgul8 years ago

  • Milestone changed from 2.3 (trunk) to 2.4 (future)

comment:5 @Nazgul7 years ago

  • Milestone 2.4 (next) deleted
  • Resolution set to wontfix
  • Status changed from new to closed

No response, so closing as wontfix.

Note: See TracTickets for help on using tickets.