Page Menu
Home
GitPull.it
Search
Configure Global Search
Log In
Files
F15177908
load-post.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
load-post.php
View Options
<?php
// this files describes my website and it's automagically called after the famework load
define
(
'SITE_NAME'
,
'My Amazing Website'
)
;
register_css
(
'my-style'
,
'static/my-style.css'
)
;
register_js
(
'my-script'
,
'static/my-script.js'
)
;
// register an 'user' role with some permissions
register_permissions
(
'user'
,
[
'say-hello'
,
]
)
;
// register an 'admin' role that it's somehow more than an 'user'
inherit_permissions
(
'admin'
,
'user'
,
[
'edit-every-hello'
,
'create-monsters'
,
]
)
;
// autoload my classes from my /include directory
// I just have to remember to create classes as 'class-Foo.php'
// then when inside the code I will do:
// $a = new Foo();
// this function will do the magic and will requires it
spl_autoload_register
(
function
(
$missing_class_name
)
{
// my class should be there
$path
=
ABSPATH
.
"/include/class-{$missing_class_name}.php"
;
// if it's really mine, require it
if
(
file_exists
(
$path
)
)
{
require
$path
;
}
}
)
;
// you may also want to load some yours additional functions
require
ABSPATH
.
'/include/functions.php'
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Nov 19, 04:09 (15 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263602
Default Alt Text
load-post.php (1 KB)
Attached To
Mode
R22 WikiCAPTCHA Control Room
Attached
Detach File
Event Timeline