A cosa serve la cartella wp-includes di wordpress?
4 risposta
- voti
-
- 2012-12-04
wp-includes
contienetuttoilnecessariopereseguire WordPresstramiteilfrontend (epoi alcuni). Èilterritorio di WordPress Coree,come dice l'adagio,nonmodificaremaiil corein nessuna circostanza.Sebbene
wp-content
possa definireplugine temi,l'API stessae la stragrandemaggioranza del core di WordPress sitrovanoin quella cartella. Questi dipendono dalla quasitotalità di WordPress. Tutte letuefunzioni standarde le loro dipendenze sitroverannoin questa cartella.Questo lo rende una risorsapreziosaper la ricercae la ricerca di cose.
wp-admin
può definireelementi aggiuntivimanon è così vitaleperilfunzionamento delfrontend./wp-admin - Admin code ./wp-content - User-defined code and content ./wp-includes - Common files
Per quanto riguarda l'affidabilità deifilein quella cartella,non dovrestifare affidamento suifilein quella cartella. Non dovrestimai averbisogno diincludere unfile o unpercorso da wp-includese se ciprovi one haibisogno,allora haifatto qualcosa diterribilmente sbagliatoe devifermartie tornareindietro.
Sebbenei filein quella cartellapossano cambiare senzapreavviso,ciònon dovrebbe avere conseguenze,poiché l'API contenuta vienemantenuta compatibile con le versioniprecedentiper unperiodo ditempo significativo.
Al difuori degli aggiornamenti a WordPress,
wp-includes
non dovrebbemaiesseremodificatoe idealmente dovrebbeessere di sola lettura.Se ènecessario aggiungere una dipendenza al codice,fare affidamento sulle versioniin wp-includeinvece di aggiungere lapropria.peresempio.nonincludere unajQuerypersonalizzata,usa quellain bundle con WordPress (non cancellarlae registrarla dinuovo).
Lemodifiche a wp-includespossono causare rischiper la sicurezza,degrado delleprestazioni,plugin/temi nonfunzionanti,ecc.
Lemodifiche aipacchettie alle librerieincluse sono annunciateprima del rilascio. Le vecchie dipendenzenonpiùnecessarie (comeil vecchio selettore di colori) vengonomantenute,ma contrassegnate come deprecateperevitare la rottura del codice
wp-includes
contains everything needed to run WordPress via the frontend ( and then some ). It is the territory of WordPress Core, and as the adage goes, never modify core under any circumstances.While
wp-content
may define plugins and themes, the API itself and the vast majority of the WordPress core sits in that folder. These are depended on by almost the entirety of WordPress. All your standard functions and their dependencies will be found in this folder.This makes it a valuable resource for research and looking up things.
wp-admin
may define additional items but it is not as vital to the running of the frontend./wp-admin - Admin code ./wp-content - User-defined code and content ./wp-includes - Common files
As for how reliable the files are in that folder, you shouldn't rely on the files in that folder. You should never need to include a file or path from wp-includes and if you attempt to or need to, then you have done something horribly wrong and need to stop and go back.
While the files in that folder may change without warning, this should be of no consequence, as the API contained is kept backwards compatible for a significant amount of time.
Outside of updates to WordPress,
wp-includes
should never be modified and should ideally be read only.Should you need to add a dependency to your code, rely on the versions in wp-includes rather than adding your own. e.g. don't include a custom jQuery, use the one bundled with WordPress ( don't de-register it and re-register it either ).
Modifications to wp-includes can cause security risks, performance degradation, broken plugins/themes, etc
Changes to the packages and libraries included are announced ahead of releases. Old dependencies no longer required (such as the old colour picker) are kept, but marked deprecated to prevent code breakage
-
- 2012-12-04
La directory
wp-includes
includei pacchettiinclusi da core .Ilteam core mantienei pacchettiinclusiinwp-includes
.Temie pluginpossonofare affidamento sulfatto che queipacchetti siano disponibiliper una data versione di WordPress.Questo è unmotivoimportanteper cui èestremamenteimportante accodare solo le versioni in bundle di core degli script,utilizzando la registrazione dello script definita dal core ,come:
wp_enqueue_script( 'jquery' )
,in modo cheiltuotema/plug-in utilizzerà sempre la versionein bundle con core,indipendentemente dalla versione di WordPressin esecuzione.The
wp-includes
directory includes the packages that are included by core. The core team maintains the packages included inwp-includes
. Themes and Plugins can rely on those packages being available for any given version of WordPress.That's a huge reason why it is extremely important to enqueue only core-bundled versions of scripts, using the core-defined script registration, such as:
wp_enqueue_script( 'jquery' )
, so that your Theme/Plugin will always be using the version bundled with core, no matter what version of WordPress is running. -
- 2012-12-04
WordPress,come applicazione,è costituito da diversepartimobili. La cartella
/wp-includes
contienefunzionalità comuniper l'API di WordPress (che utilizziin temi/plug-in)e l'amministratore di WordPress.Quindi,in pratica:
./wp-admin - Admin code ./wp-content - User-defined code and content ./wp-includes - Common files
La directory
/wp-includes
è dove sono archiviate utili librerie diterzeparti (adesempio SimplePieper RSSe IncutioRPCper XML-RPC). È ancheil luogoin cui viene definitagranparte dell'API di WordPress (ovvero WP_Http,WP_Filesystem).Uno sviluppatore dipluginpuòfare affidamento sui suoi contenuti?e per quantotempo?
Sì. Questifile sono ciò che definisce l'API di WordPressin primo luogo. Ilteamprincipalefa dituttopermantenere la compatibilità con le versioniprecedenti,quindi sein WordPress vengonointrodottemodifiche cheinterrompono ciò che stai utilizzando,lo sapraibene in anticipo.
Vorrei anche sapere,chi decide cosa succede lìe come vienemantenuto quando Wordpress cambia,tutto questo è documentato da qualcheparte come documentopolitico?
Le decisioniper l'API di WordPress sono definite dalteam di sviluppo. Di solitopuoi seguire lemodifiche su http://make.wordpress.org/core . Le librerie sono sempre mantenutepoiché lamodifica di queste librerie è ciò che cambia WordPress.
WordPress, as an application, is built of several moving parts. The
/wp-includes
folder contains common functionality for the WordPress API (which you use in themes/plugins) and the WordPress admin.So, basically:
./wp-admin - Admin code ./wp-content - User-defined code and content ./wp-includes - Common files
The
/wp-includes
directory is where useful 3rd party libraries (i.e. SimplePie for RSS and IncutioRPC for XML-RPC) are stored. It's also where much of the WordPress API (i.e. WP_Http, WP_Filesystem) is defined.Can a plugin developer rely in it's contents? and for how long?
Yes. These files are what defines the WordPress API in the first place. The core team goes to great lengths to retain backwards compatibility, so if any changes are ever introduced in WordPress that will break what you're using, you'll know aobut it well beforehand.
I would also like to know, who decides what goes in there and how does it get maintained as Wordpress changes, any is all this documented somewhere as a policy doc?
Decisions for WordPress' API are defined by the development team. You can usually follow changes on http://make.wordpress.org/core. Libraries are always maintained since changing these libraries is what changes WordPress.
-
Noni file definiscono l'API,lefunzionie le classiin queifile lofanno.Ifilepotrebbero spostarsi o scomparire senza alcunamodifica all'API.Not the files define the API, the functions and classes in those files do that. The files might move or vanish without any changes to the API.
- 0
- 2012-12-04
- fuxia
-
- 2012-12-04
wp-includes
è la directory che contiene lamaggiorparte dellefunzionalitàprincipali di WordPress.È dove risiedetuttoil codiceprincipale di WordPress.WordPressfa un ottimo lavoronelmantenere la retrocompatibilitàtra le versioni.Puoi utilizzare lefunzioniinclusein questa cartellaper creareplugin con (è così cheti colleghi al sistema).
WordPress Trac è l'areaprincipale che decide come WordPress va avanti,quindi se hai opinioni/aggiunte,fatti coinvolgere lì :)
wp-includes
is the directory that contains most of WordPress' main functionality. It's where all the major WordPress code lives.WordPress does an excellent job of maintaining backwards compatibility between versions. You can use the functions included in this folder to build plugins with (that's how you hook into the system).
WordPress Trac is the main area that decides how WordPress moves forward, so if you have opinions/additions, get involved there :)
A cosa serve la cartella wp-includes di wordpress?Cioè,qual è lo scopo architettonicofondamentale diesso,adesempioperchénon ètuttonei temi oin una cartella di amministrazione?
Uno sviluppatore dipluginpuòfare affidamento sui suoi contenuti (adesempiojQuery)e per quantotempo?
Vorrei anche sapere,chi decide cosa succede lìe come vienemantenuto quando Wordpress cambia,tutto questo è documentato da qualcheparte come documentopolitico?