Support » Plugins » How to write a plugin that can override core files?

  • I have modified a few WordPress core files, and was wondering how to create a plugin, which contains these files, that will override the core files when activated?

Viewing 7 replies - 1 through 7 (of 7 total)
  • You will want to get acquainted with the Plugin_API.



    Forum Moderator

    Dup topic deleted 😉

    (yep, dupe. thanks, i switched categories)

    I’ve checked out the plugin API, but have never written a plugin and know limited php. Can anyone give me a hint in the right direction?

    You might want to consider what part of core you are ‘replacing’ and then ask here or join the wp-hackers email list and ask there. Also look at the WordPress plugin repository to see how plugins similar to what you want to accomplish do things.

    These are my core edits:

    Remove "Allow Trackbacks and Pingbacks" option on Edit Pages:
    File: /wp-admin/includes/meta-boxes.php
    Commented out/deleted Line 379
    Remove "Allow Pings" on admin Quick Edit menu:
    File: /wp-admin/includes/template.php
    Commented out/deleted lines 1193-1196
    Unregister widgets from the widget pool:
    File: /wp-includes/default-widgets.php
    Commented out various lines within 1015-1037
    and change some widget descriptions
    Only show "Upload" option for "Add New Themes":
    File: /wp-admin/theme-install.php
    Line 29: $tabs['upload'] = __('Upload');
    Commented out lines 30-36

    As far as CSS, I’ve come up with this so far:

    // Then the_function would be something like...
    function the_function() {
    <style type="text/css">
    // Hide "Allow Trackbacks and Pingbacks" & "Allow Pings" code,
    // and hide other code

    oh well, i’ll just overwrite core files.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to write a plugin that can override core files?’ is closed to new replies.