Overwrite extending class?
-
Hi,
Nice framework. It took me a while to found latest manual and combine sortable-checkbox fields, but I did it and it works sweety ??
I have option called
KuzniczyskosNetwork
where I store bar’s settings with sortable-checkbox sites from networks (plugin WP Multi Network). To be sure that my redactor didn’t broke the system when he will be “messing” there, I edited filefactory\network_admin_page\_model\AdminPageFramework_Property_NetworkAdmin.php
to save option globally.Code:
<?php /** Admin Page Framework v3.7.7 by Michael Uno Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> <https://en.michaeluno.jp/twentyfifteen> Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <https://opensource.org/licenses/MIT> */ class Kuzniczyskos_AdminPageFramework_Property_NetworkAdmin extends Kuzniczyskos_AdminPageFramework_Property_Page { public $_sPropertyType = 'network_admin_page'; public $sStructureType = 'network_admin_page'; protected function _getOptions() { $current_network = get_current_site()->id; $main_network = get_main_network_id(); if ( $current_network != $main_network ) switch_to_network( $main_network ); $options = $this->addAndApplyFilter($this->getElement($GLOBALS, array('aKuzniczyskos_AdminPageFramework', 'aPageClasses', $this->sClassName)), 'options_' . $this->sClassName, $this->sOptionKey ? get_site_option($this->sOptionKey, array()) : array()); if ( $current_network != $main_network ) switch_to_network( $current_network ); return $options; } public function updateOption($aOptions = null) { if ($this->_bDisableSavingOptions) { return; } $current_network = get_current_site()->id; $main_network = get_main_network_id(); if ( $current_network != $main_network ) switch_to_network( $main_network ); $update = update_site_option($this->sOptionKey, $aOptions !== null ? $aOptions : $this->aOptions); if ( $current_network != $main_network ) switch_to_network( $current_network ); return $update; } }
Problem is that when I would update or modify library (like yesterday I added MetaBox) then I will have to edit the file again.
I don’t know too much on OOP, but as I asked a friend, he doesn’t see any programming way to replace the code or he is wrong? Or maybe I can change file’s location somewhere, so it will be always valid?
Greetings
- The topic ‘Overwrite extending class?’ is closed to new replies.