http://codex.wordpress.org/Determining_Plugin_and_Content_Directories
Plugins
plugins_url()
plugin_dir_url()
plugin_dir_path()
plugin_basename()
Themes
get_template_directory_uri()
get_stylesheet_directory_uri()
get_stylesheet_uri()
get_theme_root_uri()
get_theme_root()
get_theme_roots()
get_stylesheet_directory()
get_template_directory()
Site Home
home_url()
WordPress
admin_url()
site_url()
content_url()
includes_url()
wp_upload_dir()
Multisite
get_admin_url()
get_home_url()
get_site_url()
network_admin_url()
network_site_url()
network_home_url()
Constants
WP_CONTENT_DIR // no trailing slash, full paths only
WP_CONTENT_URL // full url
WP_PLUGIN_DIR // full path, no trailing slash
WP_PLUGIN_URL // full url, no trailing slash
// Available per default in MS, not set in single site install
// Can be used in single site installs (as usual: at your own risk)
UPLOADS // uploads folder, relative to ABSPATH (for e.g.: /wp-content/uploads)
WordPress Directories:
home_url() Home URL http://www.example.com
site_url() Site directory URL http://www.example.com or http://www.example.com/wordpress
admin_url() Admin directory URL http://www.example.com/wp-admin
includes_url() Includes directory URL http://www.example.com/wp-includes
content_url() Content directory URL http://www.example.com/wp-content
plugins_url() Plugins directory URL http://www.example.com/wp-content/plugins
theme_url() Themes directory URL (#18302) http://www.example.com/wp-content/themes
wp_upload_dir() Upload directory URL (returns an array) http://www.example.com/wp-content/uploads
AUTOSAVE_INTERVAL
#time in seconds
(Default: 60
)CORE_UPGRADE_SKIP_NEW_BUNDLED
#true
|false
DISABLE_WP_CRON
#true
EMPTY_TRASH_DAYS
#time in days
(Default: 30
)IMAGE_EDIT_OVERWRITE
#true
|false
MEDIA_TRASH
#true
|false
(Default: false
)WPLANG
#de_DE
WP_DEFAULT_THEME
#template name
(Default: twentyeleven
)WP_CRON_LOCK_TIMEOUT
#time in seconds
(Default: 60
)WP_MAIL_INTERVAL
#time in seconds
(Default: 300
)WP_POST_REVISIONS
#true
|false
|number
(Default: true
)WP_MAX_MEMORY_LIMIT
#256M
)WP_MEMORY_LIMIT
#32M
, for Multisite 64M
)APP_REQUEST
#true
COMMENTS_TEMPLATE
#true
DOING_AJAX
#true
DOING_AUTOSAVE
#true
DOING_CRON
#true
IFRAME_REQUEST
#true
IS_PROFILE_PAGE
#true
SHORTINIT
#true
WP_ADMIN
#true
WP_BLOG_ADMIN
#/wp-admin/
.true
WP_IMPORTING
#true
WP_INSTALLING
#true
#WP_INSTALLING_NETWORK
#WP_NETWORK_ADMIN_PAGE
.true
WP_LOAD_IMPORTERS
#true
WP_NETWORK_ADMIN
#/wp-admin/network/
.true
WP_REPAIRING
#/wp-admin/maint/repair.php
.true
WP_SETUP_CONFIG
#true
WP_UNINSTALL_PLUGIN
#uninstall.php
).true
WP_USER_ADMIN
#/wp-admin/user/
.true
XMLRPC_REQUEST
#true
ABSPATH
#path to wp-load.php
WPINC
#/wp-includes/
. You can’t change it.wp-includes
WP_LANG_DIR
#WP_CONTENT_DIR
/languages
or WP_CONTENT_DIR
WPINC
/languages
WP_PLUGIN_DIR
#WP_CONTENT_DIR
/plugins
WP_PLUGIN_URL
#WP_CONTENT_URL
/plugins
WP_CONTENT_DIR
#wp-content
dir.ABSPATH
wp-content
WP_CONTENT_URL
#wp-content
dir.{Site URL}/wp-content
WP_HOME
#WP_SITEURL
#WP_TEMP_DIR
#WPMU_PLUGIN_DIR
#WP_CONTENT_DIR
/mu-plugins
WPMU_PLUGIN_URL
#WP_CONTENT_URL
/mu-plugins
DB_CHARSET
#utf8
)DB_COLLATE
#utf8_general_ci
)DB_HOST
#IP address, domain and/or port
(Default: localhost
)DB_NAME
#database name
DB_PASSWORD
#DB_USER
#WP_ALLOW_REPAIR
#/wp-admin/maint/repair.php
.true
CUSTOM_USER_TABLE
#table name
CUSTOM_USER_META_TABLE
#table name
ALLOW_SUBDIRECTORY_INSTALL
#true
BLOGUPLOADDIR
#WP_CONTENT_DIR
/blogs.dir/{Blog ID}/files/
BLOG_ID_CURRENT_SITE
#1
DOMAIN_CURRENT_SITE
#domain
DIEONDBERROR
#true
ERRORLOGFILE
#absolute path to a writeable file
MULTISITE
#true
NOBLOGREDIRECT
#%siteurl%
for mainsite or custom URL
PATH_CURRENT_SITE
#UPLOADBLOGSDIR
#ABSPATH
.wp-content/blogs.dir
SITE_ID_CURRENT_SITE
#1
SUBDOMAIN_INSTALL
#true
|false
SUNRISE
#/wp-content/sunrise.php
file.true
UPLOADS
#ABSPATH
.UPLOADBLOGSDIR
/{blogid}/files/
WPMU_ACCEL_REDIRECT
#true
|false
(Default: false
)WPMU_SENDFILE
#true
|false
(Default: false
)WP_ALLOW_MULTISITE
#true
WP_CACHE
#/wp-content/advanced-cache.php
file.true
|false
(Default: false
)COMPRESS_CSS
#true
|false
COMPRESS_SCRIPTS
#true
|false
CONCATENATE_SCRIPTS
#true
|false
ENFORCE_GZIP
#true
|false
FS_CHMOD_DIR
#0755
)FS_CHMOD_FILE
#0644
)FS_CONNECT_TIMEOUT
#time in seconds
(Default: 30
)FS_METHOD
#direct
|ssh
|ftpext
|ftpsockets
FS_TIMEOUT
#time in seconds
(Default: 30
)FTP_BASE
#ABSPATH
FTP_CONTENT_DIR
#/wp-content/
dir.WP_CONTENT_DIR
FTP_HOST
#IP Adresse, Domain und/oder Port
FTP_LANG_DIR
#WP_LANG_DIR
FTP_PASS
#FTP_PLUGIN_DIR
#WP_PLUGIN_DIR
FTP_PRIKEY
#FTP_PUBKEY
#FTP_SSH
#true
|false
FTP_SSL
#true
|false
FTP_USER
#WP_PROXY_BYPASS_HOSTS
#www.example.com, *.example.org
WP_PROXY_HOST
#IP address or domain
WP_PROXY_PASSWORD
#WP_PROXY_PORT
#WP_PROXY_USERNAME
#WP_HTTP_BLOCK_EXTERNAL
#true
|false
WP_ACCESSIBLE_HOSTS
#WP_HTTP_BLOCK_EXTERNAL
is defined you can add hosts which shouldn’t be blocked.www.example.com, *.example.org
BACKGROUND_IMAGE
#HEADER_IMAGE
#HEADER_IMAGE_HEIGHT
#HEADER_IMAGE_WIDTH
#HEADER_TEXTCOLOR
#NO_HEADER_TEXT
#true
|false
STYLESHEETPATH
#TEMPLATEPATH
#WP_USE_THEMES
#true
|false
SAVEQUERIES
#true
|false
SCRIPT_DEBUG
#true
|false
WP_DEBUG
#true
|false
(Default: false
)WP_DEBUG_DISPLAY
#true
|false
|null
(Default: true
)WP_DEBUG_LOG
#/wp-content/debug.log
file.true
|false
(Default: false
)ADMIN_COOKIE_PATH
#/wp-admin/
dir.SITECOOKIEPATH
wp-admin
or for Multisite in subdirectory SITECOOKIEPATH
ALLOW_UNFILTERED_UPLOADS
#true
AUTH_COOKIE
#wordpress_
COOKIEHASH
AUTH_KEY
#AUTH_SALT
#COOKIEHASH
#COOKIEPATH
#Home URL without http(s)://
COOKIE_DOMAIN
#false
or for Multisite with subdomains .domain of the main site
CUSTOM_TAGS
#/wp-includes/kses.php
.true
|false
(Default: false
)DISALLOW_FILE_EDIT
#true
DISALLOW_FILE_MODS
#true
DISALLOW_UNFILTERED_HTML
#true
FORCE_SSL_ADMIN
#true
|false
(Default: false
)FORCE_SSL_LOGIN
#true
|false
(Default: false
)LOGGED_IN_COOKIE
#wordpress_logged_in_
COOKIEHASH
LOGGED_IN_KEY
#LOGGED_IN_SALT
#NONCE_KEY
#NONCE_SALT
#PASS_COOKIE
#wordpresspass_
COOKIEHASH
PLUGINS_COOKIE_PATH
#WP_PLUGIN_URL
without http(s)://SECURE_AUTH_COOKIE
#wordpress_sec_
COOKIEHASH
SECURE_AUTH_KEY
#SECURE_AUTH_SALT
#SITECOOKIEPATH
#Site URL without http(s)://
TEST_COOKIE
#wordpress_test_cookie
USER_COOKIE
#wordpressuser_
COOKIEHASH
<?php if (! function_exists ( 'wp_handle_upload' )) require_once (ABSPATH . 'wp-admin/includes/file.php'); $uploadedfile = $_FILES ['myfile']; $upload_overrides = array ( 'test_form' => false ); //uploadm=ning file $movefile = wp_handle_upload ( $uploadedfile, $upload_overrides ); if ($movefile) { //adding to media library $wp_filetype = $movefile ['type']; $filename = $movefile ['file']; $wp_upload_dir = wp_upload_dir (); $url = $wp_upload_dir ['url'] . '/' . basename ( $filename ); $new_filename = basename ( $filename ); $attachment = array ( 'guid' => $url, 'post_mime_type' => $wp_filetype, 'post_title' => preg_replace ( '/\.[^.]+$/', '', $new_filename ), 'post_content' => '', 'post_status' => 'inherit' ); $attach_id = wp_insert_attachment ( $attachment, $filename ); } else { //error uploading } ?>
wordpress Plugin activation hook
class MyPlugin { static function install() { // do not generate any output here } } register_activation_hook( __FILE__, array( ‘MyPlugin’, ‘install’ ) ); http://codex.wordpress.org/Function_Reference/register_activation_hook
<?php $initcontent = ''; $editor_id = 'mycustomeditor'; wp_editor( $initcontent, $editor_id ); ?>
<?php wp_editor( $content, $editor_id, $settings = array() ); ?>
This function does not return a value.