initial commit
16
conf/nginx.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
location PATHTOCHANGE {
|
||||
alias ALIASTOCHANGE;
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
index index.php;
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
}
|
99
conf/wp-config.php
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?php
|
||||
/**
|
||||
* La configuration de base de votre installation WordPress.
|
||||
*
|
||||
* Ce fichier contient les réglages de configuration suivants : réglages MySQL,
|
||||
* préfixe de table, clefs secrètes, langue utilisée, et ABSPATH.
|
||||
* Vous pouvez en savoir plus à leur sujet en allant sur
|
||||
* {@link http://codex.wordpress.org/fr:Modifier_wp-config.php Modifier
|
||||
* wp-config.php}. C'est votre hébergeur qui doit vous donner vos
|
||||
* codes MySQL.
|
||||
*
|
||||
* Ce fichier est utilisé par le script de création de wp-config.php pendant
|
||||
* le processus d'installation. Vous n'avez pas à utiliser le site web, vous
|
||||
* pouvez simplement renommer ce fichier en "wp-config.php" et remplir les
|
||||
* valeurs.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
// ** Réglages MySQL - Votre hébergeur doit vous fournir ces informations. ** //
|
||||
/** Nom de la base de données de WordPress. */
|
||||
define('DB_NAME', 'yunobase');
|
||||
|
||||
/** Utilisateur de la base de données MySQL. */
|
||||
define('DB_USER', 'yunouser');
|
||||
|
||||
/** Mot de passe de la base de données MySQL. */
|
||||
define('DB_PASSWORD', 'yunopass');
|
||||
|
||||
/** Adresse de l'hébergement MySQL. */
|
||||
define('DB_HOST', 'localhost');
|
||||
|
||||
/** Jeu de caractères à utiliser par la base de données lors de la création des tables. */
|
||||
define('DB_CHARSET', 'utf8');
|
||||
|
||||
/** Type de collation de la base de données.
|
||||
* N'y touchez que si vous savez ce que vous faites.
|
||||
*/
|
||||
define('DB_COLLATE', '');
|
||||
|
||||
/**#@+
|
||||
* Clefs uniques d'authentification et salage.
|
||||
*
|
||||
* Remplacez les valeurs par défaut par des phrases uniques !
|
||||
* Vous pouvez générer des phrases aléatoires en utilisant
|
||||
* {@link https://api.wordpress.org/secret-key/1.1/salt/ le service de clefs secrètes de WordPress.org}.
|
||||
* Vous pouvez modifier ces phrases à n'importe quel moment, afin d'invalider tous les cookies existants.
|
||||
* Cela forcera également tous les utilisateurs à se reconnecter.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
define('AUTH_KEY', ' z+Oq8E~x.$J%(jdrTVJ?Jg|gxaE?f|sR<|V(t}]gQDW9yc}g<4u9buBvHyVo3;(');
|
||||
define('SECURE_AUTH_KEY', 'MGGqw@$4*dxNs%,~+V}~l8Cx3~F0b<]7Y-2&!%w];){Di>]P8)5%(S;4Jv;}5Hpi');
|
||||
define('LOGGED_IN_KEY', 'b(M|@_C*=RCx~~=X(-G|t{%3Up=h(Z|_UP&YA)]-d-js|VX3b1v1;NH[`#4L[EO=');
|
||||
define('NONCE_KEY', 'XseL2lp5}2_?~s&EJ_<f-gHvSN_E8A(4rz>Ut7{(VC-e4n$t_y(t}EpHKEy0`7<6');
|
||||
define('AUTH_SALT', '+M|psJjNE(>kpozF-%$PN7y=q+E5PE?f-QBN[|.q0]m|n(6@Y<I,8GQCef=[P|^a');
|
||||
define('SECURE_AUTH_SALT', 'm<@Fkn,*`Ia$Bl#h~HAh =-%>o@h03YW3p~|*G5g5vYmoci[t$ 9EqLKS4-~;W>y');
|
||||
define('LOGGED_IN_SALT', 'jgQ4 ~ 0f6|zS}Cd6<&y7?+iRU`woOK65|M-_+X.[r Ka 6l}1fiH-m$dN2t)BcH');
|
||||
define('NONCE_SALT', ';-FHEOgPbgx{{;Z19L7:v|f+9j-T5mv)g.L6-6_5KH|{-|p?G<}^rZ>$1qI/!wRb');
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Préfixe de base de données pour les tables de WordPress.
|
||||
*
|
||||
* Vous pouvez installer plusieurs WordPress sur une seule base de données
|
||||
* si vous leur donnez chacune un préfixe unique.
|
||||
* N'utilisez que des chiffres, des lettres non-accentuées, et des caractères soulignés!
|
||||
*/
|
||||
$table_prefix = 'wp_';
|
||||
|
||||
/**
|
||||
* Langue de localisation de WordPress, par défaut en Anglais.
|
||||
*
|
||||
* Modifiez cette valeur pour localiser WordPress. Un fichier MO correspondant
|
||||
* au langage choisi doit être installé dans le dossier wp-content/languages.
|
||||
* Par exemple, pour mettre en place une traduction française, mettez le fichier
|
||||
* fr_FR.mo dans wp-content/languages, et réglez l'option ci-dessous à "fr_FR".
|
||||
*/
|
||||
define('WPLANG', 'fr_FR');
|
||||
|
||||
/**
|
||||
* Pour les développeurs : le mode deboguage de WordPress.
|
||||
*
|
||||
* En passant la valeur suivante à "true", vous activez l'affichage des
|
||||
* notifications d'erreurs pendant votre essais.
|
||||
* Il est fortemment recommandé que les développeurs d'extensions et
|
||||
* de thèmes se servent de WP_DEBUG dans leur environnement de
|
||||
* développement.
|
||||
*/
|
||||
define('WP_DEBUG', false);
|
||||
|
||||
/* C'est tout, ne touchez pas à ce qui suit ! Bon blogging ! */
|
||||
|
||||
/** Chemin absolu vers le dossier de WordPress. */
|
||||
if ( !defined('ABSPATH') )
|
||||
define('ABSPATH', dirname(__FILE__) . '/');
|
||||
|
||||
/** Réglage des variables de WordPress et de ses fichiers inclus. */
|
||||
require_once(ABSPATH . 'wp-settings.php');
|
42
manifest.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"name": "Wordpress",
|
||||
"id": "wordpress",
|
||||
"description": {
|
||||
"en": "WordPress is web software you can use to create a beautiful website or blog",
|
||||
"fr": "Outils de création de Blog ou de site web"
|
||||
},
|
||||
"developer": {
|
||||
"name": "beudbeud",
|
||||
"email": "beudbeud@beudibox.Fr",
|
||||
"url": "http://wordpress.org/"
|
||||
},
|
||||
"multi_instance": "true",
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for Wordpress"
|
||||
},
|
||||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"ask": {
|
||||
"en": "Choose a path for Wordpress"
|
||||
},
|
||||
"example": "/blog",
|
||||
"default": ""
|
||||
},
|
||||
{
|
||||
"name": "admin_passwd",
|
||||
"ask": {
|
||||
"en": "Choose a password for Wordpress administrator"
|
||||
},
|
||||
"example": "",
|
||||
"default": ""
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
45
scripts/install
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
domain=$1
|
||||
path=$2
|
||||
admin_passwd=$3
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain$path -a wordpress
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use 'wordpress' as database name and user
|
||||
db_user=wordpress
|
||||
|
||||
# Initialize database and store mysql password for upgrade
|
||||
sudo yunohost app initdb $db_user -p $db_pwd)
|
||||
sudo yunohost app setting wordpress mysqlpwd -v $db_pwd
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/wordpress
|
||||
sudo mkdir -p $final_path
|
||||
sudo cp -a ../sources/* $final_path
|
||||
sudo cp ../conf/wp-config.php $final_path/config/
|
||||
|
||||
# Change variables in Wordpress configuration
|
||||
sudo sed -i "s/yunouser/$db_user/g" $final_path/wp-config.php
|
||||
sudo sed -i "s/yunopass/$db_pwd/g" $final_path/wp-config.php
|
||||
sudo sed -i "s/yunobase/$db_user/g" $final_path/wp-config.php
|
||||
|
||||
# Set permissions to roundcube directory
|
||||
sudo chown -R www-data: $final_path
|
||||
|
||||
#Installation Wordpress
|
||||
curl -X POST -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:12.0) Gecko/20100101 Firefox/12.0" -e "http://dev.example.com/yeshello/wp-admin/install.php?step=2" -H "Content-Type:application/x-www-form-urlencoded" -H "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Encoding:gzip, deflate" --data "?step=2&weblog_title=yeshello&user_name=admin&admin_password=admin&admin_password2=admin&admin_email=mathias%40example.com&Submit=Install+WordPress" http://$domain$path/wp-admin/install.php?step=2&weblog_title=Yunohost&user_name=admin&admin_password=$admin_passwd&admin_password2=$admin_passwd&admin_email=admin@$domain&Submit=Install+WordPress
|
||||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
|
||||
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/wordpress.conf
|
||||
|
||||
# Reload Nginx and regenerate SSOwat conf
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
10
scripts/remove
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
db_user=wordpress
|
||||
db_name=wordpress
|
||||
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||
domain=$(sudo yunohost app setting wordpress domain)
|
||||
|
||||
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user ;"
|
||||
sudo rm -rf /var/www/wordpress
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/wordpress.conf
|
17
sources/index.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* Front to the WordPress application. This file doesn't do anything, but loads
|
||||
* wp-blog-header.php which does and tells WordPress to load the theme.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tells WordPress to load the WordPress theme and output it.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
define('WP_USE_THEMES', true);
|
||||
|
||||
/** Loads the WordPress Environment and Template */
|
||||
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
|
385
sources/license.txt
Normal file
|
@ -0,0 +1,385 @@
|
|||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2013 by the contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
This program incorporates work covered by the following copyright and
|
||||
permission notices:
|
||||
|
||||
b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com -
|
||||
http://tidakada.com
|
||||
|
||||
Wherever third party code has been used, credit has been given in the code's
|
||||
comments.
|
||||
|
||||
b2 is released under the GPL
|
||||
|
||||
and
|
||||
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2003-2010 by the contributors
|
||||
|
||||
WordPress is released under the GPL
|
||||
|
||||
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
WRITTEN OFFER
|
||||
|
||||
The source code for any program binaries or compressed scripts that are
|
||||
included with WordPress can be freely obtained at the following URL:
|
||||
|
||||
http://wordpress.org/download/source/
|
93
sources/readme.html
Normal file
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>WordPress › À lire</title>
|
||||
<link rel="stylesheet" href="wp-admin/css/install.css?ver=20100228" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="logo">
|
||||
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
|
||||
<br />Version 3.7
|
||||
|
||||
</h1>
|
||||
<p style="text-align: center">Plateforme de publication sémantique personnelle</p>
|
||||
|
||||
<h1>Préambule</h1>
|
||||
<p>Bienvenue. WordPress est un projet très spécial pour moi. Chaque développeur et contributeur ajoute quelque chose d'unique à ce projet, et ensemble nous créons quelque chose de beau, et dont je suis fier de faire partie. Nous avons passé des milliers d'heures sur le développement de WordPress, et nous nous attachons tous les jours à vous faciliter la vie. Merci à vous d'en faire une partie de votre monde.</p>
|
||||
<p style="text-align: right">— Matt Mullenweg</p>
|
||||
|
||||
<h1>Installation : la fameuse installation en 5 minutes</h1>
|
||||
<ol>
|
||||
<li>Décompressez l'archive dans un dossier vide de votre ordinateur, puis mettez tous ces fichiers en ligne ;</li>
|
||||
<li>Ouvrez le fichier <code>wp-config-sample.php</code> avec votre éditeur de texte préféré, comme WordPad ou similaire, et complétez les informations liées à votre base de données ;</li>
|
||||
<li>Sauvegardez le fichier sous le nom <code>wp-config.php</code> ;</li>
|
||||
<li>Envoyez le tout sur votre hébergement via un logiciel client FTP ;</li>
|
||||
<li>Ouvrez le fichier <span class="file"><a href="wp-admin/install.php">/wp-admin/install.php</a></span> dans votre navigateur. Celui-ci vous guidera dans la création du fichier <code>wp-config.php</code>, qui contient les détails de connexion à votre base de données ;
|
||||
<ol>
|
||||
<li>Si cela ne marchait pas, ne vous inquiétez pas : certains hébergeurs n'autorisent pas la création de fichier. Ouvrez le fichier <code>wp-config.php</code> avec un éditeur de texte, et saisissez-y directement les détails de connexion à votre base de données ;</li>
|
||||
<li>Enregistrez le fichier sous le nom <code>wp-config.php</code> et mettez-le en ligne ;</li>
|
||||
<li>Ouvrez le fichier <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> dans votre navigateur ;</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>Une fois le fichier de configuration correctement rempli, l'installateur met en place les tables nécessaires à votre blog. Si vous obtenez une erreur, vérifiez le contenu du fichier <span class="file"><code>wp-config.php</code></span>, et réessayez. Si cela échoue encore une fois, rendez-vous sur les <a href="http://www.WordPress-fr.net/support/">forums d'entraide</a> et soyez le plus précis possible dans vos explications. Si tout se passe bien, passez à l'étape suivante ;</li>
|
||||
<li><strong>Si vous n'avez pas précisé de mot de passe, notez bien celui qui vous est donné.</strong> Si vous n'avez pas précisé d'identifiant utilisateur, ce sera <code>admin</code> ;</li>
|
||||
<li>Une fois l'installation terminée, le script d'installation vous renverra vers la <a href="wp-login.php">page de connexion</a>. Connectez-vous avec l'identifiant et le mot de passe précisés (ou générés) durant l'installation. Si le mot de passe a été généré pour vous, cliquez sur "Profil" pour le modifier.</li>
|
||||
</ol>
|
||||
|
||||
<h1>Mise à jour</h1>
|
||||
<h2>A l'aide de l'outil de mise à jour automatique</h2>
|
||||
<p>Si votre version de WordPress est égale ou supérieure à 2.7, vous pouvez utiliser l'outil de mise à jour automatique :</p>
|
||||
<ol>
|
||||
<li>Ouvrez la page <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> dans votre navigateur, et suivez les instructions ;</li>
|
||||
<li>Vous pensiez qu'il y aurait d'autres étapes ? C'est tout !</li>
|
||||
</ol>
|
||||
|
||||
<h2>Mise à jour manuelle (obligatoire pour les versions de WordPress inférieures à 2.7) :</h2>
|
||||
<ol>
|
||||
<li>Avant tout, assurez-vous bien de disposer de copies de sauvegarde de tous les fichiers que vous avez modifiés, par exemple <code>index.php</code>.</li>
|
||||
<li>Effacez vos anciens fichiers WordPress, sauf ceux que vous avez modifié, comme <span class="file"><code>wp-config.php</code></span> ou le contenu du dossier <span class="file"><code>/wp-content/</code></span>.</li>
|
||||
<li>Mettez en ligne les nouveaux fichiers en provenance de l'archive de WordPress.</li>
|
||||
<li>Allez sur la page <code><span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a></span></code> avec votre navigateur internet.</li>
|
||||
</ol>
|
||||
|
||||
<h1>Migrer depuis d'autres logiciels/plates-formes</h1>
|
||||
<p>WordPress peut <a href="http://codex.wordpress.org/Importing_Content">importer les articles en provenance de nombreux autres outils (en)</a>. Vous devez d'abord installer WordPress comme expliqué plus haut, puis utiliser <a href="wp-admin/import.php" title="Importer dans WordPress">un des importateurs</a>.</p>
|
||||
|
||||
<h1>Prérequis fonctionnels</h1>
|
||||
<ul>
|
||||
<li><a href="http://php.net/">PHP</a> version <strong>5.2.4</strong> ou plus ;</li>
|
||||
<li><a href="http://www.mysql.com/">MySQL</a> version <strong>5.0</strong> ou plus.</li>
|
||||
</ul>
|
||||
|
||||
<h1>Ressources en ligne</h1>
|
||||
<p>Si vous vous posez des questions dont les réponses ne figurent pas sur ce document, vous disposez de nombreuses ressources en ligne :</p>
|
||||
<dl>
|
||||
<dt><a href="http://codex.wordpress.org/">Le Codex WordPress</a></dt>
|
||||
<dd>Le Codex est l'encyclopédie liée à tout le fonctionnement de WordPress. Il s'agit de la source d'informations la plus complète qui soit.</dd>
|
||||
<dt><a href="http://wordpress.org/blog/">Le blog de WordPress</a></dt>
|
||||
<dd>C'est ici que vous trouverez les dernières informations, les annonces et les nouveautés de WordPress. Les derniers articles de ce blog sont affichés dans le Tableau de Bord de WordPress par défaut.</dd>
|
||||
<dt><a href="http://planet.wordpress.org/">Planète WordPress</a></dt>
|
||||
<dd>La Planète WordPress est un agrégateur de news qui distille les articles de plusieurs blogs WordPress à travers le web.</dd>
|
||||
<dt><a href="http://wordpress-fr.net/support/">Support WordPress Francophone</a></dt>
|
||||
<dd>Si vous avez cherché partout et que malgré cela vous n'avez trouvé aucune réponse, les forums sont très actifs et son immense communauté sera prête à vous aider. Pour un traitement efficace de votre problème, faites en sorte d'utiliser, lors de la création de votre sujet, un titre et une description aussi pertinents et clairs que possible.</dd>
|
||||
<dt><a href="http://codex.wordpress.org/IRC">Canal <abbr title="Internet Relay Chat">IRC</abbr> WordPress</a></dt>
|
||||
<dd>Il existe un canal IRC qui est le rendez-vous des utilisateurs WordPress, et occasionnellement, propose son aide aux sujets liés au support. La page Wiki devrait vous indiquer la bonne direction.</dd>
|
||||
</dl>
|
||||
|
||||
<h1>Pour finir</h1>
|
||||
<ul>
|
||||
<li>Si vous avez des suggestions, des idées, des commentaires ou si (oups !) avez trouvé un bug, venez nous rejoindre sur les <a href="http://wordpress.org/support/">forums anglophones</a>.</li>
|
||||
<li>WordPress possède une <abbr title="Application Programming Interface">API</abbr> d'extension robuste, qui permet d'étendre les possibilités de son code de manière simple. Si vous êtes un développeur intéressé par son utilisation, rendez-vous sur la <a href="http://codex.wordpress.org/Plugin_API">documentation des extensions sur le Codex</a>. Vous ne devriez pas avoir à modifier une partie du code original.</li>
|
||||
</ul>
|
||||
|
||||
<h1>Faites connaître WordPress !</h1>
|
||||
<p>WordPress ne possède pas une kyrielle de millions de dollars pour s'offrir une campagne marketing, ni de célèbres sponsors, mais nous avons bien mieux : VOUS. Si vous appréciez WordPress, n'hésitez pas à en parler à votre entourage, vos amis, en aidant d'autres personnes ayant un niveau inférieur au vôtre, ou encore écrire un article faisant référence à notre travail.</p>
|
||||
|
||||
<p>WordPress est la reprise officielle de <a href="http://cafelog.com/">b2/cafélog</a>, provenant de Michel V. Le travail a continué d'être assuré par <a href="http://wordpress.org/about/">les développeurs WordPress</a>. Si vous voulez apporter votre soutien à WordPress, n'hésitez pas à <a href="http://wordpress.org/donate/">faire un don</a>.</p>
|
||||
|
||||
<h1>Licence</h1>
|
||||
<p>WordPress est un logiciel libre, mis à disposition sous les termes de la licence <abbr title="GNU Public License">GPL</abbr> version 2, ou de toute version suivante, au choix (voir <a href="license.txt">license.txt</a> (en anglais)).</p>
|
||||
|
||||
</body>
|
||||
</html>
|
132
sources/wp-activate.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
/**
|
||||
* Confirms that the activation key that is sent in an email after a user signs
|
||||
* up for a new blog matches the key for that user and then displays confirmation.
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
define( 'WP_INSTALLING', true );
|
||||
|
||||
/** Sets up the WordPress Environment. */
|
||||
require( dirname(__FILE__) . '/wp-load.php' );
|
||||
|
||||
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
|
||||
|
||||
if ( !is_multisite() ) {
|
||||
wp_redirect( site_url( '/wp-login.php?action=register' ) );
|
||||
die();
|
||||
}
|
||||
|
||||
if ( is_object( $wp_object_cache ) )
|
||||
$wp_object_cache->cache_enabled = false;
|
||||
|
||||
// Fix for page title
|
||||
$wp_query->is_404 = false;
|
||||
|
||||
/**
|
||||
* Fires before the Site Activation page is loaded.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
do_action( 'activate_header' );
|
||||
|
||||
/**
|
||||
* Adds an action hook specific to this page that fires on wp_head
|
||||
*
|
||||
* @since MU
|
||||
*/
|
||||
function do_activate_header() {
|
||||
/**
|
||||
* Fires before the Site Activation page is loaded, but on the wp_head action.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
do_action( 'activate_wp_head' );
|
||||
}
|
||||
add_action( 'wp_head', 'do_activate_header' );
|
||||
|
||||
/**
|
||||
* Loads styles specific to this page.
|
||||
*
|
||||
* @since MU
|
||||
*/
|
||||
function wpmu_activate_stylesheet() {
|
||||
?>
|
||||
<style type="text/css">
|
||||
form { margin-top: 2em; }
|
||||
#submit, #key { width: 90%; font-size: 24px; }
|
||||
#language { margin-top: .5em; }
|
||||
.error { background: #f66; }
|
||||
span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; }
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
add_action( 'wp_head', 'wpmu_activate_stylesheet' );
|
||||
|
||||
get_header();
|
||||
?>
|
||||
|
||||
<div id="content" class="widecolumn">
|
||||
<?php if ( empty($_GET['key']) && empty($_POST['key']) ) { ?>
|
||||
|
||||
<h2><?php _e('Activation Key Required') ?></h2>
|
||||
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url('wp-activate.php'); ?>">
|
||||
<p>
|
||||
<label for="key"><?php _e('Activation Key:') ?></label>
|
||||
<br /><input type="text" name="key" id="key" value="" size="50" />
|
||||
</p>
|
||||
<p class="submit">
|
||||
<input id="submit" type="submit" name="Submit" class="submit" value="<?php esc_attr_e('Activate') ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php } else {
|
||||
|
||||
$key = !empty($_GET['key']) ? $_GET['key'] : $_POST['key'];
|
||||
$result = wpmu_activate_signup($key);
|
||||
if ( is_wp_error($result) ) {
|
||||
if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
|
||||
$signup = $result->get_error_data();
|
||||
?>
|
||||
<h2><?php _e('Your account is now active!'); ?></h2>
|
||||
<?php
|
||||
echo '<p class="lead-in">';
|
||||
if ( $signup->domain . $signup->path == '' ) {
|
||||
printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, wp_lostpassword_url() );
|
||||
} else {
|
||||
printf( __('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url() );
|
||||
}
|
||||
echo '</p>';
|
||||
} else {
|
||||
?>
|
||||
<h2><?php _e('An error occurred during the activation'); ?></h2>
|
||||
<?php
|
||||
echo '<p>'.$result->get_error_message().'</p>';
|
||||
}
|
||||
} else {
|
||||
extract($result);
|
||||
$url = get_blogaddress_by_id( (int) $blog_id);
|
||||
$user = get_userdata( (int) $user_id);
|
||||
?>
|
||||
<h2><?php _e('Your account is now active!'); ?></h2>
|
||||
|
||||
<div id="signup-welcome">
|
||||
<p><span class="h3"><?php _e('Username:'); ?></span> <?php echo $user->user_login ?></p>
|
||||
<p><span class="h3"><?php _e('Password:'); ?></span> <?php echo $password; ?></p>
|
||||
</div>
|
||||
|
||||
<?php if ( $url != network_home_url('', 'http') ) : ?>
|
||||
<p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php' ); ?></p>
|
||||
<?php else: ?>
|
||||
<p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?></p>
|
||||
<?php endif;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var key_input = document.getElementById('key');
|
||||
key_input && key_input.focus();
|
||||
</script>
|
||||
<?php get_footer(); ?>
|
181
sources/wp-admin/about.php
Normal file
|
@ -0,0 +1,181 @@
|
|||
<?php
|
||||
/**
|
||||
* About This Version administration panel.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
$title = __( 'About' );
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
wp_enqueue_script( 'about' );
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we’re okay with that.' ) ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="about.php" class="nav-tab nav-tab-active">
|
||||
<?php _e( 'What’s New' ); ?>
|
||||
</a><a href="credits.php" class="nav-tab">
|
||||
<?php _e( 'Credits' ); ?>
|
||||
</a><a href="freedoms.php" class="nav-tab">
|
||||
<?php _e( 'Freedoms' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php echo _n( 'Maintenance Release', 'Maintenance Releases', 1 ); ?></h3>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.', 11 ), '3.7.1', number_format_i18n( 11 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.7.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<h3><?php _e( 'Background Updates' ); ?></h3>
|
||||
|
||||
<div class="feature-section col three-col about-updates">
|
||||
<div class="col-1">
|
||||
<h4><?php _e( 'Updates While You Sleep' ); ?></h4>
|
||||
<p><?php _e( 'With WordPress 3.7, you don’t have to lift a finger to apply maintenance and security updates. Most sites are now able to automatically apply these updates in the background, though some configurations may not allow it.' ); ?></p>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<img alt="" src="<?php echo admin_url( 'images/about-updates-2x.png' ); ?>" />
|
||||
</div>
|
||||
<div class="col-3 last-feature">
|
||||
<h4><?php _e( 'More Reliable Than Ever' ); ?></h4>
|
||||
<p><?php _e( 'The update process has been made even more reliable and secure, with dozens of new checks and safeguards.' ); ?></p>
|
||||
<p><?php _e( 'You’ll still need to click “Update Now” once WordPress 3.8 is released, but we’ve never had more confidence in that beautiful blue button.' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
if ( current_user_can( 'update_core' ) ) {
|
||||
$future_minor_update = (object) array(
|
||||
'current' => $wp_version . '.1.next.minor',
|
||||
'version' => $wp_version . '.1.next.minor',
|
||||
'php_version' => $required_php_version,
|
||||
'mysql_version' => $required_mysql_version,
|
||||
);
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
$updater = new WP_Automatic_Updater;
|
||||
$can_auto_update = wp_http_supports( array( 'ssl' ) ) && $updater->should_update( 'core', $future_minor_update, ABSPATH );
|
||||
|
||||
if ( $can_auto_update ) {
|
||||
echo '<p class="about-auto-update cool">' . __( 'This site <strong>is</strong> able to apply these updates automatically. Cool!' ). '</p>';
|
||||
|
||||
// If the updater is disabled entirely, don't show them anything.
|
||||
} elseif ( ! $updater->is_disabled() ) {
|
||||
echo '<p class="about-auto-update">';
|
||||
// If this is is filtered to false, they won't get emails, so don't claim we will.
|
||||
// Assumption: If the user can update core, they can see what the admin email is.
|
||||
|
||||
/** This filter is documented in wp-admin/includes/class-wp-upgrader.php */
|
||||
if ( apply_filters( 'send_core_update_notification_email', true, $future_minor_update ) ) {
|
||||
printf( __( 'This site <strong>is not</strong> able to apply these updates automatically. But we’ll email %s when there is a new security release.' ), esc_html( get_site_option( 'admin_email' ) ) );
|
||||
} else {
|
||||
_e( 'This site <strong>is not</strong> able to apply these updates automatically.' );
|
||||
}
|
||||
echo '</p>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changelog about-passwords">
|
||||
<h3><?php _e( 'Create Stronger Passwords' ); ?></h3>
|
||||
|
||||
<div class="feature-section col two-col">
|
||||
<div>
|
||||
<p><?php _e( 'Your password is your site’s first line of defense. It’s best to create passwords that are complex, long, and unique. To that end, our password meter has been updated in WordPress 3.7 to recognize common mistakes that can weaken your password: dates, names, keyboard patterns (123456789), and even pop culture references.' ); ?></p>
|
||||
<p><strong><?php _e( 'Try it out on the right.' ); ?></strong></p>
|
||||
</div>
|
||||
<div class="last-feature about-password-meter">
|
||||
<input type="password" id="pass" size="25" value="" />
|
||||
<p id="pass-strength-result" ><?php _e( 'Strength indicator' ); ?></p>
|
||||
<?php printf( __( 'Getting the urge to <a href="%s">change your password</a>?' ), esc_url( self_admin_url( 'profile.php' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<div class="feature-section col two-col">
|
||||
<div>
|
||||
<h3><?php _e( 'Improved Search Results' ); ?></h3>
|
||||
<p><img alt="" src="<?php echo admin_url( 'images/about-search-2x.png' ); ?>" /><?php _e( 'Search results are now ordered by how well the search query matches a post, instead of ordered only by date. For example, when your search terms match a post title, that result will be pushed to the top.' ); ?></p>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
<h3><?php _e( 'Better Global Support' ); ?></h3>
|
||||
<p><img alt="" src="<?php echo admin_url( 'images/about-globe-2x.png' ); ?>" /><?php _e( 'Localized versions of WordPress will receive faster and more complete translations. WordPress 3.7 adds support for automatically installing the right language files and keeping them up to date.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<h3><?php _e( 'Under the Hood' ); ?></h3>
|
||||
|
||||
<div class="feature-section col three-col">
|
||||
<div>
|
||||
<h4><?php _e( 'More Background Updates (Experimental)' ); ?></h4>
|
||||
<p><?php _e( 'Want WordPress to always update automatically, even for major feature releases? Want to always keep a certain plugin up to date in the background? WordPress 3.7 comes with fine-grained update controls for developers and systems administrators.' ); ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<h4><?php _e( 'Advanced Date Queries' ); ?></h4>
|
||||
<p><?php _e( 'Developers can now query for posts within a date range, or that are older than or newer than a specific point in time. Or get really fancy: all posts written on Friday afternoons? Not a problem.' ); ?></p>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
<h4><?php _e( 'Multisite Improvements' ); ?></h4>
|
||||
<p><?php _e( '<code>wp_get_sites()</code> allows developers to easily get an array of all the sites on your network without resorting to a direct database query — just one of many improvements to multisite in WordPress 3.7.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="return-to-dashboard">
|
||||
<?php if ( current_user_can( 'update_core' ) && isset( $_GET['updated'] ) ) : ?>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'update-core.php' ) ); ?>"><?php
|
||||
is_multisite() ? _e( 'Return to Updates' ) : _e( 'Return to Dashboard → Updates' );
|
||||
?></a> |
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo esc_url( self_admin_url() ); ?>"><?php
|
||||
is_blog_admin() ? _e( 'Go to Dashboard → Home' ) : _e( 'Go to Dashboard' ); ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
|
||||
// These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
|
||||
return;
|
||||
|
||||
_n_noop( 'Maintenance Release', 'Maintenance Releases' );
|
||||
_n_noop( 'Security Release', 'Security Releases' );
|
||||
_n_noop( 'Maintenance and Security Release', 'Maintenance and Security Releases' );
|
||||
|
||||
/* translators: 1: WordPress version number. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed a security issue.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.' );
|
||||
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' );
|
94
sources/wp-admin/admin-ajax.php
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress AJAX Process Execution.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*
|
||||
* @link http://codex.wordpress.org/AJAX_in_Plugins
|
||||
*/
|
||||
|
||||
/**
|
||||
* Executing AJAX process.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
define( 'DOING_AJAX', true );
|
||||
define( 'WP_ADMIN', true );
|
||||
|
||||
/** Load WordPress Bootstrap */
|
||||
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
|
||||
|
||||
/** Allow for cross-domain requests (from the frontend). */
|
||||
send_origin_headers();
|
||||
|
||||
// Require an action parameter
|
||||
if ( empty( $_REQUEST['action'] ) )
|
||||
die( '0' );
|
||||
|
||||
/** Load WordPress Administration APIs */
|
||||
require_once( ABSPATH . 'wp-admin/includes/admin.php' );
|
||||
|
||||
/** Load Ajax Handlers for WordPress Core */
|
||||
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
|
||||
|
||||
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
|
||||
@header( 'X-Robots-Tag: noindex' );
|
||||
|
||||
send_nosniff_header();
|
||||
nocache_headers();
|
||||
|
||||
/** This action is documented in wp-admin/admin.php */
|
||||
do_action( 'admin_init' );
|
||||
|
||||
$core_actions_get = array(
|
||||
'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache',
|
||||
'autocomplete-user', 'dashboard-widgets', 'logged-in',
|
||||
);
|
||||
|
||||
$core_actions_post = array(
|
||||
'oembed-cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link',
|
||||
'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment',
|
||||
'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment',
|
||||
'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'autosave', 'closed-postboxes',
|
||||
'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
|
||||
'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
|
||||
'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
|
||||
'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
|
||||
'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
|
||||
'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
|
||||
'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
|
||||
);
|
||||
|
||||
// Register core Ajax calls.
|
||||
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
|
||||
add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
|
||||
|
||||
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) )
|
||||
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
/**
|
||||
* Fires authenticated AJAX actions for logged-in users.
|
||||
*
|
||||
* The dynamic portion of the hook name, $_REQUEST['action'],
|
||||
* refers to the name of the AJAX action callback being fired.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( 'wp_ajax_' . $_REQUEST['action'] );
|
||||
} else {
|
||||
/**
|
||||
* Fires non-authenticated AJAX actions for logged-out users.
|
||||
*
|
||||
* The dynamic portion of the hook name, $_REQUEST['action'],
|
||||
* refers to the name of the AJAX action callback being fired.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
|
||||
}
|
||||
// Default status
|
||||
die( '0' );
|
90
sources/wp-admin/admin-footer.php
Normal file
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress Administration Template Footer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
?>
|
||||
|
||||
<div class="clear"></div></div><!-- wpbody-content -->
|
||||
<div class="clear"></div></div><!-- wpbody -->
|
||||
<div class="clear"></div></div><!-- wpcontent -->
|
||||
|
||||
<div id="wpfooter">
|
||||
<?php
|
||||
/**
|
||||
* Fires after the opening tag for the admin footer.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*/
|
||||
do_action( 'in_admin_footer' );
|
||||
?>
|
||||
<p id="footer-left" class="alignleft">
|
||||
<?php
|
||||
/**
|
||||
* Filter the "Thank you" text displayed in the admin footer.
|
||||
*
|
||||
* @since 2.8.0
|
||||
* @param string The content that will be printed.
|
||||
*/
|
||||
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . __( 'Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.' ) . '</span>' );
|
||||
?>
|
||||
</p>
|
||||
<p id="footer-upgrade" class="alignright">
|
||||
<?php
|
||||
/**
|
||||
* Filter the version/update text displayed in the admin footer.
|
||||
*
|
||||
* @see core_update_footer() WordPress prints the current version and update information,
|
||||
* using core_update_footer() at priority 10.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @param string The content that will be printed.
|
||||
*/
|
||||
echo apply_filters( 'update_footer', '' );
|
||||
?>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
/**
|
||||
* Print scripts or data before the default footer scripts.
|
||||
*
|
||||
* @since 1.2.0
|
||||
* @param string The data to print.
|
||||
*/
|
||||
do_action('admin_footer', '');
|
||||
|
||||
/**
|
||||
* Prints any scripts and data queued for the footer.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
do_action('admin_print_footer_scripts');
|
||||
|
||||
/**
|
||||
* Print scripts or data after the default footer scripts.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param string $GLOBALS['hook_suffix'] The current admin page.
|
||||
*/
|
||||
do_action("admin_footer-" . $GLOBALS['hook_suffix']);
|
||||
|
||||
// get_site_option() won't exist when auto upgrading from <= 2.7
|
||||
if ( function_exists('get_site_option') ) {
|
||||
if ( false === get_site_option('can_compress_scripts') )
|
||||
compression_test();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="clear"></div></div><!-- wpwrap -->
|
||||
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
|
||||
</body>
|
||||
</html>
|
15
sources/wp-admin/admin-functions.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Administration Functions
|
||||
*
|
||||
* This file is deprecated, use 'wp-admin/includes/admin.php' instead.
|
||||
*
|
||||
* @deprecated 2.5
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
_deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/admin.php' );
|
||||
|
||||
/** WordPress Administration API: Includes all Administration functions. */
|
||||
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
234
sources/wp-admin/admin-header.php
Normal file
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress Administration Template Header
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
||||
if ( ! defined( 'WP_ADMIN' ) )
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
// In case admin-header.php is included in a function.
|
||||
global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
|
||||
$current_site, $update_title, $total_update_count, $parent_file;
|
||||
|
||||
// Catch plugins that include admin-header.php before admin.php completes.
|
||||
if ( empty( $current_screen ) )
|
||||
set_current_screen();
|
||||
|
||||
get_admin_page_title();
|
||||
$title = esc_html( strip_tags( $title ) );
|
||||
|
||||
if ( is_network_admin() )
|
||||
$admin_title = sprintf( __('Network Admin: %s'), esc_html( $current_site->site_name ) );
|
||||
elseif ( is_user_admin() )
|
||||
$admin_title = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );
|
||||
else
|
||||
$admin_title = get_bloginfo( 'name' );
|
||||
|
||||
if ( $admin_title == $title )
|
||||
$admin_title = sprintf( __( '%1$s — WordPress' ), $title );
|
||||
else
|
||||
$admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
|
||||
|
||||
/**
|
||||
* Filter the <title> content for an admin page.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string $admin_title The page title, with extra context added.
|
||||
* @param string $title The original page title.
|
||||
*/
|
||||
$admin_title = apply_filters( 'admin_title', $admin_title, $title );
|
||||
|
||||
wp_user_settings();
|
||||
|
||||
_wp_admin_html_begin();
|
||||
?>
|
||||
<title><?php echo $admin_title; ?></title>
|
||||
<?php
|
||||
|
||||
wp_enqueue_style( 'colors' );
|
||||
wp_enqueue_style( 'ie' );
|
||||
wp_enqueue_script('utils');
|
||||
|
||||
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
|
||||
pagenow = '<?php echo $current_screen->id; ?>',
|
||||
typenow = '<?php echo $current_screen->post_type; ?>',
|
||||
adminpage = '<?php echo $admin_body_class; ?>',
|
||||
thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
|
||||
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
|
||||
isRtl = <?php echo (int) is_rtl(); ?>;
|
||||
</script>
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Enqueue scripts for all admin pages.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*
|
||||
* @param string $hook_suffix The current admin page.
|
||||
*/
|
||||
do_action( 'admin_enqueue_scripts', $hook_suffix );
|
||||
|
||||
/**
|
||||
* Print styles for a specific admin page based on $hook_suffix.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( "admin_print_styles-$hook_suffix" );
|
||||
|
||||
/**
|
||||
* Print styles for all admin pages.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( 'admin_print_styles' );
|
||||
|
||||
/**
|
||||
* Print scripts for a specific admin page based on $hook_suffix.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( "admin_print_scripts-$hook_suffix" );
|
||||
|
||||
/**
|
||||
* Print scripts for all admin pages.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( 'admin_print_scripts' );
|
||||
|
||||
/**
|
||||
* Fires in <head> for a specific admin page based on $hook_suffix.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( "admin_head-$hook_suffix" );
|
||||
|
||||
/**
|
||||
* Fires in <head> for all admin pages.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( 'admin_head' );
|
||||
|
||||
if ( get_user_setting('mfold') == 'f' )
|
||||
$admin_body_class .= ' folded';
|
||||
|
||||
if ( !get_user_setting('unfold') )
|
||||
$admin_body_class .= ' auto-fold';
|
||||
|
||||
if ( is_admin_bar_showing() )
|
||||
$admin_body_class .= ' admin-bar';
|
||||
|
||||
if ( is_rtl() )
|
||||
$admin_body_class .= ' rtl';
|
||||
|
||||
if ( $current_screen->post_type )
|
||||
$admin_body_class .= ' post-type-' . $current_screen->post_type;
|
||||
|
||||
if ( $current_screen->taxonomy )
|
||||
$admin_body_class .= ' taxonomy-' . $current_screen->taxonomy;
|
||||
|
||||
$admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );
|
||||
$admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) );
|
||||
$admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' );
|
||||
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
|
||||
|
||||
if ( wp_is_mobile() )
|
||||
$admin_body_class .= ' mobile';
|
||||
|
||||
$admin_body_class .= ' no-customize-support';
|
||||
|
||||
?>
|
||||
</head>
|
||||
<?php
|
||||
/**
|
||||
* Filter the admin <body> CSS classes.
|
||||
*
|
||||
* This filter differs from the post_class or body_class filters in two important ways:
|
||||
* 1. $classes is a space-separated string of class names instead of an array.
|
||||
* 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, and no-js cannot be removed.
|
||||
*
|
||||
* @since 2.3.0
|
||||
*
|
||||
* @param string $classes Space-separated string of CSS classes.
|
||||
*/
|
||||
?>
|
||||
<body class="wp-admin wp-core-ui no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
|
||||
<script type="text/javascript">
|
||||
document.body.className = document.body.className.replace('no-js','js');
|
||||
</script>
|
||||
|
||||
<?php
|
||||
// Make sure the customize body classes are correct as early as possible.
|
||||
if ( current_user_can( 'edit_theme_options' ) )
|
||||
wp_customize_support_script();
|
||||
?>
|
||||
|
||||
<div id="wpwrap">
|
||||
<a tabindex="1" href="#wpbody-content" class="screen-reader-shortcut"><?php _e('Skip to main content'); ?></a>
|
||||
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
|
||||
<div id="wpcontent">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires at the beginning of the content section in an admin page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'in_admin_header' );
|
||||
?>
|
||||
|
||||
<div id="wpbody">
|
||||
<?php
|
||||
unset($title_class, $blog_name, $total_update_count, $update_title);
|
||||
|
||||
$current_screen->set_parentage( $parent_file );
|
||||
|
||||
?>
|
||||
|
||||
<div id="wpbody-content" aria-label="<?php esc_attr_e('Main content'); ?>" tabindex="0">
|
||||
<?php
|
||||
|
||||
$current_screen->render_screen_meta();
|
||||
|
||||
if ( is_network_admin() ) {
|
||||
/**
|
||||
* Print network admin screen notices.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
do_action( 'network_admin_notices' );
|
||||
} elseif ( is_user_admin() ) {
|
||||
/**
|
||||
* Print user admin screen notices.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
do_action( 'user_admin_notices' );
|
||||
} else {
|
||||
/**
|
||||
* Print admin screen notices.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
do_action( 'admin_notices' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Print generic admin screen notices.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*/
|
||||
do_action( 'all_admin_notices' );
|
||||
|
||||
if ( $parent_file == 'options-general.php' )
|
||||
require(ABSPATH . 'wp-admin/options-head.php');
|
45
sources/wp-admin/admin-post.php
Normal file
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress Generic Request (POST/GET) Handler
|
||||
*
|
||||
* Intended for form submission handling in themes and plugins.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** We are located in WordPress Administration Screens */
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
if ( defined('ABSPATH') )
|
||||
require_once(ABSPATH . 'wp-load.php');
|
||||
else
|
||||
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
|
||||
|
||||
/** Allow for cross-domain requests (from the frontend). */
|
||||
send_origin_headers();
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
||||
|
||||
nocache_headers();
|
||||
|
||||
/** This action is documented in wp-admin/admin.php */
|
||||
do_action( 'admin_init' );
|
||||
|
||||
$action = 'admin_post';
|
||||
|
||||
if ( !wp_validate_auth_cookie() )
|
||||
$action .= '_nopriv';
|
||||
|
||||
if ( !empty($_REQUEST['action']) )
|
||||
$action .= '_' . $_REQUEST['action'];
|
||||
|
||||
/**
|
||||
* Fires the requested handler action.
|
||||
*
|
||||
* admin_post_nopriv_{$_REQUEST['action']} is called for not-logged-in users.
|
||||
* admin_post_{$_REQUEST['action']} is called for logged-in users.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( $action );
|
347
sources/wp-admin/admin.php
Normal file
|
@ -0,0 +1,347 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress Administration Bootstrap
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/**
|
||||
* In WordPress Administration Screens
|
||||
*
|
||||
* @since 2.3.2
|
||||
*/
|
||||
if ( ! defined('WP_ADMIN') )
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
if ( ! defined('WP_NETWORK_ADMIN') )
|
||||
define('WP_NETWORK_ADMIN', false);
|
||||
|
||||
if ( ! defined('WP_USER_ADMIN') )
|
||||
define('WP_USER_ADMIN', false);
|
||||
|
||||
if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
|
||||
define('WP_BLOG_ADMIN', true);
|
||||
}
|
||||
|
||||
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
|
||||
define('WP_LOAD_IMPORTERS', true);
|
||||
|
||||
require_once(dirname(dirname(__FILE__)) . '/wp-load.php');
|
||||
|
||||
nocache_headers();
|
||||
|
||||
if ( get_option('db_upgraded') ) {
|
||||
flush_rewrite_rules();
|
||||
update_option( 'db_upgraded', false );
|
||||
|
||||
/**
|
||||
* Fires on the next page load after a successful DB upgrade.
|
||||
*
|
||||
* @since 2.8.0
|
||||
*/
|
||||
do_action( 'after_db_upgrade' );
|
||||
} elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) {
|
||||
if ( !is_multisite() ) {
|
||||
wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
|
||||
exit;
|
||||
|
||||
/**
|
||||
* Filter whether to attempt to perform the multisite DB upgrade routine.
|
||||
*
|
||||
* In single site, the user would be redirected to wp-admin/upgrade.php.
|
||||
* In multisite, it is automatically fired, but only when this filter
|
||||
* returns true.
|
||||
*
|
||||
* If the network is 50 sites or less, it will run every time. Otherwise,
|
||||
* it will throttle itself to reduce load.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param bool true Whether to perform the Multisite upgrade routine. Default true.
|
||||
*/
|
||||
} elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
|
||||
$c = get_blog_count();
|
||||
// If 50 or fewer sites, run every time. Else, run "about ten percent" of the time. Shh, don't check that math.
|
||||
if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) {
|
||||
require_once( ABSPATH . WPINC . '/http.php' );
|
||||
$response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) );
|
||||
/**
|
||||
* Fires after the multisite DB upgrade is complete.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param array|WP_Error $response The upgrade response array or WP_Error on failure.
|
||||
*/
|
||||
do_action( 'after_mu_upgrade', $response );
|
||||
unset($response);
|
||||
}
|
||||
unset($c);
|
||||
}
|
||||
}
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
||||
|
||||
auth_redirect();
|
||||
|
||||
// Schedule trash collection
|
||||
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
|
||||
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
|
||||
|
||||
set_screen_options();
|
||||
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
wp_enqueue_script( 'common' );
|
||||
|
||||
$editing = false;
|
||||
|
||||
if ( isset($_GET['page']) ) {
|
||||
$plugin_page = wp_unslash( $_GET['page'] );
|
||||
$plugin_page = plugin_basename($plugin_page);
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) )
|
||||
$typenow = $_REQUEST['post_type'];
|
||||
else
|
||||
$typenow = '';
|
||||
|
||||
if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) )
|
||||
$taxnow = $_REQUEST['taxonomy'];
|
||||
else
|
||||
$taxnow = '';
|
||||
|
||||
if ( WP_NETWORK_ADMIN )
|
||||
require(ABSPATH . 'wp-admin/network/menu.php');
|
||||
elseif ( WP_USER_ADMIN )
|
||||
require(ABSPATH . 'wp-admin/user/menu.php');
|
||||
else
|
||||
require(ABSPATH . 'wp-admin/menu.php');
|
||||
|
||||
if ( current_user_can( 'manage_options' ) ) {
|
||||
/**
|
||||
* Filter the maximum memory limit available for administration screens.
|
||||
*
|
||||
* This only applies to administrators, who may require more memory for tasks like updates.
|
||||
* Memory limits when processing images (uploaded or edited by users of any role) are
|
||||
* handled separately.
|
||||
*
|
||||
* The WP_MAX_MEMORY_LIMIT constant specifically defines the maximum memory limit available
|
||||
* when in the administration back-end. The default is 256M, or 256 megabytes of memory.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string 'WP_MAX_MEMORY_LIMIT' The maximum WordPress memory limit. Default 256M.
|
||||
*/
|
||||
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires as an admin screen or script is being initialized.
|
||||
*
|
||||
* Note, this does not just run on user-facing admin screens.
|
||||
* It runs on admin-ajax.php and admin-post.php as well.
|
||||
*
|
||||
* This is roughly analgous to the more general 'init' hook, which fires earlier.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*/
|
||||
do_action( 'admin_init' );
|
||||
|
||||
if ( isset($plugin_page) ) {
|
||||
if ( !empty($typenow) )
|
||||
$the_parent = $pagenow . '?post_type=' . $typenow;
|
||||
else
|
||||
$the_parent = $pagenow;
|
||||
if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) {
|
||||
$page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
|
||||
// backwards compatibility for plugins using add_management_page
|
||||
if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) {
|
||||
// There could be plugin specific params on the URL, so we need the whole query string
|
||||
if ( !empty($_SERVER[ 'QUERY_STRING' ]) )
|
||||
$query_string = $_SERVER[ 'QUERY_STRING' ];
|
||||
else
|
||||
$query_string = 'page=' . $plugin_page;
|
||||
wp_redirect( admin_url('tools.php?' . $query_string) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
unset($the_parent);
|
||||
}
|
||||
|
||||
$hook_suffix = '';
|
||||
if ( isset($page_hook) )
|
||||
$hook_suffix = $page_hook;
|
||||
else if ( isset($plugin_page) )
|
||||
$hook_suffix = $plugin_page;
|
||||
else if ( isset($pagenow) )
|
||||
$hook_suffix = $pagenow;
|
||||
|
||||
set_current_screen();
|
||||
|
||||
// Handle plugin admin pages.
|
||||
if ( isset($plugin_page) ) {
|
||||
if ( $page_hook ) {
|
||||
/**
|
||||
* Fires before a particular screen is loaded.
|
||||
*
|
||||
* The load-* hook fires in a number of contexts. This hook is for plugin screens
|
||||
* where a callback is provided when the screen is registered.
|
||||
*
|
||||
* The dynamic portion of the hook name, $page_hook, refers to a mixture of plugin
|
||||
* page information including:
|
||||
* 1. The page type. If the plugin page is registered as a submenu page, such as for
|
||||
* Settings, the page type would be 'settings'. Otherwise the type is 'toplevel'.
|
||||
* 2. A separator of '_page_'.
|
||||
* 3. The plugin basename minus the file extension.
|
||||
*
|
||||
* Together, the three parts form the $page_hook. Citing the example above,
|
||||
* the hook name used would be 'load-settings_page_pluginbasename'.
|
||||
*
|
||||
* @see get_plugin_page_hook()
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( 'load-' . $page_hook );
|
||||
if (! isset($_GET['noheader']))
|
||||
require_once(ABSPATH . 'wp-admin/admin-header.php');
|
||||
|
||||
/**
|
||||
* Used to call the registered callback for a plugin screen.
|
||||
*
|
||||
* @access private
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
do_action( $page_hook );
|
||||
} else {
|
||||
if ( validate_file($plugin_page) )
|
||||
wp_die(__('Invalid plugin page'));
|
||||
|
||||
if ( !( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) && !( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") && is_file(WPMU_PLUGIN_DIR . "/$plugin_page") ) )
|
||||
wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));
|
||||
|
||||
/**
|
||||
* Fires before a particular screen is loaded.
|
||||
*
|
||||
* The load-* hook fires in a number of contexts. This hook is for plugin screens
|
||||
* where the file to load is directly included, rather than the use of a function.
|
||||
*
|
||||
* The dynamic portion of the hook name, $plugin_page, refers to the plugin basename.
|
||||
*
|
||||
* @see plugin_basename()
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
do_action( 'load-' . $plugin_page );
|
||||
|
||||
if ( !isset($_GET['noheader']))
|
||||
require_once(ABSPATH . 'wp-admin/admin-header.php');
|
||||
|
||||
if ( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") )
|
||||
include(WPMU_PLUGIN_DIR . "/$plugin_page");
|
||||
else
|
||||
include(WP_PLUGIN_DIR . "/$plugin_page");
|
||||
}
|
||||
|
||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
|
||||
exit();
|
||||
} else if (isset($_GET['import'])) {
|
||||
|
||||
$importer = $_GET['import'];
|
||||
|
||||
if ( ! current_user_can('import') )
|
||||
wp_die(__('You are not allowed to import.'));
|
||||
|
||||
if ( validate_file($importer) ) {
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]) ) {
|
||||
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires before an importer screen is loaded.
|
||||
*
|
||||
* The dynamic portion of the hook name, $importer, refers to the importer slug.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
do_action( 'load-importer-' . $importer );
|
||||
|
||||
$parent_file = 'tools.php';
|
||||
$submenu_file = 'import.php';
|
||||
$title = __('Import');
|
||||
|
||||
if (! isset($_GET['noheader']))
|
||||
require_once(ABSPATH . 'wp-admin/admin-header.php');
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||
|
||||
define('WP_IMPORTING', true);
|
||||
|
||||
/**
|
||||
* Whether to filter imported data through kses on import.
|
||||
*
|
||||
* Multisite uses this hook to filter all data through kses by default,
|
||||
* as a super administrator may be assisting an untrusted user.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param bool false Whether to force data to be filtered through kses. Default false.
|
||||
*/
|
||||
if ( apply_filters( 'force_filtered_html_on_import', false ) )
|
||||
kses_init_filters(); // Always filter imported data with kses on multisite.
|
||||
|
||||
call_user_func($wp_importers[$importer][2]);
|
||||
|
||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
|
||||
// Make sure rules are flushed
|
||||
flush_rewrite_rules(false);
|
||||
|
||||
exit();
|
||||
} else {
|
||||
/**
|
||||
* Fires before a particular screen is loaded.
|
||||
*
|
||||
* The load-* hook fires in a number of contexts. This hook is for core screens.
|
||||
*
|
||||
* The dynamic portion of the hook name, $pagenow, is a global variable
|
||||
* referring to the filename of the current page, such as 'admin.php',
|
||||
* 'post-new.php' etc. A complete hook for the latter would be 'load-post-new.php'.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
do_action( 'load-' . $pagenow );
|
||||
// Backwards compatibility with old load-page-new.php, load-page.php,
|
||||
// and load-categories.php actions.
|
||||
if ( $typenow == 'page' ) {
|
||||
if ( $pagenow == 'post-new.php' )
|
||||
do_action( 'load-page-new.php' );
|
||||
elseif ( $pagenow == 'post.php' )
|
||||
do_action( 'load-page.php' );
|
||||
} elseif ( $pagenow == 'edit-tags.php' ) {
|
||||
if ( $taxnow == 'category' )
|
||||
do_action( 'load-categories.php' );
|
||||
elseif ( $taxnow == 'link_category' )
|
||||
do_action( 'load-edit-link-categories.php' );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $_REQUEST['action'] ) ) {
|
||||
/**
|
||||
* Fires when an 'action' request variable is sent.
|
||||
*
|
||||
* The dynamic portion of the hook name, $_REQUEST['action'],
|
||||
* refers to the action derived from the GET or POST request.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*/
|
||||
do_action( 'admin_action_' . $_REQUEST['action'] );
|
||||
}
|
98
sources/wp-admin/async-upload.php
Normal file
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
/**
|
||||
* Accepts file uploads from swfupload or other asynchronous upload methods.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
if ( defined('ABSPATH') )
|
||||
require_once(ABSPATH . 'wp-load.php');
|
||||
else
|
||||
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
|
||||
|
||||
if ( ! ( isset( $_REQUEST['action'] ) && 'upload-attachment' == $_REQUEST['action'] ) ) {
|
||||
// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
|
||||
if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
|
||||
$_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
|
||||
unset($current_user);
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin.php' );
|
||||
|
||||
if ( !current_user_can('upload_files') )
|
||||
wp_die(__('You do not have permission to upload files.'));
|
||||
|
||||
header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
||||
|
||||
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
|
||||
define( 'DOING_AJAX', true );
|
||||
include ABSPATH . 'wp-admin/includes/ajax-actions.php';
|
||||
|
||||
send_nosniff_header();
|
||||
nocache_headers();
|
||||
|
||||
wp_ajax_upload_attachment();
|
||||
die( '0' );
|
||||
}
|
||||
|
||||
// just fetch the detail form for that attachment
|
||||
if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
|
||||
$post = get_post( $id );
|
||||
if ( 'attachment' != $post->post_type )
|
||||
wp_die( __( 'Unknown post type.' ) );
|
||||
if ( ! current_user_can( 'edit_post', $id ) )
|
||||
wp_die( __( 'You are not allowed to edit this item.' ) );
|
||||
|
||||
switch ( $_REQUEST['fetch'] ) {
|
||||
case 3 :
|
||||
if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) )
|
||||
echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
|
||||
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
|
||||
$title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // title shouldn't ever be empty, but use filename just in cas.e
|
||||
echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '…' ) ) . '</span></div>';
|
||||
break;
|
||||
case 2 :
|
||||
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
|
||||
echo get_media_item($id, array( 'send' => false, 'delete' => true ));
|
||||
break;
|
||||
default:
|
||||
add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2);
|
||||
echo get_media_item($id);
|
||||
break;
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
check_admin_referer('media-form');
|
||||
|
||||
$post_id = 0;
|
||||
if ( isset( $_REQUEST['post_id'] ) ) {
|
||||
$post_id = absint( $_REQUEST['post_id'] );
|
||||
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) )
|
||||
$post_id = 0;
|
||||
}
|
||||
|
||||
$id = media_handle_upload( 'async-upload', $post_id );
|
||||
if ( is_wp_error($id) ) {
|
||||
echo '<div class="error-div">
|
||||
<a class="dismiss" href="#" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">' . __('Dismiss') . '</a>
|
||||
<strong>' . sprintf(__('“%s” has failed to upload due to an error'), esc_html($_FILES['async-upload']['name']) ) . '</strong><br />' .
|
||||
esc_html($id->get_error_message()) . '</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( $_REQUEST['short'] ) {
|
||||
// short form response - attachment ID only
|
||||
echo $id;
|
||||
} else {
|
||||
// long form response - big chunk o html
|
||||
$type = $_REQUEST['type'];
|
||||
echo apply_filters("async_upload_{$type}", $id);
|
||||
}
|
303
sources/wp-admin/comment.php
Normal file
|
@ -0,0 +1,303 @@
|
|||
<?php
|
||||
/**
|
||||
* Comment Management Screen
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** Load WordPress Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
$parent_file = 'edit-comments.php';
|
||||
$submenu_file = 'edit-comments.php';
|
||||
|
||||
wp_reset_vars( array('action') );
|
||||
|
||||
if ( isset( $_POST['deletecomment'] ) )
|
||||
$action = 'deletecomment';
|
||||
|
||||
if ( 'cdc' == $action )
|
||||
$action = 'delete';
|
||||
elseif ( 'mac' == $action )
|
||||
$action = 'approve';
|
||||
|
||||
if ( isset( $_GET['dt'] ) ) {
|
||||
if ( 'spam' == $_GET['dt'] )
|
||||
$action = 'spam';
|
||||
elseif ( 'trash' == $_GET['dt'] )
|
||||
$action = 'trash';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display error message at bottom of comments.
|
||||
*
|
||||
* @param string $msg Error Message. Assumed to contain HTML and be sanitized.
|
||||
*/
|
||||
function comment_footer_die( $msg ) {
|
||||
echo "<div class='wrap'><p>$msg</p></div>";
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
die;
|
||||
}
|
||||
|
||||
switch( $action ) {
|
||||
|
||||
case 'editcomment' :
|
||||
$title = __('Edit Comment');
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .
|
||||
'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
wp_enqueue_script('comment');
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'javascript:history.go(-1)') );
|
||||
|
||||
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
||||
comment_footer_die( __('You are not allowed to edit this comment.') );
|
||||
|
||||
if ( 'trash' == $comment->comment_approved )
|
||||
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
|
||||
|
||||
$comment = get_comment_to_edit( $comment_id );
|
||||
|
||||
include( ABSPATH . 'wp-admin/edit-form-comment.php' );
|
||||
|
||||
break;
|
||||
|
||||
case 'delete' :
|
||||
case 'approve' :
|
||||
case 'trash' :
|
||||
case 'spam' :
|
||||
|
||||
$title = __('Moderate Comment');
|
||||
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
|
||||
if ( !$comment = get_comment_to_edit( $comment_id ) ) {
|
||||
wp_redirect( admin_url('edit-comments.php?error=1') );
|
||||
die();
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
|
||||
wp_redirect( admin_url('edit-comments.php?error=2') );
|
||||
die();
|
||||
}
|
||||
|
||||
// No need to re-approve/re-trash/re-spam a comment.
|
||||
if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) {
|
||||
wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
|
||||
die();
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
$formaction = $action . 'comment';
|
||||
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
|
||||
$nonce_action .= $comment_id;
|
||||
|
||||
?>
|
||||
<div class='wrap'>
|
||||
|
||||
<div class="narrow">
|
||||
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
|
||||
<?php
|
||||
switch ( $action ) {
|
||||
case 'spam' :
|
||||
$caution_msg = __('You are about to mark the following comment as spam:');
|
||||
$button = __('Spam Comment');
|
||||
break;
|
||||
case 'trash' :
|
||||
$caution_msg = __('You are about to move the following comment to the Trash:');
|
||||
$button = __('Trash Comment');
|
||||
break;
|
||||
case 'delete' :
|
||||
$caution_msg = __('You are about to delete the following comment:');
|
||||
$button = __('Permanently Delete Comment');
|
||||
break;
|
||||
default :
|
||||
$caution_msg = __('You are about to approve the following comment:');
|
||||
$button = __('Approve Comment');
|
||||
break;
|
||||
}
|
||||
|
||||
if ( $comment->comment_approved != '0' ) { // if not unapproved
|
||||
$message = '';
|
||||
switch ( $comment->comment_approved ) {
|
||||
case '1' :
|
||||
$message = __('This comment is currently approved.');
|
||||
break;
|
||||
case 'spam' :
|
||||
$message = __('This comment is currently marked as spam.');
|
||||
break;
|
||||
case 'trash' :
|
||||
$message = __('This comment is currently in the Trash.');
|
||||
break;
|
||||
}
|
||||
if ( $message )
|
||||
echo '<div class="updated"><p>' . $message . '</p></div>';
|
||||
}
|
||||
?>
|
||||
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
|
||||
|
||||
<table class="form-table comment-ays">
|
||||
<tr class="alt">
|
||||
<th scope="row"><?php _e('Author'); ?></th>
|
||||
<td><?php echo $comment->comment_author; ?></td>
|
||||
</tr>
|
||||
<?php if ( $comment->comment_author_email ) { ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('E-mail'); ?></th>
|
||||
<td><?php echo $comment->comment_author_email; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ( $comment->comment_author_url ) { ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('URL'); ?></th>
|
||||
<td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row" valign="top"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
|
||||
<td><?php echo $comment->comment_content; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><?php _e('Are you sure you want to do this?'); ?></p>
|
||||
|
||||
<form action='comment.php' method='get'>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
|
||||
<td class="textright"><?php submit_button( $button, 'button' ); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field( $nonce_action ); ?>
|
||||
<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
|
||||
<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
|
||||
<input type='hidden' name='noredir' value='1' />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'deletecomment' :
|
||||
case 'trashcomment' :
|
||||
case 'untrashcomment' :
|
||||
case 'spamcomment' :
|
||||
case 'unspamcomment' :
|
||||
case 'approvecomment' :
|
||||
case 'unapprovecomment' :
|
||||
$comment_id = absint( $_REQUEST['c'] );
|
||||
|
||||
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
|
||||
check_admin_referer( 'approve-comment_' . $comment_id );
|
||||
else
|
||||
check_admin_referer( 'delete-comment_' . $comment_id );
|
||||
|
||||
$noredir = isset($_REQUEST['noredir']);
|
||||
|
||||
if ( !$comment = get_comment($comment_id) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>.', 'edit-comments.php') );
|
||||
if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
|
||||
$redir = wp_get_referer();
|
||||
elseif ( '' != wp_get_original_referer() && ! $noredir )
|
||||
$redir = wp_get_original_referer();
|
||||
elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) )
|
||||
$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
|
||||
else
|
||||
$redir = admin_url('edit-comments.php');
|
||||
|
||||
$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'deletecomment' :
|
||||
wp_delete_comment( $comment_id );
|
||||
$redir = add_query_arg( array('deleted' => '1'), $redir );
|
||||
break;
|
||||
case 'trashcomment' :
|
||||
wp_trash_comment($comment_id);
|
||||
$redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'untrashcomment' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$redir = add_query_arg( array('untrashed' => '1'), $redir );
|
||||
break;
|
||||
case 'spamcomment' :
|
||||
wp_spam_comment($comment_id);
|
||||
$redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'unspamcomment' :
|
||||
wp_unspam_comment($comment_id);
|
||||
$redir = add_query_arg( array('unspammed' => '1'), $redir );
|
||||
break;
|
||||
case 'approvecomment' :
|
||||
wp_set_comment_status( $comment_id, 'approve' );
|
||||
$redir = add_query_arg( array( 'approved' => 1 ), $redir );
|
||||
break;
|
||||
case 'unapprovecomment' :
|
||||
wp_set_comment_status( $comment_id, 'hold' );
|
||||
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
|
||||
break;
|
||||
}
|
||||
|
||||
wp_redirect( $redir );
|
||||
die;
|
||||
break;
|
||||
|
||||
case 'editedcomment' :
|
||||
|
||||
$comment_id = absint( $_POST['comment_ID'] );
|
||||
$comment_post_id = absint( $_POST['comment_post_ID'] );
|
||||
|
||||
check_admin_referer( 'update-comment_' . $comment_id );
|
||||
|
||||
edit_comment();
|
||||
|
||||
$location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
|
||||
|
||||
/**
|
||||
* Filter the URI the user is redirected to after editing a comment in the admin.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param string $location The URI the user will be redirected to.
|
||||
* @param int $comment_id The ID of the comment being edited.
|
||||
*/
|
||||
$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
|
||||
wp_redirect( $location );
|
||||
|
||||
exit();
|
||||
break;
|
||||
|
||||
default:
|
||||
wp_die( __('Unknown action.') );
|
||||
break;
|
||||
|
||||
} // end switch
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
190
sources/wp-admin/credits.php
Normal file
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
/**
|
||||
* Credits administration panel.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
$title = __( 'Credits' );
|
||||
|
||||
/**
|
||||
* Retrieve the contributor credits.
|
||||
*
|
||||
* @global string $wp_version The current WordPress version.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @return array A list of all of the contributors.
|
||||
*/
|
||||
function wp_credits() {
|
||||
global $wp_version;
|
||||
$locale = get_locale();
|
||||
|
||||
$results = get_site_transient( 'wordpress_credits_' . $locale );
|
||||
|
||||
if ( ! is_array( $results )
|
||||
|| ( isset( $results['data']['version'] ) && strpos( $wp_version, $results['data']['version'] ) !== 0 )
|
||||
) {
|
||||
$response = wp_remote_get( "http://api.wordpress.org/core/credits/1.1/?version=$wp_version&locale=$locale" );
|
||||
|
||||
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
|
||||
return false;
|
||||
|
||||
$results = json_decode( wp_remote_retrieve_body( $response ), true );
|
||||
|
||||
if ( ! is_array( $results ) )
|
||||
return false;
|
||||
|
||||
set_site_transient( 'wordpress_credits_' . $locale, $results, DAY_IN_SECONDS );
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the link to a contributor's WordPress.org profile page.
|
||||
*
|
||||
* @access private
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @param string &$display_name The contributor's display name, passed by reference.
|
||||
* @param string $user_name The contributor's username.
|
||||
* @param string $profiles URL to the contributor's WordPress.org profile page.
|
||||
* @return string A contributor's display name, hyperlinked to a WordPress.org profile page.
|
||||
*/
|
||||
function _wp_credits_add_profile_link( &$display_name, $username, $profiles ) {
|
||||
$display_name = '<a href="' . esc_url( sprintf( $profiles, $username ) ) . '">' . esc_html( $display_name ) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the link to an external library used in WordPress.
|
||||
*
|
||||
* @access private
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @param string &$data External library data, passed by reference.
|
||||
* @return string Link to the external library.
|
||||
*/
|
||||
function _wp_credits_build_object_link( &$data ) {
|
||||
$data = '<a href="' . esc_url( $data[1] ) . '">' . $data[0] . '</a>';
|
||||
}
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we’re okay with that.' ) ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="about.php" class="nav-tab">
|
||||
<?php _e( 'What’s New' ); ?>
|
||||
</a><a href="credits.php" class="nav-tab nav-tab-active">
|
||||
<?php _e( 'Credits' ); ?>
|
||||
</a><a href="freedoms.php" class="nav-tab">
|
||||
<?php _e( 'Freedoms' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
|
||||
$credits = wp_credits();
|
||||
|
||||
if ( ! $credits ) {
|
||||
echo '<p class="about-description">' . sprintf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
|
||||
'http://wordpress.org/about/',
|
||||
/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
|
||||
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ) . '</p>';
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
exit;
|
||||
}
|
||||
|
||||
echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
|
||||
|
||||
$gravatar = is_ssl() ? 'https://secure.gravatar.com/avatar/' : 'http://0.gravatar.com/avatar/';
|
||||
|
||||
foreach ( $credits['groups'] as $group_slug => $group_data ) {
|
||||
if ( $group_data['name'] ) {
|
||||
if ( 'Translators' == $group_data['name'] ) {
|
||||
// Considered a special slug in the API response. (Also, will never be returned for en_US.)
|
||||
$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
|
||||
} elseif ( isset( $group_data['placeholders'] ) ) {
|
||||
$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
|
||||
} else {
|
||||
$title = translate( $group_data['name'] );
|
||||
}
|
||||
|
||||
echo '<h4 class="wp-people-group">' . $title . "</h4>\n";
|
||||
}
|
||||
|
||||
if ( ! empty( $group_data['shuffle'] ) )
|
||||
shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
|
||||
|
||||
switch ( $group_data['type'] ) {
|
||||
case 'list' :
|
||||
array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
|
||||
echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
|
||||
break;
|
||||
case 'libraries' :
|
||||
array_walk( $group_data['data'], '_wp_credits_build_object_link' );
|
||||
echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
|
||||
break;
|
||||
default:
|
||||
$compact = 'compact' == $group_data['type'];
|
||||
$classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
|
||||
echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
|
||||
foreach ( $group_data['data'] as $person_data ) {
|
||||
echo '<li class="wp-person" id="wp-person-' . $person_data[2] . '">' . "\n\t";
|
||||
echo '<a href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">';
|
||||
$size = 'compact' == $group_data['type'] ? '30' : '60';
|
||||
echo '<img src="' . $gravatar . $person_data[1] . '?s=' . $size . '" class="gravatar" alt="' . esc_attr( $person_data[0] ) . '" /></a>' . "\n\t";
|
||||
echo '<a class="web" href="' . sprintf( $credits['data']['profiles'], $person_data[2] ) . '">' . $person_data[0] . "</a>\n\t";
|
||||
if ( ! $compact )
|
||||
echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
|
||||
echo "</li>\n";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<p class="clear"><?php printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
|
||||
/* translators: Url to the codex documentation on contributing to WordPress used on the credits page */
|
||||
__( 'http://codex.wordpress.org/Contributing_to_WordPress' ) ); ?></p>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
|
||||
return;
|
||||
|
||||
// These are strings returned by the API that we want to be translatable
|
||||
__( 'Project Leaders' );
|
||||
__( 'Extended Core Team' );
|
||||
__( 'Core Developers' );
|
||||
__( 'Recent Rockstars' );
|
||||
__( 'Core Contributors to WordPress %s' );
|
||||
__( 'Contributing Developers' );
|
||||
__( 'Cofounder, Project Lead' );
|
||||
__( 'Lead Developer' );
|
||||
__( 'User Experience Lead' );
|
||||
__( 'Core Developer' );
|
||||
__( 'Core Committer' );
|
||||
__( 'Guest Committer' );
|
||||
__( 'Developer' );
|
||||
__( 'Designer' );
|
||||
__( 'XML-RPC' );
|
||||
__( 'Internationalization' );
|
||||
__( 'External Libraries' );
|
||||
__( 'Icon Design' );
|
27
sources/wp-admin/css/color-picker-rtl.css
Normal file
|
@ -0,0 +1,27 @@
|
|||
.wp-color-result {
|
||||
margin: 0 0 6px 6px;
|
||||
padding-left: 0;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.wp-color-result:after {
|
||||
border-radius: 0 0 1px 1px;
|
||||
border-left: 0;
|
||||
border-right: 1px solid #bbb;
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.wp-color-result:hover {
|
||||
border-color: #aaa;
|
||||
}
|
||||
|
||||
.wp-color-result:hover:after {
|
||||
border-left: 0;
|
||||
border-right: 1px solid #999;
|
||||
}
|
||||
|
||||
.wp-picker-container .button {
|
||||
margin-left: 0;
|
||||
margin-right: 6px;
|
||||
}
|
1
sources/wp-admin/css/color-picker-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.wp-color-result{margin:0 0 6px 6px;padding-left:0;padding-right:30px}.wp-color-result:after{border-radius:0 0 1px 1px;border-left:0;border-right:1px solid #bbb;left:auto;right:0}.wp-color-result:hover{border-color:#aaa}.wp-color-result:hover:after{border-left:0;border-right:1px solid #999}.wp-picker-container .button{margin-left:0;margin-right:6px}
|
107
sources/wp-admin/css/color-picker.css
Normal file
|
@ -0,0 +1,107 @@
|
|||
.wp-color-picker {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.wp-picker-container .hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wp-color-result {
|
||||
background-color: #f9f9f9;
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 22px;
|
||||
margin: 0 6px 6px 0px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
vertical-align: bottom;
|
||||
display: inline-block;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.wp-color-result:after {
|
||||
background: #f3f3f3;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#f4f4f4));
|
||||
background-image: -webkit-linear-gradient(top, #fefefe, #f4f4f4);
|
||||
background-image: -moz-linear-gradient(top, #fefefe, #f4f4f4);
|
||||
background-image: -o-linear-gradient(top, #fefefe, #f4f4f4);
|
||||
background-image: linear-gradient(to bottom, #fefefe, #f4f4f4);
|
||||
color: #333;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
border-radius: 0 1px 1px 0;
|
||||
border-left: 1px solid #bbb;
|
||||
content: attr( title );
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
line-height: 22px;
|
||||
padding: 0 6px;
|
||||
position: relative;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.wp-color-result:hover {
|
||||
border-color: #aaa;
|
||||
-webkit-box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
|
||||
box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.1 );
|
||||
}
|
||||
|
||||
.wp-color-result:hover:after {
|
||||
color: #222;
|
||||
border-color: #aaa;
|
||||
border-left: 1px solid #999;
|
||||
}
|
||||
|
||||
.wp-color-result.wp-picker-open {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.wp-color-result.wp-picker-open:after {
|
||||
content: attr( data-current );
|
||||
}
|
||||
|
||||
.wp-picker-container, .wp-picker-container:active {
|
||||
display: inline-block;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.wp-color-result:focus {
|
||||
border-color: #888;
|
||||
-webkit-box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
|
||||
box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
|
||||
}
|
||||
|
||||
.wp-color-result:focus:after {
|
||||
border-color: #888;
|
||||
}
|
||||
|
||||
.wp-picker-open + .wp-picker-input-wrap {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.wp-picker-container .button {
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.wp-picker-container .iris-square-slider .ui-slider-handle:focus {
|
||||
background-color: #555
|
||||
}
|
||||
|
||||
.wp-picker-container .iris-picker {
|
||||
border-color: #dfdfdf;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
input[type="text"].iris-error {
|
||||
background-color: #ffebe8;
|
||||
border-color: #c00;
|
||||
color: #000;
|
||||
}
|
1
sources/wp-admin/css/color-picker.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.wp-color-picker{width:80px}.wp-picker-container .hidden{display:none}.wp-color-result{background-color:#f9f9f9;border:1px solid #bbb;border-radius:2px;cursor:pointer;display:inline-block;height:22px;margin:0 6px 6px 0;position:relative;top:1px;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;vertical-align:bottom;display:inline-block;padding-left:30px}.wp-color-result:after{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);color:#333;text-shadow:0 1px 0 #fff;border-radius:0 1px 1px 0;border-left:1px solid #bbb;content:attr(title);display:block;font-size:11px;line-height:22px;padding:0 6px;position:relative;right:0;text-align:center;top:0}.wp-color-result:hover{border-color:#aaa;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 1px rgba(0,0,0,.1)}.wp-color-result:hover:after{color:#222;border-color:#aaa;border-left:1px solid #999}.wp-color-result.wp-picker-open{top:0}.wp-color-result.wp-picker-open:after{content:attr(data-current)}.wp-picker-container,.wp-picker-container:active{display:inline-block;outline:0}.wp-color-result:focus{border-color:#888;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.2);box-shadow:0 1px 2px rgba(0,0,0,.2)}.wp-color-result:focus:after{border-color:#888}.wp-picker-open+.wp-picker-input-wrap{display:inline-block;vertical-align:top}.wp-picker-container .button{margin-left:6px}.wp-picker-container .iris-square-slider .ui-slider-handle:focus{background-color:#555}.wp-picker-container .iris-picker{border-color:#dfdfdf;margin-top:6px}input[type=text].iris-error{background-color:#ffebe8;border-color:#c00;color:#000}
|
2252
sources/wp-admin/css/colors-classic.css
Normal file
1
sources/wp-admin/css/colors-classic.min.css
vendored
Normal file
2141
sources/wp-admin/css/colors-fresh.css
Normal file
1
sources/wp-admin/css/colors-fresh.min.css
vendored
Normal file
77
sources/wp-admin/css/customize-controls-rtl.css
Normal file
|
@ -0,0 +1,77 @@
|
|||
#customize-header-actions .button-primary {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#customize-header-actions .spinner {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-control-radio input,
|
||||
.customize-control-checkbox input {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dropdowns
|
||||
*/
|
||||
.accordion-section .dropdown {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.accordion-section .dropdown-content {
|
||||
float: right;
|
||||
margin-right: 0px;
|
||||
margin-left: 16px;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow {
|
||||
right: auto;
|
||||
left: 0;
|
||||
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
border-width: 1px 0 1px 1px;
|
||||
-webkit-border-radius: 3px 0 0 3px;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow:after {
|
||||
right: auto;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Color Picker
|
||||
*/
|
||||
.customize-control-color .dropdown {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.accordion-section input[type="text"].color-picker-hex {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
/*
|
||||
* Image Picker
|
||||
*/
|
||||
.accordion-section .customize-control-image .actions {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.customize-control-image .library,
|
||||
.customize-control-image .actions,
|
||||
.accordion-section .customize-control-image .library ul,
|
||||
.accordion-section .customize-control-image .library li,
|
||||
.accordion-section .customize-control-image .library-content {
|
||||
float: right;
|
||||
}
|
1
sources/wp-admin/css/customize-controls-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
#customize-header-actions .button-primary{float:left}#customize-header-actions .spinner{float:left;margin-right:0;margin-left:4px}.customize-control{float:right}.customize-control-radio input,.customize-control-checkbox input{margin-right:0;margin-left:5px}.accordion-section .dropdown{float:right}.accordion-section .dropdown-content{float:right;margin-right:0;margin-left:16px;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow{right:auto;left:0;border-color:#ccc;border-style:solid;border-width:1px 0 1px 1px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-control .dropdown-arrow:after{right:auto;left:4px}.customize-control-color .dropdown{margin-right:0;margin-left:5px}.accordion-section input[type=text].color-picker-hex{direction:ltr}.accordion-section .customize-control-image .actions{text-align:left}.customize-control-image .library,.customize-control-image .actions,.accordion-section .customize-control-image .library ul,.accordion-section .customize-control-image .library li,.accordion-section .customize-control-image .library-content{float:right}
|
440
sources/wp-admin/css/customize-controls.css
Normal file
|
@ -0,0 +1,440 @@
|
|||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#customize-controls a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#customize-info .accordion-section-content {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#customize-info .preview-notice {
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#customize-info .theme-name {
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
display: block;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#customize-info .theme-screenshot {
|
||||
width: 258px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#customize-info .theme-description {
|
||||
margin-top: 1em;
|
||||
color: #777;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#customize-controls .submit {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#customize-theme-controls > ul,
|
||||
#customize-theme-controls .accordion-section-content {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#customize-header-actions .button-primary {
|
||||
float: right;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#customize-header-actions .spinner {
|
||||
margin-top: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.saving #customize-header-actions .spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
width: 100%;
|
||||
float: left;
|
||||
clear: both;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.customize-control-title {
|
||||
display: block;
|
||||
line-height: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.customize-control select,
|
||||
.customize-control input[type="text"],
|
||||
.customize-control input[type="radio"],
|
||||
.customize-control input[type="checkbox"],
|
||||
.customize-control-color .color-picker,
|
||||
.customize-control-checkbox label,
|
||||
.customize-control-upload div {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.customize-control input[type="text"] {
|
||||
width: 98%;
|
||||
line-height: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.customize-control select {
|
||||
min-width: 50%;
|
||||
max-width: 100%;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.customize-control-checkbox input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.customize-control-radio {
|
||||
padding: 5px 0 10px;
|
||||
}
|
||||
|
||||
.customize-control-radio .customize-control-title {
|
||||
margin-bottom: 0;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-radio label {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.customize-control-radio input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#customize-preview iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#customize-theme-controls .accordion-section-title:hover:after,
|
||||
#customize-theme-controls .accordion-section-title:focus:after {
|
||||
border-color: #eee transparent;
|
||||
}
|
||||
|
||||
#customize-theme-controls .control-section:hover .accordion-section-title,
|
||||
#customize-theme-controls .control-section .accordion-section-title:hover,
|
||||
#customize-theme-controls .control-section.open .accordion-section-title,
|
||||
#customize-theme-controls .control-section .accordion-section-title:focus {
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 #333;
|
||||
background: #808080;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
|
||||
background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: linear-gradient(to top, #6d6d6d, #808080);
|
||||
border-left: 1px solid #808080;
|
||||
border-right: 1px solid #808080;
|
||||
}
|
||||
|
||||
#customize-theme-controls .control-section.accordion-section:hover,
|
||||
#customize-theme-controls .control-section.accordion-section.open {
|
||||
border-top-color: #808080;
|
||||
}
|
||||
|
||||
#customize-theme-controls .control-section.open .accordion-section-title {
|
||||
border-bottom: 1px solid #6d6d6d;
|
||||
}
|
||||
|
||||
/*
|
||||
* Style for custom settings
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dropdowns
|
||||
*/
|
||||
.accordion-section .dropdown {
|
||||
float: left;
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.accordion-section .dropdown-content {
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
min-width: 30px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
margin-right: 16px;
|
||||
padding: 4px 5px;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-border-radius: 3px 0 0 3px;
|
||||
border-radius: 3px 0 0 3px;
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 15px;
|
||||
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 1px 0;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow:after {
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: #ccc transparent;
|
||||
border-style: solid;
|
||||
border-width: 4px 4px 0 4px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -1px;
|
||||
right: 4px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.accordion-section .dropdown:hover .dropdown-content,
|
||||
.customize-control .dropdown:hover .dropdown-arrow {
|
||||
border-color: #aaa;
|
||||
}
|
||||
|
||||
.accordion-section .dropdown:hover .dropdown-arrow:after {
|
||||
border-color: #aaa transparent;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-status {
|
||||
display: none;
|
||||
max-width: 112px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/*
|
||||
* Color Picker
|
||||
*/
|
||||
.customize-control-color .color-picker-hex {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-color.open .color-picker-hex {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown {
|
||||
margin-right: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown .dropdown-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid rgba( 0, 0, 0, 0.15 );
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown:hover .dropdown-content {
|
||||
border-color: rgba( 0, 0, 0, 0.25 );
|
||||
}
|
||||
|
||||
.accordion-section input[type="text"].color-picker-hex {
|
||||
width: 65px;
|
||||
font-family: monospace;
|
||||
text-align: center;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
/* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
|
||||
.accordion-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
.accordion-section input[type="text"].color-picker-hex:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/*
|
||||
* Image Picker
|
||||
*/
|
||||
.customize-control-image .library,
|
||||
.customize-control-image .actions {
|
||||
display: none;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-image.open .library,
|
||||
.customize-control-image.open .actions {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .dropdown-content {
|
||||
height: auto;
|
||||
min-height: 24px;
|
||||
min-width: 40px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .dropdown-status {
|
||||
padding: 4px 5px;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .preview-thumbnail img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 122px;
|
||||
max-height: 98px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .actions {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library ul {
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
float: left;
|
||||
width: 100%;
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library li {
|
||||
color: #999;
|
||||
float: left;
|
||||
padding: 3px 5px;
|
||||
margin: 0;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
border-width: 1px 1px 0 1px;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library li.library-selected {
|
||||
margin-bottom: -1px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
color: #777;
|
||||
background: #fdfdfd;
|
||||
border-color: #dfdfdf;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0 ;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library-content {
|
||||
display: none;
|
||||
width: 100%;
|
||||
float: left;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library-content.library-selected {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library .thumbnail {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library .thumbnail:hover img {
|
||||
border-color: #21759b;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-image .library .thumbnail img {
|
||||
display: block;
|
||||
max-width: 90%;
|
||||
max-height: 80px;
|
||||
|
||||
margin: 5px auto;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-upload .upload-fallback,
|
||||
.accordion-section .customize-control-image .upload-fallback {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-upload .upload-dropzone,
|
||||
.accordion-section .customize-control-image .upload-dropzone {
|
||||
display: none;
|
||||
padding: 15px 10px;
|
||||
border: 3px dashed #dfdfdf;
|
||||
margin: 5px auto;
|
||||
text-align: center;
|
||||
color: #777;
|
||||
position: relative;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop,
|
||||
.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop {
|
||||
display: block;
|
||||
-webkit-transition: border-color 0.1s;
|
||||
-moz-transition: border-color 0.1s;
|
||||
-ms-transition: border-color 0.1s;
|
||||
-o-transition: border-color 0.1s;
|
||||
transition: border-color 0.1s;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-upload .library ul li,
|
||||
.accordion-section .customize-control-image .library ul li {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
|
||||
.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
|
||||
border-color: #83b4d8;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS can't scroll iframes,
|
||||
* instead it expands the iframe size to match the size of the content
|
||||
*/
|
||||
.ios .wp-full-overlay {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ios #customize-preview {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ios #customize-controls .wp-full-overlay-sidebar-content {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle cheaters.
|
||||
*/
|
||||
body.cheatin {
|
||||
min-width: 0;
|
||||
background: #f9f9f9;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
body.cheatin p {
|
||||
max-width: 700px;
|
||||
margin: 0 auto;
|
||||
padding: 2em;
|
||||
font-size: 14px;
|
||||
background: #fff;
|
||||
border: 1px solid #dfdfdf;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
1
sources/wp-admin/css/customize-controls.min.css
vendored
Normal file
52
sources/wp-admin/css/farbtastic.css
Normal file
|
@ -0,0 +1,52 @@
|
|||
|
||||
.farbtastic {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.farbtastic * {
|
||||
position: absolute;
|
||||
cursor: crosshair;
|
||||
}
|
||||
|
||||
.farbtastic,
|
||||
.farbtastic .wheel {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
}
|
||||
|
||||
.farbtastic .color,
|
||||
.farbtastic .overlay {
|
||||
top: 47px;
|
||||
left: 47px;
|
||||
width: 101px;
|
||||
height: 101px;
|
||||
}
|
||||
|
||||
.farbtastic .wheel {
|
||||
background: url(../images/wheel.png) no-repeat;
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
}
|
||||
|
||||
.farbtastic .overlay {
|
||||
background: url(../images/mask.png) no-repeat;
|
||||
}
|
||||
|
||||
.farbtastic .marker {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
margin: -8px 0 0 -8px;
|
||||
overflow: hidden;
|
||||
background: url(../images/marker.png) no-repeat;
|
||||
}
|
||||
|
||||
/* farbtastic-rtl */
|
||||
.rtl .farbtastic .color,
|
||||
.rtl .farbtastic .overlay {
|
||||
left: 0;
|
||||
right: 47px;
|
||||
}
|
||||
|
||||
.rtl .farbtastic .marker {
|
||||
margin: -8px -8px 0 0;
|
||||
}
|
236
sources/wp-admin/css/ie-rtl.css
Normal file
|
@ -0,0 +1,236 @@
|
|||
|
||||
body {
|
||||
direction: rtl;
|
||||
width: 99.5%;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback {
|
||||
left: auto;
|
||||
right: 0;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback,
|
||||
.rtl #adminmenuwrap {
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
|
||||
#plupload-upload-ui {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.post-com-count-wrapper a.post-com-count {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu ul {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu .wp-submenu,
|
||||
#adminmenu .wp-menu-open .wp-submenu .wp-submenu {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu {
|
||||
right: 30px;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
|
||||
padding: 3px 10px 4px 4px;
|
||||
}
|
||||
|
||||
div.quicktags-toolbar input {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.title {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.input-text-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
p.search-box {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#bh {
|
||||
margin: 7px 10px 0 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.postbox div.inside,
|
||||
.wp-editor-wrap .wp-editor-container .wp-editor-area,
|
||||
#nav-menu-theme-locations .howto select {
|
||||
width: 97.5%;
|
||||
}
|
||||
|
||||
/* without this dashboard widgets appear in one column for some screen widths */
|
||||
div#dashboard-widgets {
|
||||
padding-right: 0;
|
||||
padding-left: 1px;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
/* ---------- add by navid */
|
||||
#TB_window {
|
||||
width: 670px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-right: 335px !important;
|
||||
}
|
||||
|
||||
#dashboard_plugins {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
#dashboard_plugins h3.hndle {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
#dashboard_incoming_links ul li,
|
||||
#dashboard_secondary ul li,
|
||||
#dashboard_primary ul li,
|
||||
p.row-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#post-status-info {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
p.submit { /* quick edit and reply in edit-comments.php */
|
||||
height:22px;
|
||||
}
|
||||
|
||||
.available-theme .action-links li {
|
||||
padding-left: 7px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
form#widgets-filter { /* fix widget page */
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* nav menus
|
||||
.menu-max-depth-0 #menu-management { width: 460px; }
|
||||
.menu-max-depth-1 #menu-management { width: 490px; }
|
||||
.menu-max-depth-2 #menu-management { width: 520px; }
|
||||
.menu-max-depth-3 #menu-management { width: 550px; }
|
||||
.menu-max-depth-4 #menu-management { width: 580px; }
|
||||
.menu-max-depth-5 #menu-management { width: 610px; }
|
||||
.menu-max-depth-6 #menu-management { width: 640px; }
|
||||
.menu-max-depth-7 #menu-management { width: 670px; }
|
||||
.menu-max-depth-8 #menu-management { width: 700px; }
|
||||
.menu-max-depth-9 #menu-management { width: 730px; }
|
||||
.menu-max-depth-10 #menu-management { width: 760px; }
|
||||
.menu-max-depth-11 #menu-management { width: 790px; }
|
||||
*/
|
||||
.menu-item-depth-0 { margin-left: 0px; }
|
||||
.menu-item-depth-1 { margin-left: -30px; }
|
||||
.menu-item-depth-2 { margin-left: -60px; }
|
||||
.menu-item-depth-3 { margin-left: -90px; }
|
||||
.menu-item-depth-4 { margin-left: -120px; }
|
||||
.menu-item-depth-5 { margin-left: -150px; }
|
||||
.menu-item-depth-6 { margin-left: -180px; }
|
||||
.menu-item-depth-7 { margin-left: -210px; }
|
||||
.menu-item-depth-8 { margin-left: -240px; }
|
||||
.menu-item-depth-9 { margin-left: -270px; }
|
||||
.menu-item-depth-10 { margin-left: -300px; }
|
||||
.menu-item-depth-11 { margin-left: -330px; }
|
||||
|
||||
/*
|
||||
#menu-to-edit li dl {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport {
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport .menu-item-transport {
|
||||
margin-top: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
#menu-management,
|
||||
.nav-menus-php .menu-edit,
|
||||
#nav-menu-header .submitbox {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.nav-menus-php label {
|
||||
max-width: 90% !important;
|
||||
}
|
||||
|
||||
p.button-controls,
|
||||
.nav-menus-php .tabs-panel {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.nav-menus-php .major-publishing-actions .publishing-action {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#wpbody #nav-menu-header label {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menu-header {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
#nav-menu-footer {
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
#update-nav-menu .publishing-action {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#nav-menus-frame #update-nav-menu .delete-action {
|
||||
margin-top: -25px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menu-to-edit li {
|
||||
margin-top: -10px;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
.sortable-placeholder {
|
||||
margin-top: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
margin-bottom: 13px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.auto-add-pages {
|
||||
clear: both;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menus-frame .open-label span {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#nav-menus-frame .delete-action {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#title-wrap #title-prompt-text {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.screen-reader-text {
|
||||
right: auto;
|
||||
text-indent: -1000em;
|
||||
}
|
1
sources/wp-admin/css/ie-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
body{direction:rtl;width:99.5%}.rtl #adminmenuback{left:auto;right:0;background-image:none}.rtl #adminmenuback,.rtl #adminmenuwrap{border-width:0 0 0 1px}#plupload-upload-ui{zoom:1}.post-com-count-wrapper a.post-com-count{float:none}#adminmenu .wp-submenu ul{width:99%}#adminmenu .wp-submenu .wp-submenu .wp-submenu,#adminmenu .wp-menu-open .wp-submenu .wp-submenu{border:1px solid #dfdfdf}.folded #adminmenu .wp-submenu{right:30px}#wpcontent #adminmenu .wp-submenu li.wp-submenu-head{padding:3px 10px 4px 4px}div.quicktags-toolbar input{min-width:0}.inline-edit-row fieldset label span.title{float:right}.inline-edit-row fieldset label span.input-text-wrap{margin-right:0}p.search-box{float:left}#bh{margin:7px 10px 0 0;float:left}.postbox div.inside,.wp-editor-wrap .wp-editor-container .wp-editor-area,#nav-menu-theme-locations .howto select{width:97.5%}div#dashboard-widgets{padding-right:0;padding-left:1px}.widefat th input{margin:0 5px 0 0}#TB_window{width:670px;position:absolute;top:50%;left:50%;margin-right:335px!important}#dashboard_plugins{direction:ltr}#dashboard_plugins h3.hndle{direction:rtl}#dashboard_incoming_links ul li,#dashboard_secondary ul li,#dashboard_primary ul li,p.row-actions{width:100%}#post-status-info{height:25px}p.submit{height:22px}.available-theme .action-links li{padding-left:7px;margin-left:7px}form#widgets-filter{position:static}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:-30px}.menu-item-depth-2{margin-left:-60px}.menu-item-depth-3{margin-left:-90px}.menu-item-depth-4{margin-left:-120px}.menu-item-depth-5{margin-left:-150px}.menu-item-depth-6{margin-left:-180px}.menu-item-depth-7{margin-left:-210px}.menu-item-depth-8{margin-left:-240px}.menu-item-depth-9{margin-left:-270px}.menu-item-depth-10{margin-left:-300px}.menu-item-depth-11{margin-left:-330px}#menu-management,.nav-menus-php .menu-edit,#nav-menu-header .submitbox{zoom:1}.nav-menus-php label{max-width:90%!important}p.button-controls,.nav-menus-php .tabs-panel{max-width:90%}.nav-menus-php .major-publishing-actions .publishing-action{float:none}#wpbody #nav-menu-header label{float:none}#nav-menu-header{margin-top:-10px}#nav-menu-footer{margin-bottom:-20px}#update-nav-menu .publishing-action{max-width:200px}#nav-menus-frame #update-nav-menu .delete-action{margin-top:-25px;float:left}#menu-to-edit li{margin-top:-10px;margin-bottom:-10px}.sortable-placeholder{margin-top:0!important;margin-left:0!important;margin-bottom:13px!important;padding:0!important}.auto-add-pages{clear:both;float:none}#nav-menus-frame .open-label span{float:none;display:inline-block}#nav-menus-frame .delete-action{float:none}#title-wrap #title-prompt-text{right:0}.screen-reader-text{right:auto;text-indent:-1000em}
|
622
sources/wp-admin/css/ie.css
Normal file
|
@ -0,0 +1,622 @@
|
|||
/* Fixes for IE 7 bugs */
|
||||
|
||||
#dashboard-widgets form .input-text-wrap input,
|
||||
#dashboard-widgets form .textarea-wrap textarea {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#dashboard-widgets form #title {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#post-body.columns-2 #postbox-container-1 {
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
.welcome-panel .wp-badge {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column:first-child {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
#wp-fullscreen-title {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#wp_mce_fullscreen_ifr {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
#wp-fullscreen-tagline {
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#adminmenushadow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#adminmenuback {
|
||||
left: 0;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#adminmenuwrap {
|
||||
position: static;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#adminmenu,
|
||||
#adminmenu a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-menu-separator,
|
||||
#adminmenu li.wp-menu-separator-last {
|
||||
font-size: 1px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#adminmenu a.menu-top {
|
||||
border-bottom: 0 none;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#adminmenu .separator {
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu {
|
||||
border-top-color: transparent;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu-head {
|
||||
border-top-color: #ddd;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu ul {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top {
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-menu-arrow {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.js.folded #adminmenu li.menu-top {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
ul#adminmenu {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top a.menu-top {
|
||||
min-width: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu .wp-submenu li {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#collapse-menu {
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
#wpadminbar .ab-comments-icon {
|
||||
padding-top: 7px;
|
||||
}
|
||||
|
||||
table.fixed th,
|
||||
table.fixed td {
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#wpbody-content input.button,
|
||||
#wpbody-content input.button-primary,
|
||||
#wpbody-content input.button-secondary {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 a {
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
#dashboard_browser_nag {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#dashboard_browser_nag .browser-icon {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tablenav-pages .current-page {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#wpbody-content .postbox {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#wpbody-content .postbox h3 {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.major-publishing-actions,
|
||||
.wp-submenu,
|
||||
.wp-submenu li,
|
||||
#template,
|
||||
#template div,
|
||||
#editcat,
|
||||
#addcat {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.wp-menu-arrow {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.submitbox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Inline Editor */
|
||||
#wpbody-content .quick-edit-row-post .inline-edit-col-left {
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row-post .inline-edit-col-center {
|
||||
width: 19%;
|
||||
}
|
||||
|
||||
#wpbody-content .quick-edit-row-page .inline-edit-col-left {
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
#wpbody-content .bulk-edit-row .inline-edit-col-left {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
.inline-edit-row p.submit {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.title {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 5em;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.input-text-wrap {
|
||||
margin-left: 0;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row .input-text-wrap input {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
|
||||
width: 8em;
|
||||
}
|
||||
/* end Inline Editor */
|
||||
|
||||
#titlediv #title {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
.button,
|
||||
input[type="reset"],
|
||||
input[type="button"],
|
||||
input[type="submit"] {
|
||||
padding: 0 8px;
|
||||
line-height: 20px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.button.button-large,
|
||||
input[type="reset"].button-large,
|
||||
input[type="button"].button-large,
|
||||
input[type="submit"].button-large {
|
||||
padding: 0 10px;
|
||||
line-height: 24px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.button.button-small,
|
||||
input[type="reset"].button-small,
|
||||
input[type="button"].button-small,
|
||||
input[type="submit"].button-small {
|
||||
padding: 0 6px;
|
||||
line-height: 16px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
a.button {
|
||||
margin: 1px;
|
||||
padding: 1px 9px 2px;
|
||||
}
|
||||
|
||||
a.button.button-large {
|
||||
padding: 1px 11px 2px;
|
||||
}
|
||||
|
||||
a.button.button-small {
|
||||
padding: 1px 7px 2px;
|
||||
}
|
||||
|
||||
#screen-options-wrap {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
#post-status-info,
|
||||
#wpwrap,
|
||||
#wrap,
|
||||
#postdivrich,
|
||||
#postdiv,
|
||||
#poststuff,
|
||||
.metabox-holder,
|
||||
#titlediv,
|
||||
#post-body,
|
||||
#editorcontainer,
|
||||
.tablenav,
|
||||
.widget-liquid-left,
|
||||
.widget-liquid-right,
|
||||
#widgets-left,
|
||||
.widgets-sortables,
|
||||
#dragHelper,
|
||||
.widget .widget-top,
|
||||
.widget-control-actions,
|
||||
.tagchecklist,
|
||||
#col-container,
|
||||
#col-left,
|
||||
#col-right,
|
||||
.fileedit-sub {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
p.search-box {
|
||||
position: static;
|
||||
float: right;
|
||||
margin: -3px 0 4px;
|
||||
}
|
||||
|
||||
#widget-list .widget,
|
||||
.feature-filter .feature-group li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li input {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#editorcontainer #content {
|
||||
overflow: auto;
|
||||
margin: auto;
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
form#template div {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wp-editor-container .quicktags-toolbar input {
|
||||
overflow: visible;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#poststuff h2 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
#poststuff .inside #parent_id,
|
||||
#poststuff .inside #page_template,
|
||||
.inline-edit-row #post_parent,
|
||||
.inline-edit-row select[name="page_template"] {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#submitdiv input,
|
||||
#submitdiv select,
|
||||
#submitdiv a.button {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#bh {
|
||||
margin: 7px 10px 0 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* without this dashboard widgets appear in one column for some screen widths */
|
||||
div#dashboard-widgets {
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.tagchecklist span, .tagchecklist span a {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tablenav .button-secondary,
|
||||
.nav .button-secondary {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.tablenav select {
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.tablenav .actions select {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.subsubsub li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
a.post-state-format {
|
||||
text-indent: 0;
|
||||
line-height: 0;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
table.ie-fixed {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.widefat tr,
|
||||
.widefat th {
|
||||
margin-bottom: 0;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 5px;
|
||||
}
|
||||
|
||||
.widefat thead .check-column,
|
||||
.widefat tfoot .check-column {
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column,
|
||||
.media.widefat tbody th.check-column {
|
||||
padding: 4px 0 0;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.tablenav a.button-secondary {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.inactive-sidebar .widgets-sortables {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
#available-widgets .widget-holder {
|
||||
padding-bottom: 65px;
|
||||
}
|
||||
|
||||
#widgets-left .inactive {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
.inactive-sidebar .widget {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inactive-sidebar .widget {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#wpcontent .button-primary-disabled {
|
||||
color: #9FD0D5;
|
||||
background: #298CBA;
|
||||
}
|
||||
|
||||
#the-comment-list .unapproved tr,
|
||||
#the-comment-list .unapproved td {
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
.imgedit-submit {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#nav-menus-frame,
|
||||
#wpbody,
|
||||
.menu li {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#update-nav-menu #post-body {
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.menu li {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.menu li.sortable-placeholder {
|
||||
min-width: 400px;
|
||||
}
|
||||
|
||||
.available-theme {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.available-theme ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.available-theme .action-links li {
|
||||
padding-right: 7px;
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.about-wrap .three-col.about-updates .col-2 {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.about-wrap .about-password-meter input {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
.revisions-tickmarks,
|
||||
.revisions-tooltip {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.revisions.pinned .revisions-controls {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* IE6 leftovers */
|
||||
* html .row-actions {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left,
|
||||
* html div.widget-liquid-right {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
* html #editorcontainer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
* html #poststuff h2 {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
* html .stuffbox,
|
||||
* html .stuffbox input,
|
||||
* html .stuffbox textarea {
|
||||
border: 1px solid #DFDFDF;
|
||||
}
|
||||
|
||||
* html .feature-filter .feature-group li {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
* html .widgets-sortables {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
* html a#content_resize {
|
||||
right: -2px;
|
||||
}
|
||||
|
||||
* html .widget-title h4 {
|
||||
width: 205px;
|
||||
}
|
||||
|
||||
* html #removing-widget .in-widget-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
* html .media-item .pinkynail {
|
||||
height: 32px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
* html .describe .field input.text,
|
||||
* html .describe .field textarea {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
* html input {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
* html .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
* html .postbox-container .meta-box-sortables {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
* html #wpbody-content #screen-options-link-wrap {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* html #wpbody-content #contextual-help-link-wrap {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* html #adminmenu {
|
||||
margin-left: -80px;
|
||||
}
|
||||
|
||||
* html .folded #adminmenu {
|
||||
margin-left: -22px;
|
||||
}
|
||||
|
||||
* html #wpcontent #adminmenu li.menu-top {
|
||||
display: inline;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* html #wpfooter {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* html #adminmenu div.wp-menu-image {
|
||||
height: 29px;
|
||||
}
|
1
sources/wp-admin/css/ie.min.css
vendored
Normal file
263
sources/wp-admin/css/install.css
Normal file
|
@ -0,0 +1,263 @@
|
|||
html {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: sans-serif;
|
||||
margin: 2em auto;
|
||||
padding: 1em 2em;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #dfdfdf;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #21759b;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 30px 0 0 0;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
p, li, dd, dt {
|
||||
padding-bottom: 2px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
code, .code {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
ul, ol, dl {
|
||||
padding: 5px 5px 5px 22px;
|
||||
}
|
||||
|
||||
a img {
|
||||
border:0
|
||||
}
|
||||
abbr {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
#logo {
|
||||
margin: 6px 0 14px 0;
|
||||
border-bottom: none;
|
||||
text-align:center
|
||||
}
|
||||
#logo a {
|
||||
background-image: url('../images/wordpress-logo.png?ver=20120216');
|
||||
background-size: 274px 63px;
|
||||
background-position: top center;
|
||||
background-repeat: no-repeat;
|
||||
height: 67px;
|
||||
text-indent: -9999px;
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
}
|
||||
@media print,
|
||||
(-o-min-device-pixel-ratio: 5/4),
|
||||
(-webkit-min-device-pixel-ratio: 1.25),
|
||||
(min-resolution: 120dpi) {
|
||||
#logo a {
|
||||
background-image: url('../images/wordpress-logo-2x.png?ver=20120412');
|
||||
background-size: 274px 63px;
|
||||
}
|
||||
}
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
.step, th {
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
}
|
||||
.step .button-large {
|
||||
font-size: 14px;
|
||||
}
|
||||
textarea {
|
||||
border: 1px solid #dfdfdf;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 14px;
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
padding: 16px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 140px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
border: 1px #dfdfdf solid;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.form-table input[type=text],
|
||||
.form-table input[type=password] {
|
||||
width: 206px;
|
||||
}
|
||||
|
||||
.form-table th p {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.form-table.install-success td {
|
||||
vertical-align: middle;
|
||||
padding: 16px 20px 10px 0;
|
||||
}
|
||||
|
||||
.form-table.install-success td p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table.install-success td code {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#error-page {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
#error-page p {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code, .code {
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
}
|
||||
|
||||
#pass-strength-result {
|
||||
background-color: #eee;
|
||||
border-color: #ddd !important;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 5px 5px 5px 0;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#pass-strength-result.bad {
|
||||
background-color: #ffb78c;
|
||||
border-color: #ff853c !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.good {
|
||||
background-color: #ffec8b;
|
||||
border-color: #ffcc00 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.short {
|
||||
background-color: #ffa0a0;
|
||||
border-color: #f04040 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.strong {
|
||||
background-color: #c3ff88;
|
||||
border-color: #8dff1c !important;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: 1px solid #c00;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
padding: 0.5em 0.7em;
|
||||
margin: 5px 0 15px;
|
||||
background-color: #ffebe8;
|
||||
}
|
||||
|
||||
/* install-rtl */
|
||||
body.rtl {
|
||||
font-family: Tahoma, arial;
|
||||
}
|
||||
|
||||
.rtl h1 {
|
||||
font-family: arial;
|
||||
margin: 5px -4px 0 0;
|
||||
}
|
||||
|
||||
.rtl ul,
|
||||
.rtl ol {
|
||||
padding: 5px 22px 5px 5px;
|
||||
}
|
||||
|
||||
.rtl .step,
|
||||
.rtl th,
|
||||
.rtl .form-table th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .submit input,
|
||||
.rtl .button,
|
||||
.rtl .button-secondary {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.rtl #dbname,
|
||||
.rtl #uname,
|
||||
.rtl #pwd,
|
||||
.rtl #dbhost,
|
||||
.rtl #prefix,
|
||||
.rtl #user_login,
|
||||
.rtl #admin_email,
|
||||
.rtl #pass1,
|
||||
.rtl #pass2 {
|
||||
direction: ltr;
|
||||
}
|
1
sources/wp-admin/css/install.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
html{background:#f9f9f9}body{background:#fff;color:#333;font-family:sans-serif;margin:2em auto;padding:1em 2em;-webkit-border-radius:3px;border-radius:3px;border:1px solid #dfdfdf;max-width:700px}a{color:#21759b;text-decoration:none}a:hover{color:#d54e21}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:30px 0 0;padding:0;padding-bottom:7px}h2{font-size:16px}p,li,dd,dt{padding-bottom:2px;font-size:14px;line-height:1.5}code,.code{font-size:14px}ul,ol,dl{padding:5px 5px 5px 22px}a img{border:0}abbr{border:0;font-variant:normal}#logo{margin:6px 0 14px;border-bottom:0;text-align:center}#logo a{background-image:url(../images/wordpress-logo.png?ver=20120216);background-size:274px 63px;background-position:top center;background-repeat:no-repeat;height:67px;text-indent:-9999px;outline:0;overflow:hidden;display:block}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#logo a{background-image:url(../images/wordpress-logo-2x.png?ver=20120412);background-size:274px 63px}}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.step .button-large{font-size:14px}textarea{border:1px solid #dfdfdf;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif;width:695px}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 20px 10px 0;border-bottom:8px solid #fff;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:left;padding:16px 20px 10px 0;border-bottom:8px solid #fff;width:140px;vertical-align:top}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:2px;border:1px #dfdfdf solid;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif}.form-table input[type=text],.form-table input[type=password]{width:206px}.form-table th p{font-weight:400}.form-table.install-success td{vertical-align:middle;padding:16px 20px 10px 0}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 0;padding:5px;text-align:center;width:200px;display:none}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}.message{border:1px solid #c00;-webkit-border-radius:3px;border-radius:3px;padding:.5em .7em;margin:5px 0 15px;background-color:#ffebe8}body.rtl{font-family:Tahoma,arial}.rtl h1{font-family:arial;margin:5px -4px 0 0}.rtl ul,.rtl ol{padding:5px 22px 5px 5px}.rtl .step,.rtl th,.rtl .form-table th{text-align:right}.rtl .submit input,.rtl .button,.rtl .button-secondary{margin-right:0}.rtl #dbname,.rtl #uname,.rtl #pwd,.rtl #dbhost,.rtl #prefix,.rtl #user_login,.rtl #admin_email,.rtl #pass1,.rtl #pass2{direction:ltr}
|
71
sources/wp-admin/css/media-rtl.css
Normal file
|
@ -0,0 +1,71 @@
|
|||
body#media-upload ul#sidemenu {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
#search-filter {
|
||||
text-align: left;
|
||||
}
|
||||
/* specific to the image upload form */
|
||||
.align .field label {
|
||||
padding: 0 23px 0 0;
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
|
||||
background-position: center right;
|
||||
}
|
||||
tr.image-size label {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
.file-error {
|
||||
margin: 0 50px 5px 0;
|
||||
}
|
||||
.progress {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.describe td {
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
#media-upload .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
.menu_order {
|
||||
float: left;
|
||||
}
|
||||
.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 0 5px 5px;
|
||||
}
|
||||
#gallery-settings .title, h3.media-title {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
margin-right: 0;
|
||||
margin-left: 15px;
|
||||
}
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
#sort-buttons {
|
||||
margin: 3px 0 -8px 25px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 0;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 0;
|
||||
margin-left: 25px;
|
||||
}
|
1
sources/wp-admin/css/media-rtl.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
body#media-upload ul#sidemenu{left:auto;right:0}#search-filter{text-align:left}.align .field label{padding:0 23px 0 0;margin:0 3px 0 1em}.image-align-none-label,.image-align-left-label,.image-align-center-label,.image-align-right-label{background-position:center right}tr.image-size label{margin:0 5px 0 0}.file-error{margin:0 50px 5px 0}.progress{left:auto;right:0}.describe td{padding:0 0 0 5px}#media-upload .describe th.label{text-align:right}.menu_order{float:left}.media-upload-form label.form-help,td.help,#media-upload p.help,#media-upload label.help{font-family:Tahoma,Arial}#gallery-settings #basic th.label{padding:5px 0 5px 5px}#gallery-settings .title,h3.media-title{font-family:Tahoma,Arial}#gallery-settings .describe th.label{text-align:right}#gallery-settings label,#gallery-settings legend{margin-right:0;margin-left:15px}#gallery-settings .align .field label{margin:0 3px 0 1em}#sort-buttons{margin:3px 0 -8px 25px;text-align:left}#sort-buttons #asc,#sort-buttons #showall{padding-left:0;padding-right:5px}#sort-buttons span{margin-right:0;margin-left:25px}
|
353
sources/wp-admin/css/media.css
Normal file
|
@ -0,0 +1,353 @@
|
|||
/* Styles for the media library iframe (not used on the Library screen) */
|
||||
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 5px 5px 0;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
float: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td.error {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload th.actions-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload a.wp-post-thumbnail {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
h4.media-sub-title {
|
||||
border-bottom: 1px solid #DADADA;
|
||||
font-size: 1.3em;
|
||||
margin: 12px;
|
||||
padding: 0 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings .title,
|
||||
h3.media-title,
|
||||
h4.media-sub-title {
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-weight: normal;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select option,
|
||||
#gallery-settings .describe td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1em 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
p.media-types {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
tr.not-image {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.not-image tr.not-image {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
table.not-image tr.image-only {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* HiDPI Displays
|
||||
*/
|
||||
@media print,
|
||||
(-o-min-device-pixel-ratio: 5/4),
|
||||
(-webkit-min-device-pixel-ratio: 1.25),
|
||||
(min-resolution: 120dpi) {
|
||||
|
||||
.image-align-none-label {
|
||||
background-image: url("../images/align-none-2x.png?ver=20120916");
|
||||
background-size: 21px 15px;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background-image: url("../images/align-left-2x.png?ver=20120916");
|
||||
background-size: 22px 15px;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background-image: url("../images/align-center-2x.png?ver=20120916");
|
||||
background-size: 21px 15px;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background-image: url("../images/align-right-2x.png?ver=20120916");
|
||||
background-size: 22px 15px;
|
||||
}
|
||||
}
|
1
sources/wp-admin/css/media.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
div#media-upload-header{margin:0;padding:5px 5px 0;font-weight:700;position:relative;border-bottom-width:1px;border-bottom-style:solid}body#media-upload ul#sidemenu{font-weight:400;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden}form{margin:1em}#search-filter{text-align:right}th{position:relative}.media-upload-form label.form-help,td.help{font-family:sans-serif;font-style:italic;font-weight:400}.media-upload-form p.help{margin:0;padding:0}.media-upload-form fieldset{width:100%;border:0;text-align:justify;margin:0 0 1em;padding:0}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left}tr.image-size td{width:460px}tr.image-size div.image-size-item{margin:0 0 5px}#library-form .progress,#gallery-form .progress,.insert-gallery,.describe.startopen,.describe.startclosed{display:none}.media-item .thumbnail{max-width:128px;max-height:128px}thead.media-item-info tr{background-color:transparent}.form-table thead.media-item-info{border:8px solid #fff}abbr.required{text-decoration:none;border:0}.describe label{display:inline}.describe td.error{padding:2px 8px}.describe td.A1{width:132px}.describe input[type=text],.describe textarea{width:460px;border-width:1px;border-style:solid}#media-upload p.ml-submit{padding:1em 0}#media-upload p.help,#media-upload label.help{font-family:sans-serif;font-style:italic;font-weight:400}#media-upload .ui-sortable .media-item{cursor:move}#media-upload tr.image-size{margin-bottom:1em;height:3em}#media-upload #filter{width:623px}#media-upload #filter .subsubsub{margin:8px 0}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto}#media-upload .del-attachment{display:none;margin:5px 0}.menu_order{float:right;font-size:11px;margin:10px 10px 0}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60)}#media-upload th.order-head{width:20%;text-align:center}#media-upload th.actions-head{width:25%;text-align:center}#media-upload a.wp-post-thumbnail{margin:0 20px}#media-upload .widefat{width:626px;border-style:solid solid none}.sorthelper{height:37px;width:623px;display:block}#gallery-settings th.label{width:160px}#gallery-settings #basic th.label{padding:5px 5px 5px 0}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA}h3.media-title{font-size:1.6em}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:400;color:#5A5A5A}#gallery-settings .describe td{vertical-align:middle;height:3em}#gallery-settings .describe th.label{padding-top:.5em;text-align:left}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default}#gallery-settings .describe select{width:15em}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px}#gallery-settings .align .field label{margin:0 1em 0 3px}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf}#gallery-settings select#columns{width:6em}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px}#sort-buttons a{text-decoration:none}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px}#sort-buttons span{margin-right:25px}p.media-types{margin:1em}tr.not-image{display:none}table.not-image tr.not-image{display:table-row}table.not-image tr.image-only{display:none}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.image-align-none-label{background-image:url(../images/align-none-2x.png?ver=20120916);background-size:21px 15px}.image-align-left-label{background-image:url(../images/align-left-2x.png?ver=20120916);background-size:22px 15px}.image-align-center-label{background-image:url(../images/align-center-2x.png?ver=20120916);background-size:21px 15px}.image-align-right-label{background-image:url(../images/align-right-2x.png?ver=20120916);background-size:22px 15px}}
|
2895
sources/wp-admin/css/wp-admin-rtl.css
Normal file
1
sources/wp-admin/css/wp-admin-rtl.min.css
vendored
Normal file
9424
sources/wp-admin/css/wp-admin.css
Normal file
1
sources/wp-admin/css/wp-admin.min.css
vendored
Normal file
428
sources/wp-admin/custom-background.php
Normal file
|
@ -0,0 +1,428 @@
|
|||
<?php
|
||||
/**
|
||||
* The custom background script.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/**
|
||||
* The custom background class.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
class Custom_Background {
|
||||
|
||||
/**
|
||||
* Callback for administration header.
|
||||
*
|
||||
* @var callback
|
||||
* @since 3.0.0
|
||||
* @access private
|
||||
*/
|
||||
var $admin_header_callback;
|
||||
|
||||
/**
|
||||
* Callback for header div.
|
||||
*
|
||||
* @var callback
|
||||
* @since 3.0.0
|
||||
* @access private
|
||||
*/
|
||||
var $admin_image_div_callback;
|
||||
|
||||
/**
|
||||
* Holds the page menu hook.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.0.0
|
||||
* @access private
|
||||
*/
|
||||
var $page = '';
|
||||
|
||||
/**
|
||||
* Constructor - Register administration header callback.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param callback $admin_header_callback
|
||||
* @param callback $admin_image_div_callback Optional custom image div output callback.
|
||||
* @return Custom_Background
|
||||
*/
|
||||
function __construct($admin_header_callback = '', $admin_image_div_callback = '') {
|
||||
$this->admin_header_callback = $admin_header_callback;
|
||||
$this->admin_image_div_callback = $admin_image_div_callback;
|
||||
|
||||
add_action( 'admin_menu', array( $this, 'init' ) );
|
||||
add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the hooks for the Custom Background admin page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
function init() {
|
||||
if ( ! current_user_can('edit_theme_options') )
|
||||
return;
|
||||
|
||||
$this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array($this, 'admin_page'));
|
||||
|
||||
add_action("load-$page", array($this, 'admin_load'));
|
||||
add_action("load-$page", array($this, 'take_action'), 49);
|
||||
add_action("load-$page", array($this, 'handle_upload'), 49);
|
||||
|
||||
if ( $this->admin_header_callback )
|
||||
add_action("admin_head-$page", $this->admin_header_callback, 51);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the enqueue for the CSS & JavaScript files.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
function admin_load() {
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '</p>' .
|
||||
'<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the “Choose Image” button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' .
|
||||
'<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. “#ff0000” for red, or by choosing a color using the color picker.' ) . '</p>' .
|
||||
'<p>' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script('custom-background');
|
||||
wp_enqueue_style('wp-color-picker');
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute custom background modification.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
function take_action() {
|
||||
|
||||
if ( empty($_POST) )
|
||||
return;
|
||||
|
||||
if ( isset($_POST['reset-background']) ) {
|
||||
check_admin_referer('custom-background-reset', '_wpnonce-custom-background-reset');
|
||||
remove_theme_mod('background_image');
|
||||
remove_theme_mod('background_image_thumb');
|
||||
$this->updated = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isset($_POST['remove-background']) ) {
|
||||
// @TODO: Uploaded files are not removed here.
|
||||
check_admin_referer('custom-background-remove', '_wpnonce-custom-background-remove');
|
||||
set_theme_mod('background_image', '');
|
||||
set_theme_mod('background_image_thumb', '');
|
||||
$this->updated = true;
|
||||
wp_safe_redirect( $_POST['_wp_http_referer'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isset($_POST['background-repeat']) ) {
|
||||
check_admin_referer('custom-background');
|
||||
if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) )
|
||||
$repeat = $_POST['background-repeat'];
|
||||
else
|
||||
$repeat = 'repeat';
|
||||
set_theme_mod('background_repeat', $repeat);
|
||||
}
|
||||
|
||||
if ( isset($_POST['background-position-x']) ) {
|
||||
check_admin_referer('custom-background');
|
||||
if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) )
|
||||
$position = $_POST['background-position-x'];
|
||||
else
|
||||
$position = 'left';
|
||||
set_theme_mod('background_position_x', $position);
|
||||
}
|
||||
|
||||
if ( isset($_POST['background-attachment']) ) {
|
||||
check_admin_referer('custom-background');
|
||||
if ( in_array($_POST['background-attachment'], array('fixed', 'scroll')) )
|
||||
$attachment = $_POST['background-attachment'];
|
||||
else
|
||||
$attachment = 'fixed';
|
||||
set_theme_mod('background_attachment', $attachment);
|
||||
}
|
||||
|
||||
if ( isset($_POST['background-color']) ) {
|
||||
check_admin_referer('custom-background');
|
||||
$color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['background-color']);
|
||||
if ( strlen($color) == 6 || strlen($color) == 3 )
|
||||
set_theme_mod('background_color', $color);
|
||||
else
|
||||
set_theme_mod('background_color', '');
|
||||
}
|
||||
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the custom background page.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
function admin_page() {
|
||||
?>
|
||||
<div class="wrap" id="custom-background">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Custom Background'); ?></h2>
|
||||
<?php if ( !empty($this->updated) ) { ?>
|
||||
<div id="message" class="updated">
|
||||
<p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if ( $this->admin_image_div_callback ) {
|
||||
call_user_func($this->admin_image_div_callback);
|
||||
} else {
|
||||
?>
|
||||
<h3><?php _e('Background Image'); ?></h3>
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Preview'); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
$background_styles = '';
|
||||
if ( $bgcolor = get_background_color() )
|
||||
$background_styles .= 'background-color: #' . $bgcolor . ';';
|
||||
|
||||
if ( get_background_image() ) {
|
||||
$background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) );
|
||||
// background-image URL must be single quote, see below
|
||||
$background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');'
|
||||
. ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';'
|
||||
. ' background-position: top ' . get_theme_mod('background_position_x', 'left');
|
||||
}
|
||||
?>
|
||||
<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
|
||||
<?php if ( get_background_image() ) { ?>
|
||||
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br />
|
||||
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ( get_background_image() ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Remove Image'); ?></th>
|
||||
<td>
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('custom-background-remove', '_wpnonce-custom-background-remove'); ?>
|
||||
<?php submit_button( __( 'Remove Background Image' ), 'button', 'remove-background', false ); ?><br/>
|
||||
<?php _e('This will remove the background image. You will not be able to restore any customizations.') ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
|
||||
<?php if ( $default_image && get_background_image() != $default_image ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Restore Original Image'); ?></th>
|
||||
<td>
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('custom-background-reset', '_wpnonce-custom-background-reset'); ?>
|
||||
<?php submit_button( __( 'Restore Original Image' ), 'button', 'reset-background', false ); ?><br/>
|
||||
<?php _e('This will restore the original background image. You will not be able to restore any customizations.') ?>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Select Image'); ?></th>
|
||||
<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post" action="">
|
||||
<p>
|
||||
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
|
||||
<input type="file" id="upload" name="import" />
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
|
||||
<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
|
||||
<a id="choose-from-library-link" class="button"
|
||||
data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>"
|
||||
data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></a>
|
||||
</p>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3><?php _e('Display Options') ?></h3>
|
||||
<form method="post" action="">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<?php if ( get_background_image() ) : ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Position' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend>
|
||||
<label>
|
||||
<input name="background-position-x" type="radio" value="left"<?php checked('left', get_theme_mod('background_position_x', 'left')); ?> />
|
||||
<?php _e('Left') ?>
|
||||
</label>
|
||||
<label>
|
||||
<input name="background-position-x" type="radio" value="center"<?php checked('center', get_theme_mod('background_position_x', 'left')); ?> />
|
||||
<?php _e('Center') ?>
|
||||
</label>
|
||||
<label>
|
||||
<input name="background-position-x" type="radio" value="right"<?php checked('right', get_theme_mod('background_position_x', 'left')); ?> />
|
||||
<?php _e('Right') ?>
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Repeat' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
|
||||
<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('No Repeat'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Horizontally'); ?></label>
|
||||
<label><input type="radio" name="background-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('Tile Vertically'); ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _ex( 'Attachment', 'Background Attachment' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend>
|
||||
<label>
|
||||
<input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'scroll')); ?> />
|
||||
<?php _e('Scroll') ?>
|
||||
</label>
|
||||
<label>
|
||||
<input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', 'scroll')); ?> />
|
||||
<?php _e('Fixed') ?>
|
||||
</label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<?php endif; // get_background_image() ?>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e( 'Background Color' ); ?></th>
|
||||
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
|
||||
<?php
|
||||
$default_color = '';
|
||||
if ( current_theme_supports( 'custom-background', 'default-color' ) )
|
||||
$default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
|
||||
?>
|
||||
<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color ?> />
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field('custom-background'); ?>
|
||||
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an Image upload for the background image.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
function handle_upload() {
|
||||
|
||||
if ( empty($_FILES) )
|
||||
return;
|
||||
|
||||
check_admin_referer('custom-background-upload', '_wpnonce-custom-background-upload');
|
||||
$overrides = array('test_form' => false);
|
||||
|
||||
$uploaded_file = $_FILES['import'];
|
||||
$wp_filetype = wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'], false );
|
||||
if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) )
|
||||
wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) );
|
||||
|
||||
$file = wp_handle_upload($uploaded_file, $overrides);
|
||||
|
||||
if ( isset($file['error']) )
|
||||
wp_die( $file['error'] );
|
||||
|
||||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$filename = basename($file);
|
||||
|
||||
// Construct the object array
|
||||
$object = array(
|
||||
'post_title' => $filename,
|
||||
'post_content' => $url,
|
||||
'post_mime_type' => $type,
|
||||
'guid' => $url,
|
||||
'context' => 'custom-background'
|
||||
);
|
||||
|
||||
// Save the data
|
||||
$id = wp_insert_attachment($object, $file);
|
||||
|
||||
// Add the meta-data
|
||||
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
||||
update_post_meta( $id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
|
||||
|
||||
set_theme_mod('background_image', esc_url_raw($url));
|
||||
|
||||
$thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
|
||||
set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
|
||||
|
||||
/** This action is documented in wp-admin/custom-header.php */
|
||||
do_action( 'wp_create_file_in_uploads', $file, $id ); // For replication
|
||||
$this->updated = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused since 3.5.0.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
function attachment_fields_to_edit( $form_fields ) {
|
||||
return $form_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unused since 3.5.0.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
function filter_upload_tabs( $tabs ) {
|
||||
return $tabs;
|
||||
}
|
||||
|
||||
public function wp_set_background_image() {
|
||||
if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
|
||||
$attachment_id = absint($_POST['attachment_id']);
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
$sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
|
||||
$size = 'thumbnail';
|
||||
if ( in_array( $_POST['size'], $sizes ) )
|
||||
$size = esc_attr( $_POST['size'] );
|
||||
|
||||
update_post_meta( $attachment_id, '_wp_attachment_is_custom_background', get_option('stylesheet' ) );
|
||||
$url = wp_get_attachment_image_src( $attachment_id, $size );
|
||||
$thumbnail = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
|
||||
set_theme_mod( 'background_image', esc_url_raw( $url[0] ) );
|
||||
set_theme_mod( 'background_image_thumb', esc_url_raw( $thumbnail[0] ) );
|
||||
exit;
|
||||
}
|
||||
}
|
1045
sources/wp-admin/custom-header.php
Normal file
243
sources/wp-admin/customize.php
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?php
|
||||
/**
|
||||
* Customize Controls
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Customize
|
||||
* @since 3.4.0
|
||||
*/
|
||||
|
||||
define( 'IFRAME_REQUEST', true );
|
||||
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
if ( ! current_user_can( 'edit_theme_options' ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
wp_reset_vars( array( 'url', 'return' ) );
|
||||
$url = urldecode( $url );
|
||||
$url = wp_validate_redirect( $url, home_url( '/' ) );
|
||||
if ( $return )
|
||||
$return = wp_validate_redirect( urldecode( $return ) );
|
||||
if ( ! $return )
|
||||
$return = $url;
|
||||
|
||||
global $wp_scripts, $wp_customize;
|
||||
|
||||
$registered = $wp_scripts->registered;
|
||||
$wp_scripts = new WP_Scripts;
|
||||
$wp_scripts->registered = $registered;
|
||||
|
||||
add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
|
||||
add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' );
|
||||
add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 );
|
||||
|
||||
/**
|
||||
* Fires when Customizer controls are initialized, before scripts are enqueued.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'customize_controls_init' );
|
||||
|
||||
wp_enqueue_script( 'customize-controls' );
|
||||
wp_enqueue_style( 'customize-controls' );
|
||||
|
||||
wp_enqueue_script( 'accordion' );
|
||||
|
||||
/**
|
||||
* Enqueue Customizer control scripts.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'customize_controls_enqueue_scripts' );
|
||||
|
||||
// Let's roll.
|
||||
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
||||
|
||||
wp_user_settings();
|
||||
_wp_admin_html_begin();
|
||||
|
||||
$body_class = 'wp-core-ui js';
|
||||
|
||||
if ( wp_is_mobile() ) :
|
||||
$body_class .= ' mobile';
|
||||
|
||||
?><meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=0.8, minimum-scale=0.5, maximum-scale=1.2"><?php
|
||||
endif;
|
||||
|
||||
$is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
|
||||
|
||||
if ( $is_ios )
|
||||
$body_class .= ' ios';
|
||||
|
||||
if ( is_rtl() )
|
||||
$body_class .= ' rtl';
|
||||
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
|
||||
|
||||
$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
|
||||
?><title><?php echo $admin_title; ?></title><?php
|
||||
|
||||
/**
|
||||
* Print Customizer control styles.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'customize_controls_print_styles' );
|
||||
|
||||
/**
|
||||
* Print Customizer control scripts.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'customize_controls_print_scripts' );
|
||||
?>
|
||||
</head>
|
||||
<body class="<?php echo esc_attr( $body_class ); ?>">
|
||||
<div class="wp-full-overlay expanded">
|
||||
<form id="customize-controls" class="wrap wp-full-overlay-sidebar">
|
||||
|
||||
<div id="customize-header-actions" class="wp-full-overlay-header">
|
||||
<?php
|
||||
$save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' );
|
||||
submit_button( $save_text, 'primary save', 'save', false );
|
||||
?>
|
||||
<span class="spinner"></span>
|
||||
<a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>">
|
||||
<?php _e( 'Cancel' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$screenshot = $wp_customize->theme()->get_screenshot();
|
||||
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
|
||||
?>
|
||||
|
||||
<div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1">
|
||||
<div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
|
||||
<div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
|
||||
<span class="preview-notice"><?php
|
||||
/* translators: %s is the theme name in the Customize/Live Preview pane */
|
||||
echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
|
||||
?></span>
|
||||
</div>
|
||||
<?php if ( ! $cannot_expand ) : ?>
|
||||
<div class="accordion-section-content">
|
||||
<?php if ( $screenshot ) : ?>
|
||||
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $wp_customize->theme()->get('Description') ): ?>
|
||||
<div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div id="customize-theme-controls"><ul>
|
||||
<?php
|
||||
foreach ( $wp_customize->sections() as $section )
|
||||
$section->maybe_render();
|
||||
?>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
||||
<div id="customize-footer-actions" class="wp-full-overlay-footer">
|
||||
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
|
||||
<span class="collapse-sidebar-arrow"></span>
|
||||
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
<div id="customize-preview" class="wp-full-overlay-main"></div>
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Print Customizer control scripts in the footer.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'customize_controls_print_footer_scripts' );
|
||||
|
||||
// If the frontend and the admin are served from the same domain, load the
|
||||
// preview over ssl if the customizer is being loaded over ssl. This avoids
|
||||
// insecure content warnings. This is not attempted if the admin and frontend
|
||||
// are on different domains to avoid the case where the frontend doesn't have
|
||||
// ssl certs. Domain mapping plugins can allow other urls in these conditions
|
||||
// using the customize_allowed_urls filter.
|
||||
|
||||
$allowed_urls = array( home_url('/') );
|
||||
$admin_origin = parse_url( admin_url() );
|
||||
$home_origin = parse_url( home_url() );
|
||||
$cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) );
|
||||
|
||||
if ( is_ssl() && ! $cross_domain )
|
||||
$allowed_urls[] = home_url( '/', 'https' );
|
||||
|
||||
/**
|
||||
* Filter the list of URLs allowed to be clicked and followed in the Customizer preview.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*
|
||||
* @param array $allowed_urls An array of allowed URLs.
|
||||
*/
|
||||
$allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );
|
||||
|
||||
$fallback_url = add_query_arg( array(
|
||||
'preview' => 1,
|
||||
'template' => $wp_customize->get_template(),
|
||||
'stylesheet' => $wp_customize->get_stylesheet(),
|
||||
'preview_iframe' => true,
|
||||
'TB_iframe' => 'true'
|
||||
), home_url( '/' ) );
|
||||
|
||||
$login_url = add_query_arg( array(
|
||||
'interim-login' => 1,
|
||||
'customize-login' => 1
|
||||
), wp_login_url() );
|
||||
|
||||
$settings = array(
|
||||
'theme' => array(
|
||||
'stylesheet' => $wp_customize->get_stylesheet(),
|
||||
'active' => $wp_customize->is_theme_active(),
|
||||
),
|
||||
'url' => array(
|
||||
'preview' => esc_url( $url ? $url : home_url( '/' ) ),
|
||||
'parent' => esc_url( admin_url() ),
|
||||
'activated' => admin_url( 'themes.php?activated=true&previewed' ),
|
||||
'ajax' => esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
|
||||
'allowed' => array_map( 'esc_url', $allowed_urls ),
|
||||
'isCrossDomain' => $cross_domain,
|
||||
'fallback' => $fallback_url,
|
||||
'home' => esc_url( home_url( '/' ) ),
|
||||
'login' => $login_url,
|
||||
),
|
||||
'browser' => array(
|
||||
'mobile' => wp_is_mobile(),
|
||||
'ios' => $is_ios,
|
||||
),
|
||||
'settings' => array(),
|
||||
'controls' => array(),
|
||||
'nonce' => array(
|
||||
'save' => wp_create_nonce( 'save-customize_' . $wp_customize->get_stylesheet() ),
|
||||
'preview' => wp_create_nonce( 'preview-customize_' . $wp_customize->get_stylesheet() )
|
||||
),
|
||||
);
|
||||
|
||||
foreach ( $wp_customize->settings() as $id => $setting ) {
|
||||
$settings['settings'][ $id ] = array(
|
||||
'value' => $setting->js_value(),
|
||||
'transport' => $setting->transport,
|
||||
);
|
||||
}
|
||||
|
||||
foreach ( $wp_customize->controls() as $id => $control ) {
|
||||
$control->to_json();
|
||||
$settings['controls'][ $id ] = $control->json;
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var _wpCustomizeSettings = <?php echo json_encode( $settings ); ?>;
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
255
sources/wp-admin/edit-comments.php
Normal file
|
@ -0,0 +1,255 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit Comments Administration Screen.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
if ( !current_user_can('edit_posts') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Comments_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$doaction = $wp_list_table->current_action();
|
||||
|
||||
if ( $doaction ) {
|
||||
check_admin_referer( 'bulk-comments' );
|
||||
|
||||
if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
|
||||
$comment_status = wp_unslash( $_REQUEST['comment_status'] );
|
||||
$delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] );
|
||||
$comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( isset( $_REQUEST['delete_comments'] ) ) {
|
||||
$comment_ids = $_REQUEST['delete_comments'];
|
||||
$doaction = ( $_REQUEST['action'] != -1 ) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
} elseif ( isset( $_REQUEST['ids'] ) ) {
|
||||
$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
|
||||
} elseif ( wp_get_referer() ) {
|
||||
wp_safe_redirect( wp_get_referer() );
|
||||
exit;
|
||||
}
|
||||
|
||||
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
|
||||
|
||||
$redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
|
||||
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
|
||||
|
||||
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
|
||||
if ( !current_user_can( 'edit_comment', $comment_id ) )
|
||||
continue;
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'approve' :
|
||||
wp_set_comment_status( $comment_id, 'approve' );
|
||||
$approved++;
|
||||
break;
|
||||
case 'unapprove' :
|
||||
wp_set_comment_status( $comment_id, 'hold' );
|
||||
$unapproved++;
|
||||
break;
|
||||
case 'spam' :
|
||||
wp_spam_comment( $comment_id );
|
||||
$spammed++;
|
||||
break;
|
||||
case 'unspam' :
|
||||
wp_unspam_comment( $comment_id );
|
||||
$unspammed++;
|
||||
break;
|
||||
case 'trash' :
|
||||
wp_trash_comment( $comment_id );
|
||||
$trashed++;
|
||||
break;
|
||||
case 'untrash' :
|
||||
wp_untrash_comment( $comment_id );
|
||||
$untrashed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_delete_comment( $comment_id );
|
||||
$deleted++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $approved )
|
||||
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
|
||||
if ( $unapproved )
|
||||
$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
|
||||
if ( $spammed )
|
||||
$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
|
||||
if ( $unspammed )
|
||||
$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
|
||||
if ( $trashed )
|
||||
$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
|
||||
if ( $untrashed )
|
||||
$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
|
||||
if ( $deleted )
|
||||
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
|
||||
if ( $trashed || $spammed )
|
||||
$redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );
|
||||
|
||||
wp_safe_redirect( $redirect_to );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
wp_enqueue_script('admin-comments');
|
||||
enqueue_comment_hotkeys_js();
|
||||
|
||||
if ( $post_id )
|
||||
$title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
|
||||
else
|
||||
$title = __('Comments');
|
||||
|
||||
add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.' ) . '</p>'
|
||||
) );
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'moderating-comments',
|
||||
'title' => __('Moderating Comments'),
|
||||
'content' =>
|
||||
'<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
|
||||
'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
|
||||
'<p>' . __( 'In the <strong>Comment</strong> column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site. Hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
|
||||
'<p>' . __( 'In the <strong>In Response To</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.' ) . '</p>' .
|
||||
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php
|
||||
if ( $post_id )
|
||||
echo sprintf( __( 'Comments on “%s”' ),
|
||||
sprintf( '<a href="%s">%s</a>',
|
||||
get_edit_post_link( $post_id ),
|
||||
wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' )
|
||||
)
|
||||
);
|
||||
else
|
||||
echo __('Comments');
|
||||
|
||||
if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
|
||||
echo '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '…' ) ) . '</span>'; ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset( $_REQUEST['error'] ) ) {
|
||||
$error = (int) $_REQUEST['error'];
|
||||
$error_msg = '';
|
||||
switch ( $error ) {
|
||||
case 1 :
|
||||
$error_msg = __( 'Oops, no comment with this ID.' );
|
||||
break;
|
||||
case 2 :
|
||||
$error_msg = __( 'You are not allowed to edit comments on this post.' );
|
||||
break;
|
||||
}
|
||||
if ( $error_msg )
|
||||
echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>';
|
||||
}
|
||||
|
||||
if ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) || isset($_REQUEST['spammed']) || isset($_REQUEST['unspammed']) || isset($_REQUEST['same']) ) {
|
||||
$approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
|
||||
$deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
|
||||
$trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
|
||||
$untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
|
||||
$spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
|
||||
$unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
|
||||
$same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
|
||||
|
||||
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
|
||||
if ( $approved > 0 )
|
||||
$messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
|
||||
|
||||
if ( $spammed > 0 ) {
|
||||
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
|
||||
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
|
||||
if ( $unspammed > 0 )
|
||||
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
|
||||
|
||||
if ( $trashed > 0 ) {
|
||||
$ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
|
||||
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
|
||||
if ( $untrashed > 0 )
|
||||
$messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed );
|
||||
|
||||
if ( $deleted > 0 )
|
||||
$messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
|
||||
|
||||
if ( $same > 0 && $comment = get_comment( $same ) ) {
|
||||
switch ( $comment->comment_approved ) {
|
||||
case '1' :
|
||||
$messages[] = __('This comment is already approved.') . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
|
||||
break;
|
||||
case 'trash' :
|
||||
$messages[] = __( 'This comment is already in the Trash.' ) . ' <a href="' . esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ) . '"> ' . __( 'View Trash' ) . '</a>';
|
||||
break;
|
||||
case 'spam' :
|
||||
$messages[] = __( 'This comment is already marked as spam.' ) . ' <a href="' . esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ) . '">' . __( 'Edit comment' ) . '</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo '<div id="moderated" class="updated"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php $wp_list_table->views(); ?>
|
||||
|
||||
<form id="comments-form" action="" method="get">
|
||||
|
||||
<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
|
||||
|
||||
<?php if ( $post_id ) : ?>
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
|
||||
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
|
||||
|
||||
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
|
||||
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
|
||||
<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
|
||||
|
||||
<?php if ( isset($_REQUEST['paged']) ) { ?>
|
||||
<input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<?php
|
||||
wp_comment_reply('-1', true, 'detail');
|
||||
wp_comment_trashnotice();
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
|
608
sources/wp-admin/edit-form-advanced.php
Normal file
|
@ -0,0 +1,608 @@
|
|||
<?php
|
||||
/**
|
||||
* Post advanced form for inclusion in the administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
wp_enqueue_script('post');
|
||||
|
||||
if ( wp_is_mobile() )
|
||||
wp_enqueue_script( 'jquery-touch-punch' );
|
||||
|
||||
/**
|
||||
* Post ID global
|
||||
* @name $post_ID
|
||||
* @var int
|
||||
*/
|
||||
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
|
||||
$user_ID = isset($user_ID) ? (int) $user_ID : 0;
|
||||
$action = isset($action) ? $action : '';
|
||||
|
||||
if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type, 'thumbnail') ) {
|
||||
add_thickbox();
|
||||
wp_enqueue_media( array( 'post' => $post_ID ) );
|
||||
}
|
||||
|
||||
// Add the local autosave notice HTML
|
||||
add_action( 'admin_footer', '_local_storage_notice' );
|
||||
|
||||
/*
|
||||
* @todo Document the $messages array(s).
|
||||
*/
|
||||
$messages = array();
|
||||
$messages['post'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => sprintf( __('Post updated. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ),
|
||||
2 => __('Custom field updated.'),
|
||||
3 => __('Custom field deleted.'),
|
||||
4 => __('Post updated.'),
|
||||
/* translators: %s: date and time of the revision */
|
||||
5 => isset($_GET['revision']) ? sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => sprintf( __('Post published. <a href="%s">View post</a>'), esc_url( get_permalink($post_ID) ) ),
|
||||
7 => __('Post saved.'),
|
||||
8 => sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
|
||||
9 => sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'),
|
||||
// translators: Publish box date format, see http://php.net/date
|
||||
date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
|
||||
10 => sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
|
||||
);
|
||||
$messages['page'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => sprintf( __('Page updated. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ),
|
||||
2 => __('Custom field updated.'),
|
||||
3 => __('Custom field deleted.'),
|
||||
4 => __('Page updated.'),
|
||||
5 => isset($_GET['revision']) ? sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => sprintf( __('Page published. <a href="%s">View page</a>'), esc_url( get_permalink($post_ID) ) ),
|
||||
7 => __('Page saved.'),
|
||||
8 => sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
|
||||
9 => sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
|
||||
10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
|
||||
);
|
||||
$messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now.
|
||||
|
||||
/**
|
||||
* Filter the post updated messages.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param array $messages Post updated messages. For defaults @see $messages declarations above.
|
||||
*/
|
||||
$messages = apply_filters( 'post_updated_messages', $messages );
|
||||
|
||||
$message = false;
|
||||
if ( isset($_GET['message']) ) {
|
||||
$_GET['message'] = absint( $_GET['message'] );
|
||||
if ( isset($messages[$post_type][$_GET['message']]) )
|
||||
$message = $messages[$post_type][$_GET['message']];
|
||||
elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) )
|
||||
$message = $messages['post'][$_GET['message']];
|
||||
}
|
||||
|
||||
$notice = false;
|
||||
$form_extra = '';
|
||||
if ( 'auto-draft' == $post->post_status ) {
|
||||
if ( 'edit' == $action )
|
||||
$post->post_title = '';
|
||||
$autosave = false;
|
||||
$form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
|
||||
} else {
|
||||
$autosave = wp_get_post_autosave( $post_ID );
|
||||
}
|
||||
|
||||
$form_action = 'editpost';
|
||||
$nonce_action = 'update-post_' . $post_ID;
|
||||
$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr($post_ID) . "' />";
|
||||
|
||||
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
|
||||
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
|
||||
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
|
||||
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If this autosave isn't different from the current post, begone.
|
||||
if ( ! $notice )
|
||||
wp_delete_post_revision( $autosave->ID );
|
||||
unset($autosave_field, $_autosave_field);
|
||||
}
|
||||
|
||||
$post_type_object = get_post_type_object($post_type);
|
||||
|
||||
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
||||
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
|
||||
|
||||
|
||||
$publish_callback_args = null;
|
||||
if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {
|
||||
$revisions = wp_get_post_revisions( $post_ID );
|
||||
|
||||
// We should aim to show the revisions metabox only when there are revisions.
|
||||
if ( count( $revisions ) > 1 ) {
|
||||
reset( $revisions ); // Reset pointer for key()
|
||||
$publish_callback_args = array( 'revisions_count' => count( $revisions ), 'revision_id' => key( $revisions ) );
|
||||
add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'attachment' == $post_type ) {
|
||||
wp_enqueue_script( 'image-edit' );
|
||||
wp_enqueue_style( 'imgareaselect' );
|
||||
add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
|
||||
add_action( 'edit_form_after_title', 'edit_form_image_editor' );
|
||||
} else {
|
||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
|
||||
}
|
||||
|
||||
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
|
||||
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core' );
|
||||
|
||||
// all taxonomies
|
||||
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
|
||||
$taxonomy = get_taxonomy( $tax_name );
|
||||
if ( ! $taxonomy->show_ui )
|
||||
continue;
|
||||
|
||||
$label = $taxonomy->labels->name;
|
||||
|
||||
if ( ! is_taxonomy_hierarchical( $tax_name ) )
|
||||
$tax_meta_box_id = 'tagsdiv-' . $tax_name;
|
||||
else
|
||||
$tax_meta_box_id = $tax_name . 'div';
|
||||
|
||||
add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
|
||||
}
|
||||
|
||||
if ( post_type_supports($post_type, 'page-attributes') )
|
||||
add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
|
||||
|
||||
$audio_post_support = $video_post_support = false;
|
||||
$theme_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
|
||||
if ( 'attachment' === $post_type && ! empty( $post->post_mime_type ) ) {
|
||||
$audio_post_support = 0 === strpos( $post->post_mime_type, 'audio/' ) && current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' );
|
||||
$video_post_support = 0 === strpos( $post->post_mime_type, 'video/' ) && current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' );
|
||||
}
|
||||
|
||||
if ( $theme_support || $audio_post_support || $video_post_support )
|
||||
add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
|
||||
|
||||
if ( post_type_supports($post_type, 'excerpt') )
|
||||
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
|
||||
|
||||
if ( post_type_supports($post_type, 'trackbacks') )
|
||||
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core');
|
||||
|
||||
if ( post_type_supports($post_type, 'custom-fields') )
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Fires in the middle of built-in meta box registration.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @deprecated 3.7.0 Use 'add_meta_boxes' instead.
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'dbx_post_advanced', $post );
|
||||
|
||||
if ( post_type_supports($post_type, 'comments') )
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core');
|
||||
|
||||
if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') )
|
||||
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core');
|
||||
|
||||
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
|
||||
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
|
||||
|
||||
if ( post_type_supports($post_type, 'author') ) {
|
||||
if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
|
||||
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after all built-in meta boxes have been added.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $post_type Post type.
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'add_meta_boxes', $post_type, $post );
|
||||
|
||||
/**
|
||||
* Fires after all built-in meta boxes have been added, contextually for the given post type.
|
||||
*
|
||||
* The dynamic portion of the hook, $post_type, refers to the post type of the post.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'add_meta_boxes_' . $post_type, $post );
|
||||
|
||||
/**
|
||||
* Fires after meta boxes have been added.
|
||||
*
|
||||
* Fires once for each of the default meta box contexts: normal, advanced, and side.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $post_type Post type of the post.
|
||||
* @param string $context string Meta box context.
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
|
||||
/** This action is documented in wp-admin/edit-form-advanced.php */
|
||||
do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
|
||||
/** This action is documented in wp-admin/edit-form-advanced.php */
|
||||
do_action( 'do_meta_boxes', $post_type, 'side', $post );
|
||||
|
||||
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
|
||||
|
||||
if ( 'post' == $post_type ) {
|
||||
$customize_display = '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'customize-display',
|
||||
'title' => __('Customizing This Display'),
|
||||
'content' => $customize_display,
|
||||
) );
|
||||
|
||||
$title_and_editor = '<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>';
|
||||
$title_and_editor .= '<p>' . __('<strong>Post editor</strong> - Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The Text mode allows you to enter HTML along with your post text. Line breaks will be converted to paragraphs automatically. You can insert media files by clicking the icons above the post editor and following the directions. You can go to the distraction-free writing screen via the Fullscreen icon in Visual mode (second to last in the top row) or the Fullscreen button in Text mode (last in the row). Once there, you can make buttons visible by hovering over the top area. Exit Fullscreen back to the regular post editor.') . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'title-post-editor',
|
||||
'title' => __('Title and Post Editor'),
|
||||
'content' => $title_and_editor,
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_Screen" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
} elseif ( 'page' == $post_type ) {
|
||||
$about_pages = '<p>' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '</p>' .
|
||||
'<p>' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box:') . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'about-pages',
|
||||
'title' => __('About Pages'),
|
||||
'content' => $about_pages,
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_Screen" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
} elseif ( 'attachment' == $post_type ) {
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __('This screen allows you to edit four fields for metadata in a file within the media library.') . '</p>' .
|
||||
'<p>' . __('For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.') . '</p>' .
|
||||
'<p>' . __('Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.') . '</p>' .
|
||||
'<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'post' == $post_type || 'page' == $post_type ) {
|
||||
$inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>';
|
||||
$inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. Please refer to the Codex to <a href="http://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'inserting-media',
|
||||
'title' => __( 'Inserting Media' ),
|
||||
'content' => $inserting_media,
|
||||
) );
|
||||
}
|
||||
|
||||
if ( 'post' == $post_type ) {
|
||||
$publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>';
|
||||
$publish_box .= '<ul><li>' . __('<strong>Publish</strong> - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '</li>';
|
||||
|
||||
if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
|
||||
$publish_box .= '<li>' . __( '<strong>Format</strong> - Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>';
|
||||
}
|
||||
|
||||
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
|
||||
$publish_box .= '<li>' . __('<strong>Featured Image</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '</li>';
|
||||
}
|
||||
|
||||
$publish_box .= '</ul>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'publish-box',
|
||||
'title' => __('Publish Settings'),
|
||||
'content' => $publish_box,
|
||||
) );
|
||||
|
||||
$discussion_settings = '<p>' . __('<strong>Send Trackbacks</strong> - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>';
|
||||
$discussion_settings .= '<p>' . __('<strong>Discussion</strong> - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'discussion-settings',
|
||||
'title' => __('Discussion Settings'),
|
||||
'content' => $discussion_settings,
|
||||
) );
|
||||
} elseif ( 'page' == $post_type ) {
|
||||
$page_attributes = '<p>' . __('<strong>Parent</strong> - You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '</p>' .
|
||||
'<p>' . __('<strong>Template</strong> - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '</p>' .
|
||||
'<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'page-attributes',
|
||||
'title' => __('Page Attributes'),
|
||||
'content' => $page_attributes,
|
||||
) );
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php
|
||||
echo esc_html( $title );
|
||||
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
|
||||
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
||||
?></h2>
|
||||
<?php if ( $notice ) : ?>
|
||||
<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
||||
<?php endif; ?>
|
||||
<div id="lost-connection-notice" class="error hidden">
|
||||
<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you’re reconnected.' ); ?>
|
||||
<span class="hide-if-no-sessionstorage"><?php _e( 'We’re backing up this post in your browser, just in case.' ); ?></span>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
/**
|
||||
* Fires inside the post editor <form> tag.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
?>
|
||||
<form name="post" action="post.php" method="post" id="post"<?php do_action( 'post_edit_form_tag', $post ); ?>>
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ) ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
|
||||
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(wp_get_referer()); ?>" />
|
||||
<?php if ( ! empty( $active_post_lock ) ) { ?>
|
||||
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
|
||||
<?php
|
||||
}
|
||||
if ( 'draft' != get_post_status( $post ) )
|
||||
wp_original_referer_field(true, 'previous');
|
||||
|
||||
echo $form_extra;
|
||||
|
||||
wp_nonce_field( 'autosave', 'autosavenonce', false );
|
||||
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires at the beginning of the edit form.
|
||||
*
|
||||
* At this point, the required hidden fields and nonces have already been output.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'edit_form_top', $post ); ?>
|
||||
|
||||
<div id="poststuff">
|
||||
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
||||
<div id="post-body-content">
|
||||
|
||||
<?php if ( post_type_supports($post_type, 'title') ) { ?>
|
||||
<div id="titlediv">
|
||||
<div id="titlewrap">
|
||||
<?php
|
||||
/**
|
||||
* Filter the title field placeholder text.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string $text Placeholder text. Default 'Enter title here'.
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
?>
|
||||
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
||||
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
||||
</div>
|
||||
<div class="inside">
|
||||
<?php
|
||||
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
|
||||
$shortlink = wp_get_shortlink($post->ID, 'post');
|
||||
$permalink = get_permalink( $post->ID );
|
||||
if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
|
||||
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
|
||||
|
||||
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
|
||||
$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
|
||||
?>
|
||||
<div id="edit-slug-box" class="hide-if-no-js">
|
||||
<?php
|
||||
if ( $has_sample_permalink )
|
||||
echo $sample_permalink_html;
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
|
||||
?>
|
||||
</div><!-- /titlediv -->
|
||||
<?php
|
||||
}
|
||||
/**
|
||||
* Fires after the title field.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'edit_form_after_title', $post );
|
||||
|
||||
if ( post_type_supports($post_type, 'editor') ) {
|
||||
?>
|
||||
<div id="postdivrich" class="postarea edit-form-section">
|
||||
|
||||
<?php wp_editor( $post->post_content, 'content', array(
|
||||
'dfw' => true,
|
||||
'tabfocus_elements' => 'insert-media-button,save-post',
|
||||
'editor_height' => 360,
|
||||
) ); ?>
|
||||
<table id="post-status-info" cellspacing="0"><tbody><tr>
|
||||
<td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
|
||||
<td class="autosave-info">
|
||||
<span class="autosave-message"> </span>
|
||||
<?php
|
||||
if ( 'auto-draft' != $post->post_status ) {
|
||||
echo '<span id="last-edit">';
|
||||
if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
} else {
|
||||
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
}
|
||||
echo '</span>';
|
||||
} ?>
|
||||
</td>
|
||||
</tr></tbody></table>
|
||||
|
||||
</div>
|
||||
<?php }
|
||||
/**
|
||||
* Fires after the content editor.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'edit_form_after_editor', $post );
|
||||
?>
|
||||
</div><!-- /post-body-content -->
|
||||
|
||||
<div id="postbox-container-1" class="postbox-container">
|
||||
<?php
|
||||
|
||||
if ( 'page' == $post_type ) {
|
||||
/**
|
||||
* Fires before meta boxes with 'side' context are output for the 'page' post type.
|
||||
*
|
||||
* The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'submitpage_box', $post );
|
||||
}
|
||||
else {
|
||||
/**
|
||||
* Fires before meta boxes with 'side' context are output for all post types other than 'page'.
|
||||
*
|
||||
* The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'submitpost_box', $post );
|
||||
}
|
||||
|
||||
|
||||
do_meta_boxes($post_type, 'side', $post);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div id="postbox-container-2" class="postbox-container">
|
||||
<?php
|
||||
|
||||
do_meta_boxes(null, 'normal', $post);
|
||||
|
||||
if ( 'page' == $post_type ) {
|
||||
/**
|
||||
* Fires after 'normal' context meta boxes have been output for the 'page' post type.
|
||||
*
|
||||
* @since 1.5.2
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'edit_page_form', $post );
|
||||
}
|
||||
else {
|
||||
/**
|
||||
* Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
|
||||
*
|
||||
* @since 1.5.2
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'edit_form_advanced', $post );
|
||||
}
|
||||
|
||||
|
||||
do_meta_boxes(null, 'advanced', $post);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
/**
|
||||
* Fires after all meta box sections have been output, before the closing #post-body div.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
do_action( 'dbx_post_sidebar', $post );
|
||||
|
||||
?>
|
||||
</div><!-- /post-body -->
|
||||
<br class="clear" />
|
||||
</div><!-- /poststuff -->
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( post_type_supports( $post_type, 'comments' ) )
|
||||
wp_comment_reply();
|
||||
?>
|
||||
|
||||
<?php if ( post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
|
||||
<script type="text/javascript">
|
||||
try{document.post.title.focus();}catch(e){}
|
||||
</script>
|
||||
<?php endif; ?>
|
152
sources/wp-admin/edit-form-comment.php
Normal file
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit comment form for inclusion in another file.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
?>
|
||||
<form name="post" action="comment.php" method="post" id="post">
|
||||
<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Edit Comment'); ?></h2>
|
||||
|
||||
<div id="poststuff">
|
||||
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
|
||||
<input type="hidden" name="action" value="editedcomment" />
|
||||
<input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
|
||||
<input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
|
||||
|
||||
<div id="post-body" class="metabox-holder columns-2">
|
||||
<div id="post-body-content" class="edit-form-section">
|
||||
<div id="namediv" class="stuffbox">
|
||||
<h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
|
||||
<div class="inside">
|
||||
<table class="form-table editcomment">
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td class="first"><?php _e( 'Name:' ); ?></td>
|
||||
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td class="first">
|
||||
<?php
|
||||
if ( $comment->comment_author_email ) {
|
||||
printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
|
||||
} else {
|
||||
_e( 'E-mail:' );
|
||||
}
|
||||
?></td>
|
||||
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" id="email" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td class="first">
|
||||
<?php
|
||||
if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
|
||||
$link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
|
||||
printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
|
||||
} else {
|
||||
_e( 'URL:' );
|
||||
} ?></td>
|
||||
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="postdiv" class="postarea">
|
||||
<?php
|
||||
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
|
||||
wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
||||
</div>
|
||||
</div><!-- /post-body-content -->
|
||||
|
||||
<div id="postbox-container-1" class="postbox-container">
|
||||
<div id="submitdiv" class="stuffbox" >
|
||||
<h3><span class='hndle'><?php _e('Status') ?></span></h3>
|
||||
<div class="inside">
|
||||
<div class="submitbox" id="submitcomment">
|
||||
<div id="minor-publishing">
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="preview-action">
|
||||
<a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
|
||||
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ _ex('Approved', 'adjective') ?></label><br />
|
||||
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ _ex('Pending', 'adjective') ?></label><br />
|
||||
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ _ex('Spam', 'adjective'); ?></label>
|
||||
</div>
|
||||
|
||||
<?php if ( $ip = get_comment_author_IP() ) : ?>
|
||||
<div class="misc-pub-section misc-pub-comment-author-ip">
|
||||
<?php _e( 'IP address:' ); ?> <strong><a href="<?php echo esc_url( sprintf( 'http://whois.arin.net/rest/ip/%s', $ip ) ); ?>"><?php echo esc_html( $ip ); ?></a></strong>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="misc-pub-section curtime misc-pub-curtime">
|
||||
<?php
|
||||
// translators: Publish box date format, see http://php.net/date
|
||||
$datef = __( 'M j, Y @ G:i' );
|
||||
$stamp = __('Submitted on: <b>%1$s</b>');
|
||||
$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
?>
|
||||
<span id="timestamp"><?php printf($stamp, $date); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
|
||||
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
|
||||
</div>
|
||||
</div> <!-- misc actions -->
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<div id="delete-action">
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<?php submit_button( __( 'Update' ), 'primary', 'save', false ); ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /submitdiv -->
|
||||
</div>
|
||||
|
||||
<div id="postbox-container-2" class="postbox-container">
|
||||
<?php
|
||||
|
||||
do_action('add_meta_boxes', 'comment', $comment);
|
||||
do_action('add_meta_boxes_comment', $comment);
|
||||
|
||||
do_meta_boxes(null, 'normal', $comment);
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url( wp_get_referer() ); ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); ?>
|
||||
<input type="hidden" name="noredir" value="1" />
|
||||
|
||||
</div><!-- /post-body -->
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
try{document.post.name.focus();}catch(e){}
|
||||
</script>
|
141
sources/wp-admin/edit-link-form.php
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit links form for inclusion in administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( ! empty($link_id) ) {
|
||||
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
|
||||
$submit_text = __('Update Link');
|
||||
$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
|
||||
$nonce_action = 'update-bookmark_' . $link_id;
|
||||
} else {
|
||||
$heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
|
||||
$submit_text = __('Add Link');
|
||||
$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
|
||||
$nonce_action = 'add-bookmark';
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
|
||||
|
||||
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', null, 'side', 'core');
|
||||
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', null, 'normal', 'core');
|
||||
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', null, 'normal', 'core');
|
||||
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', null, 'normal', 'core');
|
||||
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', null, 'normal', 'core');
|
||||
|
||||
do_action('add_meta_boxes', 'link', $link);
|
||||
do_action('add_meta_boxes_link', $link);
|
||||
|
||||
/** This action is documented in wp-admin/edit-form-advanced.php */
|
||||
do_action('do_meta_boxes', 'link', 'normal', $link);
|
||||
/** This action is documented in wp-admin/edit-form-advanced.php */
|
||||
do_action('do_meta_boxes', 'link', 'advanced', $link);
|
||||
/** This action is documented in wp-admin/edit-form-advanced.php */
|
||||
do_action('do_meta_boxes', 'link', 'side', $link);
|
||||
|
||||
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
|
||||
'<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
|
||||
'<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_Screen" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
|
||||
);
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a></h2>
|
||||
|
||||
<?php if ( isset( $_GET['added'] ) ) : ?>
|
||||
<div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
if ( !empty($form) )
|
||||
echo $form;
|
||||
if ( !empty($link_added) )
|
||||
echo $link_added;
|
||||
|
||||
wp_nonce_field( $nonce_action );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
|
||||
<div id="poststuff">
|
||||
|
||||
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
||||
<div id="post-body-content">
|
||||
<div id="namediv" class="stuffbox">
|
||||
<h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
|
||||
<p><?php _e('Example: Nifty blogging software'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="addressdiv" class="stuffbox">
|
||||
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
|
||||
<p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="descriptiondiv" class="stuffbox">
|
||||
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
|
||||
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /post-body-content -->
|
||||
|
||||
<div id="postbox-container-1" class="postbox-container">
|
||||
<?php
|
||||
|
||||
do_action('submitlink_box');
|
||||
$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
|
||||
|
||||
?>
|
||||
</div>
|
||||
<div id="postbox-container-2" class="postbox-container">
|
||||
<?php
|
||||
|
||||
do_meta_boxes(null, 'normal', $link);
|
||||
|
||||
do_meta_boxes(null, 'advanced', $link);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if ( $link_id ) : ?>
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
|
||||
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="action" value="add" />
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
96
sources/wp-admin/edit-tag-form.php
Normal file
|
@ -0,0 +1,96 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit tag form for inclusion in administration panels.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( empty($tag_ID) ) { ?>
|
||||
<div id="message" class="updated"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form_pre', $tag );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form_pre', $tag );
|
||||
else
|
||||
do_action('edit_tag_form_pre', $tag);
|
||||
|
||||
do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo $tax->labels->edit_item; ?></h2>
|
||||
<div id="ajax-response"></div>
|
||||
<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_edit_form_tag' ); ?>>
|
||||
<input type="hidden" name="action" value="editedtag" />
|
||||
<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy) ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="name"><?php _ex('Name', 'Taxonomy Name'); ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
|
||||
<p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
|
||||
</tr>
|
||||
<?php if ( !global_terms_enabled() ) { ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
|
||||
<p class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label></th>
|
||||
<td>
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
|
||||
<?php if ( 'category' == $taxonomy ) : ?>
|
||||
<p class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; // is_taxonomy_hierarchical() ?>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" class="large-text"><?php echo $tag->description; // textarea_escaped ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
|
||||
</tr>
|
||||
<?php
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form_fields', $tag);
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form_fields', $tag);
|
||||
else
|
||||
do_action('edit_tag_form_fields', $tag);
|
||||
|
||||
do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
// Back compat hooks
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form', $tag);
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form', $tag);
|
||||
else
|
||||
do_action('edit_tag_form', $tag);
|
||||
|
||||
do_action($taxonomy . '_edit_form', $tag, $taxonomy);
|
||||
|
||||
submit_button( __('Update') );
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
try{document.forms.edittag.name.focus();}catch(e){}
|
||||
</script>
|
465
sources/wp-admin/edit-tags.php
Normal file
|
@ -0,0 +1,465 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit Tags Administration Screen.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! $taxnow )
|
||||
wp_die( __( 'Invalid taxonomy' ) );
|
||||
|
||||
$tax = get_taxonomy( $taxnow );
|
||||
|
||||
if ( ! $tax )
|
||||
wp_die( __( 'Invalid taxonomy' ) );
|
||||
|
||||
if ( ! current_user_can( $tax->cap->manage_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Terms_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
$title = $tax->labels->name;
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
|
||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
|
||||
} else if ( 'link_category' == $tax->name ) {
|
||||
$parent_file = 'link-manager.php';
|
||||
$submenu_file = 'edit-tags.php?taxonomy=link_category';
|
||||
} else {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
|
||||
}
|
||||
|
||||
add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) );
|
||||
|
||||
switch ( $wp_list_table->current_action() ) {
|
||||
|
||||
case 'add-tag':
|
||||
|
||||
check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( $ret && !is_wp_error( $ret ) )
|
||||
$location = add_query_arg( 'message', 1, $location );
|
||||
else
|
||||
$location = add_query_arg( 'message', 4, $location );
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( !isset( $_REQUEST['tag_ID'] ) ) {
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
}
|
||||
|
||||
$tag_ID = (int) $_REQUEST['tag_ID'];
|
||||
check_admin_referer( 'delete-tag_' . $tag_ID );
|
||||
|
||||
if ( !current_user_can( $tax->cap->delete_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
wp_delete_term( $tag_ID, $taxonomy );
|
||||
|
||||
$location = add_query_arg( 'message', 2, $location );
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
|
||||
break;
|
||||
|
||||
case 'bulk-delete':
|
||||
check_admin_referer( 'bulk-tags' );
|
||||
|
||||
if ( !current_user_can( $tax->cap->delete_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$tags = (array) $_REQUEST['delete_tags'];
|
||||
foreach ( $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, $taxonomy );
|
||||
}
|
||||
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
$location = add_query_arg( 'message', 6, $location );
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
$title = $tax->labels->edit_item;
|
||||
|
||||
$tag_ID = (int) $_REQUEST['tag_ID'];
|
||||
|
||||
$tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
|
||||
if ( ! $tag )
|
||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
include( ABSPATH . 'wp-admin/edit-tag-form.php' );
|
||||
|
||||
break;
|
||||
|
||||
case 'editedtag':
|
||||
$tag_ID = (int) $_POST['tag_ID'];
|
||||
check_admin_referer( 'update-tag_' . $tag_ID );
|
||||
|
||||
if ( !current_user_can( $tax->cap->edit_terms ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$tag = get_term( $tag_ID, $taxonomy );
|
||||
if ( ! $tag )
|
||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||
|
||||
$ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
|
||||
|
||||
$location = 'edit-tags.php?taxonomy=' . $taxonomy;
|
||||
if ( 'post' != $post_type )
|
||||
$location .= '&post_type=' . $post_type;
|
||||
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
if ( false !== strpos( $referer, 'edit-tags.php' ) )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
if ( $ret && !is_wp_error( $ret ) )
|
||||
$location = add_query_arg( 'message', 3, $location );
|
||||
else
|
||||
$location = add_query_arg( 'message', 5, $location );
|
||||
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||
$location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
|
||||
|
||||
if ( ! empty( $_REQUEST['paged'] ) )
|
||||
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
|
||||
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
|
||||
|
||||
if ( $pagenum > $total_pages && $total_pages > 0 ) {
|
||||
wp_redirect( add_query_arg( 'paged', $total_pages ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
wp_enqueue_script('admin-tags');
|
||||
if ( current_user_can($tax->cap->edit_terms) )
|
||||
wp_enqueue_script('inline-edit-tax');
|
||||
|
||||
if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
|
||||
$help ='';
|
||||
if ( 'category' == $taxonomy )
|
||||
$help = '<p>' . sprintf(__( 'You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>';
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
$help = '<p>' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '</p>';
|
||||
else
|
||||
$help = '<p>' . __( 'You can assign keywords to your posts using <strong>tags</strong>. Unlike categories, tags have no hierarchy, meaning there’s no relationship from one tag to another.' ) . '</p>';
|
||||
|
||||
if ( 'link_category' == $taxonomy )
|
||||
$help .= '<p>' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '</p>';
|
||||
else
|
||||
$help .='<p>' . __( 'What’s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' => $help,
|
||||
) );
|
||||
|
||||
if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
|
||||
if ( 'category' == $taxonomy )
|
||||
$help = '<p>' . __( 'When adding a new category on this screen, you’ll fill in the following fields:' ) . '</p>';
|
||||
else
|
||||
$help = '<p>' . __( 'When adding a new tag on this screen, you’ll fill in the following fields:' ) . '</p>';
|
||||
|
||||
$help .= '<ul>' .
|
||||
'<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
|
||||
|
||||
if ( ! global_terms_enabled() )
|
||||
$help .= '<li>' . __( '<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<li>' . __( '<strong>Parent</strong> - Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '</li>';
|
||||
|
||||
$help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
|
||||
'</ul>' .
|
||||
'<p>' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '</p>';
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'adding-terms',
|
||||
'title' => 'category' == $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ),
|
||||
'content' => $help,
|
||||
) );
|
||||
}
|
||||
|
||||
$help = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
|
||||
|
||||
if ( 'category' == $taxonomy )
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Categories_Screen" target="_blank">Documentation on Categories</a>' ) . '</p>';
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Links_Link_Categories_Screen" target="_blank">Documentation on Link Categories</a>' ) . '</p>';
|
||||
else
|
||||
$help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Tags_Screen" target="_blank">Documentation on Tags</a>' ) . '</p>';
|
||||
|
||||
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
|
||||
|
||||
get_current_screen()->set_help_sidebar( $help );
|
||||
|
||||
unset( $help );
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
if ( !current_user_can($tax->cap->edit_terms) )
|
||||
wp_die( __('You are not allowed to edit this item.') );
|
||||
|
||||
$messages = array();
|
||||
$messages['_item'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Item added.' ),
|
||||
2 => __( 'Item deleted.' ),
|
||||
3 => __( 'Item updated.' ),
|
||||
4 => __( 'Item not added.' ),
|
||||
5 => __( 'Item not updated.' ),
|
||||
6 => __( 'Items deleted.' )
|
||||
);
|
||||
$messages['category'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Category added.' ),
|
||||
2 => __( 'Category deleted.' ),
|
||||
3 => __( 'Category updated.' ),
|
||||
4 => __( 'Category not added.' ),
|
||||
5 => __( 'Category not updated.' ),
|
||||
6 => __( 'Categories deleted.' )
|
||||
);
|
||||
$messages['post_tag'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Tag added.' ),
|
||||
2 => __( 'Tag deleted.' ),
|
||||
3 => __( 'Tag updated.' ),
|
||||
4 => __( 'Tag not added.' ),
|
||||
5 => __( 'Tag not updated.' ),
|
||||
6 => __( 'Tags deleted.' )
|
||||
);
|
||||
|
||||
$messages = apply_filters( 'term_updated_messages', $messages );
|
||||
|
||||
$message = false;
|
||||
if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
|
||||
if ( isset( $messages[ $taxonomy ][ $msg ] ) )
|
||||
$message = $messages[ $taxonomy ][ $msg ];
|
||||
elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) )
|
||||
$message = $messages['_item'][ $msg ];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
if ( !empty($_REQUEST['s']) )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<form class="search-form" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
|
||||
<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
|
||||
|
||||
</form>
|
||||
<br class="clear" />
|
||||
|
||||
<div id="col-container">
|
||||
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<form id="posts-filter" action="" method="post">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
|
||||
<br class="clear" />
|
||||
</form>
|
||||
|
||||
<?php if ( 'category' == $taxonomy ) : ?>
|
||||
<div class="form-wrap">
|
||||
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
|
||||
<?php if ( current_user_can( 'import' ) ) : ?>
|
||||
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'import.php') ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
|
||||
<div class="form-wrap">
|
||||
<p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.'), 'import.php') ;?></p>
|
||||
</div>
|
||||
<?php endif;
|
||||
do_action('after-' . $taxonomy . '-table', $taxonomy);
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div><!-- /col-right -->
|
||||
|
||||
<div id="col-left">
|
||||
<div class="col-wrap">
|
||||
|
||||
<?php
|
||||
|
||||
if ( !is_null( $tax->labels->popular_items ) ) {
|
||||
if ( current_user_can( $tax->cap->edit_terms ) )
|
||||
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
|
||||
else
|
||||
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
|
||||
|
||||
if ( $tag_cloud ) :
|
||||
?>
|
||||
<div class="tagcloud">
|
||||
<h3><?php echo $tax->labels->popular_items; ?></h3>
|
||||
<?php echo $tag_cloud; unset( $tag_cloud ); ?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
}
|
||||
|
||||
if ( current_user_can($tax->cap->edit_terms) ) {
|
||||
// Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('add_category_form_pre', (object)array('parent' => 0) );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('add_link_category_form_pre', (object)array('parent' => 0) );
|
||||
else
|
||||
do_action('add_tag_form_pre', $taxonomy);
|
||||
|
||||
do_action($taxonomy . '_pre_add_form', $taxonomy);
|
||||
?>
|
||||
|
||||
<div class="form-wrap">
|
||||
<h3><?php echo $tax->labels->add_new_item; ?></h3>
|
||||
<form id="addtag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_new_form_tag' ); ?>>
|
||||
<input type="hidden" name="action" value="add-tag" />
|
||||
<input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
|
||||
<?php wp_nonce_field('add-tag', '_wpnonce_add-tag'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="tag-name"><?php _ex('Name', 'Taxonomy Name'); ?></label>
|
||||
<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
|
||||
<p><?php _e('The name is how it appears on your site.'); ?></p>
|
||||
</div>
|
||||
<?php if ( ! global_terms_enabled() ) : ?>
|
||||
<div class="form-field">
|
||||
<label for="tag-slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label>
|
||||
<input name="slug" id="tag-slug" type="text" value="" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
</div>
|
||||
<?php endif; // global_terms_enabled() ?>
|
||||
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
|
||||
<div class="form-field">
|
||||
<label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label>
|
||||
<?php
|
||||
$dropdown_args = array(
|
||||
'hide_empty' => 0,
|
||||
'hide_if_empty' => false,
|
||||
'taxonomy' => $taxonomy,
|
||||
'name' => 'parent',
|
||||
'orderby' => 'name',
|
||||
'hierarchical' => true,
|
||||
'show_option_none' => __( 'None' ),
|
||||
);
|
||||
|
||||
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy );
|
||||
wp_dropdown_categories( $dropdown_args );
|
||||
?>
|
||||
<?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?>
|
||||
<p><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; // is_taxonomy_hierarchical() ?>
|
||||
<div class="form-field">
|
||||
<label for="tag-description"><?php _ex('Description', 'Taxonomy Description'); ?></label>
|
||||
<textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( ! is_taxonomy_hierarchical($taxonomy) )
|
||||
do_action('add_tag_form_fields', $taxonomy);
|
||||
do_action($taxonomy . '_add_form_fields', $taxonomy);
|
||||
|
||||
submit_button( $tax->labels->add_new_item );
|
||||
|
||||
// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
|
||||
if ( 'category' == $taxonomy )
|
||||
do_action('edit_category_form', (object)array('parent' => 0) );
|
||||
elseif ( 'link_category' == $taxonomy )
|
||||
do_action('edit_link_category_form', (object)array('parent' => 0) );
|
||||
else
|
||||
do_action('add_tag_form', $taxonomy);
|
||||
|
||||
do_action($taxonomy . '_add_form', $taxonomy);
|
||||
?>
|
||||
</form></div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div><!-- /col-left -->
|
||||
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
<script type="text/javascript">
|
||||
try{document.forms.addtag['tag-name'].focus();}catch(e){}
|
||||
</script>
|
||||
<?php $wp_list_table->inline_edit(); ?>
|
||||
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
325
sources/wp-admin/edit.php
Normal file
|
@ -0,0 +1,325 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit Posts Administration Screen.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! $typenow )
|
||||
wp_die( __( 'Invalid post type' ) );
|
||||
|
||||
$post_type = $typenow;
|
||||
$post_type_object = get_post_type_object( $post_type );
|
||||
|
||||
if ( ! $post_type_object )
|
||||
wp_die( __( 'Invalid post type' ) );
|
||||
|
||||
if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
|
||||
wp_die( __( 'Cheatin’ uh?' ) );
|
||||
|
||||
$wp_list_table = _get_list_table('WP_Posts_List_Table');
|
||||
$pagenum = $wp_list_table->get_pagenum();
|
||||
|
||||
// Back-compat for viewing comments of an entry
|
||||
foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
|
||||
if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
|
||||
wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
|
||||
exit;
|
||||
}
|
||||
}
|
||||
unset( $_redirect );
|
||||
|
||||
if ( 'post' != $post_type ) {
|
||||
$parent_file = "edit.php?post_type=$post_type";
|
||||
$submenu_file = "edit.php?post_type=$post_type";
|
||||
$post_new_file = "post-new.php?post_type=$post_type";
|
||||
} else {
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = 'edit.php';
|
||||
$post_new_file = 'post-new.php';
|
||||
}
|
||||
|
||||
$doaction = $wp_list_table->current_action();
|
||||
|
||||
if ( $doaction ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'locked', 'ids'), wp_get_referer() );
|
||||
if ( ! $sendback )
|
||||
$sendback = admin_url( $parent_file );
|
||||
$sendback = add_query_arg( 'paged', $pagenum, $sendback );
|
||||
if ( strpos($sendback, 'post.php') !== false )
|
||||
$sendback = admin_url($post_new_file);
|
||||
|
||||
if ( 'delete_all' == $doaction ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
|
||||
if ( get_post_status_object($post_status) ) // Check the post status exists first
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( isset( $_REQUEST['media'] ) ) {
|
||||
$post_ids = $_REQUEST['media'];
|
||||
} elseif ( isset( $_REQUEST['ids'] ) ) {
|
||||
$post_ids = explode( ',', $_REQUEST['ids'] );
|
||||
} elseif ( !empty( $_REQUEST['post'] ) ) {
|
||||
$post_ids = array_map('intval', $_REQUEST['post']);
|
||||
}
|
||||
|
||||
if ( !isset( $post_ids ) ) {
|
||||
wp_redirect( $sendback );
|
||||
exit;
|
||||
}
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = $locked = 0;
|
||||
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can( 'delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to move this item to the Trash.') );
|
||||
|
||||
if ( wp_check_post_lock( $post_id ) ) {
|
||||
$locked++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to Trash.') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids), 'locked' => $locked ), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can( 'delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to restore this item from the Trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from Trash.') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
break;
|
||||
case 'delete':
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = get_post($post_id);
|
||||
|
||||
if ( !current_user_can( 'delete_post', $post_id ) )
|
||||
wp_die( __('You are not allowed to delete this item.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id) )
|
||||
wp_die( __('Error in deleting.') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id) )
|
||||
wp_die( __('Error in deleting.') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
if ( isset($_REQUEST['bulk_edit']) ) {
|
||||
$done = bulk_edit_posts($_REQUEST);
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
|
||||
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
|
||||
$title = $post_type_object->labels->name;
|
||||
|
||||
if ( 'post' == $post_type ) {
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __('This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.') . '</p>'
|
||||
) );
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'screen-content',
|
||||
'title' => __('Screen Content'),
|
||||
'content' =>
|
||||
'<p>' . __('You can customize the display of this screen’s contents in a number of ways:') . '</p>' .
|
||||
'<ul>' .
|
||||
'<li>' . __('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.') . '</li>' .
|
||||
'<li>' . __('You can filter the list of posts by post status using the text links in the upper left to show All, Published, Draft, or Trashed posts. The default view is to show all posts.') . '</li>' .
|
||||
'<li>' . __('You can view posts in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.') . '</li>' .
|
||||
'<li>' . __('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.') . '</li>' .
|
||||
'</ul>'
|
||||
) );
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'action-links',
|
||||
'title' => __('Available Actions'),
|
||||
'content' =>
|
||||
'<p>' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '</p>' .
|
||||
'<ul>' .
|
||||
'<li>' . __('<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.') . '</li>' .
|
||||
'<li>' . __('<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.') . '</li>' .
|
||||
'<li>' . __('<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.') . '</li>' .
|
||||
'<li>' . __('<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post’s status.') . '</li>' .
|
||||
'</ul>'
|
||||
) );
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'bulk-actions',
|
||||
'title' => __('Bulk Actions'),
|
||||
'content' =>
|
||||
'<p>' . __('You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.') . '</p>' .
|
||||
'<p>' . __('When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Posts_Screen" target="_blank">Documentation on Managing Posts</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
} elseif ( 'page' == $post_type ) {
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' =>
|
||||
'<p>' . __('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.') . '</p>'
|
||||
) );
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'managing-pages',
|
||||
'title' => __('Managing Pages'),
|
||||
'content' =>
|
||||
'<p>' . __('Managing pages is very similar to managing posts, and the screens can be customized in the same way.') . '</p>' .
|
||||
'<p>' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.') . '</p>'
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Pages_Screen" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
}
|
||||
|
||||
add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
|
||||
|
||||
$bulk_counts = array(
|
||||
'updated' => isset( $_REQUEST['updated'] ) ? absint( $_REQUEST['updated'] ) : 0,
|
||||
'locked' => isset( $_REQUEST['locked'] ) ? absint( $_REQUEST['locked'] ) : 0,
|
||||
'deleted' => isset( $_REQUEST['deleted'] ) ? absint( $_REQUEST['deleted'] ) : 0,
|
||||
'trashed' => isset( $_REQUEST['trashed'] ) ? absint( $_REQUEST['trashed'] ) : 0,
|
||||
'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0,
|
||||
);
|
||||
|
||||
$bulk_messages = array();
|
||||
$bulk_messages['post'] = array(
|
||||
'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
|
||||
'locked' => _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
|
||||
'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
|
||||
'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
|
||||
);
|
||||
$bulk_messages['page'] = array(
|
||||
'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
|
||||
'locked' => _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
|
||||
'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
|
||||
'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filter the bulk action updated messages.
|
||||
*
|
||||
* By default, custom post types use the messages for the 'post' post type.
|
||||
*
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param array $bulk_messages Arrays of messages, each keyed by the corresponding post type. Messages are
|
||||
* keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'.
|
||||
* @param array $bulk_counts Array of item counts for each message, used to build internationalized strings.
|
||||
*/
|
||||
$bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts );
|
||||
$bulk_counts = array_filter( $bulk_counts );
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php
|
||||
echo esc_html( $post_type_object->labels->name );
|
||||
if ( current_user_can( $post_type_object->cap->create_posts ) )
|
||||
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
||||
if ( ! empty( $_REQUEST['s'] ) )
|
||||
printf( ' <span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() );
|
||||
?></h2>
|
||||
|
||||
<?php
|
||||
// If we have a bulk message to issue:
|
||||
$messages = array();
|
||||
foreach ( $bulk_counts as $message => $count ) {
|
||||
if ( isset( $bulk_messages[ $post_type ][ $message ] ) )
|
||||
$messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );
|
||||
elseif ( isset( $bulk_messages['post'][ $message ] ) )
|
||||
$messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
|
||||
|
||||
if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
|
||||
$ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
|
||||
$messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if ( $messages )
|
||||
echo '<div id="message" class="updated"><p>' . join( ' ', $messages ) . '</p></div>';
|
||||
unset( $messages );
|
||||
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
|
||||
<?php $wp_list_table->views(); ?>
|
||||
|
||||
<form id="posts-filter" action="" method="get">
|
||||
|
||||
<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
|
||||
<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
|
||||
<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
|
||||
<input type="hidden" name="show_sticky" value="1" />
|
||||
<?php } ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
if ( $wp_list_table->has_items() )
|
||||
$wp_list_table->inline_edit();
|
||||
?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
244
sources/wp-admin/export.php
Normal file
|
@ -0,0 +1,244 @@
|
|||
<?php
|
||||
/**
|
||||
* WordPress Export Administration Screen
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** Load WordPress Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( !current_user_can('export') )
|
||||
wp_die(__('You do not have sufficient permissions to export the content of this site.'));
|
||||
|
||||
/** Load WordPress export API */
|
||||
require_once( ABSPATH . 'wp-admin/includes/export.php' );
|
||||
$title = __('Export');
|
||||
|
||||
/**
|
||||
* Display JavaScript on the page.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
function export_add_js() {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
jQuery(document).ready(function($){
|
||||
var form = $('#export-filters'),
|
||||
filters = form.find('.export-filters');
|
||||
filters.hide();
|
||||
form.find('input:radio').change(function() {
|
||||
filters.slideUp('fast');
|
||||
switch ( $(this).val() ) {
|
||||
case 'posts': $('#post-filters').slideDown(); break;
|
||||
case 'pages': $('#page-filters').slideDown(); break;
|
||||
}
|
||||
});
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action( 'admin_head', 'export_add_js' );
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' => '<p>' . __('You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.') . '</p>' .
|
||||
'<p>' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '</p>',
|
||||
) );
|
||||
|
||||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
||||
'<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_Screen" target="_blank">Documentation on Export</a>') . '</p>' .
|
||||
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
|
||||
);
|
||||
|
||||
if ( isset( $_GET['download'] ) ) {
|
||||
$args = array();
|
||||
|
||||
if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
|
||||
$args['content'] = 'all';
|
||||
} else if ( 'posts' == $_GET['content'] ) {
|
||||
$args['content'] = 'post';
|
||||
|
||||
if ( $_GET['cat'] )
|
||||
$args['category'] = (int) $_GET['cat'];
|
||||
|
||||
if ( $_GET['post_author'] )
|
||||
$args['author'] = (int) $_GET['post_author'];
|
||||
|
||||
if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) {
|
||||
$args['start_date'] = $_GET['post_start_date'];
|
||||
$args['end_date'] = $_GET['post_end_date'];
|
||||
}
|
||||
|
||||
if ( $_GET['post_status'] )
|
||||
$args['status'] = $_GET['post_status'];
|
||||
} else if ( 'pages' == $_GET['content'] ) {
|
||||
$args['content'] = 'page';
|
||||
|
||||
if ( $_GET['page_author'] )
|
||||
$args['author'] = (int) $_GET['page_author'];
|
||||
|
||||
if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) {
|
||||
$args['start_date'] = $_GET['page_start_date'];
|
||||
$args['end_date'] = $_GET['page_end_date'];
|
||||
}
|
||||
|
||||
if ( $_GET['page_status'] )
|
||||
$args['status'] = $_GET['page_status'];
|
||||
} else {
|
||||
$args['content'] = $_GET['content'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the export args.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*
|
||||
* @param array $args The arguments to send to the exporter.
|
||||
*/
|
||||
$args = apply_filters( 'export_args', $args );
|
||||
|
||||
export_wp( $args );
|
||||
die();
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
/**
|
||||
* Create the date options fields for exporting a given post type.
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database object.
|
||||
* @global WP_Locale $wp_locale Date and Time Locale object.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string $post_type The post type. Default 'post'.
|
||||
*/
|
||||
function export_date_options( $post_type = 'post' ) {
|
||||
global $wpdb, $wp_locale;
|
||||
|
||||
$months = $wpdb->get_results( $wpdb->prepare( "
|
||||
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
||||
FROM $wpdb->posts
|
||||
WHERE post_type = %s AND post_status != 'auto-draft'
|
||||
ORDER BY post_date DESC
|
||||
", $post_type ) );
|
||||
|
||||
$month_count = count( $months );
|
||||
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
|
||||
return;
|
||||
|
||||
foreach ( $months as $date ) {
|
||||
if ( 0 == $date->year )
|
||||
continue;
|
||||
|
||||
$month = zeroise( $date->month, 2 );
|
||||
echo '<option value="' . $date->year . '-' . $month . '">' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
|
||||
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
|
||||
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
|
||||
<p><?php _e('Once you’ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.'); ?></p>
|
||||
|
||||
<h3><?php _e( 'Choose what to export' ); ?></h3>
|
||||
<form action="" method="get" id="export-filters">
|
||||
<input type="hidden" name="download" value="true" />
|
||||
<p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label></p>
|
||||
<p class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></p>
|
||||
|
||||
<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
|
||||
<ul id="post-filters" class="export-filters">
|
||||
<li>
|
||||
<label><?php _e( 'Categories:' ); ?></label>
|
||||
<?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Authors:' ); ?></label>
|
||||
<?php
|
||||
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
|
||||
wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) );
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Date range:' ); ?></label>
|
||||
<select name="post_start_date">
|
||||
<option value="0"><?php _e( 'Start Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
<select name="post_end_date">
|
||||
<option value="0"><?php _e( 'End Date' ); ?></option>
|
||||
<?php export_date_options(); ?>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Status:' ); ?></label>
|
||||
<select name="post_status">
|
||||
<option value="0"><?php _e( 'All' ); ?></option>
|
||||
<?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
|
||||
foreach ( $post_stati as $status ) : ?>
|
||||
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
|
||||
<ul id="page-filters" class="export-filters">
|
||||
<li>
|
||||
<label><?php _e( 'Authors:' ); ?></label>
|
||||
<?php
|
||||
$authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
|
||||
wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) );
|
||||
?>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Date range:' ); ?></label>
|
||||
<select name="page_start_date">
|
||||
<option value="0"><?php _e( 'Start Date' ); ?></option>
|
||||
<?php export_date_options( 'page' ); ?>
|
||||
</select>
|
||||
<select name="page_end_date">
|
||||
<option value="0"><?php _e( 'End Date' ); ?></option>
|
||||
<?php export_date_options( 'page' ); ?>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label><?php _e( 'Status:' ); ?></label>
|
||||
<select name="page_status">
|
||||
<option value="0"><?php _e( 'All' ); ?></option>
|
||||
<?php foreach ( $post_stati as $status ) : ?>
|
||||
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>
|
||||
<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Fires after the export filters form.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
do_action( 'export_filters' );
|
||||
?>
|
||||
|
||||
<?php submit_button( __('Download Export File') ); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
|
57
sources/wp-admin/freedoms.php
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/**
|
||||
* Your Rights administration panel.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
$title = __( 'Freedoms' );
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<div class="about-text"><?php echo str_replace( '3.7', $display_version, __( 'Thank you for updating to WordPress 3.7! You might not notice a thing, and we’re okay with that.' ) ); ?></div>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="about.php" class="nav-tab">
|
||||
<?php _e( 'What’s New' ); ?>
|
||||
</a><a href="credits.php" class="nav-tab">
|
||||
<?php _e( 'Credits' ); ?>
|
||||
</a><a href="freedoms.php" class="nav-tab nav-tab-active">
|
||||
<?php _e( 'Freedoms' ); ?>
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<p class="about-description"><?php printf( __( 'WordPress is Free and open source software, built by a distributed community of mostly volunteer developers from around the world. WordPress comes with some awesome, worldview-changing rights courtesy of its <a href="%s">license</a>, the GPL.' ), 'http://wordpress.org/about/license/' ); ?></p>
|
||||
|
||||
<ol start="0">
|
||||
<li><p><?php _e( 'You have the freedom to run the program, for any purpose.' ); ?></p></li>
|
||||
<li><p><?php _e( 'You have access to the source code, the freedom to study how the program works, and the freedom to change it to make it do what you wish.' ); ?></p></li>
|
||||
<li><p><?php _e( 'You have the freedom to redistribute copies of the original program so you can help your neighbor.' ); ?></p></li>
|
||||
<li><p><?php _e( 'You have the freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes.' ); ?></p></li>
|
||||
</ol>
|
||||
|
||||
<p><?php printf( __( 'WordPress grows when people like you tell their friends about it, and the thousands of businesses and services that are built on and around WordPress share that fact with their users. We’re flattered every time someone spreads the good word, just make sure to <a href="%s">check out our trademark guidelines</a> first.' ), 'http://wordpressfoundation.org/trademark-policy/' ); ?></p>
|
||||
|
||||
<p><?php
|
||||
|
||||
$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : 'http://wordpress.org/plugins/';
|
||||
$themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : 'http://wordpress.org/themes/';
|
||||
|
||||
printf( __( 'Every plugin and theme in WordPress.org’s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it’s GPL</a> first. If they don’t respect the WordPress license, we don’t recommend them.' ), $plugins_url, $themes_url, 'http://wordpress.org/about/license/' ); ?></p>
|
||||
|
||||
<p><?php _e( 'Don’t you wish all software came with these freedoms? So do we! For more information, check out the <a href="http://www.fsf.org/">Free Software Foundation</a>.' ); ?></p>
|
||||
|
||||
</div>
|
||||
<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
|
BIN
sources/wp-admin/images/about-globe-2x.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
sources/wp-admin/images/about-search-2x.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
sources/wp-admin/images/about-updates-2x.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
sources/wp-admin/images/align-center-2x.png
Normal file
After Width: | Height: | Size: 147 B |
BIN
sources/wp-admin/images/align-center.png
Normal file
After Width: | Height: | Size: 546 B |
BIN
sources/wp-admin/images/align-left-2x.png
Normal file
After Width: | Height: | Size: 143 B |
BIN
sources/wp-admin/images/align-left.png
Normal file
After Width: | Height: | Size: 554 B |
BIN
sources/wp-admin/images/align-none-2x.png
Normal file
After Width: | Height: | Size: 121 B |
BIN
sources/wp-admin/images/align-none.png
Normal file
After Width: | Height: | Size: 417 B |
BIN
sources/wp-admin/images/align-right-2x.png
Normal file
After Width: | Height: | Size: 142 B |
BIN
sources/wp-admin/images/align-right.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
sources/wp-admin/images/arrows-2x.png
Normal file
After Width: | Height: | Size: 863 B |
BIN
sources/wp-admin/images/arrows-dark-2x.png
Normal file
After Width: | Height: | Size: 719 B |
BIN
sources/wp-admin/images/arrows-dark-vs-2x.png
Normal file
After Width: | Height: | Size: 761 B |
BIN
sources/wp-admin/images/arrows-dark-vs.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
sources/wp-admin/images/arrows-dark.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
sources/wp-admin/images/arrows-pr-2x.png
Normal file
After Width: | Height: | Size: 723 B |
BIN
sources/wp-admin/images/arrows-pr.png
Normal file
After Width: | Height: | Size: 461 B |
BIN
sources/wp-admin/images/arrows-vs-2x.png
Normal file
After Width: | Height: | Size: 723 B |
BIN
sources/wp-admin/images/arrows-vs.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
sources/wp-admin/images/arrows.png
Normal file
After Width: | Height: | Size: 243 B |
BIN
sources/wp-admin/images/bubble_bg-2x.gif
Normal file
After Width: | Height: | Size: 507 B |
BIN
sources/wp-admin/images/bubble_bg-rtl-2x.gif
Normal file
After Width: | Height: | Size: 499 B |
BIN
sources/wp-admin/images/bubble_bg-rtl.gif
Normal file
After Width: | Height: | Size: 400 B |
BIN
sources/wp-admin/images/bubble_bg.gif
Normal file
After Width: | Height: | Size: 395 B |
BIN
sources/wp-admin/images/comment-grey-bubble-2x.png
Normal file
After Width: | Height: | Size: 259 B |
BIN
sources/wp-admin/images/comment-grey-bubble.png
Normal file
After Width: | Height: | Size: 114 B |
BIN
sources/wp-admin/images/date-button-2x.gif
Normal file
After Width: | Height: | Size: 992 B |
BIN
sources/wp-admin/images/date-button.gif
Normal file
After Width: | Height: | Size: 400 B |
BIN
sources/wp-admin/images/generic.png
Normal file
After Width: | Height: | Size: 719 B |
BIN
sources/wp-admin/images/icons32-2x.png
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
sources/wp-admin/images/icons32-vs-2x.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
sources/wp-admin/images/icons32-vs.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
sources/wp-admin/images/icons32.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
sources/wp-admin/images/imgedit-icons-2x.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
sources/wp-admin/images/imgedit-icons.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
sources/wp-admin/images/list-2x.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
sources/wp-admin/images/list.png
Normal file
After Width: | Height: | Size: 1,003 B |
BIN
sources/wp-admin/images/loading.gif
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
sources/wp-admin/images/lock-2x.png
Normal file
After Width: | Height: | Size: 716 B |
BIN
sources/wp-admin/images/lock.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
sources/wp-admin/images/marker.png
Normal file
After Width: | Height: | Size: 377 B |