This commit is contained in:
root@pico committed 2015-05-01 18:05:29 +02:00
1 parent 081b47e563
commit d4a73670cc
1572 files changed
+235147 -96367

No files matched your search

+56 -21
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// //
// getid3.lib.php - part of getID3() //
@@ -282,7 +283,6 @@ class getid3_lib
}
} else {
throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()');
break;
}
}
return self::CastAsInt($intvalue);
@@ -519,11 +519,12 @@ class getid3_lib
}
public static function XML2array($XMLstring) {
if (function_exists('simplexml_load_string')) {
if (function_exists('get_object_vars')) {
$XMLobject = simplexml_load_string($XMLstring);
return self::SimpleXMLelement2array($XMLobject);
}
if ( function_exists( 'simplexml_load_string' ) && function_exists( 'libxml_disable_entity_loader' ) ) {
$loader = libxml_disable_entity_loader( true );
$XMLobject = simplexml_load_string( $XMLstring, 'SimpleXMLElement', LIBXML_NOENT );
$return = self::SimpleXMLelement2array( $XMLobject );
libxml_disable_entity_loader( $loader );
return $return;
}
return false;
}
@@ -634,7 +635,7 @@ class getid3_lib
}
if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) {
if (($fp_dest = fopen($filename_dest, 'wb'))) {
if (fseek($fp_src, $offset, SEEK_SET) == 0) {
if (fseek($fp_src, $offset) == 0) {
$byteslefttowrite = $length;
while (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) {
$byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite);
@@ -985,6 +986,19 @@ class getid3_lib
throw new Exception('PHP does not have iconv() support - cannot convert from '.$in_charset.' to '.$out_charset);
}
public static function recursiveMultiByteCharString2HTML($data, $charset='ISO-8859-1') {
if (is_string($data)) {
return self::MultiByteCharString2HTML($data, $charset);
} elseif (is_array($data)) {
$return_data = array();
foreach ($data as $key => $value) {
$return_data[$key] = self::recursiveMultiByteCharString2HTML($value, $charset);
}
return $return_data;
}
// integer, float, objects, resources, etc
return $data;
}
public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
$string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string
@@ -1209,16 +1223,21 @@ class getid3_lib
$newvaluelength = strlen(trim($value));
foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) {
$oldvaluelength = strlen(trim($existingvalue));
if (($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) {
if ((strlen($existingvalue) > 10) && ($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) {
$ThisFileInfo['comments'][$tagname][$existingkey] = trim($value);
break 2;
//break 2;
break;
}
}
}
if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) {
$value = (is_string($value) ? trim($value) : $value);
$ThisFileInfo['comments'][$tagname][] = $value;
if (!is_numeric($key)) {
$ThisFileInfo['comments'][$tagname][$key] = $value;
} else {
$ThisFileInfo['comments'][$tagname][] = $value;
}
}
}
}
@@ -1226,20 +1245,23 @@ class getid3_lib
}
// Copy to ['comments_html']
foreach ($ThisFileInfo['comments'] as $field => $values) {
if ($field == 'picture') {
// pictures can take up a lot of space, and we don't need multiple copies of them
// let there be a single copy in [comments][picture], and not elsewhere
continue;
}
foreach ($values as $index => $value) {
if (is_array($value)) {
$ThisFileInfo['comments_html'][$field][$index] = $value;
} else {
$ThisFileInfo['comments_html'][$field][$index] = str_replace('&#0;', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));
if (!empty($ThisFileInfo['comments'])) {
foreach ($ThisFileInfo['comments'] as $field => $values) {
if ($field == 'picture') {
// pictures can take up a lot of space, and we don't need multiple copies of them
// let there be a single copy in [comments][picture], and not elsewhere
continue;
}
foreach ($values as $index => $value) {
if (is_array($value)) {
$ThisFileInfo['comments_html'][$field][$index] = $value;
} else {
$ThisFileInfo['comments_html'][$field][$index] = str_replace('&#0;', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));
}
}
}
}
}
return true;
}
@@ -1338,4 +1360,17 @@ class getid3_lib
}
return $filesize;
}
/**
* Workaround for Bug #37268 (https://bugs.php.net/bug.php?id=37268)
* @param string $path A path.
* @param string $suffix If the name component ends in suffix this will also be cut off.
* @return string
*/
public static function mb_basename($path, $suffix = null) {
$splited = preg_split('#/#', rtrim($path, '/ '));
return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);
}
}
+67 -47
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// //
// Please see readme.txt for more information //
@@ -17,18 +18,21 @@ if (!defined('GETID3_OS_ISWINDOWS')) {
if (!defined('GETID3_INCLUDEPATH')) {
define('GETID3_INCLUDEPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
}
// Workaround Bug #39923 (https://bugs.php.net/bug.php?id=39923)
if (!defined('IMG_JPG') && defined('IMAGETYPE_JPEG')) {
define('IMG_JPG', IMAGETYPE_JPEG);
}
// attempt to define temp dir as something flexible but reliable
$temp_dir = ini_get('upload_tmp_dir');
if ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) {
$temp_dir = '';
}
if (!$temp_dir && function_exists('sys_get_temp_dir')) {
// PHP v5.2.1+
if (!$temp_dir) {
// sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts
$temp_dir = sys_get_temp_dir();
}
$temp_dir = realpath($temp_dir);
$temp_dir = @realpath($temp_dir); // see https://github.com/JamesHeinrich/getID3/pull/10
$open_basedir = ini_get('open_basedir');
if ($open_basedir) {
// e.g. "/var/www/vhosts/getid3.org/httpdocs/:/tmp/"
@@ -57,7 +61,9 @@ if (!$temp_dir) {
$temp_dir = '*'; // invalid directory name should force tempnam() to use system default temp dir
}
// $temp_dir = '/something/else/'; // feel free to override temp dir here if it works better for your system
define('GETID3_TEMP_DIR', $temp_dir);
if (!defined('GETID3_TEMP_DIR')) {
define('GETID3_TEMP_DIR', $temp_dir);
}
unset($open_basedir, $temp_dir);
// End: Defines
@@ -97,13 +103,13 @@ class getID3
public $fp; // Filepointer to file being analysed.
public $info; // Result array.
public $tempdir = GETID3_TEMP_DIR;
public $memory_limit = 0;
// Protected variables
protected $startup_error = '';
protected $startup_warning = '';
protected $memory_limit = 0;
const VERSION = '1.9.7-20130705';
const VERSION = '1.9.8-20140511';
const FREAD_BUFFER_SIZE = 32768;
const ATTACHMENTS_NONE = false;
@@ -112,13 +118,6 @@ class getID3
// public: constructor
public function __construct() {
// Check for PHP version
$required_php_version = '5.0.5';
if (version_compare(PHP_VERSION, $required_php_version, '<')) {
$this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION;
return false;
}
// Check memory
$this->memory_limit = ini_get('memory_limit');
if (preg_match('#([0-9]+)M#i', $this->memory_limit, $matches)) {
@@ -261,16 +260,32 @@ class getID3
$filename = preg_replace('#(.+)'.preg_quote(DIRECTORY_SEPARATOR).'{2,}#U', '\1'.DIRECTORY_SEPARATOR, $filename);
// open local file
if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) {
//if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) { // see http://www.getid3.org/phpBB3/viewtopic.php?t=1720
if ((is_readable($filename) || file_exists($filename)) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) {
// great
} else {
throw new getid3_exception('Could not open "'.$filename.'" (does not exist, or is not a file)');
$errormessagelist = array();
if (!is_readable($filename)) {
$errormessagelist[] = '!is_readable';
}
if (!is_file($filename)) {
$errormessagelist[] = '!is_file';
}
if (!file_exists($filename)) {
$errormessagelist[] = '!file_exists';
}
if (empty($errormessagelist)) {
$errormessagelist[] = 'fopen failed';
}
throw new getid3_exception('Could not open "'.$filename.'" ('.implode('; ', $errormessagelist).')');
}
$this->info['filesize'] = filesize($filename);
// set redundant parameters - might be needed in some include file
$this->info['filename'] = basename($filename);
// filenames / filepaths in getID3 are always expressed with forward slashes (unix-style) for both Windows and other to try and minimize confusion
$filename = str_replace('\\', '/', $filename);
$this->info['filepath'] = str_replace('\\', '/', realpath(dirname($filename)));
$this->info['filename'] = getid3_lib::mb_basename($filename);
$this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];
@@ -352,7 +367,7 @@ class getID3
// ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier
if (!$this->option_tag_id3v2) {
fseek($this->fp, 0, SEEK_SET);
fseek($this->fp, 0);
$header = fread($this->fp, 10);
if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) {
$this->info['id3v2']['header'] = true;
@@ -363,7 +378,7 @@ class getID3
}
// read 32 kb file data
fseek($this->fp, $this->info['avdataoffset'], SEEK_SET);
fseek($this->fp, $this->info['avdataoffset']);
$formattest = fread($this->fp, 32774);
// determine format
@@ -588,6 +603,14 @@ class getID3
'mime_type' => 'audio/basic',
),
// AMR - audio - Adaptive Multi Rate
'amr' => array(
'pattern' => '^\x23\x21AMR\x0A', // #!AMR[0A]
'group' => 'audio',
'module' => 'amr',
'mime_type' => 'audio/amr',
),
// AVR - audio - Audio Visual Research
'avr' => array(
'pattern' => '^2BIT',
@@ -1161,6 +1184,7 @@ class getID3
'matroska' => array('matroska' , 'UTF-8'),
'flac' => array('vorbiscomment' , 'UTF-8'),
'divxtag' => array('divx' , 'ISO-8859-1'),
'iptc' => array('iptc' , 'ISO-8859-1'),
);
}
@@ -1181,7 +1205,11 @@ class getID3
$value = trim($value, " \r\n\t"); // do not trim nulls from $value!! Unicode characters will get mangled if trailing nulls are removed!
}
if ($value) {
$this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value;
if (!is_numeric($key)) {
$this->info['tags'][trim($tag_name)][trim($tag_key)][$key] = $value;
} else {
$this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value;
}
}
}
if ($tag_key == 'picture') {
@@ -1196,14 +1224,7 @@ class getID3
if ($this->option_tags_html) {
foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {
foreach ($valuearray as $key => $value) {
if (is_string($value)) {
//$this->info['tags_html'][$tag_name][$tag_key][$key] = getid3_lib::MultiByteCharString2HTML($value, $encoding);
$this->info['tags_html'][$tag_name][$tag_key][$key] = str_replace('&#0;', '', trim(getid3_lib::MultiByteCharString2HTML($value, $encoding)));
} else {
$this->info['tags_html'][$tag_name][$tag_key][$key] = $value;
}
}
$this->info['tags_html'][$tag_name][$tag_key] = getid3_lib::recursiveMultiByteCharString2HTML($valuearray, $encoding);
}
}
@@ -1259,7 +1280,6 @@ class getID3
return true;
}
public function getHashdata($algorithm) {
switch ($algorithm) {
case 'md5':
@@ -1565,8 +1585,11 @@ class getID3
}
abstract class getid3_handler
{
abstract class getid3_handler {
/**
* @var getID3
*/
protected $getid3; // pointer
protected $data_string_flag = false; // analyzing filepointer or string
@@ -1593,7 +1616,7 @@ abstract class getid3_handler
// Analyze from string instead
public function AnalyzeString($string) {
// Enter string mode
$this->setStringMode($string);
$this->setStringMode($string);
// Save info
$saved_avdataoffset = $this->getid3->info['avdataoffset'];
@@ -1634,10 +1657,10 @@ abstract class getid3_handler
$this->data_string_position += $bytes;
return substr($this->data_string, $this->data_string_position - $bytes, $bytes);
}
$pos = $this->ftell() + $bytes;
if (!getid3_lib::intValueSupported($pos)) {
$pos = $this->ftell() + $bytes;
if (!getid3_lib::intValueSupported($pos)) {
throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10);
}
}
return fread($this->getid3->fp, $bytes);
}
@@ -1657,14 +1680,14 @@ abstract class getid3_handler
break;
}
return 0;
} else {
$pos = $bytes;
if ($whence == SEEK_CUR) {
} else {
$pos = $bytes;
if ($whence == SEEK_CUR) {
$pos = $this->ftell() + $bytes;
} elseif ($whence == SEEK_END) {
$pos = $this->info['filesize'] + $bytes;
}
if (!getid3_lib::intValueSupported($pos)) {
} elseif ($whence == SEEK_END) {
$pos = $this->getid3->info['filesize'] + $bytes;
}
if (!getid3_lib::intValueSupported($pos)) {
throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10);
}
}
@@ -1682,20 +1705,17 @@ abstract class getid3_handler
return $this->dependency_to == $module;
}
protected function error($text)
{
protected function error($text) {
$this->getid3->info['error'][] = $text;
return false;
}
protected function warning($text)
{
protected function warning($text) {
return $this->getid3->warning($text);
}
protected function notice($text)
{
protected function notice($text) {
// does nothing for now
}
+1 -1
View File
@@ -24,4 +24,4 @@ made publicly available to all getID3() users.
The licensee may not sub-license getID3() itself, meaning that any
commercially released product containing all or parts of getID3() must
have added functionality beyond what is available in getID3();
getID3() itself may not be re-licensed by the licensee.
getID3() itself may not be re-licensed by the licensee.
+2 -1
View File
@@ -2,6 +2,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
*****************************************************************
@@ -25,4 +26,4 @@ getID3 Commercial License: http://getid3.org/#gCL (payment required)
*****************************************************************
Copies of each of the above licenses are included in the 'licenses'
directory of the getID3 distribution.
directory of the getID3 distribution.
+77 -83
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -15,8 +16,7 @@
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
class getid3_asf extends getid3_handler
{
class getid3_asf extends getid3_handler {
public function __construct(getID3 $getid3) {
parent::__construct($getid3); // extends getid3_handler::__construct()
@@ -66,25 +66,22 @@ class getid3_asf extends getid3_handler
$info['fileformat'] = 'asf';
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
$HeaderObjectData = fread($this->getid3->fp, 30);
$this->fseek($info['avdataoffset']);
$HeaderObjectData = $this->fread(30);
$thisfile_asf_headerobject['objectid'] = substr($HeaderObjectData, 0, 16);
$thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']);
if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) {
$info['warning'][] = 'ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}';
unset($info['fileformat']);
unset($info['asf']);
return false;
break;
unset($info['fileformat'], $info['asf']);
return $this->error('ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}');
}
$thisfile_asf_headerobject['objectsize'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8));
$thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4));
$thisfile_asf_headerobject['reserved1'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1));
$thisfile_asf_headerobject['reserved2'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1));
$NextObjectOffset = ftell($this->getid3->fp);
$ASFHeaderData = fread($this->getid3->fp, $thisfile_asf_headerobject['objectsize'] - 30);
$NextObjectOffset = $this->ftell();
$ASFHeaderData = $this->fread($thisfile_asf_headerobject['objectsize'] - 30);
$offset = 0;
for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) {
@@ -284,7 +281,7 @@ class getid3_asf extends getid3_handler
$offset += 4;
$thisfile_asf_headerextensionobject['extension_data'] = substr($ASFHeaderData, $offset, $thisfile_asf_headerextensionobject['extension_data_size']);
$unhandled_sections = 0;
$thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->ASF_HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections);
$thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections);
if ($unhandled_sections === 0) {
unset($thisfile_asf_headerextensionobject['extension_data']);
}
@@ -332,7 +329,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf_codeclistobject_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
$thisfile_asf_codeclistobject_codecentries_current['type'] = $this->ASFCodecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']);
$thisfile_asf_codeclistobject_codecentries_current['type'] = self::codecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']);
$CodecNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
$offset += 2;
@@ -826,22 +823,14 @@ class getid3_asf extends getid3_handler
break;
case 'id3':
// id3v2 module might not be loaded
if (class_exists('getid3_id3v2')) {
$tempfile = tempnam(GETID3_TEMP_DIR, 'getID3');
$tempfilehandle = fopen($tempfile, 'wb');
$tempThisfileInfo = array('encoding'=>$info['encoding']);
fwrite($tempfilehandle, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
fclose($tempfilehandle);
$this->getid3->include_module('tag.id3v2');
$getid3_temp = new getID3();
$getid3_temp->openfile($tempfile);
$getid3_id3v2 = new getid3_id3v2($getid3_temp);
$getid3_id3v2->Analyze();
$info['id3v2'] = $getid3_temp->info['id3v2'];
unset($getid3_temp, $getid3_id3v2);
$getid3_id3v2 = new getid3_id3v2($this->getid3);
$getid3_id3v2->AnalyzeString($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
unset($getid3_id3v2);
unlink($tempfile);
if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] > 1024) {
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = '<value too large to display>';
}
break;
@@ -860,7 +849,7 @@ class getid3_asf extends getid3_handler
$wm_picture_offset = 0;
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 1));
$wm_picture_offset += 1;
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type'] = $this->WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']);
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type'] = self::WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']);
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_size'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 4));
$wm_picture_offset += 4;
@@ -1156,8 +1145,8 @@ class getid3_asf extends getid3_handler
}
}
while (ftell($this->getid3->fp) < $info['avdataend']) {
$NextObjectDataHeader = fread($this->getid3->fp, 24);
while ($this->ftell() < $info['avdataend']) {
$NextObjectDataHeader = $this->fread(24);
$offset = 0;
$NextObjectGUID = substr($NextObjectDataHeader, 0, 16);
$offset += 16;
@@ -1179,7 +1168,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf['data_object'] = array();
$thisfile_asf_dataobject = &$thisfile_asf['data_object'];
$DataObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 50 - 24);
$DataObjectData = $NextObjectDataHeader.$this->fread(50 - 24);
$offset = 24;
$thisfile_asf_dataobject['objectid'] = $NextObjectGUID;
@@ -1207,9 +1196,9 @@ class getid3_asf extends getid3_handler
// * * Error Correction Present bits 1 // If set, use Opaque Data Packet structure, else use Payload structure
// * Error Correction Data
$info['avdataoffset'] = ftell($this->getid3->fp);
fseek($this->getid3->fp, ($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data
$info['avdataend'] = ftell($this->getid3->fp);
$info['avdataoffset'] = $this->ftell();
$this->fseek(($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data
$info['avdataend'] = $this->ftell();
break;
case GETID3_ASF_Simple_Index_Object:
@@ -1229,7 +1218,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf['simple_index_object'] = array();
$thisfile_asf_simpleindexobject = &$thisfile_asf['simple_index_object'];
$SimpleIndexObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 56 - 24);
$SimpleIndexObjectData = $NextObjectDataHeader.$this->fread(56 - 24);
$offset = 24;
$thisfile_asf_simpleindexobject['objectid'] = $NextObjectGUID;
@@ -1246,7 +1235,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf_simpleindexobject['index_entries_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));
$offset += 4;
$IndexEntriesData = $SimpleIndexObjectData.fread($this->getid3->fp, 6 * $thisfile_asf_simpleindexobject['index_entries_count']);
$IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $thisfile_asf_simpleindexobject['index_entries_count']);
for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) {
$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));
$offset += 4;
@@ -1283,7 +1272,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf['asf_index_object'] = array();
$thisfile_asf_asfindexobject = &$thisfile_asf['asf_index_object'];
$ASFIndexObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 34 - 24);
$ASFIndexObjectData = $NextObjectDataHeader.$this->fread(34 - 24);
$offset = 24;
$thisfile_asf_asfindexobject['objectid'] = $NextObjectGUID;
@@ -1297,7 +1286,7 @@ class getid3_asf extends getid3_handler
$thisfile_asf_asfindexobject['index_blocks_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
$offset += 4;
$ASFIndexObjectData .= fread($this->getid3->fp, 4 * $thisfile_asf_asfindexobject['index_specifiers_count']);
$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count']);
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
$IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
$offset += 2;
@@ -1307,17 +1296,17 @@ class getid3_asf extends getid3_handler
$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type_text'] = $this->ASFIndexObjectIndexTypeLookup($thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']);
}
$ASFIndexObjectData .= fread($this->getid3->fp, 4);
$ASFIndexObjectData .= $this->fread(4);
$thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
$offset += 4;
$ASFIndexObjectData .= fread($this->getid3->fp, 8 * $thisfile_asf_asfindexobject['index_specifiers_count']);
$ASFIndexObjectData .= $this->fread(8 * $thisfile_asf_asfindexobject['index_specifiers_count']);
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
$thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8));
$offset += 8;
}
$ASFIndexObjectData .= fread($this->getid3->fp, 4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']);
$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']);
for ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) {
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
$thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
@@ -1332,9 +1321,9 @@ class getid3_asf extends getid3_handler
if ($this->GUIDname($NextObjectGUIDtext)) {
$info['warning'][] = 'unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8);
} else {
$info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.(ftell($this->getid3->fp) - 16 - 8);
$info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.($this->ftell() - 16 - 8);
}
fseek($this->getid3->fp, ($NextObjectSize - 16 - 8), SEEK_CUR);
$this->fseek(($NextObjectSize - 16 - 8), SEEK_CUR);
break;
}
}
@@ -1433,10 +1422,10 @@ class getid3_asf extends getid3_handler
$thisfile_video['dataformat'] = (!empty($thisfile_video['dataformat']) ? $thisfile_video['dataformat'] : 'asf');
}
if (!empty($thisfile_video['streams'])) {
$thisfile_video['streams']['resolution_x'] = 0;
$thisfile_video['streams']['resolution_y'] = 0;
$thisfile_video['resolution_x'] = 0;
$thisfile_video['resolution_y'] = 0;
foreach ($thisfile_video['streams'] as $key => $valuearray) {
if (($valuearray['resolution_x'] > $thisfile_video['streams']['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['streams']['resolution_y'])) {
if (($valuearray['resolution_x'] > $thisfile_video['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['resolution_y'])) {
$thisfile_video['resolution_x'] = $valuearray['resolution_x'];
$thisfile_video['resolution_y'] = $valuearray['resolution_y'];
}
@@ -1451,15 +1440,14 @@ class getid3_asf extends getid3_handler
return true;
}
public static function ASFCodecListObjectTypeLookup($CodecListType) {
static $ASFCodecListObjectTypeLookup = array();
if (empty($ASFCodecListObjectTypeLookup)) {
$ASFCodecListObjectTypeLookup[0x0001] = 'Video Codec';
$ASFCodecListObjectTypeLookup[0x0002] = 'Audio Codec';
$ASFCodecListObjectTypeLookup[0xFFFF] = 'Unknown Codec';
}
public static function codecListObjectTypeLookup($CodecListType) {
static $lookup = array(
0x0001 => 'Video Codec',
0x0002 => 'Audio Codec',
0xFFFF => 'Unknown Codec'
);
return (isset($ASFCodecListObjectTypeLookup[$CodecListType]) ? $ASFCodecListObjectTypeLookup[$CodecListType] : 'Invalid Codec Type');
return (isset($lookup[$CodecListType]) ? $lookup[$CodecListType] : 'Invalid Codec Type');
}
public static function KnownGUIDs() {
@@ -1666,31 +1654,37 @@ class getid3_asf extends getid3_handler
}
public static function WMpictureTypeLookup($WMpictureType) {
static $WMpictureTypeLookup = array();
if (empty($WMpictureTypeLookup)) {
$WMpictureTypeLookup[0x03] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Front Cover');
$WMpictureTypeLookup[0x04] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Back Cover');
$WMpictureTypeLookup[0x00] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'User Defined');
$WMpictureTypeLookup[0x05] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Leaflet Page');
$WMpictureTypeLookup[0x06] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Media Label');
$WMpictureTypeLookup[0x07] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Lead Artist');
$WMpictureTypeLookup[0x08] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Artist');
$WMpictureTypeLookup[0x09] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Conductor');
$WMpictureTypeLookup[0x0A] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Band');
$WMpictureTypeLookup[0x0B] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Composer');
$WMpictureTypeLookup[0x0C] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Lyricist');
$WMpictureTypeLookup[0x0D] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Recording Location');
$WMpictureTypeLookup[0x0E] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'During Recording');
$WMpictureTypeLookup[0x0F] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'During Performance');
$WMpictureTypeLookup[0x10] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Video Screen Capture');
$WMpictureTypeLookup[0x12] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Illustration');
$WMpictureTypeLookup[0x13] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Band Logotype');
$WMpictureTypeLookup[0x14] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Publisher Logotype');
static $lookup = null;
if ($lookup === null) {
$lookup = array(
0x03 => 'Front Cover',
0x04 => 'Back Cover',
0x00 => 'User Defined',
0x05 => 'Leaflet Page',
0x06 => 'Media Label',
0x07 => 'Lead Artist',
0x08 => 'Artist',
0x09 => 'Conductor',
0x0A => 'Band',
0x0B => 'Composer',
0x0C => 'Lyricist',
0x0D => 'Recording Location',
0x0E => 'During Recording',
0x0F => 'During Performance',
0x10 => 'Video Screen Capture',
0x12 => 'Illustration',
0x13 => 'Band Logotype',
0x14 => 'Publisher Logotype'
);
$lookup = array_map(function($str) {
return getid3_lib::iconv_fallback('UTF-8', 'UTF-16LE', $str);
}, $lookup);
}
return (isset($WMpictureTypeLookup[$WMpictureType]) ? $WMpictureTypeLookup[$WMpictureType] : '');
return (isset($lookup[$WMpictureType]) ? $lookup[$WMpictureType] : '');
}
public function ASF_HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
public function HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
// http://msdn.microsoft.com/en-us/library/bb643323.aspx
$offset = 0;
@@ -1825,7 +1819,7 @@ class getid3_asf extends getid3_handler
$descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
$offset += 2;
$descriptionRecord['data_type_text'] = $this->ASFmetadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
$descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
$descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
$offset += 4;
@@ -1897,7 +1891,7 @@ class getid3_asf extends getid3_handler
$descriptionRecord['data_type'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 2));
$offset += 2;
$descriptionRecord['data_type_text'] = $this->ASFmetadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
$descriptionRecord['data_type_text'] = self::metadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
$descriptionRecord['data_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset, 4));
$offset += 4;
@@ -1937,8 +1931,8 @@ class getid3_asf extends getid3_handler
}
public static function ASFmetadataLibraryObjectDataTypeLookup($id) {
static $ASFmetadataLibraryObjectDataTypeLookup = array(
public static function metadataLibraryObjectDataTypeLookup($id) {
static $lookup = array(
0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters
0x0001 => 'BYTE array', // The type of the data is implementation-specific
0x0002 => 'BOOL', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values
@@ -1947,7 +1941,7 @@ class getid3_asf extends getid3_handler
0x0005 => 'WORD', // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer
0x0006 => 'GUID', // The data is 16 bytes long and should be interpreted as a 128-bit GUID
);
return (isset($ASFmetadataLibraryObjectDataTypeLookup[$id]) ? $ASFmetadataLibraryObjectDataTypeLookup[$id] : 'invalid');
return (isset($lookup[$id]) ? $lookup[$id] : 'invalid');
}
public function ASF_WMpicture(&$data) {
@@ -1964,7 +1958,7 @@ class getid3_asf extends getid3_handler
$offset = 0;
$WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1));
$offset += 1;
$WMpicture['image_type'] = $this->WMpictureTypeLookup($WMpicture['image_type_id']);
$WMpicture['image_type'] = self::WMpictureTypeLookup($WMpicture['image_type_id']);
$WMpicture['image_size'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 4));
$offset += 4;
@@ -2016,4 +2010,4 @@ class getid3_asf extends getid3_handler
return $string;
}
}
}
+110 -94
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
// //
// FLV module by Seth Kaufman <sethØwhirl-i-gig*com> //
// //
@@ -38,6 +39,11 @@
// * version 0.6.1 (30 May 2011) //
// prevent infinite loops in expGolombUe() //
// //
// * version 0.7.0 (16 Jul 2013) //
// handle GETID3_FLV_VIDEO_VP6FLV_ALPHA //
// improved AVCSequenceParameterSetReader::readData() //
// by Xander Schouwerwou <schouwerwouØgmail*com> //
// //
/////////////////////////////////////////////////////////////////
// //
// module.audio-video.flv.php //
@@ -67,38 +73,38 @@ define('H264_PROFILE_HIGH422', 122);
define('H264_PROFILE_HIGH444', 144);
define('H264_PROFILE_HIGH444_PREDICTIVE', 244);
class getid3_flv extends getid3_handler
{
class getid3_flv extends getid3_handler {
const magic = 'FLV';
public $max_frames = 100000; // break out of the loop if too many frames have been scanned; only scan this many if meta frame does not contain useful duration
public function Analyze() {
$info = &$this->getid3->info;
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
$this->fseek($info['avdataoffset']);
$FLVdataLength = $info['avdataend'] - $info['avdataoffset'];
$FLVheader = fread($this->getid3->fp, 5);
$FLVheader = $this->fread(5);
$info['fileformat'] = 'flv';
$info['flv']['header']['signature'] = substr($FLVheader, 0, 3);
$info['flv']['header']['version'] = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1));
$TypeFlags = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1));
$magic = 'FLV';
if ($info['flv']['header']['signature'] != $magic) {
$info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"';
unset($info['flv']);
unset($info['fileformat']);
if ($info['flv']['header']['signature'] != self::magic) {
$info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes(self::magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"';
unset($info['flv'], $info['fileformat']);
return false;
}
$info['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04);
$info['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01);
$FrameSizeDataLength = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4));
$FrameSizeDataLength = getid3_lib::BigEndian2Int($this->fread(4));
$FLVheaderFrameLength = 9;
if ($FrameSizeDataLength > $FLVheaderFrameLength) {
fseek($this->getid3->fp, $FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR);
$this->fseek($FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR);
}
$Duration = 0;
$found_video = false;
@@ -108,15 +114,15 @@ class getid3_flv extends getid3_handler
$tagParseCount = 0;
$info['flv']['framecount'] = array('total'=>0, 'audio'=>0, 'video'=>0);
$flv_framecount = &$info['flv']['framecount'];
while (((ftell($this->getid3->fp) + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime)) {
$ThisTagHeader = fread($this->getid3->fp, 16);
while ((($this->ftell() + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime)) {
$ThisTagHeader = $this->fread(16);
$PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 0, 4));
$TagType = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 4, 1));
$DataLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 5, 3));
$Timestamp = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 8, 3));
$LastHeaderByte = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1));
$NextOffset = ftell($this->getid3->fp) - 1 + $DataLength;
$NextOffset = $this->ftell() - 1 + $DataLength;
if ($Timestamp > $Duration) {
$Duration = $Timestamp;
}
@@ -140,7 +146,7 @@ class getid3_flv extends getid3_handler
$found_video = true;
$info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07;
$FLVvideoHeader = fread($this->getid3->fp, 11);
$FLVvideoHeader = $this->fread(11);
if ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) {
// this code block contributed by: moysevichØgmail*com
@@ -160,7 +166,7 @@ class getid3_flv extends getid3_handler
//$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2));
$spsSize = getid3_lib::LittleEndian2Int(substr($FLVvideoHeader, 9, 2));
// read the first SequenceParameterSet
$sps = fread($this->getid3->fp, $spsSize);
$sps = $this->fread($spsSize);
if (strlen($sps) == $spsSize) { // make sure that whole SequenceParameterSet was red
$spsReader = new AVCSequenceParameterSetReader($sps);
$spsReader->readData();
@@ -185,19 +191,15 @@ class getid3_flv extends getid3_handler
//$PictureSizeEnc <<= 1;
//$info['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8;
$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2));
$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
$PictureSizeEnc['x'] >>= 7;
$PictureSizeEnc['y'] >>= 7;
$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2)) >> 7;
$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2)) >> 7;
$info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFF;
$info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFF;
break;
case 1:
$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3));
$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3));
$PictureSizeEnc['x'] >>= 7;
$PictureSizeEnc['y'] >>= 7;
$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3)) >> 7;
$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3)) >> 7;
$info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFFFF;
$info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFFFF;
break;
@@ -233,8 +235,22 @@ class getid3_flv extends getid3_handler
break;
}
} elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_VP6FLV_ALPHA) {
/* contributed by schouwerwouØgmail*com */
if (!isset($info['video']['resolution_x'])) { // only when meta data isn't set
$PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));
$PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 2));
$info['video']['resolution_x'] = ($PictureSizeEnc['x'] & 0xFF) << 3;
$info['video']['resolution_y'] = ($PictureSizeEnc['y'] & 0xFF) << 3;
}
/* end schouwerwouØgmail*com */
}
if (!empty($info['video']['resolution_x']) && !empty($info['video']['resolution_y'])) {
$info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y'];
}
$info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y'];
}
break;
@@ -242,8 +258,8 @@ class getid3_flv extends getid3_handler
case GETID3_FLV_TAG_META:
if (!$found_meta) {
$found_meta = true;
fseek($this->getid3->fp, -1, SEEK_CUR);
$datachunk = fread($this->getid3->fp, $DataLength);
$this->fseek(-1, SEEK_CUR);
$datachunk = $this->fread($DataLength);
$AMFstream = new AMFStream($datachunk);
$reader = new AMFReader($AMFstream);
$eventName = $reader->readData();
@@ -279,7 +295,7 @@ class getid3_flv extends getid3_handler
// noop
break;
}
fseek($this->getid3->fp, $NextOffset, SEEK_SET);
$this->fseek($NextOffset);
}
$info['playtime_seconds'] = $Duration / 1000;
@@ -288,16 +304,16 @@ class getid3_flv extends getid3_handler
}
if ($info['flv']['header']['hasAudio']) {
$info['audio']['codec'] = $this->FLVaudioFormat($info['flv']['audio']['audioFormat']);
$info['audio']['sample_rate'] = $this->FLVaudioRate($info['flv']['audio']['audioRate']);
$info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info['flv']['audio']['audioSampleSize']);
$info['audio']['codec'] = self::audioFormatLookup($info['flv']['audio']['audioFormat']);
$info['audio']['sample_rate'] = self::audioRateLookup($info['flv']['audio']['audioRate']);
$info['audio']['bits_per_sample'] = self::audioBitDepthLookup($info['flv']['audio']['audioSampleSize']);
$info['audio']['channels'] = $info['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo
$info['audio']['lossless'] = ($info['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed
$info['audio']['dataformat'] = 'flv';
}
if (!empty($info['flv']['header']['hasVideo'])) {
$info['video']['codec'] = $this->FLVvideoCodec($info['flv']['video']['videoCodec']);
$info['video']['codec'] = self::videoCodecLookup($info['flv']['video']['videoCodec']);
$info['video']['dataformat'] = 'flv';
$info['video']['lossless'] = false;
}
@@ -308,17 +324,17 @@ class getid3_flv extends getid3_handler
$info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
}
if (isset($info['flv']['meta']['onMetaData']['audiocodecid'])) {
$info['audio']['codec'] = $this->FLVaudioFormat($info['flv']['meta']['onMetaData']['audiocodecid']);
$info['audio']['codec'] = self::audioFormatLookup($info['flv']['meta']['onMetaData']['audiocodecid']);
}
if (isset($info['flv']['meta']['onMetaData']['videocodecid'])) {
$info['video']['codec'] = $this->FLVvideoCodec($info['flv']['meta']['onMetaData']['videocodecid']);
$info['video']['codec'] = self::videoCodecLookup($info['flv']['meta']['onMetaData']['videocodecid']);
}
return true;
}
public function FLVaudioFormat($id) {
$FLVaudioFormat = array(
public static function audioFormatLookup($id) {
static $lookup = array(
0 => 'Linear PCM, platform endian',
1 => 'ADPCM',
2 => 'mp3',
@@ -330,35 +346,35 @@ class getid3_flv extends getid3_handler
8 => 'G.711 mu-law logarithmic PCM',
9 => 'reserved',
10 => 'AAC',
11 => false, // unknown?
11 => 'Speex',
12 => false, // unknown?
13 => false, // unknown?
14 => 'mp3 8kHz',
15 => 'Device-specific sound',
);
return (isset($FLVaudioFormat[$id]) ? $FLVaudioFormat[$id] : false);
return (isset($lookup[$id]) ? $lookup[$id] : false);
}
public function FLVaudioRate($id) {
$FLVaudioRate = array(
public static function audioRateLookup($id) {
static $lookup = array(
0 => 5500,
1 => 11025,
2 => 22050,
3 => 44100,
);
return (isset($FLVaudioRate[$id]) ? $FLVaudioRate[$id] : false);
return (isset($lookup[$id]) ? $lookup[$id] : false);
}
public function FLVaudioBitDepth($id) {
$FLVaudioBitDepth = array(
public static function audioBitDepthLookup($id) {
static $lookup = array(
0 => 8,
1 => 16,
);
return (isset($FLVaudioBitDepth[$id]) ? $FLVaudioBitDepth[$id] : false);
return (isset($lookup[$id]) ? $lookup[$id] : false);
}
public function FLVvideoCodec($id) {
$FLVvideoCodec = array(
public static function videoCodecLookup($id) {
static $lookup = array(
GETID3_FLV_VIDEO_H263 => 'Sorenson H.263',
GETID3_FLV_VIDEO_SCREEN => 'Screen video',
GETID3_FLV_VIDEO_VP6FLV => 'On2 VP6',
@@ -366,7 +382,7 @@ class getid3_flv extends getid3_handler
GETID3_FLV_VIDEO_SCREENV2 => 'Screen video v2',
GETID3_FLV_VIDEO_H264 => 'Sorenson H.264',
);
return (isset($FLVvideoCodec[$id]) ? $FLVvideoCodec[$id] : false);
return (isset($lookup[$id]) ? $lookup[$id] : false);
}
}
@@ -374,7 +390,7 @@ class AMFStream {
public $bytes;
public $pos;
public function AMFStream(&$bytes) {
public function __construct(&$bytes) {
$this->bytes =& $bytes;
$this->pos = 0;
}
@@ -457,7 +473,7 @@ class AMFStream {
class AMFReader {
public $stream;
public function AMFReader(&$stream) {
public function __construct(&$stream) {
$this->stream =& $stream;
}
@@ -619,60 +635,60 @@ class AVCSequenceParameterSetReader {
public $width;
public $height;
public function AVCSequenceParameterSetReader($sps) {
public function __construct($sps) {
$this->sps = $sps;
}
public function readData() {
$this->skipBits(8);
$this->skipBits(8);
$profile = $this->getBits(8); // read profile
$this->skipBits(16);
$this->expGolombUe(); // read sps id
if (in_array($profile, array(H264_PROFILE_HIGH, H264_PROFILE_HIGH10, H264_PROFILE_HIGH422, H264_PROFILE_HIGH444, H264_PROFILE_HIGH444_PREDICTIVE))) {
if ($this->expGolombUe() == 3) {
$this->skipBits(1);
}
$this->expGolombUe();
$this->expGolombUe();
$this->skipBits(1);
if ($this->getBit()) {
for ($i = 0; $i < 8; $i++) {
if ($this->getBit()) {
$size = $i < 6 ? 16 : 64;
$lastScale = 8;
$nextScale = 8;
for ($j = 0; $j < $size; $j++) {
if ($nextScale != 0) {
$deltaScale = $this->expGolombUe();
$nextScale = ($lastScale + $deltaScale + 256) % 256;
}
if ($nextScale != 0) {
$lastScale = $nextScale;
}
}
}
$profile = $this->getBits(8); // read profile
if ($profile > 0) {
$this->skipBits(8);
$level_idc = $this->getBits(8); // level_idc
$this->expGolombUe(); // seq_parameter_set_id // sps
$this->expGolombUe(); // log2_max_frame_num_minus4
$picOrderType = $this->expGolombUe(); // pic_order_cnt_type
if ($picOrderType == 0) {
$this->expGolombUe(); // log2_max_pic_order_cnt_lsb_minus4
} elseif ($picOrderType == 1) {
$this->skipBits(1); // delta_pic_order_always_zero_flag
$this->expGolombSe(); // offset_for_non_ref_pic
$this->expGolombSe(); // offset_for_top_to_bottom_field
$num_ref_frames_in_pic_order_cnt_cycle = $this->expGolombUe(); // num_ref_frames_in_pic_order_cnt_cycle
for ($i = 0; $i < $num_ref_frames_in_pic_order_cnt_cycle; $i++) {
$this->expGolombSe(); // offset_for_ref_frame[ i ]
}
}
}
$this->expGolombUe();
$pocType = $this->expGolombUe();
if ($pocType == 0) {
$this->expGolombUe();
} elseif ($pocType == 1) {
$this->skipBits(1);
$this->expGolombSe();
$this->expGolombSe();
$pocCycleLength = $this->expGolombUe();
for ($i = 0; $i < $pocCycleLength; $i++) {
$this->expGolombSe();
$this->expGolombUe(); // num_ref_frames
$this->skipBits(1); // gaps_in_frame_num_value_allowed_flag
$pic_width_in_mbs_minus1 = $this->expGolombUe(); // pic_width_in_mbs_minus1
$pic_height_in_map_units_minus1 = $this->expGolombUe(); // pic_height_in_map_units_minus1
$frame_mbs_only_flag = $this->getBits(1); // frame_mbs_only_flag
if ($frame_mbs_only_flag == 0) {
$this->skipBits(1); // mb_adaptive_frame_field_flag
}
$this->skipBits(1); // direct_8x8_inference_flag
$frame_cropping_flag = $this->getBits(1); // frame_cropping_flag
$frame_crop_left_offset = 0;
$frame_crop_right_offset = 0;
$frame_crop_top_offset = 0;
$frame_crop_bottom_offset = 0;
if ($frame_cropping_flag) {
$frame_crop_left_offset = $this->expGolombUe(); // frame_crop_left_offset
$frame_crop_right_offset = $this->expGolombUe(); // frame_crop_right_offset
$frame_crop_top_offset = $this->expGolombUe(); // frame_crop_top_offset
$frame_crop_bottom_offset = $this->expGolombUe(); // frame_crop_bottom_offset
}
$this->skipBits(1); // vui_parameters_present_flag
// etc
$this->width = (($pic_width_in_mbs_minus1 + 1) * 16) - ($frame_crop_left_offset * 2) - ($frame_crop_right_offset * 2);
$this->height = ((2 - $frame_mbs_only_flag) * ($pic_height_in_map_units_minus1 + 1) * 16) - ($frame_crop_top_offset * 2) - ($frame_crop_bottom_offset * 2);
}
$this->expGolombUe();
$this->skipBits(1);
$this->width = ($this->expGolombUe() + 1) * 16;
$heightMap = $this->expGolombUe() + 1;
$this->height = (2 - $this->getBit()) * $heightMap * 16;
}
public function skipBits($bits) {
@@ -726,4 +742,4 @@ class AVCSequenceParameterSetReader {
public function getHeight() {
return $this->height;
}
}
}
+11 -25
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -281,10 +282,8 @@ class getid3_matroska extends getid3_handler
switch ($trackarray['CodecID']) {
case 'V_MS/VFW/FOURCC':
if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, false)) {
$this->warning('Unable to parse codec private data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio-video.riff.php"');
break;
}
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
$parsed = getid3_riff::ParseBITMAPINFOHEADER($trackarray['CodecPrivate']);
$track_info['codec'] = getid3_riff::fourccLookup($parsed['fourcc']);
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
@@ -335,10 +334,7 @@ class getid3_matroska extends getid3_handler
case 'A_MPEG/L3':
case 'A_MPEG/L2':
case 'A_FLAC':
if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.($track_info['dataformat'] == 'mp2' ? 'mp3' : $track_info['dataformat']).'.php', __FILE__, false)) {
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio.'.$track_info['dataformat'].'.php"');
break;
}
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.($track_info['dataformat'] == 'mp2' ? 'mp3' : $track_info['dataformat']).'.php', __FILE__, true);
if (!isset($info['matroska']['track_data_offsets'][$trackarray['TrackNumber']])) {
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because $info[matroska][track_data_offsets]['.$trackarray['TrackNumber'].'] not set');
@@ -385,10 +381,6 @@ class getid3_matroska extends getid3_handler
}
if (!empty($getid3_temp->info['warning'])) {
foreach ($getid3_temp->info['warning'] as $newerror) {
if ($track_info['dataformat'] == 'mp3' && preg_match('/^Probable truncated file: expecting \d+ bytes of audio data, only found \d+ \(short by \d+ bytes\)$/', $newerror)) {
// LAME/Xing header is probably set, but audio data is chunked into Matroska file and near-impossible to verify if audio stream is complete, so ignore useless warning
continue;
}
$this->warning($class.'() says: ['.$newerror.']');
}
}
@@ -400,7 +392,7 @@ class getid3_matroska extends getid3_handler
case 'A_AAC/MPEG2/LC/SBR':
case 'A_AAC/MPEG4/LC':
case 'A_AAC/MPEG4/LC/SBR':
$this->warning($trackarray['CodecID'].' audio data contains no header, audio/video bitrates can\'t be calculated');
$this->warning($trackarray['CodecID'].' audio data contains no header, audio/video bitrates can\'t be calculated');
break;
case 'A_VORBIS':
@@ -415,10 +407,7 @@ class getid3_matroska extends getid3_handler
}
$vorbis_offset -= 1;
if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, false)) {
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio.ogg.php"');
break;
}
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);
// create temp instance
$getid3_temp = new getID3();
@@ -455,10 +444,7 @@ class getid3_matroska extends getid3_handler
break;
case 'A_MS/ACM':
if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, false)) {
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio-video.riff.php"');
break;
}
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
$parsed = getid3_riff::parseWAVEFORMATex($trackarray['CodecPrivate']);
foreach ($parsed as $key => $value) {
@@ -515,7 +501,6 @@ class getid3_matroska extends getid3_handler
switch ($top_element['id']) {
case EBML_ID_EBML:
$info['fileformat'] = 'matroska';
$info['matroska']['header']['offset'] = $top_element['offset'];
$info['matroska']['header']['length'] = $top_element['length'];
@@ -534,6 +519,7 @@ class getid3_matroska extends getid3_handler
case EBML_ID_DOCTYPE:
$element_data['data'] = getid3_lib::trimNullByte($element_data['data']);
$info['matroska']['doctype'] = $element_data['data'];
$info['fileformat'] = $element_data['data'];
break;
default:
@@ -1526,8 +1512,8 @@ class getid3_matroska extends getid3_handler
$CodecIDlist['V_MPEG4/ISO/AVC'] = 'h264';
$CodecIDlist['V_MPEG4/ISO/SP'] = 'mpeg4';
$CodecIDlist['V_VP8'] = 'vp8';
$CodecIDlist['V_MS/VFW/FOURCC'] = 'riff';
$CodecIDlist['A_MS/ACM'] = 'riff';
$CodecIDlist['V_MS/VFW/FOURCC'] = 'vcm'; // Microsoft (TM) Video Codec Manager (VCM)
$CodecIDlist['A_MS/ACM'] = 'acm'; // Microsoft (TM) Audio Codec Manager (ACM)
}
return (isset($CodecIDlist[$codecid]) ? $CodecIDlist[$codecid] : $codecid);
}
@@ -1762,4 +1748,4 @@ class getid3_matroska extends getid3_handler
return $info;
}
}
}
+203 -178
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -30,7 +31,7 @@ class getid3_quicktime extends getid3_handler
$info['quicktime']['hinting'] = false;
$info['quicktime']['controller'] = 'standard'; // may be overridden if 'ctyp' atom is present
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
$this->fseek($info['avdataoffset']);
$offset = 0;
$atomcounter = 0;
@@ -40,15 +41,15 @@ class getid3_quicktime extends getid3_handler
$info['error'][] = 'Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions';
break;
}
fseek($this->getid3->fp, $offset, SEEK_SET);
$AtomHeader = fread($this->getid3->fp, 8);
$this->fseek($offset);
$AtomHeader = $this->fread(8);
$atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4));
$atomname = substr($AtomHeader, 4, 4);
// 64-bit MOV patch by jlegateØktnc*com
if ($atomsize == 1) {
$atomsize = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 8));
$atomsize = getid3_lib::BigEndian2Int($this->fread(8));
}
$info['quicktime'][$atomname]['name'] = $atomname;
@@ -66,58 +67,8 @@ class getid3_quicktime extends getid3_handler
// to read user data atoms, you should allow for the terminating 0.
break;
}
switch ($atomname) {
case 'mdat': // Media DATa atom
// 'mdat' contains the actual data for the audio/video
if (($atomsize > 8) && (!isset($info['avdataend_tmp']) || ($info['quicktime'][$atomname]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) {
$info['avdataoffset'] = $info['quicktime'][$atomname]['offset'] + 8;
$OldAVDataEnd = $info['avdataend'];
$info['avdataend'] = $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
$getid3_temp->info['avdataend'] = $info['avdataend'];
$getid3_mp3 = new getid3_mp3($getid3_temp);
if ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode(fread($this->getid3->fp, 4)))) {
$getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
if (!empty($getid3_temp->info['warning'])) {
foreach ($getid3_temp->info['warning'] as $value) {
$info['warning'][] = $value;
}
}
if (!empty($getid3_temp->info['mpeg'])) {
$info['mpeg'] = $getid3_temp->info['mpeg'];
if (isset($info['mpeg']['audio'])) {
$info['audio']['dataformat'] = 'mp3';
$info['audio']['codec'] = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3')));
$info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate'];
$info['audio']['channels'] = $info['mpeg']['audio']['channels'];
$info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate'];
$info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
$info['bitrate'] = $info['audio']['bitrate'];
}
}
}
unset($getid3_mp3, $getid3_temp);
$info['avdataend'] = $OldAVDataEnd;
unset($OldAVDataEnd);
}
break;
case 'free': // FREE space atom
case 'skip': // SKIP atom
case 'wide': // 64-bit expansion placeholder atom
// 'free', 'skip' and 'wide' are just padding, contains no useful data at all
break;
default:
$atomHierarchy = array();
$info['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, fread($this->getid3->fp, $atomsize), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
break;
}
$atomHierarchy = array();
$info['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, $this->fread(min($atomsize, round($this->getid3->memory_limit / 2))), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
$offset += $atomsize;
$atomcounter++;
@@ -172,15 +123,12 @@ class getid3_quicktime extends getid3_handler
$info = &$this->getid3->info;
//$atom_parent = array_pop($atomHierarchy);
$atom_parent = end($atomHierarchy); // http://www.getid3.org/phpBB3/viewtopic.php?t=1717
$atom_parent = end($atomHierarchy); // not array_pop($atomHierarchy); see http://www.getid3.org/phpBB3/viewtopic.php?t=1717
array_push($atomHierarchy, $atomname);
$atom_structure['hierarchy'] = implode(' ', $atomHierarchy);
$atom_structure['name'] = $atomname;
$atom_structure['size'] = $atomsize;
$atom_structure['offset'] = $baseoffset;
//echo getid3_lib::PrintHexBytes(substr($atom_data, 0, 8)).'<br>';
//echo getid3_lib::PrintHexBytes(substr($atom_data, 0, 8), false).'<br><br>';
switch ($atomname) {
case 'moov': // MOVie container atom
case 'trak': // TRAcK container atom
@@ -200,27 +148,27 @@ class getid3_quicktime extends getid3_handler
break;
case 'ilst': // Item LiST container atom
$atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
// some "ilst" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted
$allnumericnames = true;
foreach ($atom_structure['subatoms'] as $subatomarray) {
if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) {
$allnumericnames = false;
break;
}
}
if ($allnumericnames) {
$newData = array();
if ($atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms)) {
// some "ilst" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted
$allnumericnames = true;
foreach ($atom_structure['subatoms'] as $subatomarray) {
foreach ($subatomarray['subatoms'] as $newData_subatomarray) {
unset($newData_subatomarray['hierarchy'], $newData_subatomarray['name']);
$newData[$subatomarray['name']] = $newData_subatomarray;
if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) {
$allnumericnames = false;
break;
}
}
$atom_structure['data'] = $newData;
unset($atom_structure['subatoms']);
if ($allnumericnames) {
$newData = array();
foreach ($atom_structure['subatoms'] as $subatomarray) {
foreach ($subatomarray['subatoms'] as $newData_subatomarray) {
unset($newData_subatomarray['hierarchy'], $newData_subatomarray['name']);
$newData[$subatomarray['name']] = $newData_subatomarray;
break;
}
}
$atom_structure['data'] = $newData;
unset($atom_structure['subatoms']);
}
}
break;
@@ -308,46 +256,46 @@ class getid3_quicktime extends getid3_handler
case 'geID':
case 'plID':
case 'sfID': // iTunes store country
case '©alb': // ALBum
case '©art': // ARTist
case '©ART':
case '©aut':
case '©cmt': // CoMmenT
case '©com': // COMposer
case '©cpy':
case '©day': // content created year
case '©dir':
case '©ed1':
case '©ed2':
case '©ed3':
case '©ed4':
case '©ed5':
case '©ed6':
case '©ed7':
case '©ed8':
case '©ed9':
case '©enc':
case '©fmt':
case '©gen': // GENre
case '©grp': // GRouPing
case '©hst':
case '©inf':
case '©lyr': // LYRics
case '©mak':
case '©mod':
case '©nam': // full NAMe
case '©ope':
case '©PRD':
case '©prd':
case '©prf':
case '©req':
case '©src':
case '©swr':
case '©too': // encoder
case '©trk': // TRacK
case '©url':
case '©wrn':
case '©wrt': // WRiTer
case "\xA9".'alb': // ALBum
case "\xA9".'art': // ARTist
case "\xA9".'ART':
case "\xA9".'aut':
case "\xA9".'cmt': // CoMmenT
case "\xA9".'com': // COMposer
case "\xA9".'cpy':
case "\xA9".'day': // content created year
case "\xA9".'dir':
case "\xA9".'ed1':
case "\xA9".'ed2':
case "\xA9".'ed3':
case "\xA9".'ed4':
case "\xA9".'ed5':
case "\xA9".'ed6':
case "\xA9".'ed7':
case "\xA9".'ed8':
case "\xA9".'ed9':
case "\xA9".'enc':
case "\xA9".'fmt':
case "\xA9".'gen': // GENre
case "\xA9".'grp': // GRouPing
case "\xA9".'hst':
case "\xA9".'inf':
case "\xA9".'lyr': // LYRics
case "\xA9".'mak':
case "\xA9".'mod':
case "\xA9".'nam': // full NAMe
case "\xA9".'ope':
case "\xA9".'PRD':
case "\xA9".'prd':
case "\xA9".'prf':
case "\xA9".'req':
case "\xA9".'src':
case "\xA9".'swr':
case "\xA9".'too': // encoder
case "\xA9".'trk': // TRacK
case "\xA9".'url':
case "\xA9".'wrn':
case "\xA9".'wrt': // WRiTer
case '----': // itunes specific
if ($atom_parent == 'udta') {
// User data atom handler
@@ -370,7 +318,7 @@ class getid3_quicktime extends getid3_handler
$boxsmalltype = substr($atom_data, $atomoffset + 2, 2);
$boxsmalldata = substr($atom_data, $atomoffset + 4, $boxsmallsize);
if ($boxsmallsize <= 1) {
$info['warning'][] = 'Invalid QuickTime atom smallbox size "'.$boxsmallsize.'" in atom "'.$atomname.'" at offset: '.($atom_structure['offset'] + $atomoffset);
$info['warning'][] = 'Invalid QuickTime atom smallbox size "'.$boxsmallsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset);
$atom_structure['data'] = null;
$atomoffset = strlen($atom_data);
break;
@@ -380,7 +328,7 @@ class getid3_quicktime extends getid3_handler
$atom_structure['data'] = $boxsmalldata;
break;
default:
$info['warning'][] = 'Unknown QuickTime smallbox type: "'.getid3_lib::PrintHexBytes($boxsmalltype).'" at offset '.$baseoffset;
$info['warning'][] = 'Unknown QuickTime smallbox type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxsmalltype).'" ('.trim(getid3_lib::PrintHexBytes($boxsmalltype)).') at offset '.$baseoffset;
$atom_structure['data'] = $atom_data;
break;
}
@@ -392,7 +340,7 @@ class getid3_quicktime extends getid3_handler
$boxtype = substr($atom_data, $atomoffset + 4, 4);
$boxdata = substr($atom_data, $atomoffset + 8, $boxsize - 8);
if ($boxsize <= 1) {
$info['warning'][] = 'Invalid QuickTime atom box size "'.$boxsize.'" in atom "'.$atomname.'" at offset: '.($atom_structure['offset'] + $atomoffset);
$info['warning'][] = 'Invalid QuickTime atom box size "'.$boxsize.'" in atom "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" at offset: '.($atom_structure['offset'] + $atomoffset);
$atom_structure['data'] = null;
$atomoffset = strlen($atom_data);
break;
@@ -409,7 +357,7 @@ class getid3_quicktime extends getid3_handler
$atom_structure['version'] = getid3_lib::BigEndian2Int(substr($boxdata, 0, 1));
$atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($boxdata, 1, 3));
switch ($atom_structure['flags_raw']) {
case 0: // data flag
case 0: // data flag
case 21: // tmpo/cpil flag
switch ($atomname) {
case 'cpil':
@@ -460,17 +408,27 @@ class getid3_quicktime extends getid3_handler
}
break;
case 1: // text flag
case 1: // text flag
case 13: // image flag
default:
$atom_structure['data'] = substr($boxdata, 8);
if ($atomname == 'covr') {
// not a foolproof check, but better than nothing
if (preg_match('#^\xFF\xD8\xFF#', $atom_structure['data'])) {
$atom_structure['image_mime'] = 'image/jpeg';
} elseif (preg_match('#^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A#', $atom_structure['data'])) {
$atom_structure['image_mime'] = 'image/png';
} elseif (preg_match('#^GIF#', $atom_structure['data'])) {
$atom_structure['image_mime'] = 'image/gif';
}
}
break;
}
break;
default:
$info['warning'][] = 'Unknown QuickTime box type: "'.getid3_lib::PrintHexBytes($boxtype).'" at offset '.$baseoffset;
$info['warning'][] = 'Unknown QuickTime box type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $boxtype).'" ('.trim(getid3_lib::PrintHexBytes($boxtype)).') at offset '.$baseoffset;
$atom_structure['data'] = $atom_data;
}
@@ -840,7 +798,12 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
$sttsEntriesDataOffset = 8;
//$FrameRateCalculatorArray = array();
$frames_count = 0;
for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
$max_stts_entries_to_scan = min(floor($this->getid3->memory_limit / 10000), $atom_structure['number_entries']);
if ($max_stts_entries_to_scan < $atom_structure['number_entries']) {
$info['warning'][] = 'QuickTime atom "stts" has '.$atom_structure['number_entries'].' but only scanning the first '.$max_stts_entries_to_scan.' entries due to limited PHP memory available ('.floor($this->getid3->memory_limit / 1048576).'MB).';
}
for ($i = 0; $i < $max_stts_entries_to_scan; $i++) {
$atom_structure['time_to_sample_table'][$i]['sample_count'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
$sttsEntriesDataOffset += 4;
$atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
@@ -1086,8 +1049,8 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
case 'sync': // SYNChronization atom
case 'scpt': // tranSCriPT atom
case 'ssrc': // non-primary SouRCe atom
for ($i = 0; $i < (strlen($atom_data) % 4); $i++) {
$atom_structure['track_id'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $i * 4, 4));
for ($i = 0; $i < strlen($atom_data); $i += 4) {
@$atom_structure['track_id'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4));
}
break;
@@ -1260,10 +1223,76 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
break;
case 'mdat': // Media DATa atom
// 'mdat' contains the actual data for the audio/video, possibly also subtitles
/* due to lack of known documentation, this is a kludge implementation. If you know of documentation on how mdat is properly structed, please send it to info@getid3.org */
// first, skip any 'wide' padding, and second 'mdat' header (with specified size of zero?)
$mdat_offset = 0;
while (true) {
if (substr($atom_data, $mdat_offset, 8) == "\x00\x00\x00\x08".'wide') {
$mdat_offset += 8;
} elseif (substr($atom_data, $mdat_offset, 8) == "\x00\x00\x00\x00".'mdat') {
$mdat_offset += 8;
} else {
break;
}
}
// check to see if it looks like chapter titles, in the form of unterminated strings with a leading 16-bit size field
while (($chapter_string_length = getid3_lib::BigEndian2Int(substr($atom_data, $mdat_offset, 2)))
&& ($chapter_string_length < 1000)
&& ($chapter_string_length <= (strlen($atom_data) - $mdat_offset - 2))
&& preg_match('#^[\x20-\xFF]+$#', substr($atom_data, $mdat_offset + 2, $chapter_string_length), $chapter_matches)) {
$mdat_offset += (2 + $chapter_string_length);
@$info['quicktime']['comments']['chapters'][] = $chapter_matches[0];
}
if (($atomsize > 8) && (!isset($info['avdataend_tmp']) || ($info['quicktime'][$atomname]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) {
$info['avdataoffset'] = $atom_structure['offset'] + 8; // $info['quicktime'][$atomname]['offset'] + 8;
$OldAVDataEnd = $info['avdataend'];
$info['avdataend'] = $atom_structure['offset'] + $atom_structure['size']; // $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
$getid3_temp->info['avdataend'] = $info['avdataend'];
$getid3_mp3 = new getid3_mp3($getid3_temp);
if ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode($this->fread(4)))) {
$getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
if (!empty($getid3_temp->info['warning'])) {
foreach ($getid3_temp->info['warning'] as $value) {
$info['warning'][] = $value;
}
}
if (!empty($getid3_temp->info['mpeg'])) {
$info['mpeg'] = $getid3_temp->info['mpeg'];
if (isset($info['mpeg']['audio'])) {
$info['audio']['dataformat'] = 'mp3';
$info['audio']['codec'] = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3')));
$info['audio']['sample_rate'] = $info['mpeg']['audio']['sample_rate'];
$info['audio']['channels'] = $info['mpeg']['audio']['channels'];
$info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate'];
$info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
$info['bitrate'] = $info['audio']['bitrate'];
}
}
}
unset($getid3_mp3, $getid3_temp);
$info['avdataend'] = $OldAVDataEnd;
unset($OldAVDataEnd);
}
unset($mdat_offset, $chapter_string_length, $chapter_matches);
break;
case 'free': // FREE space atom
case 'skip': // SKIP atom
case 'wide': // 64-bit expansion placeholder atom
// 'mdat' data is too big to deal with, contains no useful metadata
// 'free', 'skip' and 'wide' are just padding, contains no useful data at all
// When writing QuickTime files, it is sometimes necessary to update an atom's size.
@@ -1329,7 +1358,7 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
//$atom_structure['data'] = $atom_data;
break;
case '©xyz': // GPS latitude+longitude+altitude
case "\xA9".'xyz': // GPS latitude+longitude+altitude
$atom_structure['data'] = $atom_data;
if (preg_match('#([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)?/$#i', $atom_data, $matches)) {
@list($all, $latitude, $longitude, $altitude) = $matches;
@@ -1358,16 +1387,12 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
$info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_data, 'description'=>$atom_structure['description']);
}
break;
case 'NCHD': // MakerNoteVersion
// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
$atom_structure['data'] = $atom_data;
break;
case 'NCTG': // NikonTags
// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
case 'NCTG': // Nikon - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
$atom_structure['data'] = $this->QuicktimeParseNikonNCTG($atom_data);
break;
case 'NCDB': // NikonTags
// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
case 'NCHD': // Nikon:MakerNoteVersion - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
case 'NCDB': // Nikon - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
case 'CNCV': // Canon:CompressorVersion - http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html
$atom_structure['data'] = $atom_data;
break;
@@ -1391,7 +1416,7 @@ if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($
break;
default:
$info['warning'][] = 'Unknown QuickTime atom type: "'.$atomname.'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset;
$info['warning'][] = 'Unknown QuickTime atom type: "'.preg_replace('#[^a-zA-Z0-9 _\\-]#', '?', $atomname).'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset;
$atom_structure['data'] = $atom_data;
break;
}
@@ -2086,58 +2111,58 @@ echo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.'<br
public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
static $handyatomtranslatorarray = array();
if (empty($handyatomtranslatorarray)) {
$handyatomtranslatorarray['©cpy'] = 'copyright';
$handyatomtranslatorarray['©day'] = 'creation_date'; // iTunes 4.0
$handyatomtranslatorarray['©dir'] = 'director';
$handyatomtranslatorarray['©ed1'] = 'edit1';
$handyatomtranslatorarray['©ed2'] = 'edit2';
$handyatomtranslatorarray['©ed3'] = 'edit3';
$handyatomtranslatorarray['©ed4'] = 'edit4';
$handyatomtranslatorarray['©ed5'] = 'edit5';
$handyatomtranslatorarray['©ed6'] = 'edit6';
$handyatomtranslatorarray['©ed7'] = 'edit7';
$handyatomtranslatorarray['©ed8'] = 'edit8';
$handyatomtranslatorarray['©ed9'] = 'edit9';
$handyatomtranslatorarray['©fmt'] = 'format';
$handyatomtranslatorarray['©inf'] = 'information';
$handyatomtranslatorarray['©prd'] = 'producer';
$handyatomtranslatorarray['©prf'] = 'performers';
$handyatomtranslatorarray['©req'] = 'system_requirements';
$handyatomtranslatorarray['©src'] = 'source_credit';
$handyatomtranslatorarray['©wrt'] = 'writer';
$handyatomtranslatorarray["\xA9".'cpy'] = 'copyright';
$handyatomtranslatorarray["\xA9".'day'] = 'creation_date'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'dir'] = 'director';
$handyatomtranslatorarray["\xA9".'ed1'] = 'edit1';
$handyatomtranslatorarray["\xA9".'ed2'] = 'edit2';
$handyatomtranslatorarray["\xA9".'ed3'] = 'edit3';
$handyatomtranslatorarray["\xA9".'ed4'] = 'edit4';
$handyatomtranslatorarray["\xA9".'ed5'] = 'edit5';
$handyatomtranslatorarray["\xA9".'ed6'] = 'edit6';
$handyatomtranslatorarray["\xA9".'ed7'] = 'edit7';
$handyatomtranslatorarray["\xA9".'ed8'] = 'edit8';
$handyatomtranslatorarray["\xA9".'ed9'] = 'edit9';
$handyatomtranslatorarray["\xA9".'fmt'] = 'format';
$handyatomtranslatorarray["\xA9".'inf'] = 'information';
$handyatomtranslatorarray["\xA9".'prd'] = 'producer';
$handyatomtranslatorarray["\xA9".'prf'] = 'performers';
$handyatomtranslatorarray["\xA9".'req'] = 'system_requirements';
$handyatomtranslatorarray["\xA9".'src'] = 'source_credit';
$handyatomtranslatorarray["\xA9".'wrt'] = 'writer';
// http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt
$handyatomtranslatorarray['©nam'] = 'title'; // iTunes 4.0
$handyatomtranslatorarray['©cmt'] = 'comment'; // iTunes 4.0
$handyatomtranslatorarray['©wrn'] = 'warning';
$handyatomtranslatorarray['©hst'] = 'host_computer';
$handyatomtranslatorarray['©mak'] = 'make';
$handyatomtranslatorarray['©mod'] = 'model';
$handyatomtranslatorarray['©PRD'] = 'product';
$handyatomtranslatorarray['©swr'] = 'software';
$handyatomtranslatorarray['©aut'] = 'author';
$handyatomtranslatorarray['©ART'] = 'artist';
$handyatomtranslatorarray['©trk'] = 'track';
$handyatomtranslatorarray['©alb'] = 'album'; // iTunes 4.0
$handyatomtranslatorarray['©com'] = 'comment';
$handyatomtranslatorarray['©gen'] = 'genre'; // iTunes 4.0
$handyatomtranslatorarray['©ope'] = 'composer';
$handyatomtranslatorarray['©url'] = 'url';
$handyatomtranslatorarray['©enc'] = 'encoder';
$handyatomtranslatorarray["\xA9".'nam'] = 'title'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'cmt'] = 'comment'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'wrn'] = 'warning';
$handyatomtranslatorarray["\xA9".'hst'] = 'host_computer';
$handyatomtranslatorarray["\xA9".'mak'] = 'make';
$handyatomtranslatorarray["\xA9".'mod'] = 'model';
$handyatomtranslatorarray["\xA9".'PRD'] = 'product';
$handyatomtranslatorarray["\xA9".'swr'] = 'software';
$handyatomtranslatorarray["\xA9".'aut'] = 'author';
$handyatomtranslatorarray["\xA9".'ART'] = 'artist';
$handyatomtranslatorarray["\xA9".'trk'] = 'track';
$handyatomtranslatorarray["\xA9".'alb'] = 'album'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'com'] = 'comment';
$handyatomtranslatorarray["\xA9".'gen'] = 'genre'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'ope'] = 'composer';
$handyatomtranslatorarray["\xA9".'url'] = 'url';
$handyatomtranslatorarray["\xA9".'enc'] = 'encoder';
// http://atomicparsley.sourceforge.net/mpeg-4files.html
$handyatomtranslatorarray['©art'] = 'artist'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'art'] = 'artist'; // iTunes 4.0
$handyatomtranslatorarray['aART'] = 'album_artist';
$handyatomtranslatorarray['trkn'] = 'track_number'; // iTunes 4.0
$handyatomtranslatorarray['disk'] = 'disc_number'; // iTunes 4.0
$handyatomtranslatorarray['gnre'] = 'genre'; // iTunes 4.0
$handyatomtranslatorarray['©too'] = 'encoder'; // iTunes 4.0
$handyatomtranslatorarray["\xA9".'too'] = 'encoder'; // iTunes 4.0
$handyatomtranslatorarray['tmpo'] = 'bpm'; // iTunes 4.0
$handyatomtranslatorarray['cprt'] = 'copyright'; // iTunes 4.0?
$handyatomtranslatorarray['cpil'] = 'compilation'; // iTunes 4.0
$handyatomtranslatorarray['covr'] = 'picture'; // iTunes 4.0
$handyatomtranslatorarray['rtng'] = 'rating'; // iTunes 4.0
$handyatomtranslatorarray['©grp'] = 'grouping'; // iTunes 4.2
$handyatomtranslatorarray["\xA9".'grp'] = 'grouping'; // iTunes 4.2
$handyatomtranslatorarray['stik'] = 'stik'; // iTunes 4.9
$handyatomtranslatorarray['pcst'] = 'podcast'; // iTunes 4.9
$handyatomtranslatorarray['catg'] = 'category'; // iTunes 4.9
@@ -2145,7 +2170,7 @@ echo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.'<br
$handyatomtranslatorarray['purl'] = 'podcast_url'; // iTunes 4.9
$handyatomtranslatorarray['egid'] = 'episode_guid'; // iTunes 4.9
$handyatomtranslatorarray['desc'] = 'description'; // iTunes 5.0
$handyatomtranslatorarray['©lyr'] = 'lyrics'; // iTunes 5.0
$handyatomtranslatorarray["\xA9".'lyr'] = 'lyrics'; // iTunes 5.0
$handyatomtranslatorarray['tvnn'] = 'tv_network_name'; // iTunes 6.0
$handyatomtranslatorarray['tvsh'] = 'tv_show_name'; // iTunes 6.0
$handyatomtranslatorarray['tvsn'] = 'tv_season'; // iTunes 6.0
@@ -2218,4 +2243,4 @@ echo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.'<br
return substr($pascalstring, 1);
}
}
}
+187 -36
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -26,8 +27,9 @@ getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE_
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true);
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true);
class getid3_riff extends getid3_handler
{
class getid3_riff extends getid3_handler {
protected $container = 'riff'; // default
public function Analyze() {
$info = &$this->getid3->info;
@@ -58,7 +60,8 @@ class getid3_riff extends getid3_handler
switch ($RIFFtype) {
case 'FORM': // AIFF, AIFC
$info['fileformat'] = 'aiff';
//$info['fileformat'] = 'aiff';
$this->container = 'aiff';
$thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);
$thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));
break;
@@ -66,13 +69,18 @@ class getid3_riff extends getid3_handler
case 'RIFF': // AVI, WAV, etc
case 'SDSS': // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com)
case 'RMP3': // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s
$info['fileformat'] = 'riff';
//$info['fileformat'] = 'riff';
$this->container = 'riff';
$thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);
if ($RIFFsubtype == 'RMP3') {
// RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s
$RIFFsubtype = 'WAVE';
}
$thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));
if ($RIFFsubtype != 'AMV ') {
// AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size
// Handled separately in ParseRIFFAMV()
$thisfile_riff[$RIFFsubtype] = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));
}
if (($info['avdataend'] - $info['filesize']) == 1) {
// LiteWave appears to incorrectly *not* pad actual output file
// to nearest WORD boundary so may appear to be short by one
@@ -110,16 +118,19 @@ class getid3_riff extends getid3_handler
$nextRIFFoffset = $chunkdata['offset'] + $chunkdata['size'];
switch ($nextRIFFheaderID) {
case 'RIFF':
$chunkdata['chunks'] = $this->ParseRIFF($chunkdata['offset'] + 4, $nextRIFFoffset);
if (!isset($thisfile_riff[$nextRIFFtype])) {
$thisfile_riff[$nextRIFFtype] = array();
}
$thisfile_riff[$nextRIFFtype][] = $chunkdata;
break;
case 'AMV ':
unset($info['riff']);
$info['amv'] = $this->ParseRIFFAMV($chunkdata['offset'] + 4, $nextRIFFoffset);
break;
case 'JUNK':
// ignore
$thisfile_riff[$nextRIFFheaderID][] = $chunkdata;
@@ -152,13 +163,17 @@ class getid3_riff extends getid3_handler
default:
$this->error('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$RIFFsubtype.'" instead');
unset($info['fileformat']);
//unset($info['fileformat']);
return false;
}
$streamindex = 0;
switch ($RIFFsubtype) {
// http://en.wikipedia.org/wiki/Wav
case 'WAVE':
$info['fileformat'] = 'wav';
if (empty($thisfile_audio['bitrate_mode'])) {
$thisfile_audio['bitrate_mode'] = 'cbr';
}
@@ -588,10 +603,13 @@ class getid3_riff extends getid3_handler
}
break;
// http://en.wikipedia.org/wiki/Audio_Video_Interleave
case 'AVI ':
$info['fileformat'] = 'avi';
$info['mime_type'] = 'video/avi';
$thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably
$thisfile_video['dataformat'] = 'avi';
$info['mime_type'] = 'video/avi';
if (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) {
$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8;
@@ -825,7 +843,7 @@ class getid3_riff extends getid3_handler
switch ($strhfccType) {
case 'vids':
$thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($info['fileformat'] == 'riff'));
$thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($this->container == 'riff'));
$thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount'];
if ($thisfile_riff_video_current['codec'] == 'DV') {
@@ -875,11 +893,28 @@ class getid3_riff extends getid3_handler
}
break;
case 'AMV ':
$info['fileformat'] = 'amv';
$info['mime_type'] = 'video/amv';
$thisfile_video['bitrate_mode'] = 'vbr'; // it's MJPEG, presumably contant-quality encoding, thereby VBR
$thisfile_video['dataformat'] = 'mjpeg';
$thisfile_video['codec'] = 'mjpeg';
$thisfile_video['lossless'] = false;
$thisfile_video['bits_per_sample'] = 24;
$thisfile_audio['dataformat'] = 'adpcm';
$thisfile_audio['lossless'] = false;
break;
// http://en.wikipedia.org/wiki/CD-DA
case 'CDDA':
$thisfile_audio['bitrate_mode'] = 'cbr';
$info['fileformat'] = 'cda';
unset($info['mime_type']);
$thisfile_audio_dataformat = 'cda';
$thisfile_audio['lossless'] = true;
unset($info['mime_type']);
$info['avdataoffset'] = 44;
@@ -901,6 +936,7 @@ class getid3_riff extends getid3_handler
$info['playtime_seconds'] = $thisfile_riff_CDDA_fmt_0['playtime_seconds'];
// hardcoded data for CD-audio
$thisfile_audio['lossless'] = true;
$thisfile_audio['sample_rate'] = 44100;
$thisfile_audio['channels'] = 2;
$thisfile_audio['bits_per_sample'] = 16;
@@ -909,13 +945,15 @@ class getid3_riff extends getid3_handler
}
break;
// http://en.wikipedia.org/wiki/AIFF
case 'AIFF':
case 'AIFC':
$info['fileformat'] = 'aiff';
$info['mime_type'] = 'audio/x-aiff';
$thisfile_audio['bitrate_mode'] = 'cbr';
$thisfile_audio_dataformat = 'aiff';
$thisfile_audio['lossless'] = true;
$info['mime_type'] = 'audio/x-aiff';
if (isset($thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'])) {
$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'] + 8;
@@ -1028,12 +1066,15 @@ class getid3_riff extends getid3_handler
*/
break;
// http://en.wikipedia.org/wiki/8SVX
case '8SVX':
$info['fileformat'] = '8svx';
$info['mime_type'] = 'audio/8svx';
$thisfile_audio['bitrate_mode'] = 'cbr';
$thisfile_audio_dataformat = '8svx';
$thisfile_audio['bits_per_sample'] = 8;
$thisfile_audio['channels'] = 1; // overridden below, if need be
$info['mime_type'] = 'audio/x-aiff';
if (isset($thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'])) {
$info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8;
@@ -1108,31 +1149,31 @@ class getid3_riff extends getid3_handler
}
break;
case 'CDXA':
$info['mime_type'] = 'video/mpeg';
$info['fileformat'] = 'vcd'; // Asume Video CD
$info['mime_type'] = 'video/mpeg';
if (!empty($thisfile_riff['CDXA']['data'][0]['size'])) {
if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, false)) {
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_mpeg = new getid3_mpeg($getid3_temp);
$getid3_mpeg->Analyze();
if (empty($getid3_temp->info['error'])) {
$info['audio'] = $getid3_temp->info['audio'];
$info['video'] = $getid3_temp->info['video'];
$info['mpeg'] = $getid3_temp->info['mpeg'];
$info['warning'] = $getid3_temp->info['warning'];
}
unset($getid3_temp, $getid3_mpeg);
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, true);
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_mpeg = new getid3_mpeg($getid3_temp);
$getid3_mpeg->Analyze();
if (empty($getid3_temp->info['error'])) {
$info['audio'] = $getid3_temp->info['audio'];
$info['video'] = $getid3_temp->info['video'];
$info['mpeg'] = $getid3_temp->info['mpeg'];
$info['warning'] = $getid3_temp->info['warning'];
}
unset($getid3_temp, $getid3_mpeg);
}
break;
default:
$info['error'][] = 'Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$RIFFsubtype.'" instead';
unset($info['fileformat']);
break;
//unset($info['fileformat']);
}
switch ($RIFFsubtype) {
@@ -1150,6 +1191,7 @@ class getid3_riff extends getid3_handler
if (isset($thisfile_riff[$RIFFsubtype]['id3 '])) {
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_id3v2 = new getid3_id3v2($getid3_temp);
@@ -1278,6 +1320,115 @@ class getid3_riff extends getid3_handler
return true;
}
public function ParseRIFFAMV($startoffset, $maxoffset) {
// AMV files are RIFF-AVI files with parts of the spec deliberately broken, such as chunk size fields hardcoded to zero (because players known in hardware that these fields are always a certain size
// https://code.google.com/p/amv-codec-tools/wiki/AmvDocumentation
//typedef struct _amvmainheader {
//FOURCC fcc; // 'amvh'
//DWORD cb;
//DWORD dwMicroSecPerFrame;
//BYTE reserve[28];
//DWORD dwWidth;
//DWORD dwHeight;
//DWORD dwSpeed;
//DWORD reserve0;
//DWORD reserve1;
//BYTE bTimeSec;
//BYTE bTimeMin;
//WORD wTimeHour;
//} AMVMAINHEADER;
$info = &$this->getid3->info;
$RIFFchunk = false;
try {
$this->fseek($startoffset);
$maxoffset = min($maxoffset, $info['avdataend']);
$AMVheader = $this->fread(284);
if (substr($AMVheader, 0, 8) != 'hdrlamvh') {
throw new Exception('expecting "hdrlamv" at offset '.($startoffset + 0).', found "'.substr($AMVheader, 0, 8).'"');
}
if (substr($AMVheader, 8, 4) != "\x38\x00\x00\x00") { // "amvh" chunk size, hardcoded to 0x38 = 56 bytes
throw new Exception('expecting "0x38000000" at offset '.($startoffset + 8).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 8, 4)).'"');
}
$RIFFchunk = array();
$RIFFchunk['amvh']['us_per_frame'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 12, 4));
$RIFFchunk['amvh']['reserved28'] = substr($AMVheader, 16, 28); // null? reserved?
$RIFFchunk['amvh']['resolution_x'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 44, 4));
$RIFFchunk['amvh']['resolution_y'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 48, 4));
$RIFFchunk['amvh']['frame_rate_int'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 52, 4));
$RIFFchunk['amvh']['reserved0'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 56, 4)); // 1? reserved?
$RIFFchunk['amvh']['reserved1'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 60, 4)); // 0? reserved?
$RIFFchunk['amvh']['runtime_sec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 64, 1));
$RIFFchunk['amvh']['runtime_min'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 65, 1));
$RIFFchunk['amvh']['runtime_hrs'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 66, 2));
$info['video']['frame_rate'] = 1000000 / $RIFFchunk['amvh']['us_per_frame'];
$info['video']['resolution_x'] = $RIFFchunk['amvh']['resolution_x'];
$info['video']['resolution_y'] = $RIFFchunk['amvh']['resolution_y'];
$info['playtime_seconds'] = ($RIFFchunk['amvh']['runtime_hrs'] * 3600) + ($RIFFchunk['amvh']['runtime_min'] * 60) + $RIFFchunk['amvh']['runtime_sec'];
// the rest is all hardcoded(?) and does not appear to be useful until you get to audio info at offset 256, even then everything is probably hardcoded
if (substr($AMVheader, 68, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x38\x00\x00\x00") {
throw new Exception('expecting "LIST<0x00000000>strlstrh<0x38000000>" at offset '.($startoffset + 68).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 68, 20)).'"');
}
// followed by 56 bytes of null: substr($AMVheader, 88, 56) -> 144
if (substr($AMVheader, 144, 8) != 'strf'."\x24\x00\x00\x00") {
throw new Exception('expecting "strf<0x24000000>" at offset '.($startoffset + 144).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 144, 8)).'"');
}
// followed by 36 bytes of null: substr($AMVheader, 144, 36) -> 180
if (substr($AMVheader, 188, 20) != 'LIST'."\x00\x00\x00\x00".'strlstrh'."\x30\x00\x00\x00") {
throw new Exception('expecting "LIST<0x00000000>strlstrh<0x30000000>" at offset '.($startoffset + 188).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 188, 20)).'"');
}
// followed by 48 bytes of null: substr($AMVheader, 208, 48) -> 256
if (substr($AMVheader, 256, 8) != 'strf'."\x14\x00\x00\x00") {
throw new Exception('expecting "strf<0x14000000>" at offset '.($startoffset + 256).', found "'.getid3_lib::PrintHexBytes(substr($AMVheader, 256, 8)).'"');
}
// followed by 20 bytes of a modified WAVEFORMATEX:
// typedef struct {
// WORD wFormatTag; //(Fixme: this is equal to PCM's 0x01 format code)
// WORD nChannels; //(Fixme: this is always 1)
// DWORD nSamplesPerSec; //(Fixme: for all known sample files this is equal to 22050)
// DWORD nAvgBytesPerSec; //(Fixme: for all known sample files this is equal to 44100)
// WORD nBlockAlign; //(Fixme: this seems to be 2 in AMV files, is this correct ?)
// WORD wBitsPerSample; //(Fixme: this seems to be 16 in AMV files instead of the expected 4)
// WORD cbSize; //(Fixme: this seems to be 0 in AMV files)
// WORD reserved;
// } WAVEFORMATEX;
$RIFFchunk['strf']['wformattag'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 264, 2));
$RIFFchunk['strf']['nchannels'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 266, 2));
$RIFFchunk['strf']['nsamplespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 268, 4));
$RIFFchunk['strf']['navgbytespersec'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 272, 4));
$RIFFchunk['strf']['nblockalign'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 276, 2));
$RIFFchunk['strf']['wbitspersample'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 278, 2));
$RIFFchunk['strf']['cbsize'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 280, 2));
$RIFFchunk['strf']['reserved'] = getid3_lib::LittleEndian2Int(substr($AMVheader, 282, 2));
$info['audio']['lossless'] = false;
$info['audio']['sample_rate'] = $RIFFchunk['strf']['nsamplespersec'];
$info['audio']['channels'] = $RIFFchunk['strf']['nchannels'];
$info['audio']['bits_per_sample'] = $RIFFchunk['strf']['wbitspersample'];
$info['audio']['bitrate'] = $info['audio']['sample_rate'] * $info['audio']['channels'] * $info['audio']['bits_per_sample'];
$info['audio']['bitrate_mode'] = 'cbr';
} catch (getid3_exception $e) {
if ($e->getCode() == 10) {
$this->warning('RIFFAMV parser: '.$e->getMessage());
} else {
throw $e;
}
}
return $RIFFchunk;
}
public function ParseRIFF($startoffset, $maxoffset) {
$info = &$this->getid3->info;
@@ -1329,7 +1480,7 @@ class getid3_riff extends getid3_handler
$getid3_temp->openfile($this->getid3->filename);
$getid3_temp->info['avdataoffset'] = $this->ftell() - 4;
$getid3_temp->info['avdataend'] = $this->ftell() + $AudioChunkSize;
$getid3_mp3 = new getid3_mp3($getid3_temp);
$getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__);
$getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
if (isset($getid3_temp->info['mpeg']['audio'])) {
$info['mpeg']['audio'] = $getid3_temp->info['mpeg']['audio'];
@@ -1412,7 +1563,7 @@ class getid3_riff extends getid3_handler
$getid3_temp->openfile($this->getid3->filename);
$getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
$getid3_temp->info['avdataend'] = $info['avdataend'];
$getid3_mp3 = new getid3_mp3($getid3_temp);
$getid3_mp3 = new getid3_mp3($getid3_temp, __CLASS__);
$getid3_mp3->getOnlyMPEGaudioInfo($info['avdataoffset'], false);
if (empty($getid3_temp->info['error'])) {
$info['audio'] = $getid3_temp->info['audio'];
@@ -2426,10 +2577,10 @@ class getid3_riff extends getid3_handler
}
private function EitherEndian2Int($byteword, $signed=false) {
if ($this->getid3->info['fileformat'] == 'riff') {
if ($this->container == 'riff') {
return getid3_lib::LittleEndian2Int($byteword, $signed);
}
return getid3_lib::BigEndian2Int($byteword, false, $signed);
}
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -470,4 +471,4 @@ class getid3_ac3 extends getid3_handler
}
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -287,4 +288,4 @@ class getid3_dts extends getid3_handler
return false;
}
}
}
+2 -1
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -439,4 +440,4 @@ class getid3_flac extends getid3_handler
return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved');
}
}
}
+40 -37
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -95,8 +96,8 @@ class getid3_mp3 extends getid3_handler
// Not sure what version of LAME this is - look in padding of last frame for longer version string
$PossibleLAMEversionStringOffset = $info['avdataend'] - $PossiblyLongerLAMEversion_FrameLength;
fseek($this->getid3->fp, $PossibleLAMEversionStringOffset);
$PossiblyLongerLAMEversion_Data = fread($this->getid3->fp, $PossiblyLongerLAMEversion_FrameLength);
$this->fseek($PossibleLAMEversionStringOffset);
$PossiblyLongerLAMEversion_Data = $this->fread($PossiblyLongerLAMEversion_FrameLength);
switch (substr($CurrentDataLAMEversionString, -1)) {
case 'a':
case 'b':
@@ -422,12 +423,12 @@ class getid3_mp3 extends getid3_handler
$MPEGaudioEmphasisLookup = self::MPEGaudioEmphasisArray();
}
if (fseek($this->getid3->fp, $offset, SEEK_SET) != 0) {
if ($this->fseek($offset) != 0) {
$info['error'][] = 'decodeMPEGaudioHeader() failed to seek to next offset at '.$offset;
return false;
}
//$headerstring = fread($this->getid3->fp, 1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame
$headerstring = fread($this->getid3->fp, 226); // LAME header at offset 36 + 190 bytes of Xing/LAME data
//$headerstring = $this->fread(1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame
$headerstring = $this->fread(226); // LAME header at offset 36 + 190 bytes of Xing/LAME data
// MP3 audio frame structure:
// $aa $aa $aa $aa [$bb $bb] $cc...
@@ -890,19 +891,21 @@ class getid3_mp3 extends getid3_handler
if (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) {
if ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) {
if (isset($info['fileformat']) && ($info['fileformat'] == 'riff')) {
if ($this->isDependencyFor('matroska') || $this->isDependencyFor('riff')) {
// ignore, audio data is broken into chunks so will always be data "missing"
} elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) {
$info['warning'][] = 'Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)';
} else {
$info['warning'][] = 'Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)';
}
elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) {
$this->warning('Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)');
}
else {
$this->warning('Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)');
}
} else {
if ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) {
// $prenullbytefileoffset = ftell($this->getid3->fp);
// fseek($this->getid3->fp, $info['avdataend'], SEEK_SET);
// $PossibleNullByte = fread($this->getid3->fp, 1);
// fseek($this->getid3->fp, $prenullbytefileoffset, SEEK_SET);
// $prenullbytefileoffset = $this->ftell();
// $this->fseek($info['avdataend']);
// $PossibleNullByte = $this->fread(1);
// $this->fseek($prenullbytefileoffset);
// if ($PossibleNullByte === "\x00") {
$info['avdataend']--;
// $info['warning'][] = 'Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored';
@@ -1118,8 +1121,8 @@ class getid3_mp3 extends getid3_handler
public function FreeFormatFrameLength($offset, $deepscan=false) {
$info = &$this->getid3->info;
fseek($this->getid3->fp, $offset, SEEK_SET);
$MPEGaudioData = fread($this->getid3->fp, 32768);
$this->fseek($offset);
$MPEGaudioData = $this->fread(32768);
$SyncPattern1 = substr($MPEGaudioData, 0, 4);
// may be different pattern due to padding
@@ -1166,8 +1169,8 @@ class getid3_mp3 extends getid3_handler
$ActualFrameLengthValues = array();
$nextoffset = $offset + $framelength;
while ($nextoffset < ($info['avdataend'] - 6)) {
fseek($this->getid3->fp, $nextoffset - 1, SEEK_SET);
$NextSyncPattern = fread($this->getid3->fp, 6);
$this->fseek($nextoffset - 1);
$NextSyncPattern = $this->fread(6);
if ((substr($NextSyncPattern, 1, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 1, strlen($SyncPattern2)) == $SyncPattern2)) {
// good - found where expected
$ActualFrameLengthValues[] = $framelength;
@@ -1215,22 +1218,22 @@ class getid3_mp3 extends getid3_handler
$Distribution['padding'] = array();
$info = &$this->getid3->info;
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
$this->fseek($info['avdataoffset']);
$max_frames_scan = 5000;
$frames_scanned = 0;
$previousvalidframe = $info['avdataoffset'];
while (ftell($this->getid3->fp) < $info['avdataend']) {
while ($this->ftell() < $info['avdataend']) {
set_time_limit(30);
$head4 = fread($this->getid3->fp, 4);
$head4 = $this->fread(4);
if (strlen($head4) < 4) {
break;
}
if ($head4{0} != "\xFF") {
for ($i = 1; $i < 4; $i++) {
if ($head4{$i} == "\xFF") {
fseek($this->getid3->fp, $i - 4, SEEK_CUR);
$this->fseek($i - 4, SEEK_CUR);
continue 2;
}
}
@@ -1258,9 +1261,9 @@ class getid3_mp3 extends getid3_handler
$LongMPEGfrequencyLookup[$head4]);
}
if ($MPEGaudioHeaderLengthCache[$head4] > 4) {
$WhereWeWere = ftell($this->getid3->fp);
fseek($this->getid3->fp, $MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR);
$next4 = fread($this->getid3->fp, 4);
$WhereWeWere = $this->ftell();
$this->fseek($MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR);
$next4 = $this->fread(4);
if ($next4{0} == "\xFF") {
if (!isset($MPEGaudioHeaderDecodeCache[$next4])) {
$MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4);
@@ -1269,7 +1272,7 @@ class getid3_mp3 extends getid3_handler
$MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false);
}
if ($MPEGaudioHeaderValidCache[$next4]) {
fseek($this->getid3->fp, -4, SEEK_CUR);
$this->fseek(-4, SEEK_CUR);
getid3_lib::safe_inc($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]);
getid3_lib::safe_inc($Distribution['layer'][$LongMPEGlayerLookup[$head4]]);
@@ -1277,7 +1280,7 @@ class getid3_mp3 extends getid3_handler
getid3_lib::safe_inc($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]);
getid3_lib::safe_inc($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]);
if ($max_frames_scan && (++$frames_scanned >= $max_frames_scan)) {
$pct_data_scanned = (ftell($this->getid3->fp) - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);
$pct_data_scanned = ($this->ftell() - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);
$info['warning'][] = 'too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.';
foreach ($Distribution as $key1 => $value1) {
foreach ($value1 as $key2 => $value2) {
@@ -1290,7 +1293,7 @@ class getid3_mp3 extends getid3_handler
}
}
unset($next4);
fseek($this->getid3->fp, $WhereWeWere - 3, SEEK_SET);
$this->fseek($WhereWeWere - 3);
}
}
@@ -1355,13 +1358,13 @@ class getid3_mp3 extends getid3_handler
}
fseek($this->getid3->fp, $avdataoffset, SEEK_SET);
$this->fseek($avdataoffset);
$sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset);
if ($sync_seek_buffer_size <= 0) {
$info['error'][] = 'Invalid $sync_seek_buffer_size at offset '.$avdataoffset;
return false;
}
$header = fread($this->getid3->fp, $sync_seek_buffer_size);
$header = $this->fread($sync_seek_buffer_size);
$sync_seek_buffer_size = strlen($header);
$SynchSeekOffset = 0;
while ($SynchSeekOffset < $sync_seek_buffer_size) {
@@ -1473,7 +1476,7 @@ class getid3_mp3 extends getid3_handler
$dummy = array('error'=>$info['error'], 'warning'=>$info['warning'], 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);
$synchstartoffset = $info['avdataoffset'];
fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
$this->fseek($info['avdataoffset']);
// you can play with these numbers:
$max_frames_scan = 50000;
@@ -1488,13 +1491,13 @@ class getid3_mp3 extends getid3_handler
$pct_data_scanned = 0;
for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {
$frames_scanned_this_segment = 0;
if (ftell($this->getid3->fp) >= $info['avdataend']) {
if ($this->ftell() >= $info['avdataend']) {
break;
}
$scan_start_offset[$current_segment] = max(ftell($this->getid3->fp), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments)));
$scan_start_offset[$current_segment] = max($this->ftell(), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments)));
if ($current_segment > 0) {
fseek($this->getid3->fp, $scan_start_offset[$current_segment], SEEK_SET);
$buffer_4k = fread($this->getid3->fp, 4096);
$this->fseek($scan_start_offset[$current_segment]);
$buffer_4k = $this->fread(4096);
for ($j = 0; $j < (strlen($buffer_4k) - 4); $j++) {
if (($buffer_4k{$j} == "\xFF") && ($buffer_4k{($j + 1)} > "\xE0")) { // synch detected
if ($this->decodeMPEGaudioHeader($scan_start_offset[$current_segment] + $j, $dummy, false, false, $FastMode)) {
@@ -1523,7 +1526,7 @@ class getid3_mp3 extends getid3_handler
}
$frames_scanned++;
if ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) {
$this_pct_scanned = (ftell($this->getid3->fp) - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']);
$this_pct_scanned = ($this->ftell() - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']);
if (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) {
// file likely contains < $max_frames_scan, just scan as one segment
$max_scan_segments = 1;
@@ -2006,4 +2009,4 @@ class getid3_mp3 extends getid3_handler
return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org');
}
}
}
+88 -3
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -114,6 +115,66 @@ class getid3_ogg extends getid3_handler
$info['audio']['bitrate_mode'] = 'vbr';
}
} elseif (substr($filedata, 0, 7) == "\x80".'theora') {
// http://www.theora.org/doc/Theora.pdf (section 6.2)
$info['ogg']['pageheader']['theora']['theora_magic'] = substr($filedata, $filedataoffset, 7); // hard-coded to "\x80.'theora'
$filedataoffset += 7;
$info['ogg']['pageheader']['theora']['version_major'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['version_minor'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['version_revision'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['frame_width_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2));
$filedataoffset += 2;
$info['ogg']['pageheader']['theora']['frame_height_macroblocks'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2));
$filedataoffset += 2;
$info['ogg']['pageheader']['theora']['resolution_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3));
$filedataoffset += 3;
$info['ogg']['pageheader']['theora']['resolution_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3));
$filedataoffset += 3;
$info['ogg']['pageheader']['theora']['picture_offset_x'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['picture_offset_y'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['frame_rate_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4));
$filedataoffset += 4;
$info['ogg']['pageheader']['theora']['frame_rate_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 4));
$filedataoffset += 4;
$info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3));
$filedataoffset += 3;
$info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3));
$filedataoffset += 3;
$info['ogg']['pageheader']['theora']['color_space_id'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 1));
$filedataoffset += 1;
$info['ogg']['pageheader']['theora']['nominal_bitrate'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 3));
$filedataoffset += 3;
$info['ogg']['pageheader']['theora']['flags'] = getid3_lib::BigEndian2Int(substr($filedata, $filedataoffset, 2));
$filedataoffset += 2;
$info['ogg']['pageheader']['theora']['quality'] = ($info['ogg']['pageheader']['theora']['flags'] & 0xFC00) >> 10;
$info['ogg']['pageheader']['theora']['kfg_shift'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x03E0) >> 5;
$info['ogg']['pageheader']['theora']['pixel_format_id'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0018) >> 3;
$info['ogg']['pageheader']['theora']['reserved'] = ($info['ogg']['pageheader']['theora']['flags'] & 0x0007) >> 0; // should be 0
$info['ogg']['pageheader']['theora']['color_space'] = self::TheoraColorSpace($info['ogg']['pageheader']['theora']['color_space_id']);
$info['ogg']['pageheader']['theora']['pixel_format'] = self::TheoraPixelFormat($info['ogg']['pageheader']['theora']['pixel_format_id']);
$info['video']['dataformat'] = 'theora';
$info['mime_type'] = 'video/ogg';
//$info['audio']['bitrate_mode'] = 'abr';
//$info['audio']['lossless'] = false;
$info['video']['resolution_x'] = $info['ogg']['pageheader']['theora']['resolution_x'];
$info['video']['resolution_y'] = $info['ogg']['pageheader']['theora']['resolution_y'];
if ($info['ogg']['pageheader']['theora']['frame_rate_denominator'] > 0) {
$info['video']['frame_rate'] = (float) $info['ogg']['pageheader']['theora']['frame_rate_numerator'] / $info['ogg']['pageheader']['theora']['frame_rate_denominator'];
}
if ($info['ogg']['pageheader']['theora']['pixel_aspect_denominator'] > 0) {
$info['video']['pixel_aspect_ratio'] = (float) $info['ogg']['pageheader']['theora']['pixel_aspect_numerator'] / $info['ogg']['pageheader']['theora']['pixel_aspect_denominator'];
}
$info['warning'][] = 'Ogg Theora (v3) not fully supported in this version of getID3 ['.$this->getid3->version().'] -- bitrate, playtime and all audio data are currently unavailable';
} elseif (substr($filedata, 0, 8) == "fishead\x00") {
@@ -172,8 +233,8 @@ class getid3_ogg extends getid3_handler
} elseif (substr($filedata, 1, 6) == 'theora') {
$info['video']['dataformat'] = 'theora';
$info['error'][] = 'Ogg Theora not correctly handled in this version of getID3 ['.$this->getid3->version().']';
$info['video']['dataformat'] = 'theora1';
$info['error'][] = 'Ogg Theora (v1) not correctly handled in this version of getID3 ['.$this->getid3->version().']';
//break;
} elseif (substr($filedata, 1, 6) == 'vorbis') {
@@ -668,4 +729,28 @@ class getid3_ogg extends getid3_handler
return round($qval, 1); // 5 or 4.9
}
}
public static function TheoraColorSpace($colorspace_id) {
// http://www.theora.org/doc/Theora.pdf (table 6.3)
static $TheoraColorSpaceLookup = array();
if (empty($TheoraColorSpaceLookup)) {
$TheoraColorSpaceLookup[0] = 'Undefined';
$TheoraColorSpaceLookup[1] = 'Rec. 470M';
$TheoraColorSpaceLookup[2] = 'Rec. 470BG';
$TheoraColorSpaceLookup[3] = 'Reserved';
}
return (isset($TheoraColorSpaceLookup[$colorspace_id]) ? $TheoraColorSpaceLookup[$colorspace_id] : null);
}
public static function TheoraPixelFormat($pixelformat_id) {
// http://www.theora.org/doc/Theora.pdf (table 6.4)
static $TheoraPixelFormatLookup = array();
if (empty($TheoraPixelFormatLookup)) {
$TheoraPixelFormatLookup[0] = '4:2:0';
$TheoraPixelFormatLookup[1] = 'Reserved';
$TheoraPixelFormatLookup[2] = '4:2:2';
$TheoraPixelFormatLookup[3] = '4:4:4';
}
return (isset($TheoraPixelFormatLookup[$pixelformat_id]) ? $TheoraPixelFormatLookup[$pixelformat_id] : null);
}
}
+13 -12
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -32,8 +33,8 @@ class getid3_apetag extends getid3_handler
if ($this->overrideendoffset == 0) {
fseek($this->getid3->fp, 0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);
$APEfooterID3v1 = fread($this->getid3->fp, $id3v1tagsize + $apetagheadersize + $lyrics3tagsize);
$this->fseek(0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);
$APEfooterID3v1 = $this->fread($id3v1tagsize + $apetagheadersize + $lyrics3tagsize);
//if (preg_match('/APETAGEX.{24}TAG.{125}$/i', $APEfooterID3v1)) {
if (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $id3v1tagsize - $apetagheadersize, 8) == 'APETAGEX') {
@@ -51,8 +52,8 @@ class getid3_apetag extends getid3_handler
} else {
fseek($this->getid3->fp, $this->overrideendoffset - $apetagheadersize, SEEK_SET);
if (fread($this->getid3->fp, 8) == 'APETAGEX') {
$this->fseek($this->overrideendoffset - $apetagheadersize);
if ($this->fread(8) == 'APETAGEX') {
$info['ape']['tag_offset_end'] = $this->overrideendoffset;
}
@@ -68,21 +69,21 @@ class getid3_apetag extends getid3_handler
// shortcut
$thisfile_ape = &$info['ape'];
fseek($this->getid3->fp, $thisfile_ape['tag_offset_end'] - $apetagheadersize, SEEK_SET);
$APEfooterData = fread($this->getid3->fp, 32);
$this->fseek($thisfile_ape['tag_offset_end'] - $apetagheadersize);
$APEfooterData = $this->fread(32);
if (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) {
$info['error'][] = 'Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end'];
return false;
}
if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {
fseek($this->getid3->fp, $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize, SEEK_SET);
$thisfile_ape['tag_offset_start'] = ftell($this->getid3->fp);
$APEtagData = fread($this->getid3->fp, $thisfile_ape['footer']['raw']['tagsize'] + $apetagheadersize);
$this->fseek($thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize);
$thisfile_ape['tag_offset_start'] = $this->ftell();
$APEtagData = $this->fread($thisfile_ape['footer']['raw']['tagsize'] + $apetagheadersize);
} else {
$thisfile_ape['tag_offset_start'] = $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'];
fseek($this->getid3->fp, $thisfile_ape['tag_offset_start'], SEEK_SET);
$APEtagData = fread($this->getid3->fp, $thisfile_ape['footer']['raw']['tagsize']);
$this->fseek($thisfile_ape['tag_offset_start']);
$APEtagData = $this->fread($thisfile_ape['footer']['raw']['tagsize']);
}
$info['avdataend'] = $thisfile_ape['tag_offset_start'];
@@ -367,4 +368,4 @@ class getid3_apetag extends getid3_handler
return in_array(strtolower($itemkey), $APEtagItemIsUTF8Lookup);
}
}
}
+5 -4
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -25,9 +26,9 @@ class getid3_id3v1 extends getid3_handler
return false;
}
fseek($this->getid3->fp, -256, SEEK_END);
$preid3v1 = fread($this->getid3->fp, 128);
$id3v1tag = fread($this->getid3->fp, 128);
$this->fseek(-256, SEEK_END);
$preid3v1 = $this->fread(128);
$id3v1tag = $this->fread(128);
if (substr($id3v1tag, 0, 3) == 'TAG') {
@@ -356,4 +357,4 @@ class getid3_id3v1 extends getid3_handler
return $ID3v1Tag;
}
}
}
+18 -8
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -51,8 +52,8 @@ class getid3_id3v2 extends getid3_handler
$thisfile_id3v2_flags = &$thisfile_id3v2['flags'];
fseek($this->getid3->fp, $this->StartingOffset, SEEK_SET);
$header = fread($this->getid3->fp, 10);
$this->fseek($this->StartingOffset);
$header = $this->fread(10);
if (substr($header, 0, 3) == 'ID3' && strlen($header) == 10) {
$thisfile_id3v2['majorversion'] = ord($header{3});
@@ -131,7 +132,7 @@ class getid3_id3v2 extends getid3_handler
}
if ($sizeofframes > 0) {
$framedata = fread($this->getid3->fp, $sizeofframes); // read all frames from file into $framedata variable
$framedata = $this->fread($sizeofframes); // read all frames from file into $framedata variable
// if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x)
if (!empty($thisfile_id3v2_flags['unsynch']) && ($id3v2_majorversion <= 3)) {
@@ -423,7 +424,7 @@ class getid3_id3v2 extends getid3_handler
// ID3v2 size 4 * %0xxxxxxx
if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) {
$footer = fread($this->getid3->fp, 10);
$footer = $this->fread(10);
if (substr($footer, 0, 3) == '3DI') {
$thisfile_id3v2['footer'] = true;
$thisfile_id3v2['majorversion_footer'] = ord($footer{3});
@@ -642,7 +643,12 @@ class getid3_id3v2 extends getid3_handler
$parsedFrame['description'] = $frame_description;
$parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
$commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
} else {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
}
}
//unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain
@@ -1077,7 +1083,12 @@ class getid3_id3v2 extends getid3_handler
$parsedFrame['description'] = $frame_description;
$parsedFrame['data'] = $frame_text;
if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
$commentkey = ($parsedFrame['description'] ? $parsedFrame['description'] : (!empty($info['id3v2']['comments'][$parsedFrame['framenameshort']]) ? count($info['id3v2']['comments'][$parsedFrame['framenameshort']]) : 0));
if (!isset($info['id3v2']['comments'][$parsedFrame['framenameshort']]) || !array_key_exists($commentkey, $info['id3v2']['comments'][$parsedFrame['framenameshort']])) {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][$commentkey] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
} else {
$info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
}
}
}
@@ -1885,7 +1896,7 @@ class getid3_id3v2 extends getid3_handler
$frame_offset += 2;
$parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
$frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8);
for ($i = 0; $i < $frame_indexpoints; $i++) {
for ($i = 0; $i < $parsedFrame['indexpoints']; $i++) {
$parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint));
$frame_offset += $frame_bytesperpoint;
}
@@ -3411,4 +3422,3 @@ class getid3_id3v2 extends getid3_handler
}
}
+23 -23
View File
@@ -3,6 +3,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
@@ -27,8 +28,8 @@ class getid3_lyrics3 extends getid3_handler
return false;
}
fseek($this->getid3->fp, (0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size]
$lyrics3_id3v1 = fread($this->getid3->fp, 128 + 9 + 6);
$this->fseek((0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - "LYRICSEND" - [Lyrics3size]
$lyrics3_id3v1 = $this->fread(128 + 9 + 6);
$lyrics3lsz = substr($lyrics3_id3v1, 0, 6); // Lyrics3size
$lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200
$id3v1tag = substr($lyrics3_id3v1, 15, 128); // ID3v1
@@ -68,9 +69,9 @@ class getid3_lyrics3 extends getid3_handler
if (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) {
fseek($this->getid3->fp, $info['ape']['tag_offset_start'] - 15, SEEK_SET);
$lyrics3lsz = fread($this->getid3->fp, 6);
$lyrics3end = fread($this->getid3->fp, 9);
$this->fseek($info['ape']['tag_offset_start'] - 15);
$lyrics3lsz = $this->fread(6);
$lyrics3end = $this->fread(9);
if ($lyrics3end == 'LYRICSEND') {
// Lyrics3v1, APE, maybe ID3v1
@@ -101,20 +102,19 @@ class getid3_lyrics3 extends getid3_handler
if (!isset($info['ape'])) {
$GETID3_ERRORARRAY = &$info['warning'];
if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, false)) {
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_apetag = new getid3_apetag($getid3_temp);
$getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
$getid3_apetag->Analyze();
if (!empty($getid3_temp->info['ape'])) {
$info['ape'] = $getid3_temp->info['ape'];
}
if (!empty($getid3_temp->info['replay_gain'])) {
$info['replay_gain'] = $getid3_temp->info['replay_gain'];
}
unset($getid3_temp, $getid3_apetag);
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
$getid3_temp = new getID3();
$getid3_temp->openfile($this->getid3->filename);
$getid3_apetag = new getid3_apetag($getid3_temp);
$getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
$getid3_apetag->Analyze();
if (!empty($getid3_temp->info['ape'])) {
$info['ape'] = $getid3_temp->info['ape'];
}
if (!empty($getid3_temp->info['replay_gain'])) {
$info['replay_gain'] = $getid3_temp->info['replay_gain'];
}
unset($getid3_temp, $getid3_apetag);
}
}
@@ -132,11 +132,11 @@ class getid3_lyrics3 extends getid3_handler
return false;
}
fseek($this->getid3->fp, $endoffset, SEEK_SET);
$this->fseek($endoffset);
if ($length <= 0) {
return false;
}
$rawdata = fread($this->getid3->fp, $length);
$rawdata = $this->fread($length);
$ParsedLyrics3['raw']['lyrics3version'] = $version;
$ParsedLyrics3['raw']['lyrics3tagsize'] = $length;
@@ -169,7 +169,7 @@ class getid3_lyrics3 extends getid3_handler
$ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9));
$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
} else {
$info['error'][] = '"LYRICSEND" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
$info['error'][] = '"LYRICSEND" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
return false;
}
break;
@@ -217,7 +217,7 @@ class getid3_lyrics3 extends getid3_handler
$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
}
} else {
$info['error'][] = '"LYRICS200" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
$info['error'][] = '"LYRICS200" expected at '.($this->ftell() - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
return false;
}
break;
@@ -291,4 +291,4 @@ class getid3_lyrics3 extends getid3_handler
}
return null;
}
}
}
+17 -16
View File
@@ -2,6 +2,7 @@
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// also https://github.com/JamesHeinrich/getID3 //
/////////////////////////////////////////////////////////////////
*****************************************************************
@@ -67,13 +68,13 @@ What does getID3() do?
===========================================================================
Reads & parses (to varying degrees):
# tags:
¤ tags:
* APE (v1 and v2)
* ID3v1 (& ID3v1.1)
* ID3v2 (v2.4, v2.3, v2.2)
* Lyrics3 (v1 & v2)
# audio-lossy:
¤ audio-lossy:
* MP3/MP2/MP1
* MPC / Musepack
* Ogg (Vorbis, OggFLAC, Speex)
@@ -85,7 +86,7 @@ Reads & parses (to varying degrees):
* DSS
* VQF
# audio-lossless:
¤ audio-lossless:
* AIFF
* AU
* Bonk
@@ -104,7 +105,7 @@ Reads & parses (to varying degrees):
* WAV (RIFF)
* WavPack
# audio-video:
¤ audio-video:
* ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV)
* AVI (RIFF)
* Flash
@@ -114,7 +115,7 @@ Reads & parses (to varying degrees):
* Quicktime (including MP4)
* RealVideo
# still image:
¤ still image:
* BMP
* GIF
* JPEG
@@ -123,7 +124,7 @@ Reads & parses (to varying degrees):
* SWF (Flash)
* PhotoCD
# data:
¤ data:
* ISO-9660 CD-ROM image (directory structure)
* SZIP (limited support)
* ZIP (directory structure)
@@ -309,7 +310,7 @@ http://www.getid3.org/phpBB3/viewforum.php?f=7
(http://web.inter.nl.net/users/hvdh/lossless/lossless.htm)
* Support for RIFF-INFO chunks
* http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html
(thanks Nick Humfrey <njh@surgeradio*co*uk>)
(thanks Nick Humfrey <njhØsurgeradio*co*uk>)
* http://abcavi.narod.ru/sof/abcavi/infotags.htm
(thanks Kibi)
* Better support for Bink video
@@ -324,23 +325,23 @@ http://www.getid3.org/phpBB3/viewforum.php?f=7
* Support for IFF
* Support for ICO
* Support for ANI
* Support for EXE (comments, author, etc) (thanks p*quaedackers@planet*nl)
* Support for EXE (comments, author, etc) (thanks p*quaedackersØplanet*nl)
* Support for DVD-IFO (region, subtitles, aspect ratio, etc)
(thanks p*quaedackers@planet*nl)
(thanks p*quaedackersØplanet*nl)
* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content
(thanks n8n8@yahoo*com)
(thanks n8n8Øyahoo*com)
* Support for a2b
* Optional scan-through-frames for AVI verification
(thanks rockcohen@massive-interactive*nl)
* Support for TTF (thanks info@butterflyx*com)
(thanks rockcohenØmassive-interactive*nl)
* Support for TTF (thanks infoØbutterflyx*com)
* Support for DSS (http://www.getid3.org/phpBB3/viewtopic.php?t=171)
* Support for SMAF (http://smaf-yamaha.com/what/demo.html)
http://www.getid3.org/phpBB3/viewtopic.php?t=182
* Support for AMR (http://www.getid3.org/phpBB3/viewtopic.php?t=195)
* Support for 3gpp (http://www.getid3.org/phpBB3/viewtopic.php?t=195)
* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2K@hotmail*com)
* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2KØhotmail*com)
* Parse XML data returned in Ogg comments
* Parse XML data from Quicktime SMIL metafiles (klausrath@mac*com)
* Parse XML data from Quicktime SMIL metafiles (klausrathØmac*com)
* ID3v2 genre string creator function
* More complete parsing of JPG
* Support for all old-style ASF packets
@@ -424,7 +425,7 @@ http://www.getid3.org/phpBB3/viewtopic.php?t=25
"movi" chunk that fits in the first 2GB, should issue error
to show that playtime is incorrect. Other data should be mostly
correct, assuming that data is constant throughout the file)
* PHP <= v5 on Windows cannot read UTF-8 filenames
Known Bugs/Issues in other programs
@@ -600,4 +601,4 @@ Reference material:
* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm
* http://trac.musepack.net/trac/wiki/SV8Specification
* http://wyday.com/cuesharp/specification.php
* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
+1 -1
View File
@@ -315,7 +315,7 @@ class SimplePie_Sanitize
}
else
{
$file = $this->registry->create('File', array($img['attribs']['src']['data'], $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen));
$file = $this->registry->create('File', array($img->getAttribute('src'), $this->timeout, 5, array('X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']), $this->useragent, $this->force_fsockopen));
$headers = $file->headers;
if ($file->success && ($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300)))
+257 -68
View File
@@ -22,9 +22,17 @@ function _wp_admin_bar_init() {
return false;
/* Load the admin bar class code ready for instantiation */
require( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
/* Instantiate the admin bar */
/**
* Filter the admin bar class to instantiate.
*
* @since 3.1.0
*
* @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'.
*/
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
if ( class_exists( $admin_bar_class ) )
$wp_admin_bar = new $admin_bar_class;
@@ -36,9 +44,6 @@ function _wp_admin_bar_init() {
return true;
}
// Don't remove. Wrong way to disable.
add_action( 'template_redirect', '_wp_admin_bar_init', 0 );
add_action( 'admin_init', '_wp_admin_bar_init' );
/**
* Render the admin bar to the page based on the $wp_admin_bar->menu member var.
@@ -57,30 +62,46 @@ function wp_admin_bar_render() {
if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) )
return false;
/**
* Load all necessary admin bar items.
*
* This is the hook used to add, remove, or manipulate admin bar items.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference
*/
do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
/**
* Fires before the admin bar is rendered.
*
* @since 3.1.0
*/
do_action( 'wp_before_admin_bar_render' );
$wp_admin_bar->render();
/**
* Fires after the admin bar is rendered.
*
* @since 3.1.0
*/
do_action( 'wp_after_admin_bar_render' );
}
add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
add_action( 'in_admin_header', 'wp_admin_bar_render', 0 );
/**
* Add the WordPress logo menu.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_wp_menu( $wp_admin_bar ) {
$wp_admin_bar->add_menu( array(
'id' => 'wp-logo',
'title' => '<span class="ab-icon"></span>',
'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'About WordPress' ) . '</span>',
'href' => self_admin_url( 'about.php' ),
'meta' => array(
'title' => __('About WordPress'),
),
) );
if ( is_user_logged_in() ) {
@@ -89,7 +110,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
'parent' => 'wp-logo',
'id' => 'about',
'title' => __('About WordPress'),
'href' => self_admin_url( 'about.php' ),
'href' => self_admin_url( 'about.php' ),
) );
}
@@ -98,7 +119,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
'parent' => 'wp-logo-external',
'id' => 'wporg',
'title' => __('WordPress.org'),
'href' => __('http://wordpress.org/'),
'href' => __('https://wordpress.org/'),
) );
// Add codex link
@@ -106,7 +127,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
'parent' => 'wp-logo-external',
'id' => 'documentation',
'title' => __('Documentation'),
'href' => __('http://codex.wordpress.org/'),
'href' => __('https://codex.wordpress.org/'),
) );
// Add forums link
@@ -114,7 +135,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
'parent' => 'wp-logo-external',
'id' => 'support-forums',
'title' => __('Support Forums'),
'href' => __('http://wordpress.org/support/'),
'href' => __('https://wordpress.org/support/'),
) );
// Add feedback link
@@ -122,14 +143,33 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
'parent' => 'wp-logo-external',
'id' => 'feedback',
'title' => __('Feedback'),
'href' => __('http://wordpress.org/support/forum/requests-and-feedback'),
'href' => __('https://wordpress.org/support/forum/requests-and-feedback'),
) );
}
/**
* Add the sidebar toggle button.
*
* @since 3.8.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) {
if ( is_admin() ) {
$wp_admin_bar->add_menu( array(
'id' => 'menu-toggle',
'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
'href' => '#',
) );
}
}
/**
* Add the "My Account" item.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_my_account_item( $wp_admin_bar ) {
$user_id = get_current_user_id();
@@ -139,7 +179,7 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) {
if ( ! $user_id )
return;
$avatar = get_avatar( $user_id, 16 );
$avatar = get_avatar( $user_id, 26 );
$howdy = sprintf( __('Howdy, %1$s'), $current_user->display_name );
$class = empty( $avatar ) ? '' : 'with-avatar';
@@ -150,7 +190,6 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) {
'href' => $profile_url,
'meta' => array(
'class' => $class,
'title' => __('My Account'),
),
) );
}
@@ -159,6 +198,8 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) {
* Add the "My Account" submenu items.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
$user_id = get_current_user_id();
@@ -206,10 +247,10 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
* Add the "Site Name" menu.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_site_menu( $wp_admin_bar ) {
global $current_site;
// Don't show for logged out users.
if ( ! is_user_logged_in() )
return;
@@ -220,13 +261,14 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
$blogname = get_bloginfo('name');
if ( empty( $blogname ) )
if ( ! $blogname ) {
$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
}
if ( is_network_admin() ) {
$blogname = sprintf( __('Network Admin: %s'), esc_html( $current_site->site_name ) );
$blogname = sprintf( __('Network Admin: %s'), esc_html( get_current_site()->site_name ) );
} elseif ( is_user_admin() ) {
$blogname = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );
$blogname = sprintf( __('Global Dashboard: %s'), esc_html( get_current_site()->site_name ) );
}
$title = wp_html_excerpt( $blogname, 40, '&hellip;' );
@@ -275,10 +317,10 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
* Add the "My Sites/[Site Name]" menu and all submenus.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
global $wpdb;
// Don't show for logged out users or single site mode.
if ( ! is_user_logged_in() || ! is_multisite() )
return;
@@ -287,10 +329,16 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
if ( count( $wp_admin_bar->user->blogs ) < 1 && ! is_super_admin() )
return;
if ( $wp_admin_bar->user->active_blog ) {
$my_sites_url = get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' );
} else {
$my_sites_url = admin_url( 'my-sites.php' );
}
$wp_admin_bar->add_menu( array(
'id' => 'my-sites',
'title' => __( 'My Sites' ),
'href' => admin_url( 'my-sites.php' ),
'href' => $my_sites_url,
) );
if ( is_super_admin() ) {
@@ -326,9 +374,15 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
) );
$wp_admin_bar->add_menu( array(
'parent' => 'network-admin',
'id' => 'network-admin-v',
'title' => __( 'Visit Network' ),
'href' => network_home_url(),
'id' => 'network-admin-t',
'title' => __( 'Themes' ),
'href' => network_admin_url( 'themes.php' ),
) );
$wp_admin_bar->add_menu( array(
'parent' => 'network-admin',
'id' => 'network-admin-p',
'title' => __( 'Plugins' ),
'href' => network_admin_url( 'plugins.php' ),
) );
}
@@ -346,7 +400,12 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
$blavatar = '<div class="blavatar"></div>';
$blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
$blogname = $blog->blogname;
if ( ! $blogname ) {
$blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
}
$menu_id = 'blog-' . $blog->userblog_id;
$wp_admin_bar->add_menu( array(
@@ -396,6 +455,8 @@ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) {
* Provide a shortlink.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
$short = wp_get_shortlink( 0, 'query' );
@@ -418,6 +479,8 @@ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) {
* Provide an edit link for posts and terms.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_edit_menu( $wp_admin_bar ) {
global $tag, $wp_the_query;
@@ -433,11 +496,23 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
&& ( $post_type_object->public )
&& ( $post_type_object->show_in_admin_bar ) )
{
$wp_admin_bar->add_menu( array(
'id' => 'view',
'title' => $post_type_object->labels->view_item,
'href' => get_permalink( $post->ID )
) );
if( 'draft' == $post->post_status ) {
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
/** This filter is documented in wp-admin/includes/meta-boxes.php */
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
$wp_admin_bar->add_menu( array(
'id' => 'preview',
'title' => $post_type_object->labels->view_item,
'href' => esc_url( $preview_link ),
'meta' => array( 'target' => 'wp-preview-' . $post->ID ),
) );
} else {
$wp_admin_bar->add_menu( array(
'id' => 'view',
'title' => $post_type_object->labels->view_item,
'href' => get_permalink( $post->ID )
) );
}
} elseif ( 'edit-tags' == $current_screen->base
&& isset( $tag ) && is_object( $tag )
&& ( $tax = get_taxonomy( $tag->taxonomy ) )
@@ -458,22 +533,24 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
if ( ! empty( $current_object->post_type )
&& ( $post_type_object = get_post_type_object( $current_object->post_type ) )
&& current_user_can( 'edit_post', $current_object->ID )
&& $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
&& $post_type_object->show_ui && $post_type_object->show_in_admin_bar
&& $edit_post_link = get_edit_post_link( $current_object->ID ) )
{
$wp_admin_bar->add_menu( array(
'id' => 'edit',
'title' => $post_type_object->labels->edit_item,
'href' => get_edit_post_link( $current_object->ID )
'href' => $edit_post_link
) );
} elseif ( ! empty( $current_object->taxonomy )
&& ( $tax = get_taxonomy( $current_object->taxonomy ) )
&& current_user_can( $tax->cap->edit_terms )
&& $tax->show_ui )
&& $tax->show_ui
&& $edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) )
{
$wp_admin_bar->add_menu( array(
'id' => 'edit',
'title' => $tax->labels->edit_item,
'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy )
'href' => $edit_term_link
) );
}
}
@@ -483,6 +560,8 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
* Add "Add New" menu.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
$actions = array();
@@ -527,9 +606,6 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
'id' => 'new-content',
'title' => $title,
'href' => admin_url( current( array_keys( $actions ) ) ),
'meta' => array(
'title' => _x( 'Add New', 'admin bar menu group label' ),
),
) );
foreach ( $actions as $link => $action ) {
@@ -548,6 +624,8 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) {
* Add edit comments link with awaiting moderation count bubble.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_comments_menu( $wp_admin_bar ) {
if ( !current_user_can('edit_posts') )
@@ -572,45 +650,139 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
* Add appearance submenu items to the "Site Name" menu.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
$wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance' ) );
if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
if ( ! current_user_can( 'edit_theme_options' ) )
return;
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize',
'title' => __('Customize'),
'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ),
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
$customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() );
if ( current_theme_supports( 'widgets' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
if ( current_user_can( 'switch_themes' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'themes',
'title' => __( 'Themes' ),
'href' => admin_url( 'themes.php' ),
'meta' => array(
'class' => 'hide-if-customize',
),
) );
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-themes',
'title' => __( 'Themes' ),
'href' => add_query_arg( urlencode( 'autofocus[section]' ), 'themes', $customize_url ), // urlencode() needed due to #16859
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
}
}
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize',
'title' => __('Customize'),
'href' => $customize_url,
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
}
if ( ! current_user_can( 'edit_theme_options' ) ) {
return;
}
if ( current_theme_supports( 'widgets' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'widgets',
'title' => __( 'Widgets' ),
'href' => admin_url( 'widgets.php' ),
'meta' => array(
'class' => 'hide-if-customize',
),
) );
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-widgets',
'title' => __( 'Widgets' ),
'href' => add_query_arg( urlencode( 'autofocus[panel]' ), 'widgets', $customize_url ), // urlencode() needed due to #16859
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
}
}
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
if ( current_theme_supports( 'custom-background' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );
if ( current_theme_supports( 'custom-background' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'background',
'title' => __( 'Background' ),
'href' => admin_url( 'themes.php?page=custom-background' ),
'meta' => array(
'class' => 'hide-if-customize',
),
) );
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-background',
'title' => __( 'Background' ),
'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'background_image', $customize_url ), // urlencode() needed due to #16859
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
}
}
if ( current_theme_supports( 'custom-header' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'header',
'title' => __( 'Header' ),
'href' => admin_url( 'themes.php?page=custom-header' ),
'meta' => array(
'class' => 'hide-if-customize',
),
) );
if ( current_user_can( 'customize' ) ) {
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize-header',
'title' => __( 'Header' ),
'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'header_image', $customize_url ), // urlencode() needed due to #16859
'meta' => array(
'class' => 'hide-if-no-customize',
),
) );
}
}
if ( current_theme_supports( 'custom-header' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );
}
/**
* Provide an update link if theme/plugin/core updates are available.
*
* @since 3.1.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_updates_menu( $wp_admin_bar ) {
@@ -636,6 +808,8 @@ function wp_admin_bar_updates_menu( $wp_admin_bar ) {
* Add search form.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_search_menu( $wp_admin_bar ) {
if ( is_admin() )
@@ -643,6 +817,7 @@ function wp_admin_bar_search_menu( $wp_admin_bar ) {
$form = '<form action="' . esc_url( home_url( '/' ) ) . '" method="get" id="adminbarsearch">';
$form .= '<input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />';
$form .= '<label for="adminbar-search" class="screen-reader-text">' . __( 'Search' ) . '</label>';
$form .= '<input type="submit" class="adminbar-button" value="' . __('Search') . '"/>';
$form .= '</form>';
@@ -661,6 +836,8 @@ function wp_admin_bar_search_menu( $wp_admin_bar ) {
* Add secondary menus.
*
* @since 3.3.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
$wp_admin_bar->add_group( array(
@@ -683,7 +860,6 @@ function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {
* Style and scripts for the admin bar.
*
* @since 3.1.0
*
*/
function wp_admin_bar_header() { ?>
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
@@ -694,12 +870,15 @@ function wp_admin_bar_header() { ?>
* Default admin bar callback.
*
* @since 3.1.0
*
*/
function _admin_bar_bump_cb() { ?>
<style type="text/css" media="screen">
html { margin-top: 28px !important; }
* html body { margin-top: 28px !important; }
html { margin-top: 32px !important; }
* html body { margin-top: 32px !important; }
@media screen and ( max-width: 782px ) {
html { margin-top: 46px !important; }
* html body { margin-top: 46px !important; }
}
</style>
<?php
}
@@ -745,6 +924,16 @@ function is_admin_bar_showing() {
}
}
/**
* Filter whether to show the admin bar.
*
* Returning false to this hook is the recommended way to hide the admin bar.
* The user's display preference is used for logged in users.
*
* @since 3.1.0
*
* @param bool $show_admin_bar Whether the admin bar should be shown. Default false.
*/
$show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );
return $show_admin_bar;
+1 -1
View File
@@ -7,7 +7,7 @@
*
* @author Elias Torres <elias@torrez.us>
* @version 0.4
* @since 2.3
* @since 2.3.0
*/
/**
+146 -85
View File
@@ -4,7 +4,7 @@
*
* These functions must be used within the WordPress Loop.
*
* @link http://codex.wordpress.org/Author_Templates
* @link https://codex.wordpress.org/Author_Templates
*
* @package WordPress
* @subpackage Template
@@ -13,9 +13,9 @@
/**
* Retrieve the author of the current post.
*
* @since 1.5
* @since 1.5.0
*
* @uses $authordata The current author's DB object.
* @uses apply_filters() Calls 'the_author' hook on the author display name.
*
* @param string $deprecated Deprecated.
* @return string The author's display name.
@@ -26,6 +26,13 @@ function get_the_author($deprecated = '') {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.1' );
/**
* Filter the display name of the current post's author.
*
* @since 2.9.0
*
* @param string $authordata->display_name The author's display name.
*/
return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
}
@@ -42,7 +49,7 @@ function get_the_author($deprecated = '') {
*
* @since 0.71
* @see get_the_author()
* @link http://codex.wordpress.org/Template_Tags/the_author
* @link https://codex.wordpress.org/Template_Tags/the_author
*
* @param string $deprecated Deprecated.
* @param string $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.
@@ -61,16 +68,21 @@ function the_author( $deprecated = '', $deprecated_echo = true ) {
/**
* Retrieve the author who last edited the current post.
*
* @since 2.8
* @uses $post The current post's DB object.
* @uses get_post_meta() Retrieves the ID of the author who last edited the current post.
* @uses get_userdata() Retrieves the author's DB object.
* @uses apply_filters() Calls 'the_modified_author' hook on the author display name.
* @since 2.8.0
*
* @return string The author's display name.
*/
function get_the_modified_author() {
if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
$last_user = get_userdata($last_id);
/**
* Filter the display name of the author who last edited the current post.
*
* @since 2.8.0
*
* @param string $last_user->display_name The author's display name.
*/
return apply_filters('the_modified_author', $last_user->display_name);
}
}
@@ -78,7 +90,8 @@ function get_the_modified_author() {
/**
* Display the name of the author who last edited the current post.
*
* @since 2.8
* @since 2.8.0
*
* @see get_the_author()
* @return string The author's display name, from get_the_modified_author().
*/
@@ -88,9 +101,8 @@ function the_modified_author() {
/**
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @link https://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* @uses $authordata The current author's DB object (if $user_id not specified).
* @param string $field selects the field of the users record.
* @param int $user_id Optional. User ID.
* @return string The author's field from the current author's DB object.
@@ -108,19 +120,41 @@ function get_the_author_meta( $field = '', $user_id = false ) {
$value = isset( $authordata->$field ) ? $authordata->$field : '';
/**
* Filter the value of the requested user metadata.
*
* The filter name is dynamic and depends on the $field parameter of the function.
*
* @since 2.8.0
*
* @param string $value The value of the metadata.
* @param int $user_id The user ID.
*/
return apply_filters( 'get_the_author_' . $field, $value, $user_id );
}
/**
* Retrieve the requested data of the author of the current post.
* @link http://codex.wordpress.org/Template_Tags/the_author_meta
* @link https://codex.wordpress.org/Template_Tags/the_author_meta
* @since 2.8.0
* @param string $field selects the field of the users record.
* @param int $user_id Optional. User ID.
* @echo string The author's field from the current author's DB object.
*/
function the_author_meta($field = '', $user_id = false) {
echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id);
function the_author_meta( $field = '', $user_id = false ) {
$author_meta = get_the_author_meta( $field, $user_id );
/**
* The value of the requested user metadata.
*
* The filter name is dynamic and depends on the $field parameter of the function.
*
* @since 2.8.0
*
* @param string $author_meta The value of the metadata.
* @param int $user_id The user ID.
*/
echo apply_filters( 'the_author_' . $field, $author_meta, $user_id );
}
/**
@@ -128,9 +162,6 @@ function the_author_meta($field = '', $user_id = false) {
*
* If the author has a home page set, return an HTML link, otherwise just return the
* author's name.
*
* @uses get_the_author_meta()
* @uses get_the_author()
*/
function get_the_author_link() {
if ( get_the_author_meta('url') ) {
@@ -146,9 +177,9 @@ function get_the_author_link() {
* If the author has a home page set, echo an HTML link, otherwise just echo the
* author's name.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_link
* @since 2.1
* @uses get_the_author_link()
* @link https://codex.wordpress.org/Template_Tags/the_author_link
*
* @since 2.1.0
*/
function the_author_link() {
echo get_the_author_link();
@@ -157,21 +188,23 @@ function the_author_link() {
/**
* Retrieve the number of posts by the author of the current post.
*
* @since 1.5
* @uses $post The current post in the Loop's DB object.
* @uses count_user_posts()
* @since 1.5.0
*
* @return int The number of posts by the author.
*/
function get_the_author_posts() {
return count_user_posts( get_post()->post_author );
$post = get_post();
if ( ! $post ) {
return 0;
}
return count_user_posts( $post->post_author, $post->post_type );
}
/**
* Display the number of posts by the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_posts
* @link https://codex.wordpress.org/Template_Tags/the_author_posts
* @since 0.71
* @uses get_the_author_posts() Echoes returned value from function.
*/
function the_author_posts() {
echo get_the_author_posts();
@@ -184,11 +217,8 @@ function the_author_posts() {
* reason for this, is that another function is used to help in printing the
* link to the author's posts.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_posts_link
* @link https://codex.wordpress.org/Template_Tags/the_author_posts_link
* @since 1.2.0
* @uses $authordata The current author's DB object.
* @uses get_author_posts_url()
* @uses get_the_author()
* @param string $deprecated Deprecated.
*/
function the_author_posts_link($deprecated = '') {
@@ -204,6 +234,14 @@ function the_author_posts_link($deprecated = '') {
esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ),
get_the_author()
);
/**
* Filter the link to the author page of the author of the current post.
*
* @since 2.9.0
*
* @param string $link HTML link.
*/
echo apply_filters( 'the_author_posts_link', $link );
}
@@ -232,7 +270,16 @@ function get_author_posts_url($author_id, $author_nicename = '') {
$link = home_url( user_trailingslashit( $link ) );
}
$link = apply_filters('author_link', $link, $author_id, $author_nicename);
/**
* Filter the URL to the author's page.
*
* @since 2.1.0
*
* @param string $link The URL to the author's page.
* @param int $author_id The author's id.
* @param string $author_nicename The author's nice name.
*/
$link = apply_filters( 'author_link', $link, $author_id, $author_nicename );
return $link;
}
@@ -240,30 +287,37 @@ function get_author_posts_url($author_id, $author_nicename = '') {
/**
* List all the authors of the blog, with several options available.
*
* <ul>
* <li>optioncount (boolean) (false): Show the count in parenthesis next to the
* author's name.</li>
* <li>exclude_admin (boolean) (true): Exclude the 'admin' user that is
* installed by default.</li>
* <li>show_fullname (boolean) (false): Show their full names.</li>
* <li>hide_empty (boolean) (true): Don't show authors without any posts.</li>
* <li>feed (string) (''): If isn't empty, show links to author's feeds.</li>
* <li>feed_image (string) (''): If isn't empty, use this image to link to
* feeds.</li>
* <li>echo (boolean) (true): Set to false to return the output, instead of
* echoing.</li>
* <li>style (string) ('list'): Whether to display list of authors in list form
* or as a string.</li>
* <li>html (bool) (true): Whether to list the items in html form or plaintext.
* </li>
* </ul>
* @link https://codex.wordpress.org/Template_Tags/wp_list_authors
*
* @link http://codex.wordpress.org/Template_Tags/wp_list_authors
* @since 1.2.0
* @param array $args The argument array.
* @return null|string The output, if echo is set to false.
*
* @param string|array $args {
* Optional. Array or string of default arguments.
*
* @type string $orderby How to sort the authors. Accepts 'nicename', 'email', 'url', 'registered',
* 'user_nicename', 'user_email', 'user_url', 'user_registered', 'name',
* 'display_name', 'post_count', 'ID', 'meta_value', 'user_login'. Default 'name'.
* @type string $order Sorting direction for $orderby. Accepts 'ASC', 'DESC'. Default 'ASC'.
* @type int $number Maximum authors to return or display. Default empty (all authors).
* @type bool $optioncount Show the count in parenthesis next to the author's name. Default false.
* @type bool $exclude_admin Whether to exclude the 'admin' account, if it exists. Default false.
* @type bool $show_fullname Whether to show the author's full name. Default false.
* @type bool $hide_empty Whether to hide any authors with no posts. Default true.
* @type string $feed If not empty, show a link to the author's feed and use this text as the alt
* parameter of the link. Default empty.
* @type string $feed_image If not empty, show a link to the author's feed and use this image URL as
* clickable anchor. Default empty.
* @type string $feed_type The feed type to link to, such as 'rss2'. Defaults to default feed type.
* @type bool $echo Whether to output the result or instead return it. Default true.
* @type string $style If 'list', each author is wrapped in an `<li>` element, otherwise the authors
* will be separated by commas.
* @type bool $html Whether to list the items in HTML form or plaintext. Default true.
* @type string $exclude An array, comma-, or space-separated list of author IDs to exclude. Default empty.
* @type string $exclude An array, comma-, or space-separated list of author IDs to include. Default empty.
* }
* @return null|string The output, if echo is set to false. Otherwise null.
*/
function wp_list_authors($args = '') {
function wp_list_authors( $args = '' ) {
global $wpdb;
$defaults = array(
@@ -271,93 +325,94 @@ function wp_list_authors($args = '') {
'optioncount' => false, 'exclude_admin' => true,
'show_fullname' => false, 'hide_empty' => true,
'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
'style' => 'list', 'html' => true
'style' => 'list', 'html' => true, 'exclude' => '', 'include' => ''
);
$args = wp_parse_args( $args, $defaults );
extract( $args, EXTR_SKIP );
$return = '';
$query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number' ) );
$query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number', 'exclude', 'include' ) );
$query_args['fields'] = 'ids';
$authors = get_users( $query_args );
$author_count = array();
foreach ( (array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row )
foreach ( (array) $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author" ) as $row ) {
$author_count[$row->post_author] = $row->count;
}
foreach ( $authors as $author_id ) {
$author = get_userdata( $author_id );
if ( $exclude_admin && 'admin' == $author->display_name )
if ( $args['exclude_admin'] && 'admin' == $author->display_name ) {
continue;
}
$posts = isset( $author_count[$author->ID] ) ? $author_count[$author->ID] : 0;
if ( !$posts && $hide_empty )
if ( ! $posts && $args['hide_empty'] ) {
continue;
}
$link = '';
if ( $show_fullname && $author->first_name && $author->last_name )
if ( $args['show_fullname'] && $author->first_name && $author->last_name ) {
$name = "$author->first_name $author->last_name";
else
} else {
$name = $author->display_name;
}
if ( !$html ) {
if ( ! $args['html'] ) {
$return .= $name . ', ';
continue; // No need to go further to process HTML.
}
if ( 'list' == $style ) {
if ( 'list' == $args['style'] ) {
$return .= '<li>';
}
$link = '<a href="' . get_author_posts_url( $author->ID, $author->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $author->display_name) ) . '">' . $name . '</a>';
if ( !empty( $feed_image ) || !empty( $feed ) ) {
if ( ! empty( $args['feed_image'] ) || ! empty( $args['feed'] ) ) {
$link .= ' ';
if ( empty( $feed_image ) ) {
if ( empty( $args['feed_image'] ) ) {
$link .= '(';
}
$link .= '<a href="' . get_author_feed_link( $author->ID ) . '"';
$link .= '<a href="' . get_author_feed_link( $author->ID, $args['feed_type'] ) . '"';
$alt = $title = '';
if ( !empty( $feed ) ) {
$title = ' title="' . esc_attr( $feed ) . '"';
$alt = ' alt="' . esc_attr( $feed ) . '"';
$name = $feed;
$link .= $title;
$alt = '';
if ( ! empty( $args['feed'] ) ) {
$alt = ' alt="' . esc_attr( $args['feed'] ) . '"';
$name = $args['feed'];
}
$link .= '>';
if ( !empty( $feed_image ) )
$link .= '<img src="' . esc_url( $feed_image ) . '" style="border: none;"' . $alt . $title . ' />';
else
if ( ! empty( $args['feed_image'] ) ) {
$link .= '<img src="' . esc_url( $args['feed_image'] ) . '" style="border: none;"' . $alt . ' />';
} else {
$link .= $name;
}
$link .= '</a>';
if ( empty( $feed_image ) )
if ( empty( $args['feed_image'] ) ) {
$link .= ')';
}
}
if ( $optioncount )
if ( $args['optioncount'] ) {
$link .= ' ('. $posts . ')';
}
$return .= $link;
$return .= ( 'list' == $style ) ? '</li>' : ', ';
$return .= ( 'list' == $args['style'] ) ? '</li>' : ', ';
}
$return = rtrim($return, ', ');
$return = rtrim( $return, ', ' );
if ( !$echo )
if ( ! $args['echo'] ) {
return $return;
}
echo $return;
}
@@ -378,6 +433,13 @@ function is_multi_author() {
set_transient( 'is_multi_author', $is_multi_author );
}
/**
* Filter whether the site has more than one author with published posts.
*
* @since 3.2.0
*
* @param bool $is_multi_author Whether $is_multi_author should evaluate as true.
*/
return apply_filters( 'is_multi_author', (bool) $is_multi_author );
}
@@ -389,4 +451,3 @@ function is_multi_author() {
function __clear_multi_author_cache() {
delete_transient( 'is_multi_author' );
}
add_action('transition_post_status', '__clear_multi_author_cache');
+183 -142
View File
@@ -19,35 +19,36 @@
* This function is used internally by wp_list_bookmarks() and should not be
* used by themes.
*
* The defaults for overwriting are:
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'show_description' - Default is 0 (integer). Whether to show the description
* of the bookmark.
* 'show_images' - Default is 1 (integer). Whether to show link image if
* available.
* 'show_name' - Default is 0 (integer). Whether to show link name if
* available.
* 'before' - Default is '<li>' (string). The html or text to prepend to each
* bookmarks.
* 'after' - Default is '</li>' (string). The html or text to append to each
* bookmarks.
* 'link_before' - Default is '' (string). The html or text to prepend to each
* bookmarks inside the <a> tag.
* 'link_after' - Default is '' (string). The html or text to append to each
* bookmarks inside the <a> tag.
* 'between' - Default is '\n' (string). The string for use in between the link,
* description, and image.
* 'show_rating' - Default is 0 (integer). Whether to show the link rating.
*
* @since 2.1.0
* @access private
*
* @param array $bookmarks List of bookmarks to traverse
* @param string|array $args Optional. Overwrite the defaults.
* @param array $bookmarks List of bookmarks to traverse.
* @param string|array $args {
* Optional. Bookmarks arguments.
*
* @type int|bool $show_updated Whether to show the time the bookmark was last updated.
* Accepts 1|true or 0|false. Default 0|false.
* @type int|bool $show_description Whether to show the bookmakr description. Accepts 1|true,
* Accepts 1|true or 0|false. Default 0|false.
* @type int|bool $show_images Whether to show the link image if available. Accepts 1|true
* or 0|false. Default 1|true.
* @type int|bool $show_name Whether to show link name if available. Accepts 1|true or
* 0|false. Default 0|false.
* @type string $before The HTML or text to prepend to each bookmark. Default `<li>`.
* @type string $after The HTML or text to append to each bookmark. Default `</li>`.
* @type string $link_before The HTML or text to prepend to each bookmark inside the anchor
* tags. Default empty.
* @type string $link_after The HTML or text to append to each bookmark inside the anchor
* tags. Default empty.
* @type string $between The string for use in between the link, description, and image.
* Default "\n".
* @type int|bool $show_rating Whether to show the link rating. Accepts 1|true or 0|false.
* Default 0|false.
*
* }
* @return string Formatted output in HTML
*/
function _walk_bookmarks($bookmarks, $args = '' ) {
function _walk_bookmarks( $bookmarks, $args = '' ) {
$defaults = array(
'show_updated' => 0, 'show_description' => 0,
'show_images' => 1, 'show_name' => 0,
@@ -56,75 +57,89 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = ''; // Blank string to start with.
foreach ( (array) $bookmarks as $bookmark ) {
if ( !isset($bookmark->recently_updated) )
if ( ! isset( $bookmark->recently_updated ) ) {
$bookmark->recently_updated = false;
$output .= $before;
if ( $show_updated && $bookmark->recently_updated )
$output .= get_option('links_recently_updated_prepend');
}
$output .= $r['before'];
if ( $r['show_updated'] && $bookmark->recently_updated ) {
$output .= '<em>';
}
$the_link = '#';
if ( !empty($bookmark->link_url) )
$the_link = esc_url($bookmark->link_url);
$desc = esc_attr(sanitize_bookmark_field('link_description', $bookmark->link_description, $bookmark->link_id, 'display'));
$name = esc_attr(sanitize_bookmark_field('link_name', $bookmark->link_name, $bookmark->link_id, 'display'));
if ( ! empty( $bookmark->link_url ) ) {
$the_link = esc_url( $bookmark->link_url );
}
$desc = esc_attr( sanitize_bookmark_field( 'link_description', $bookmark->link_description, $bookmark->link_id, 'display' ) );
$name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
$title = $desc;
if ( $show_updated )
if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {
if ( $r['show_updated'] ) {
if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
$title .= ' (';
$title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * HOUR_IN_SECONDS)));
$title .= sprintf(
__('Last updated: %s'),
date(
get_option( 'links_updated_date_format' ),
$bookmark->link_updated_f + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS )
)
);
$title .= ')';
}
}
$alt = ' alt="' . $name . ( $r['show_description'] ? ' ' . $title : '' ) . '"';
$alt = ' alt="' . $name . ( $show_description ? ' ' . $title : '' ) . '"';
if ( '' != $title )
if ( '' != $title ) {
$title = ' title="' . $title . '"';
}
$rel = $bookmark->link_rel;
if ( '' != $rel )
if ( '' != $rel ) {
$rel = ' rel="' . esc_attr($rel) . '"';
}
$target = $bookmark->link_target;
if ( '' != $target )
if ( '' != $target ) {
$target = ' target="' . $target . '"';
}
$output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
$output .= $link_before;
$output .= $r['link_before'];
if ( $bookmark->link_image != null && $show_images ) {
if ( strpos($bookmark->link_image, 'http') === 0 )
if ( $bookmark->link_image != null && $r['show_images'] ) {
if ( strpos( $bookmark->link_image, 'http' ) === 0 ) {
$output .= "<img src=\"$bookmark->link_image\" $alt $title />";
else // If it's a relative path
} else { // If it's a relative path
$output .= "<img src=\"" . get_option('siteurl') . "$bookmark->link_image\" $alt $title />";
if ( $show_name )
}
if ( $r['show_name'] ) {
$output .= " $name";
}
} else {
$output .= $name;
}
$output .= $link_after;
$output .= $r['link_after'];
$output .= '</a>';
if ( $show_updated && $bookmark->recently_updated )
$output .= get_option('links_recently_updated_append');
if ( $r['show_updated'] && $bookmark->recently_updated ) {
$output .= '</em>';
}
if ( $show_description && '' != $desc )
$output .= $between . $desc;
if ( $r['show_description'] && '' != $desc ) {
$output .= $r['between'] . $desc;
}
if ( $show_rating )
$output .= $between . sanitize_bookmark_field('link_rating', $bookmark->link_rating, $bookmark->link_id, 'display');
$output .= "$after\n";
if ( $r['show_rating'] ) {
$output .= $r['between'] . sanitize_bookmark_field(
'link_rating',
$bookmark->link_rating,
$bookmark->link_id,
'display'
);
}
$output .= $r['after'] . "\n";
} // end while
return $output;
@@ -134,69 +149,55 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
* Retrieve or echo all of the bookmarks.
*
* List of default arguments are as follows:
* 'orderby' - Default is 'name' (string). How to order the links by. String is
* based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
* ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
* display.
* 'category' - Default is empty string (string). Include the links in what
* category ID(s).
* 'category_name' - Default is empty string (string). Get links by category
* name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
* links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'echo' - Default is 1 (integer). Whether to echo (default) or return the
* formatted bookmarks.
* 'categorize' - Default is 1 (integer). Whether to show links listed by
* category (default) or show links in one column.
* 'show_description' - Default is 0 (integer). Whether to show the description
* of the bookmark.
*
* These options define how the Category name will appear before the category
* links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will
* display for only the 'title_li' string and only if 'title_li' is not empty.
* 'title_li' - Default is 'Bookmarks' (translatable string). What to show
* before the links appear.
* 'title_before' - Default is '<h2>' (string). The HTML or text to show before
* the 'title_li' string.
* 'title_after' - Default is '</h2>' (string). The HTML or text to show after
* the 'title_li' string.
* 'class' - Default is 'linkcat' (string). The CSS class to use for the
* 'title_li'.
*
* 'category_before' - Default is '<li id="%id" class="%class">'. String must
* contain '%id' and '%class' to get
* the id of the category and the 'class' argument. These are used for
* formatting in themes.
* Argument will be displayed before the 'title_before' argument.
* 'category_after' - Default is '</li>' (string). The HTML or text that will
* appear after the list of links.
*
* These are only used if 'categorize' is set to 1 or true.
* 'category_orderby' - Default is 'name'. How to order the bookmark category
* based on term scheme.
* 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending)
* or DESC (descending).
*
* @see _walk_bookmarks() For other arguments that can be set in this function
* and passed to _walk_bookmarks().
* @see get_bookmarks() For other arguments that can be set in this function and
* passed to get_bookmarks().
* @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks
*
* @since 2.1.0
* @uses _walk_bookmarks() Used to iterate over all of the bookmarks and return
* the html
* @uses get_terms() Gets all of the categories that are for links.
*
* @param string|array $args Optional. Overwrite the defaults of the function
* @return string|null Will only return if echo option is set to not echo.
* Default is not return anything.
* @see _walk_bookmarks()
*
* @param string|array $args {
* Optional. String or array of arguments to list bookmarks.
*
* @type string $orderby How to order the links by. Accepts post fields. Default 'name'.
* @type string $order Whether to order bookmarks in ascending or descending order.
* Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'.
* @type int $limit Amount of bookmarks to display. Accepts 1+ or -1 for all.
* Default -1.
* @type string $category Comma-separated list of category ids to include links from.
* Default empty.
* @type string $category_name Category to retrieve links for by name. Default empty.
* @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts
* 1|true or 0|false. Default 1|true.
* @type int|bool $show_updated Whether to display the time the bookmark was last updated.
* Accepts 1|true or 0|false. Default 0|false.
* @type int|bool $echo Whether to echo or return the formatted bookmarks. Accepts
* 1|true (echo) or 0|false (return). Default 1|true.
* @type int|bool $categorize Whether to show links listed by category or in a single column.
* Accepts 1|true (by category) or 0|false (one column). Default 1|true.
* @type int|bool $show_description Whether to show the bookmark descriptions. Accepts 1|true or 0|false.
* Default 0|false.
* @type string $title_li What to show before the links appear. Default 'Bookmarks'.
* @type string $title_before The HTML or text to prepend to the $title_li string. Default '<h2>'.
* @type string $title_after The HTML or text to append to the $title_li string. Default '</h2>'.
* @type string $class The CSS class to use for the $title_li. Default 'linkcat'.
* @type string $category_before The HTML or text to prepend to $title_before if $categorize is true.
* String must contain '%id' and '%class' to inherit the category ID and
* the $class argument used for formatting in themes.
* Default '<li id="%id" class="%class">'.
* @type string $category_after The HTML or text to append to $title_after if $categorize is true.
* Default '</li>'.
* @type string $category_orderby How to order the bookmark category based on term scheme if $categorize
* is true. Default 'name'.
* @type string $category_order Whether to order categories in ascending or descending order if
* $categorize is true. Accepts 'ASC' (ascending) or 'DESC' (descending).
* Default 'ASC'.
* }
* @return string|null Will only return if echo option is set to not echo. Default is not return anything.
*/
function wp_list_bookmarks($args = '') {
function wp_list_bookmarks( $args = '' ) {
$defaults = array(
'orderby' => 'name', 'order' => 'ASC',
'limit' => -1, 'category' => '', 'exclude_category' => '',
@@ -210,48 +211,88 @@ function wp_list_bookmarks($args = '') {
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = '';
if ( $categorize ) {
$cats = get_terms( 'link_category', array( 'name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0 ) );
if ( empty( $cats ) )
$categorize = false;
if ( $r['categorize'] ) {
$cats = get_terms( 'link_category', array(
'name__like' => $r['category_name'],
'include' => $r['category'],
'exclude' => $r['exclude_category'],
'orderby' => $r['category_orderby'],
'order' => $r['category_order'],
'hierarchical' => 0
) );
if ( empty( $cats ) ) {
$r['categorize'] = false;
}
}
if ( $categorize ) {
if ( $r['categorize'] ) {
// Split the bookmarks into ul's for each category
foreach ( (array) $cats as $cat ) {
$params = array_merge($r, array('category'=>$cat->term_id));
$bookmarks = get_bookmarks($params);
if ( empty($bookmarks) )
$params = array_merge( $r, array( 'category' => $cat->term_id ) );
$bookmarks = get_bookmarks( $params );
if ( empty( $bookmarks ) ) {
continue;
$output .= str_replace(array('%id', '%class'), array("linkcat-$cat->term_id", $class), $category_before);
$catname = apply_filters( "link_category", $cat->name );
$output .= "$title_before$catname$title_after\n\t<ul class='xoxo blogroll'>\n";
$output .= _walk_bookmarks($bookmarks, $r);
$output .= "\n\t</ul>\n$category_after\n";
}
$output .= str_replace(
array( '%id', '%class' ),
array( "linkcat-$cat->term_id", $r['class'] ),
$r['category_before']
);
/**
* Filter the bookmarks category name.
*
* @since 2.2.0
*
* @param string $cat_name The category name of bookmarks.
*/
$catname = apply_filters( 'link_category', $cat->name );
$output .= $r['title_before'];
$output .= $catname;
$output .= $r['title_after'];
$output .= "\n\t<ul class='xoxo blogroll'>\n";
$output .= _walk_bookmarks( $bookmarks, $r );
$output .= "\n\t</ul>\n";
$output .= $r['category_after'] . "\n";
}
} else {
//output one single list using title_li for the title
$bookmarks = get_bookmarks($r);
$bookmarks = get_bookmarks( $r );
if ( !empty($bookmarks) ) {
if ( !empty( $title_li ) ){
$output .= str_replace(array('%id', '%class'), array("linkcat-$category", $class), $category_before);
$output .= "$title_before$title_li$title_after\n\t<ul class='xoxo blogroll'>\n";
$output .= _walk_bookmarks($bookmarks, $r);
$output .= "\n\t</ul>\n$category_after\n";
if ( ! empty( $bookmarks ) ) {
if ( ! empty( $r['title_li'] ) ) {
$output .= str_replace(
array( '%id', '%class' ),
array( "linkcat-" . $r['category'], $r['class'] ),
$r['category_before']
);
$output .= $r['title_before'];
$output .= $r['title_li'];
$output .= $r['title_after'];
$output .= "\n\t<ul class='xoxo blogroll'>\n";
$output .= _walk_bookmarks( $bookmarks, $r );
$output .= "\n\t</ul>\n";
$output .= $r['category_after'] . "\n";
} else {
$output .= _walk_bookmarks($bookmarks, $r);
$output .= _walk_bookmarks( $bookmarks, $r );
}
}
}
$output = apply_filters( 'wp_list_bookmarks', $output );
/**
* Filter the bookmarks list before it is echoed or returned.
*
* @since 2.5.0
*
* @param string $html The HTML list of bookmarks.
*/
$html = apply_filters( 'wp_list_bookmarks', $output );
if ( !$echo )
return $output;
echo $output;
if ( ! $r['echo'] ) {
return $html;
}
echo $html;
}
+123 -95
View File
@@ -10,9 +10,10 @@
* Retrieve Bookmark data
*
* @since 2.1.0
* @uses $wpdb Database Object
*
* @param mixed $bookmark
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int|stdClass $bookmark
* @param string $output Optional. Either OBJECT, ARRAY_N, or ARRAY_A constant
* @param string $filter Optional, default is 'raw'.
* @return array|object Type returned depends on $output value.
@@ -60,8 +61,6 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
* Retrieve single bookmark data item or field.
*
* @since 2.3.0
* @uses get_bookmark() Gets bookmark object using $bookmark as ID
* @uses sanitize_bookmark_field() Sanitizes Bookmark field based on $context.
*
* @param string $field The name of the data field to return
* @param int $bookmark The bookmark ID to get field
@@ -91,34 +90,31 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
* that fails, then the query will be built from the arguments and executed. The
* results will be stored to the cache.
*
* List of default arguments are as follows:
* 'orderby' - Default is 'name' (string). How to order the links by. String is
* based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
* ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
* display.
* 'category' - Default is empty string (string). Include the links in what
* category ID(s).
* 'category_name' - Default is empty string (string). Get links by category
* name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
* links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'include' - Default is empty string (string). Include bookmark ID(s)
* separated by commas.
* 'exclude' - Default is empty string (string). Exclude bookmark ID(s)
* separated by commas.
*
* @since 2.1.0
* @uses $wpdb Database Object
* @link http://codex.wordpress.org/Template_Tags/get_bookmarks
*
* @param string|array $args List of arguments to overwrite the defaults
* @return array List of bookmark row objects
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string|array $args {
* Optional. String or array of arguments to retrieve bookmarks.
*
* @type string $orderby How to order the links by. Accepts post fields. Default 'name'.
* @type string $order Whether to order bookmarks in ascending or descending order.
* Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'.
* @type int $limit Amount of bookmarks to display. Accepts 1+ or -1 for all.
* Default -1.
* @type string $category Comma-separated list of category ids to include links from.
* Default empty.
* @type string $category_name Category to retrieve links for by name. Default empty.
* @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts
* 1|true or 0|false. Default 1|true.
* @type int|bool $show_updated Whether to display the time the bookmark was last updated.
* Accepts 1|true or 0|false. Default 0|false.
* @type string $include Comma-separated list of bookmark IDs to include. Default empty.
* @type string $exclude Comma-separated list of bookmark IDs to exclude. Default empty.
* }
* @return array List of bookmark row objects.
*/
function get_bookmarks($args = '') {
function get_bookmarks( $args = '' ) {
global $wpdb;
$defaults = array(
@@ -130,93 +126,116 @@ function get_bookmarks($args = '') {
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$cache = array();
$key = md5( serialize( $r ) );
if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
if ( is_array($cache) && isset( $cache[ $key ] ) )
return apply_filters('get_bookmarks', $cache[ $key ], $r );
if ( is_array( $cache ) && isset( $cache[ $key ] ) ) {
$bookmarks = $cache[ $key ];
/**
* Filter the returned list of bookmarks.
*
* The first time the hook is evaluated in this file, it returns the cached
* bookmarks list. The second evaluation returns a cached bookmarks list if the
* link category is passed but does not exist. The third evaluation returns
* the full cached results.
*
* @since 2.1.0
*
* @see get_bookmarks()
*
* @param array $bookmarks List of the cached bookmarks.
* @param array $r An array of bookmark query arguments.
*/
return apply_filters( 'get_bookmarks', $bookmarks, $r );
}
}
if ( !is_array($cache) )
if ( ! is_array( $cache ) ) {
$cache = array();
}
$inclusions = '';
if ( !empty($include) ) {
$exclude = ''; //ignore exclude, category, and category_name params if using include
$category = '';
$category_name = '';
$inclinks = preg_split('/[\s,]+/',$include);
if ( count($inclinks) ) {
if ( ! empty( $r['include'] ) ) {
$r['exclude'] = ''; //ignore exclude, category, and category_name params if using include
$r['category'] = '';
$r['category_name'] = '';
$inclinks = preg_split( '/[\s,]+/', $r['include'] );
if ( count( $inclinks ) ) {
foreach ( $inclinks as $inclink ) {
if (empty($inclusions))
$inclusions = ' AND ( link_id = ' . intval($inclink) . ' ';
else
$inclusions .= ' OR link_id = ' . intval($inclink) . ' ';
if ( empty( $inclusions ) ) {
$inclusions = ' AND ( link_id = ' . intval( $inclink ) . ' ';
} else {
$inclusions .= ' OR link_id = ' . intval( $inclink ) . ' ';
}
}
}
}
if (!empty($inclusions))
if (! empty( $inclusions ) ) {
$inclusions .= ')';
}
$exclusions = '';
if ( !empty($exclude) ) {
$exlinks = preg_split('/[\s,]+/',$exclude);
if ( count($exlinks) ) {
if ( ! empty( $r['exclude'] ) ) {
$exlinks = preg_split( '/[\s,]+/', $r['exclude'] );
if ( count( $exlinks ) ) {
foreach ( $exlinks as $exlink ) {
if (empty($exclusions))
$exclusions = ' AND ( link_id <> ' . intval($exlink) . ' ';
else
$exclusions .= ' AND link_id <> ' . intval($exlink) . ' ';
if ( empty( $exclusions ) ) {
$exclusions = ' AND ( link_id <> ' . intval( $exlink ) . ' ';
} else {
$exclusions .= ' AND link_id <> ' . intval( $exlink ) . ' ';
}
}
}
}
if (!empty($exclusions))
if ( ! empty( $exclusions ) ) {
$exclusions .= ')';
}
if ( !empty($category_name) ) {
if ( $category = get_term_by('name', $category_name, 'link_category') ) {
$category = $category->term_id;
if ( ! empty( $r['category_name'] ) ) {
if ( $r['category'] = get_term_by('name', $r['category_name'], 'link_category') ) {
$r['category'] = $r['category']->term_id;
} else {
$cache[ $key ] = array();
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
/** This filter is documented in wp-includes/bookmark.php */
return apply_filters( 'get_bookmarks', array(), $r );
}
}
if ( ! empty($search) ) {
$search = esc_sql( like_escape( $search ) );
$search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) ";
$search = '';
if ( ! empty( $r['search'] ) ) {
$like = '%' . $wpdb->esc_like( $r['search'] ) . '%';
$search = $wpdb->prepare(" AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ", $like, $like, $like );
}
$category_query = '';
$join = '';
if ( !empty($category) ) {
$incategories = preg_split('/[\s,]+/',$category);
if ( ! empty( $r['category'] ) ) {
$incategories = preg_split( '/[\s,]+/', $r['category'] );
if ( count($incategories) ) {
foreach ( $incategories as $incat ) {
if (empty($category_query))
$category_query = ' AND ( tt.term_id = ' . intval($incat) . ' ';
else
$category_query .= ' OR tt.term_id = ' . intval($incat) . ' ';
if ( empty( $category_query ) ) {
$category_query = ' AND ( tt.term_id = ' . intval( $incat ) . ' ';
} else {
$category_query .= ' OR tt.term_id = ' . intval( $incat ) . ' ';
}
}
}
}
if (!empty($category_query)) {
if ( ! empty( $category_query ) ) {
$category_query .= ") AND taxonomy = 'link_category'";
$join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
}
if ( $show_updated && get_option('links_recently_updated_time') ) {
$recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL " . get_option('links_recently_updated_time') . " MINUTE) >= NOW(), 1,0) as recently_updated ";
if ( $r['show_updated'] ) {
$recently_updated_test = ", IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ";
} else {
$recently_updated_test = '';
}
$get_updated = ( $show_updated ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
$get_updated = ( $r['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
$orderby = strtolower($orderby);
$orderby = strtolower( $r['orderby'] );
$length = '';
switch ( $orderby ) {
case 'length':
@@ -230,40 +249,47 @@ function get_bookmarks($args = '') {
break;
default:
$orderparams = array();
foreach ( explode(',', $orderby) as $ordparam ) {
$ordparam = trim($ordparam);
$keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes' );
if ( in_array( 'link_' . $ordparam, $keys ) )
$keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes', 'link_description' );
foreach ( explode( ',', $orderby ) as $ordparam ) {
$ordparam = trim( $ordparam );
if ( in_array( 'link_' . $ordparam, $keys ) ) {
$orderparams[] = 'link_' . $ordparam;
elseif ( in_array( $ordparam, $keys ) )
} elseif ( in_array( $ordparam, $keys ) ) {
$orderparams[] = $ordparam;
}
}
$orderby = implode(',', $orderparams);
$orderby = implode( ',', $orderparams );
}
if ( empty( $orderby ) )
if ( empty( $orderby ) ) {
$orderby = 'link_name';
}
$order = strtoupper( $order );
if ( '' !== $order && !in_array( $order, array( 'ASC', 'DESC' ) ) )
$order = strtoupper( $r['order'] );
if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {
$order = 'ASC';
}
$visible = '';
if ( $hide_invisible )
if ( $r['hide_invisible'] ) {
$visible = "AND link_visible = 'Y'";
}
$query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
$query .= " $exclusions $inclusions $search";
$query .= " ORDER BY $orderby $order";
if ($limit != -1)
$query .= " LIMIT $limit";
if ( $r['limit'] != -1 ) {
$query .= ' LIMIT ' . $r['limit'];
}
$results = $wpdb->get_results($query);
$results = $wpdb->get_results( $query );
$cache[ $key ] = $results;
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
return apply_filters('get_bookmarks', $results, $r);
/** This filter is documented in wp-includes/bookmark.php */
return apply_filters( 'get_bookmarks', $results, $r );
}
/**
@@ -337,7 +363,7 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
// We return here so that the categories aren't filtered.
// The 'link_category' filter is for the name of a link category, not an array of a link's link categories
return $value;
break;
case 'link_visible' : // bool stored as Y|N
$value = preg_replace('/[^YNyn]/', '', $value);
break;
@@ -352,23 +378,26 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
return $value;
if ( 'edit' == $context ) {
$value = apply_filters("edit_$field", $value, $bookmark_id);
/** This filter is documented in wp-includes/post.php */
$value = apply_filters( "edit_$field", $value, $bookmark_id );
if ( 'link_notes' == $field ) {
$value = esc_html( $value ); // textarea_escaped
} else {
$value = esc_attr($value);
}
} else if ( 'db' == $context ) {
$value = apply_filters("pre_$field", $value);
} elseif ( 'db' == $context ) {
/** This filter is documented in wp-includes/post.php */
$value = apply_filters( "pre_$field", $value );
} else {
// Use display filters by default.
$value = apply_filters($field, $value, $bookmark_id, $context);
/** This filter is documented in wp-includes/post.php */
$value = apply_filters( $field, $value, $bookmark_id, $context );
if ( 'attribute' == $context )
$value = esc_attr($value);
else if ( 'js' == $context )
$value = esc_js($value);
if ( 'attribute' == $context ) {
$value = esc_attr( $value );
} elseif ( 'js' == $context ) {
$value = esc_js( $value );
}
}
return $value;
@@ -378,7 +407,6 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
* Deletes bookmark cache
*
* @since 2.7.0
* @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'
*/
function clean_bookmark_cache( $bookmark_id ) {
wp_cache_delete( $bookmark_id, 'bookmark' );
+100 -39
View File
@@ -2,7 +2,7 @@
/**
* Object Cache API
*
* @link http://codex.wordpress.org/Function_Reference/WP_Cache
* @link https://codex.wordpress.org/Function_Reference/WP_Cache
*
* @package WordPress
* @subpackage Cache
@@ -21,10 +21,10 @@
* @param int $expire When the cache data should be expired
* @return bool False if cache key and group already exist, true on success
*/
function wp_cache_add($key, $data, $group = '', $expire = 0) {
function wp_cache_add( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->add($key, $data, $group, $expire);
return $wp_object_cache->add( $key, $data, $group, (int) $expire );
}
/**
@@ -103,7 +103,7 @@ function wp_cache_flush() {
* @param int|string $key What the contents in the cache are called
* @param string $group Where the cache contents are grouped
* @param bool $force Whether to force an update of the local cache from the persistent cache (default is false)
* @param &bool $found Whether key was found in the cache. Disambiguates a return of false, a storable value.
* @param bool &$found Whether key was found in the cache. Disambiguates a return of false, a storable value.
* @return bool|mixed False on failure to retrieve contents or the cache
* contents on success
*/
@@ -154,16 +154,17 @@ function wp_cache_init() {
* @param int $expire When to expire the cache contents
* @return bool False if not exists, true if contents were replaced
*/
function wp_cache_replace($key, $data, $group = '', $expire = 0) {
function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->replace($key, $data, $group, $expire);
return $wp_object_cache->replace( $key, $data, $group, (int) $expire );
}
/**
* Saves the data to the cache.
*
* @since 2.0
* @since 2.0.0
*
* @uses $wp_object_cache Object Cache Class
* @see WP_Object_Cache::set()
*
@@ -173,10 +174,10 @@ function wp_cache_replace($key, $data, $group = '', $expire = 0) {
* @param int $expire When to expire the cache contents
* @return bool False on failure, true on success
*/
function wp_cache_set($key, $data, $group = '', $expire = 0) {
function wp_cache_set( $key, $data, $group = '', $expire = 0 ) {
global $wp_object_cache;
return $wp_object_cache->set($key, $data, $group, $expire);
return $wp_object_cache->set( $key, $data, $group, (int) $expire );
}
/**
@@ -216,7 +217,6 @@ function wp_cache_add_global_groups( $groups ) {
*/
function wp_cache_add_non_persistent_groups( $groups ) {
// Default cache doesn't persist so nothing to do here.
return;
}
/**
@@ -256,7 +256,7 @@ function wp_cache_reset() {
*
* @package WordPress
* @subpackage Cache
* @since 2.0
* @since 2.0.0
*/
class WP_Object_Cache {
@@ -267,7 +267,7 @@ class WP_Object_Cache {
* @access private
* @since 2.0.0
*/
var $cache = array ();
private $cache = array();
/**
* The amount of times the cache data was already stored in the cache.
@@ -276,7 +276,7 @@ class WP_Object_Cache {
* @access private
* @var int
*/
var $cache_hits = 0;
private $cache_hits = 0;
/**
* Amount of times the cache did not have the request in cache
@@ -285,7 +285,7 @@ class WP_Object_Cache {
* @access public
* @since 2.0.0
*/
var $cache_misses = 0;
public $cache_misses = 0;
/**
* List of global groups
@@ -294,7 +294,7 @@ class WP_Object_Cache {
* @access protected
* @since 3.0.0
*/
var $global_groups = array();
protected $global_groups = array();
/**
* The blog prefix to prepend to keys in non-global groups.
@@ -303,7 +303,68 @@ class WP_Object_Cache {
* @access private
* @since 3.5.0
*/
var $blog_prefix;
private $blog_prefix;
/**
* Holds the value of `is_multisite()`
*
* @var bool
* @access private
* @since 3.5.0
*/
private $multisite;
/**
* Make private properties readable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to get.
* @return mixed Property.
*/
public function __get( $name ) {
return $this->$name;
}
/**
* Make private properties settable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to set.
* @param mixed $value Property value.
* @return mixed Newly-set property.
*/
public function __set( $name, $value ) {
return $this->$name = $value;
}
/**
* Make private properties checkable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to check if set.
* @return bool Whether the property is set.
*/
public function __isset( $name ) {
return isset( $this->$name );
}
/**
* Make private properties un-settable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param string $name Property to unset.
*/
public function __unset( $name ) {
unset( $this->$name );
}
/**
* Adds data to the cache if it doesn't already exist.
@@ -320,7 +381,7 @@ class WP_Object_Cache {
* @param int $expire When to expire the cache contents
* @return bool False if cache key and group already exist, true on success
*/
function add( $key, $data, $group = 'default', $expire = '' ) {
public function add( $key, $data, $group = 'default', $expire = 0 ) {
if ( wp_suspend_cache_addition() )
return false;
@@ -334,7 +395,7 @@ class WP_Object_Cache {
if ( $this->_exists( $id, $group ) )
return false;
return $this->set($key, $data, $group, $expire);
return $this->set( $key, $data, $group, (int) $expire );
}
/**
@@ -344,7 +405,7 @@ class WP_Object_Cache {
*
* @param array $groups List of groups that are global.
*/
function add_global_groups( $groups ) {
public function add_global_groups( $groups ) {
$groups = (array) $groups;
$groups = array_fill_keys( $groups, true );
@@ -361,7 +422,7 @@ class WP_Object_Cache {
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
function decr( $key, $offset = 1, $group = 'default' ) {
public function decr( $key, $offset = 1, $group = 'default' ) {
if ( empty( $group ) )
$group = 'default';
@@ -387,26 +448,24 @@ class WP_Object_Cache {
/**
* Remove the contents of the cache key in the group
*
* If the cache key does not exist in the group and $force parameter is set
* to false, then nothing will happen. The $force parameter is set to false
* by default.
* If the cache key does not exist in the group, then nothing will happen.
*
* @since 2.0.0
*
* @param int|string $key What the contents in the cache are called
* @param string $group Where the cache contents are grouped
* @param bool $force Optional. Whether to force the unsetting of the cache
* key in the group
* @param bool $deprecated Deprecated.
*
* @return bool False if the contents weren't deleted and true on success
*/
function delete($key, $group = 'default', $force = false) {
public function delete( $key, $group = 'default', $deprecated = false ) {
if ( empty( $group ) )
$group = 'default';
if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) )
$key = $this->blog_prefix . $key;
if ( ! $force && ! $this->_exists( $key, $group ) )
if ( ! $this->_exists( $key, $group ) )
return false;
unset( $this->cache[$group][$key] );
@@ -420,7 +479,7 @@ class WP_Object_Cache {
*
* @return bool Always returns true
*/
function flush() {
public function flush() {
$this->cache = array ();
return true;
@@ -443,7 +502,7 @@ class WP_Object_Cache {
* @return bool|mixed False on failure to retrieve contents or the cache
* contents on success
*/
function get( $key, $group = 'default', $force = false, &$found = null ) {
public function get( $key, $group = 'default', $force = false, &$found = null ) {
if ( empty( $group ) )
$group = 'default';
@@ -474,7 +533,7 @@ class WP_Object_Cache {
* @param string $group The group the key is in.
* @return false|int False on failure, the item's new value on success.
*/
function incr( $key, $offset = 1, $group = 'default' ) {
public function incr( $key, $offset = 1, $group = 'default' ) {
if ( empty( $group ) )
$group = 'default';
@@ -509,7 +568,7 @@ class WP_Object_Cache {
* @param int $expire When to expire the cache contents
* @return bool False if not exists, true if contents were replaced
*/
function replace( $key, $data, $group = 'default', $expire = '' ) {
public function replace( $key, $data, $group = 'default', $expire = 0 ) {
if ( empty( $group ) )
$group = 'default';
@@ -520,7 +579,7 @@ class WP_Object_Cache {
if ( ! $this->_exists( $id, $group ) )
return false;
return $this->set( $key, $data, $group, $expire );
return $this->set( $key, $data, $group, (int) $expire );
}
/**
@@ -529,7 +588,7 @@ class WP_Object_Cache {
* @since 3.0.0
* @deprecated 3.5.0
*/
function reset() {
public function reset() {
_deprecated_function( __FUNCTION__, '3.5', 'switch_to_blog()' );
// Clear out non-global caches since the blog ID has changed.
@@ -559,7 +618,7 @@ class WP_Object_Cache {
* @param int $expire Not Used
* @return bool Always returns true
*/
function set($key, $data, $group = 'default', $expire = '') {
public function set( $key, $data, $group = 'default', $expire = 0 ) {
if ( empty( $group ) )
$group = 'default';
@@ -581,7 +640,7 @@ class WP_Object_Cache {
*
* @since 2.0.0
*/
function stats() {
public function stats() {
echo "<p>";
echo "<strong>Cache Hits:</strong> {$this->cache_hits}<br />";
echo "<strong>Cache Misses:</strong> {$this->cache_misses}<br />";
@@ -602,7 +661,7 @@ class WP_Object_Cache {
*
* @param int $blog_id Blog ID
*/
function switch_to_blog( $blog_id ) {
public function switch_to_blog( $blog_id ) {
$blog_id = (int) $blog_id;
$this->blog_prefix = $this->multisite ? $blog_id . ':' : '';
}
@@ -613,6 +672,9 @@ class WP_Object_Cache {
* @since 3.4.0
*
* @access protected
* @param string $key
* @param string $group
* @return bool
*/
protected function _exists( $key, $group ) {
return isset( $this->cache[ $group ] ) && ( isset( $this->cache[ $group ][ $key ] ) || array_key_exists( $key, $this->cache[ $group ] ) );
@@ -622,9 +684,8 @@ class WP_Object_Cache {
* Sets up object properties; PHP 5 style constructor
*
* @since 2.0.8
* @return null|WP_Object_Cache If cache is disabled, returns null.
*/
function __construct() {
public function __construct() {
global $blog_id;
$this->multisite = is_multisite();
@@ -647,7 +708,7 @@ class WP_Object_Cache {
*
* @return bool True value. Won't be used by PHP
*/
function __destruct() {
public function __destruct() {
return true;
}
}
+71 -20
View File
@@ -39,8 +39,23 @@
function redirect_canonical( $requested_url = null, $do_redirect = true ) {
global $wp_rewrite, $is_IIS, $wp_query, $wpdb;
if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) )
if ( isset( $_SERVER['REQUEST_METHOD'] ) && ! in_array( strtoupper( $_SERVER['REQUEST_METHOD'] ), array( 'GET', 'HEAD' ) ) ) {
return;
}
// If we're not in wp-admin and the post has been published and preview nonce
// is non-existent or invalid then no need for preview in query
if ( is_preview() && get_query_var( 'p' ) && 'publish' == get_post_status( get_query_var( 'p' ) ) ) {
if ( ! isset( $_GET['preview_id'] )
|| ! isset( $_GET['preview_nonce'] )
|| ! wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . (int) $_GET['preview_id'] ) ) {
$wp_query->is_preview = false;
}
}
if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || is_preview() || is_robots() || ( $is_IIS && !iis7_supports_permalinks() ) ) {
return;
}
if ( !$requested_url ) {
// build the URL in the address bar
@@ -54,8 +69,8 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
return;
// Some PHP setups turn requests for / into /index.php in REQUEST_URI
// See: http://trac.wordpress.org/ticket/5017
// See: http://trac.wordpress.org/ticket/7173
// See: https://core.trac.wordpress.org/ticket/5017
// See: https://core.trac.wordpress.org/ticket/7173
// Disabled, for now:
// $original['path'] = preg_replace('|/index\.php$|', '/', $original['path']);
@@ -68,6 +83,16 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
if ( !isset($redirect['query']) )
$redirect['query'] = '';
// If the original URL ended with non-breaking spaces, they were almost
// certainly inserted by accident. Let's remove them, so the reader doesn't
// see a 404 error with no obvious cause.
$redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] );
// It's not a preview, so remove it from URL
if ( get_query_var( 'preview' ) ) {
$redirect['query'] = remove_query_arg( 'preview', $redirect['query'] );
}
if ( is_feed() && ( $id = get_query_var( 'p' ) ) ) {
if ( $redirect_url = get_post_comments_feed_link( $id, get_query_var( 'feed' ) ) ) {
$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed'), $redirect_url );
@@ -101,6 +126,20 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
}
}
if ( get_query_var( 'day' ) && get_query_var( 'monthnum' ) && get_query_var( 'year' ) ) {
$year = get_query_var( 'year' );
$month = get_query_var( 'monthnum' );
$day = get_query_var( 'day' );
$date = sprintf( '%04d-%02d-%02d', $year, $month, $day );
if ( ! wp_checkdate( $month, $day, $year, $date ) ) {
$redirect_url = get_month_link( $year, $month );
$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum', 'day' ), $redirect_url );
}
} elseif ( get_query_var( 'monthnum' ) && get_query_var( 'year' ) && 12 < get_query_var( 'monthnum' ) ) {
$redirect_url = get_year_link( get_query_var( 'year' ) );
$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum' ), $redirect_url );
}
if ( ! $redirect_url ) {
if ( $redirect_url = redirect_guess_404_permalink() ) {
$redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url );
@@ -160,7 +199,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
} elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories)
$term_count = 0;
foreach ( $wp_query->tax_query->queries as $tax_query )
foreach ( $wp_query->tax_query->queried_terms as $tax_query )
$term_count += count( $tax_query['terms'] );
$obj = $wp_query->get_queried_object();
@@ -220,11 +259,11 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
// paging and feeds
if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) {
while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $redirect['path'] ) ) {
while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) {
// Strip off paging and feed
$redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging
$redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings
$redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $redirect['path']); // strip off any existing comment paging
$redirect['path'] = preg_replace("#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing comment paging
}
$addl_path = '';
@@ -268,7 +307,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
}
if ( get_option('page_comments') && ( ( 'newest' == get_option('default_comments_page') && get_query_var('cpage') > 0 ) || ( 'newest' != get_option('default_comments_page') && get_query_var('cpage') > 1 ) ) ) {
$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( 'comment-page-' . get_query_var('cpage'), 'commentpaged' );
$addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . get_query_var('cpage'), 'commentpaged' );
$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
}
@@ -281,10 +320,13 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
}
if ( 'wp-register.php' == basename( $redirect['path'] ) ) {
if ( is_multisite() )
if ( is_multisite() ) {
/** This filter is documented in wp-login.php */
$redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) );
else
} else {
$redirect_url = site_url( 'wp-login.php?action=register' );
}
wp_redirect( $redirect_url, 301 );
die();
}
@@ -380,7 +422,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
( strtolower($original['host']) != 'www.' . strtolower($redirect['host']) && 'www.' . strtolower($original['host']) != strtolower($redirect['host']) ) )
$redirect['host'] = $original['host'];
$compare_original = array($original['host'], $original['path']);
$compare_original = array( $original['host'], $original['path'] );
if ( !empty( $original['port'] ) )
$compare_original[] = $original['port'];
@@ -388,7 +430,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
if ( !empty( $original['query'] ) )
$compare_original[] = $original['query'];
$compare_redirect = array($redirect['host'], $redirect['path']);
$compare_redirect = array( $redirect['host'], $redirect['path'] );
if ( !empty( $redirect['port'] ) )
$compare_redirect[] = $redirect['port'];
@@ -418,8 +460,17 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
$requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url);
}
// Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning false
$redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url);
/**
* Filter the canonical redirect URL.
*
* Returning false to this filter will cancel the redirect.
*
* @since 2.3.0
*
* @param string $redirect_url The redirect URL.
* @param string $requested_url The requested URL.
*/
$redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );
if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request
return false;
@@ -443,9 +494,12 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
* Removes arguments from a query string if they are not present in a URL
* DO NOT use this in plugin code.
*
* @since 3.4
* @since 3.4.0
* @access private
*
* @param string $query_string
* @param array $args_to_check
* @param string $url
* @return string The altered query string
*/
function _remove_qs_args_if_not_in_url( $query_string, Array $args_to_check, $url ) {
@@ -466,7 +520,8 @@ function _remove_qs_args_if_not_in_url( $query_string, Array $args_to_check, $ur
* Attempts to guess the correct URL based on query vars
*
* @since 2.3.0
* @uses $wpdb
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @return bool|string The correct URL if one is found. False on failure.
*/
@@ -474,7 +529,7 @@ function redirect_guess_404_permalink() {
global $wpdb, $wp_rewrite;
if ( get_query_var('name') ) {
$where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%');
$where = $wpdb->prepare("post_name LIKE %s", $wpdb->esc_like( get_query_var('name') ) . '%');
// if any of post_type, year, monthnum, or day are set, use them to refine the query
if ( get_query_var('post_type') )
@@ -503,8 +558,6 @@ function redirect_guess_404_permalink() {
return false;
}
add_action('template_redirect', 'redirect_canonical');
function wp_redirect_admin_locations() {
global $wp_rewrite;
if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) )
@@ -532,5 +585,3 @@ function wp_redirect_admin_locations() {
exit;
}
}
add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
+230 -123
View File
@@ -13,14 +13,12 @@
* the name in value of the 'name' key. The capabilities are stored as an array
* in the value of the 'capability' key.
*
* <code>
* array (
* 'rolename' => array (
* 'name' => 'rolename',
* 'capabilities' => array()
* )
* )
* </code>
* array (
* 'rolename' => array (
* 'name' => 'rolename',
* 'capabilities' => array()
* )
* )
*
* @since 2.0.0
* @package WordPress
@@ -34,7 +32,7 @@ class WP_Roles {
* @access public
* @var array
*/
var $roles;
public $roles;
/**
* List of the role objects.
@@ -43,7 +41,7 @@ class WP_Roles {
* @access public
* @var array
*/
var $role_objects = array();
public $role_objects = array();
/**
* List of role names.
@@ -52,7 +50,7 @@ class WP_Roles {
* @access public
* @var array
*/
var $role_names = array();
public $role_names = array();
/**
* Option name for storing role list.
@@ -61,7 +59,7 @@ class WP_Roles {
* @access public
* @var string
*/
var $role_key;
public $role_key;
/**
* Whether to use the database for retrieval and storage.
@@ -70,17 +68,34 @@ class WP_Roles {
* @access public
* @var bool
*/
var $use_db = true;
public $use_db = true;
/**
* Constructor
*
* @since 2.0.0
*/
function __construct() {
public function __construct() {
$this->_init();
}
/**
* Make private/protected methods readable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param callable $name Method to call.
* @param array $arguments Arguments to pass when calling.
* @return mixed|bool Return value of the callback, false otherwise.
*/
public function __call( $name, $arguments ) {
if ( '_init' === $name ) {
return call_user_func_array( array( $this, $name ), $arguments );
}
return false;
}
/**
* Set up the object properties.
*
@@ -90,12 +105,13 @@ class WP_Roles {
*
* @since 2.1.0
* @access protected
* @uses $wpdb Used to get the database prefix.
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global array $wp_user_roles Used to set the 'roles' property value.
*/
function _init () {
protected function _init() {
global $wpdb, $wp_user_roles;
$this->role_key = $wpdb->prefix . 'user_roles';
$this->role_key = $wpdb->get_blog_prefix() . 'user_roles';
if ( ! empty( $wp_user_roles ) ) {
$this->roles = $wp_user_roles;
$this->use_db = false;
@@ -123,15 +139,15 @@ class WP_Roles {
* @since 3.5.0
* @access public
*/
function reinit() {
public function reinit() {
// There is no need to reinit if using the wp_user_roles global.
if ( ! $this->use_db )
return;
global $wpdb, $wp_user_roles;
global $wpdb;
// Duplicated from _init() to avoid an extra function call.
$this->role_key = $wpdb->prefix . 'user_roles';
$this->role_key = $wpdb->get_blog_prefix() . 'user_roles';
$this->roles = get_option( $this->role_key );
if ( empty( $this->roles ) )
return;
@@ -160,7 +176,7 @@ class WP_Roles {
* @param array $capabilities List of role capabilities in the above format.
* @return WP_Role|null WP_Role object if role is added, null if already exists.
*/
function add_role( $role, $display_name, $capabilities = array() ) {
public function add_role( $role, $display_name, $capabilities = array() ) {
if ( isset( $this->roles[$role] ) )
return;
@@ -183,7 +199,7 @@ class WP_Roles {
*
* @param string $role Role name.
*/
function remove_role( $role ) {
public function remove_role( $role ) {
if ( ! isset( $this->role_objects[$role] ) )
return;
@@ -193,6 +209,9 @@ class WP_Roles {
if ( $this->use_db )
update_option( $this->role_key, $this->roles );
if ( get_option( 'default_role' ) == $role )
update_option( 'default_role', 'subscriber' );
}
/**
@@ -205,7 +224,7 @@ class WP_Roles {
* @param string $cap Capability name.
* @param bool $grant Optional, default is true. Whether role is capable of performing capability.
*/
function add_cap( $role, $cap, $grant = true ) {
public function add_cap( $role, $cap, $grant = true ) {
if ( ! isset( $this->roles[$role] ) )
return;
@@ -223,7 +242,7 @@ class WP_Roles {
* @param string $role Role name.
* @param string $cap Capability name.
*/
function remove_cap( $role, $cap ) {
public function remove_cap( $role, $cap ) {
if ( ! isset( $this->roles[$role] ) )
return;
@@ -241,7 +260,7 @@ class WP_Roles {
* @param string $role Role name.
* @return WP_Role|null WP_Role object if found, null if the role does not exist.
*/
function get_role( $role ) {
public function get_role( $role ) {
if ( isset( $this->role_objects[$role] ) )
return $this->role_objects[$role];
else
@@ -256,7 +275,7 @@ class WP_Roles {
*
* @return array List of role names.
*/
function get_names() {
public function get_names() {
return $this->role_names;
}
@@ -269,7 +288,7 @@ class WP_Roles {
* @param string $role Role name to look up.
* @return bool
*/
function is_role( $role ) {
public function is_role( $role ) {
return isset( $this->role_names[$role] );
}
}
@@ -289,7 +308,7 @@ class WP_Role {
* @access public
* @var string
*/
var $name;
public $name;
/**
* List of capabilities the role contains.
@@ -298,7 +317,7 @@ class WP_Role {
* @access public
* @var array
*/
var $capabilities;
public $capabilities;
/**
* Constructor - Set up object properties.
@@ -312,7 +331,7 @@ class WP_Role {
* @param string $role Role name.
* @param array $capabilities List of capabilities.
*/
function __construct( $role, $capabilities ) {
public function __construct( $role, $capabilities ) {
$this->name = $role;
$this->capabilities = $capabilities;
}
@@ -327,7 +346,7 @@ class WP_Role {
* @param string $cap Capability name.
* @param bool $grant Whether role has capability privilege.
*/
function add_cap( $cap, $grant = true ) {
public function add_cap( $cap, $grant = true ) {
global $wp_roles;
if ( ! isset( $wp_roles ) )
@@ -350,7 +369,7 @@ class WP_Role {
*
* @param string $cap Capability name.
*/
function remove_cap( $cap ) {
public function remove_cap( $cap ) {
global $wp_roles;
if ( ! isset( $wp_roles ) )
@@ -374,7 +393,16 @@ class WP_Role {
* @param string $cap Capability name.
* @return bool True, if user has capability. False, if doesn't have capability.
*/
function has_cap( $cap ) {
public function has_cap( $cap ) {
/**
* Filter which capabilities a role has.
*
* @since 2.0.0
*
* @param array $capabilities Array of role capabilities.
* @param string $cap Capability name.
* @param string $name Role name.
*/
$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );
if ( !empty( $capabilities[$cap] ) )
return $capabilities[$cap];
@@ -390,16 +418,31 @@ class WP_Role {
* @since 2.0.0
* @package WordPress
* @subpackage User
*
* @property string $nickname
* @property string $user_description
* @property string $user_firstname
* @property string $user_lastname
* @property string $user_login
* @property string $user_pass
* @property string $user_nicename
* @property string $user_email
* @property string $user_url
* @property string $user_registered
* @property string $user_activation_key
* @property string $user_status
* @property string $display_name
* @property string $spam
* @property string $deleted
*/
class WP_User {
/**
* User data container.
*
* @since 2.0.0
* @access private
* @var array
* @var object
*/
var $data;
public $data;
/**
* The user's ID.
@@ -408,7 +451,7 @@ class WP_User {
* @access public
* @var int
*/
var $ID = 0;
public $ID = 0;
/**
* The individual capabilities the user has been given.
@@ -417,7 +460,7 @@ class WP_User {
* @access public
* @var array
*/
var $caps = array();
public $caps = array();
/**
* User metadata option name.
@@ -426,7 +469,7 @@ class WP_User {
* @access public
* @var string
*/
var $cap_key;
public $cap_key;
/**
* The roles the user is part of.
@@ -435,7 +478,7 @@ class WP_User {
* @access public
* @var array
*/
var $roles = array();
public $roles = array();
/**
* All capabilities the user has, including individual and role based.
@@ -444,7 +487,7 @@ class WP_User {
* @access public
* @var array
*/
var $allcaps = array();
public $allcaps = array();
/**
* The filter context applied to user data fields.
@@ -468,9 +511,8 @@ class WP_User {
* @param int|string|stdClass|WP_User $id User's ID, a WP_User object, or a user object from the DB.
* @param string $name Optional. User's username
* @param int $blog_id Optional Blog ID, defaults to current blog.
* @return WP_User
*/
function __construct( $id = 0, $name = '', $blog_id = '' ) {
public function __construct( $id = 0, $name = '', $blog_id = '' ) {
if ( ! isset( self::$back_compat_keys ) ) {
$prefix = $GLOBALS['wpdb']->prefix;
self::$back_compat_keys = array(
@@ -483,7 +525,7 @@ class WP_User {
);
}
if ( is_a( $id, 'WP_User' ) ) {
if ( $id instanceof WP_User ) {
$this->init( $id->data, $blog_id );
return;
} elseif ( is_object( $id ) ) {
@@ -496,13 +538,17 @@ class WP_User {
$id = 0;
}
if ( $id )
if ( $id ) {
$data = self::get_data_by( 'id', $id );
else
} else {
$data = self::get_data_by( 'login', $name );
}
if ( $data )
if ( $data ) {
$this->init( $data, $blog_id );
} else {
$this->data = new stdClass;
}
}
/**
@@ -511,7 +557,7 @@ class WP_User {
* @param object $data User DB row object
* @param int $blog_id Optional. The blog id to initialize for
*/
function init( $data, $blog_id = '' ) {
public function init( $data, $blog_id = '' ) {
$this->data = $data;
$this->ID = (int) $data->ID;
@@ -525,9 +571,9 @@ class WP_User {
*
* @param string $field The field to query against: 'id', 'slug', 'email' or 'login'
* @param string|int $value The field value
* @return object Raw user object
* @return object|false Raw user object
*/
static function get_data_by( $field, $value ) {
public static function get_data_by( $field, $value ) {
global $wpdb;
if ( 'id' == $field ) {
@@ -586,8 +632,10 @@ class WP_User {
* Magic method for checking the existence of a certain custom field
*
* @since 3.3.0
* @param string $key
* @return bool
*/
function __isset( $key ) {
public function __isset( $key ) {
if ( 'id' == $key ) {
_deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) );
$key = 'ID';
@@ -606,8 +654,10 @@ class WP_User {
* Magic method for accessing custom fields
*
* @since 3.3.0
* @param string $key
* @return mixed
*/
function __get( $key ) {
public function __get( $key ) {
if ( 'id' == $key ) {
_deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) );
return $this->ID;
@@ -633,7 +683,7 @@ class WP_User {
*
* @since 3.3.0
*/
function __set( $key, $value ) {
public function __set( $key, $value ) {
if ( 'id' == $key ) {
_deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) );
$this->ID = $value;
@@ -651,7 +701,7 @@ class WP_User {
*
* @return bool True if user exists in the database, false if not.
*/
function exists() {
public function exists() {
return ! empty( $this->ID );
}
@@ -664,7 +714,7 @@ class WP_User {
*
* @param string $key Property
*/
function get( $key ) {
public function get( $key ) {
return $this->__get( $key );
}
@@ -677,18 +727,18 @@ class WP_User {
*
* @param string $key Property
*/
function has_prop( $key ) {
public function has_prop( $key ) {
return $this->__isset( $key );
}
/*
/**
* Return an array representation.
*
* @since 3.5.0
*
* @return array Array representation.
*/
function to_array() {
public function to_array() {
return get_object_vars( $this->data );
}
@@ -709,7 +759,7 @@ class WP_User {
global $wpdb;
if ( empty($cap_key) )
$this->cap_key = $wpdb->prefix . 'capabilities';
$this->cap_key = $wpdb->get_blog_prefix() . 'capabilities';
else
$this->cap_key = $cap_key;
@@ -732,8 +782,10 @@ class WP_User {
* @since 2.0.0
* @uses $wp_roles
* @access public
*
* @return array List of all capabilities for the user.
*/
function get_role_caps() {
public function get_role_caps() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
@@ -750,6 +802,8 @@ class WP_User {
$this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities );
}
$this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps );
return $this->allcaps;
}
/**
@@ -762,7 +816,7 @@ class WP_User {
*
* @param string $role Role name.
*/
function add_role( $role ) {
public function add_role( $role ) {
$this->caps[$role] = true;
update_user_meta( $this->ID, $this->cap_key, $this->caps );
$this->get_role_caps();
@@ -777,7 +831,7 @@ class WP_User {
*
* @param string $role Role name.
*/
function remove_role( $role ) {
public function remove_role( $role ) {
if ( !in_array($role, $this->roles) )
return;
unset( $this->caps[$role] );
@@ -798,7 +852,7 @@ class WP_User {
*
* @param string $role Role name.
*/
function set_role( $role ) {
public function set_role( $role ) {
if ( 1 == count( $this->roles ) && $role == current( $this->roles ) )
return;
@@ -815,6 +869,17 @@ class WP_User {
update_user_meta( $this->ID, $this->cap_key, $this->caps );
$this->get_role_caps();
$this->update_user_level_from_caps();
/**
* Fires after the user's role has changed.
*
* @since 2.9.0
* @since 3.6.0 Added $old_roles to include an array of the user's previous roles.
*
* @param int $user_id The user ID.
* @param string $role The new role.
* @param array $old_roles An array of the user's previous roles.
*/
do_action( 'set_user_role', $this->ID, $role, $old_roles );
}
@@ -837,7 +902,7 @@ class WP_User {
* @param string $item Level capability name.
* @return int Max Level.
*/
function level_reduction( $max, $item ) {
public function level_reduction( $max, $item ) {
if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) {
$level = intval( $matches[1] );
return max( $max, $level );
@@ -856,10 +921,10 @@ class WP_User {
* @since 2.0.0
* @access public
*/
function update_user_level_from_caps() {
public function update_user_level_from_caps() {
global $wpdb;
$this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 );
update_user_meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level );
update_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level', $this->user_level );
}
/**
@@ -871,9 +936,11 @@ class WP_User {
* @param string $cap Capability name.
* @param bool $grant Whether to grant capability to user.
*/
function add_cap( $cap, $grant = true ) {
public function add_cap( $cap, $grant = true ) {
$this->caps[$cap] = $grant;
update_user_meta( $this->ID, $this->cap_key, $this->caps );
$this->get_role_caps();
$this->update_user_level_from_caps();
}
/**
@@ -884,11 +951,14 @@ class WP_User {
*
* @param string $cap Capability name.
*/
function remove_cap( $cap ) {
if ( ! isset( $this->caps[$cap] ) )
public function remove_cap( $cap ) {
if ( ! isset( $this->caps[ $cap ] ) ) {
return;
unset( $this->caps[$cap] );
}
unset( $this->caps[ $cap ] );
update_user_meta( $this->ID, $this->cap_key, $this->caps );
$this->get_role_caps();
$this->update_user_level_from_caps();
}
/**
@@ -897,11 +967,11 @@ class WP_User {
* @since 2.1.0
* @access public
*/
function remove_all_caps() {
public function remove_all_caps() {
global $wpdb;
$this->caps = array();
delete_user_meta( $this->ID, $this->cap_key );
delete_user_meta( $this->ID, $wpdb->prefix . 'user_level' );
delete_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level' );
$this->get_role_caps();
}
@@ -918,7 +988,7 @@ class WP_User {
* @param string|int $cap Capability or role name to search.
* @return bool True, if user has capability; false, if user does not have capability.
*/
function has_cap( $cap ) {
public function has_cap( $cap ) {
if ( is_numeric( $cap ) ) {
_deprecated_argument( __FUNCTION__, '2.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') );
$cap = $this->translate_level_to_cap( $cap );
@@ -935,8 +1005,19 @@ class WP_User {
return true;
}
/**
* Dynamically filter a user's capabilities.
*
* @since 2.0.0
* @since 3.7.0 Added the user object.
*
* @param array $allcaps An array of all the user's capabilities.
* @param array $caps Actual capabilities for meta capability.
* @param array $args Optional parameters passed to has_cap(), typically object ID.
* @param WP_User $user The user object.
*/
// Must have ALL requested caps
$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args );
$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this );
$capabilities['exist'] = true; // Everyone is allowed to exist
foreach ( (array) $caps as $cap ) {
if ( empty( $capabilities[ $cap ] ) )
@@ -957,7 +1038,7 @@ class WP_User {
* @param int $level Level number, 1 to 10.
* @return string
*/
function translate_level_to_cap( $level ) {
public function translate_level_to_cap( $level ) {
return 'level_' . $level;
}
@@ -968,7 +1049,7 @@ class WP_User {
*
* @param int $blog_id Optional Blog ID, defaults to current blog.
*/
function for_blog( $blog_id = '' ) {
public function for_blog( $blog_id = '' ) {
global $wpdb;
if ( ! empty( $blog_id ) )
$cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';
@@ -1033,22 +1114,15 @@ function map_meta_cap( $cap, $user_id ) {
break;
}
$post_author_id = $post->post_author;
// If no author set yet, default to current user for cap checks.
if ( ! $post_author_id )
$post_author_id = $user_id;
$post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
// If the user is the author...
if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) {
// If the post author is set and the user is the author...
if ( $post->post_author && $user_id == $post->post_author ) {
// If the post is published...
if ( 'publish' == $post->post_status ) {
$caps[] = $post_type->cap->delete_published_posts;
} elseif ( 'trash' == $post->post_status ) {
if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
if ( 'publish' == get_post_meta( $post->ID, '_wp_trash_meta_status', true ) ) {
$caps[] = $post_type->cap->delete_published_posts;
}
} else {
// If the post is draft...
$caps[] = $post_type->cap->delete_posts;
@@ -1057,10 +1131,11 @@ function map_meta_cap( $cap, $user_id ) {
// The user is trying to edit someone else's post.
$caps[] = $post_type->cap->delete_others_posts;
// The post is published, extra cap required.
if ( 'publish' == $post->post_status )
if ( 'publish' == $post->post_status ) {
$caps[] = $post_type->cap->delete_published_posts;
elseif ( 'private' == $post->post_status )
} elseif ( 'private' == $post->post_status ) {
$caps[] = $post_type->cap->delete_private_posts;
}
}
break;
// edit_post breaks down to edit_posts, edit_published_posts, or
@@ -1068,6 +1143,8 @@ function map_meta_cap( $cap, $user_id ) {
case 'edit_post':
case 'edit_page':
$post = get_post( $args[0] );
if ( empty( $post ) )
break;
if ( 'revision' == $post->post_type ) {
$post = get_post( $post->post_parent );
@@ -1083,22 +1160,15 @@ function map_meta_cap( $cap, $user_id ) {
break;
}
$post_author_id = $post->post_author;
// If no author set yet, default to current user for cap checks.
if ( ! $post_author_id )
$post_author_id = $user_id;
$post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
// If the user is the author...
if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) {
// If the post author is set and the user is the author...
if ( $post->post_author && $user_id == $post->post_author ) {
// If the post is published...
if ( 'publish' == $post->post_status ) {
$caps[] = $post_type->cap->edit_published_posts;
} elseif ( 'trash' == $post->post_status ) {
if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
if ( 'publish' == get_post_meta( $post->ID, '_wp_trash_meta_status', true ) ) {
$caps[] = $post_type->cap->edit_published_posts;
}
} else {
// If the post is draft...
$caps[] = $post_type->cap->edit_posts;
@@ -1107,10 +1177,11 @@ function map_meta_cap( $cap, $user_id ) {
// The user is trying to edit someone else's post.
$caps[] = $post_type->cap->edit_others_posts;
// The post is published, extra cap required.
if ( 'publish' == $post->post_status )
if ( 'publish' == $post->post_status ) {
$caps[] = $post_type->cap->edit_published_posts;
elseif ( 'private' == $post->post_status )
} elseif ( 'private' == $post->post_status ) {
$caps[] = $post_type->cap->edit_private_posts;
}
}
break;
case 'read_post':
@@ -1137,20 +1208,13 @@ function map_meta_cap( $cap, $user_id ) {
break;
}
$post_author_id = $post->post_author;
// If no author set yet, default to current user for cap checks.
if ( ! $post_author_id )
$post_author_id = $user_id;
$post_author_data = $post_author_id == get_current_user_id() ? wp_get_current_user() : get_userdata( $post_author_id );
if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID )
if ( $post->post_author && $user_id == $post->post_author ) {
$caps[] = $post_type->cap->read;
elseif ( $status_obj->private )
} elseif ( $status_obj->private ) {
$caps[] = $post_type->cap->read_private_posts;
else
} else {
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
}
break;
case 'publish_post':
$post = get_post( $args[0] );
@@ -1167,6 +1231,21 @@ function map_meta_cap( $cap, $user_id ) {
$meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false;
if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}" ) ) {
/**
* Filter whether the user is allowed to add post meta to a post.
*
* The dynamic portion of the hook name, `$meta_key`, refers to the
* meta key passed to {@see map_meta_cap()}.
*
* @since 3.3.0
*
* @param bool $allowed Whether the user can add the post meta. Default false.
* @param string $meta_key The meta key.
* @param int $post_id Post ID.
* @param int $user_id User ID.
* @param string $cap Capability name.
* @param array $caps User capabilities.
*/
$allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps );
if ( ! $allowed )
$caps[] = $cap;
@@ -1176,6 +1255,8 @@ function map_meta_cap( $cap, $user_id ) {
break;
case 'edit_comment':
$comment = get_comment( $args[0] );
if ( empty( $comment ) )
break;
$post = get_post( $comment->comment_post_ID );
$caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
break;
@@ -1210,18 +1291,25 @@ function map_meta_cap( $cap, $user_id ) {
case 'update_plugins':
case 'delete_plugins':
case 'install_plugins':
case 'upload_plugins':
case 'update_themes':
case 'delete_themes':
case 'install_themes':
case 'upload_themes':
case 'update_core':
// Disallow anything that creates, deletes, or updates core, plugin, or theme files.
// Files in uploads are excepted.
if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
if ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) {
$caps[] = 'do_not_allow';
elseif ( is_multisite() && ! is_super_admin( $user_id ) )
} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
$caps[] = 'do_not_allow';
else
} elseif ( 'upload_themes' === $cap ) {
$caps[] = 'install_themes';
} elseif ( 'upload_plugins' === $cap ) {
$caps[] = 'install_plugins';
} else {
$caps[] = $cap;
}
break;
case 'activate_plugins':
$caps[] = $cap;
@@ -1254,6 +1342,12 @@ function map_meta_cap( $cap, $user_id ) {
else
$caps[] = 'do_not_allow';
break;
case 'customize' :
$caps[] = 'edit_theme_options';
break;
case 'delete_site':
$caps[] = 'manage_options';
break;
default:
// Handle meta capabilities for custom post types.
$post_type_meta_caps = _post_type_meta_capabilities();
@@ -1266,7 +1360,17 @@ function map_meta_cap( $cap, $user_id ) {
$caps[] = $cap;
}
return apply_filters('map_meta_cap', $caps, $cap, $user_id, $args);
/**
* Filter a user's capabilities depending on specific context and/or privilege.
*
* @since 2.8.0
*
* @param array $caps Returns the user's actual capabilities.
* @param string $cap Capability name.
* @param int $user_id The user ID.
* @param array $args Adds the context to the cap. Typically the object ID.
*/
return apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args );
}
/**
@@ -1299,21 +1403,25 @@ function current_user_can( $capability ) {
* @return bool
*/
function current_user_can_for_blog( $blog_id, $capability ) {
if ( is_multisite() )
switch_to_blog( $blog_id );
$switched = is_multisite() ? switch_to_blog( $blog_id ) : false;
$current_user = wp_get_current_user();
if ( empty( $current_user ) )
if ( empty( $current_user ) ) {
if ( $switched ) {
restore_current_blog();
}
return false;
}
$args = array_slice( func_get_args(), 2 );
$args = array_merge( array( $capability ), $args );
$can = call_user_func_array( array( $current_user, 'has_cap' ), $args );
if ( is_multisite() )
if ( $switched ) {
restore_current_blog();
}
return $can;
}
@@ -1409,7 +1517,6 @@ function add_role( $role, $display_name, $capabilities = array() ) {
* @since 2.0.0
*
* @param string $role Role name.
* @return null
*/
function remove_role( $role ) {
global $wp_roles;
@@ -1417,7 +1524,7 @@ function remove_role( $role ) {
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
return $wp_roles->remove_role( $role );
$wp_roles->remove_role( $role );
}
/**
File diff suppressed because it is too large. Load diff
+34 -31
View File
@@ -5,23 +5,6 @@
* @package WordPress
*/
/**
* Retrieves all category IDs.
*
* @since 2.0.0
* @link http://codex.wordpress.org/Function_Reference/get_all_category_ids
*
* @return object List of all of the category IDs.
*/
function get_all_category_ids() {
if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) {
$cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') );
wp_cache_add( 'all_category_ids', $cat_ids, 'category' );
}
return $cat_ids;
}
/**
* Retrieve list of category objects.
*
@@ -31,7 +14,7 @@ function get_all_category_ids() {
*
* @since 2.1.0
* @see get_terms() Type of arguments that can be changed.
* @link http://codex.wordpress.org/Function_Reference/get_categories
* @link https://codex.wordpress.org/Function_Reference/get_categories
*
* @param string|array $args Optional. Change the defaults retrieving categories.
* @return array List of categories.
@@ -40,7 +23,17 @@ function get_categories( $args = '' ) {
$defaults = array( 'taxonomy' => 'category' );
$args = wp_parse_args( $args, $defaults );
$taxonomy = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args );
$taxonomy = $args['taxonomy'];
/**
* Filter the taxonomy used to retrieve terms when calling {@see get_categories()}.
*
* @since 2.7.0
*
* @param string $taxonomy Taxonomy to retrieve terms from.
* @param array $args An array of arguments. See {@see get_terms()}.
*/
$taxonomy = apply_filters( 'get_categories_taxonomy', $taxonomy, $args );
// Back compat
if ( isset($args['type']) && 'link' == $args['type'] ) {
@@ -71,15 +64,15 @@ function get_categories( $args = '' ) {
* The category will converted to maintain backwards compatibility.
*
* @since 1.5.1
* @uses get_term() Used to get the category data from the taxonomy.
*
* @param int|object $category Category ID or Category row object
* @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
* @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
* @return mixed Category data in type defined by $output parameter.
* @return object|array|WP_Error|null Category data in type defined by $output parameter. WP_Error if $category is empty, null if it does not exist.
*/
function get_category( $category, $output = OBJECT, $filter = 'raw' ) {
$category = get_term( $category, 'category', $output, $filter );
if ( is_wp_error( $category ) )
return $category;
@@ -133,13 +126,19 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
$path = '/' . $curcategory->slug . $path;
}
if ( $path == $full_path )
return get_category( $category->term_id, $output );
if ( $path == $full_path ) {
$category = get_term( $category->term_id, 'category', $output );
_make_cat_compat( $category );
return $category;
}
}
// If full matching is not required, return the first cat that matches the leaf.
if ( ! $full_match )
return get_category( $categories[0]->term_id, $output );
if ( ! $full_match ) {
$category = get_term( reset( $categories )->term_id, 'category', $output );
_make_cat_compat( $category );
return $category;
}
return null;
}
@@ -185,7 +184,7 @@ function get_cat_ID( $cat_name ) {
*/
function get_cat_name( $cat_id ) {
$cat_id = (int) $cat_id;
$category = get_category( $cat_id );
$category = get_term( $cat_id, 'category' );
if ( ! $category || is_wp_error( $category ) )
return '';
return $category->name;
@@ -211,7 +210,6 @@ function cat_is_ancestor_of( $cat1, $cat2 ) {
* Sanitizes category data based on context.
*
* @since 2.3.0
* @uses sanitize_term() See this function for what context are supported.
*
* @param object|array $category Category data
* @param string $context Optional. Default is 'display'.
@@ -225,7 +223,6 @@ function sanitize_category( $category, $context = 'display' ) {
* Sanitizes data in single category key field.
*
* @since 2.3.0
* @uses sanitize_term_field() See function for more details.
*
* @param string $field Category key to sanitize
* @param mixed $value Category value to sanitize
@@ -244,7 +241,6 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) {
*
* @since 2.3.0
* @see get_terms() For list of arguments to pass.
* @uses apply_filters() Calls 'get_tags' hook on array of tags and with $args.
*
* @param string|array $args Tag arguments to use when retrieving tags.
* @return array List of tags.
@@ -257,6 +253,14 @@ function get_tags( $args = '' ) {
return $return;
}
/**
* Filter the array of term objects returned for the 'post_tag' taxonomy.
*
* @since 2.3.0
*
* @param array $tags Array of 'post_tag' term objects.
* @param array $args An array of arguments. @see get_terms()
*/
$tags = apply_filters( 'get_tags', $tags, $args );
return $tags;
}
@@ -278,7 +282,7 @@ function get_tags( $args = '' ) {
* @param int|object $tag
* @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
* @param string $filter Optional. Default is raw or no WordPress defined filter will applied.
* @return object|array Return type based on $output value.
* @return object|array|WP_Error|null Tag data in type defined by $output parameter. WP_Error if $tag is empty, null if it does not exist.
*/
function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {
return get_term( $tag, 'post_tag', $output, $filter );
@@ -290,7 +294,6 @@ function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {
* Remove the category cache data based on ID.
*
* @since 2.1.0
* @uses clean_term_cache() Clears the cache for the category based on ID
*
* @param int $id Category ID
*/
File diff suppressed because it is too large. Load diff
+59 -18
View File
@@ -30,7 +30,7 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @package IXR
* @since 1.5
* @since 1.5.0
*
* @copyright Incutio Ltd 2010 (http://www.incutio.com)
* @version 1.7.4 7th September 2010
@@ -43,7 +43,7 @@
* IXR_Value
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Value {
var $data;
@@ -151,7 +151,7 @@ class IXR_Value {
/**
* Checks whether or not the supplied array is a struct or not
*
* @param unknown_type $array
* @param array $array
* @return boolean
*/
function isStruct($array)
@@ -171,7 +171,7 @@ class IXR_Value {
* IXR_MESSAGE
*
* @package IXR
* @since 1.5
* @since 1.5.0
*
*/
class IXR_Message
@@ -203,11 +203,44 @@ class IXR_Message
{
// first remove the XML declaration
// merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
$header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr($this->message, 0, 100), 1);
$this->message = substr_replace($this->message, $header, 0, 100);
if (trim($this->message) == '') {
$header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 );
$this->message = trim( substr_replace( $this->message, $header, 0, 100 ) );
if ( '' == $this->message ) {
return false;
}
// Then remove the DOCTYPE
$header = preg_replace( '/^<!DOCTYPE[^>]*+>/i', '', substr( $this->message, 0, 200 ), 1 );
$this->message = trim( substr_replace( $this->message, $header, 0, 200 ) );
if ( '' == $this->message ) {
return false;
}
// Check that the root tag is valid
$root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), "> \t\r\n" ) );
if ( '<!DOCTYPE' === strtoupper( $root_tag ) ) {
return false;
}
if ( ! in_array( $root_tag, array( '<methodCall', '<methodResponse', '<fault' ) ) ) {
return false;
}
// Bail if there are too many elements to parse
$element_limit = 30000;
if ( function_exists( 'apply_filters' ) ) {
/**
* Filter the number of elements to parse in an XML-RPC response.
*
* @since 4.0.0
*
* @param int $element_limit Default elements limit.
*/
$element_limit = apply_filters( 'xmlrpc_element_limit', $element_limit );
}
if ( $element_limit && 2 * $element_limit < substr_count( $this->message, '<' ) ) {
return false;
}
$this->_parser = xml_parser_create();
// Set XML parser to take the case of tags in to account
xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
@@ -332,7 +365,7 @@ class IXR_Message
$this->_arraystructs[count($this->_arraystructs)-1][] = $value;
}
} else {
// Just add as a paramater
// Just add as a parameter
$this->params[] = $value;
}
}
@@ -344,7 +377,7 @@ class IXR_Message
* IXR_Server
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Server
{
@@ -369,7 +402,11 @@ class IXR_Server
{
if (!$data) {
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {
header('Content-Type: text/plain'); // merged from WP #9093
if ( function_exists( 'status_header' ) ) {
status_header( 405 ); // WP #20986
header( 'Allow: POST' );
}
header('Content-Type: text/plain'); // merged from WP #9093
die('XML-RPC server accepts POST requests only.');
}
@@ -425,7 +462,7 @@ EOD;
// Perform the callback and send the response
if (count($args) == 1) {
// If only one paramater just send that instead of the whole array
// If only one parameter just send that instead of the whole array
$args = $args[0];
}
@@ -555,7 +592,7 @@ EOD;
* IXR_Request
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Request
{
@@ -598,7 +635,7 @@ EOD;
* IXR_Client
*
* @package IXR
* @since 1.5
* @since 1.5.0
*
*/
class IXR_Client
@@ -629,6 +666,10 @@ class IXR_Client
if (!$this->path) {
$this->path = '/';
}
if ( ! empty( $bits['query'] ) ) {
$this->path .= '?' . $bits['query'];
}
} else {
$this->server = $server;
$this->path = $path;
@@ -750,7 +791,7 @@ class IXR_Client
* IXR_Error
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Error
{
@@ -792,7 +833,7 @@ EOD;
* IXR_Date
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Date {
var $year;
@@ -855,7 +896,7 @@ class IXR_Date {
* IXR_Base64
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_Base64
{
@@ -876,7 +917,7 @@ class IXR_Base64
* IXR_IntrospectionServer
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_IntrospectionServer extends IXR_Server
{
@@ -1039,7 +1080,7 @@ class IXR_IntrospectionServer extends IXR_Server
* IXR_ClientMulticall
*
* @package IXR
* @since 1.5
* @since 1.5.0
*/
class IXR_ClientMulticall extends IXR_Client
{
+25 -14
View File
@@ -1,7 +1,7 @@
<?php
if ( !class_exists('SimplePie') )
require_once (ABSPATH . WPINC . '/class-simplepie.php');
require_once( ABSPATH . WPINC . '/class-simplepie.php' );
class WP_Feed_Cache extends SimplePie_Cache {
/**
@@ -10,44 +10,55 @@ class WP_Feed_Cache extends SimplePie_Cache {
* @static
* @access public
*/
function create($location, $filename, $extension) {
public function create($location, $filename, $extension) {
return new WP_Feed_Cache_Transient($location, $filename, $extension);
}
}
class WP_Feed_Cache_Transient {
var $name;
var $mod_name;
var $lifetime = 43200; //Default lifetime in cache of 12 hours
public $name;
public $mod_name;
public $lifetime = 43200; //Default lifetime in cache of 12 hours
function __construct($location, $filename, $extension) {
public function __construct($location, $filename, $extension) {
$this->name = 'feed_' . $filename;
$this->mod_name = 'feed_mod_' . $filename;
$this->lifetime = apply_filters('wp_feed_cache_transient_lifetime', $this->lifetime, $filename);
$lifetime = $this->lifetime;
/**
* Filter the transient lifetime of the feed cache.
*
* @since 2.8.0
*
* @param int $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours).
* @param string $filename Unique identifier for the cache object.
*/
$this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename);
}
function save($data) {
if ( is_a($data, 'SimplePie') )
public function save($data) {
if ( $data instanceof SimplePie ) {
$data = $data->data;
}
set_transient($this->name, $data, $this->lifetime);
set_transient($this->mod_name, time(), $this->lifetime);
return true;
}
function load() {
public function load() {
return get_transient($this->name);
}
function mtime() {
public function mtime() {
return get_transient($this->mod_name);
}
function touch() {
public function touch() {
return set_transient($this->mod_name, time(), $this->lifetime);
}
function unlink() {
public function unlink() {
delete_transient($this->name);
delete_transient($this->mod_name);
return true;
@@ -56,7 +67,7 @@ class WP_Feed_Cache_Transient {
class WP_SimplePie_File extends SimplePie_File {
function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
public function __construct($url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false) {
$this->url = $url;
$this->timeout = $timeout;
$this->redirects = $redirects;
+933 -580
View File
File diff suppressed because it is too large. Load diff
+330 -66
View File
@@ -3,7 +3,7 @@
* API for fetching the HTML to embed remote content based on a provided URL.
* Used internally by the {@link WP_Embed} class, but is designed to be generic.
*
* @link http://codex.wordpress.org/oEmbed oEmbed Codex Article
* @link https://codex.wordpress.org/oEmbed oEmbed Codex Article
* @link http://oembed.com/ oEmbed Homepage
*
* @package WordPress
@@ -18,62 +18,187 @@
* @since 2.9.0
*/
class WP_oEmbed {
var $providers = array();
public $providers = array();
public static $early_providers = array();
private $compat_methods = array( '_fetch_with_format', '_parse_json', '_parse_xml', '_parse_body' );
/**
* Constructor
*
* @uses apply_filters() Filters a list of pre-defined oEmbed providers.
* @since 2.9.0
*/
function __construct() {
// List out some popular sites that support oEmbed.
// The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them.
// Add to this list using the wp_oembed_add_provider() function (see its PHPDoc for details).
$this->providers = apply_filters( 'oembed_providers', array(
'#https?://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
'http://youtu.be/*' => array( 'http://www.youtube.com/oembed', false ),
'http://blip.tv/*' => array( 'http://blip.tv/oembed/', false ),
'#https?://(www\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ),
'#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ),
'http://dai.ly/*' => array( 'http://www.dailymotion.com/services/oembed', false ),
'#https?://(www\.)?flickr\.com/.*#i' => array( 'http://www.flickr.com/services/oembed/', true ),
'http://flic.kr/*' => array( 'http://www.flickr.com/services/oembed/', false ),
'#https?://(.+\.)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ),
'#https?://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ),
'#https?://(www\.)?viddler\.com/.*#i' => array( 'http://lab.viddler.com/services/oembed/', true ),
'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ),
'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ),
'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ),
'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ),
'#https?://(www\.)?scribd\.com/.*#i' => array( 'http://www.scribd.com/services/oembed', true ),
'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ),
'#https?://(.+\.)?polldaddy\.com/.*#i' => array( 'http://polldaddy.com/oembed/', true ),
'#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ),
'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i'=> array( 'http://api.twitter.com/1/statuses/oembed.{format}', true ),
'#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ),
'#https?://(www\.)?slideshare\.net/*#' => array( 'http://www.slideshare.net/api/oembed/2', true ),
'#http://instagr(\.am|am\.com)/p/.*#i' => array( 'http://api.instagram.com/oembed', true ),
'#https?://(www\.)?rdio\.com/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
'#https?://rd\.io/x/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
'#https?://(open|play)\.spotify\.com/.*#i' => array( 'https://embed.spotify.com/oembed/', true ),
) );
public function __construct() {
$providers = array(
'#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ),
'#https://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
'#http://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed', true ),
'#https://(www\.)?youtube\.com/playlist.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
'#http://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed', true ),
'#https://youtu\.be/.*#i' => array( 'http://www.youtube.com/oembed?scheme=https', true ),
'http://blip.tv/*' => array( 'http://blip.tv/oembed/', false ),
'#https?://(.+\.)?vimeo\.com/.*#i' => array( 'http://vimeo.com/api/oembed.{format}', true ),
'#https?://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/services/oembed', true ),
'http://dai.ly/*' => array( 'http://www.dailymotion.com/services/oembed', false ),
'#https?://(www\.)?flickr\.com/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
'#https?://flic\.kr/.*#i' => array( 'https://www.flickr.com/services/oembed/', true ),
'#https?://(.+\.)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ),
'#https?://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ),
'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ),
'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ),
'#https?://(www\.)?scribd\.com/doc/.*#i' => array( 'http://www.scribd.com/services/oembed', true ),
'#https?://wordpress.tv/.*#i' => array( 'http://wordpress.tv/oembed/', true ),
'#https?://(.+\.)?polldaddy\.com/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
'#https?://poll\.fm/.*#i' => array( 'https://polldaddy.com/oembed/', true ),
'#https?://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ),
'#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' => array( 'https://api.twitter.com/1/statuses/oembed.{format}', true ),
'#https?://vine.co/v/.*#i' => array( 'https://vine.co/oembed.{format}', true ),
'#https?://(www\.)?soundcloud\.com/.*#i' => array( 'http://soundcloud.com/oembed', true ),
'#https?://(.+?\.)?slideshare\.net/.*#i' => array( 'https://www.slideshare.net/api/oembed/2', true ),
'#https?://instagr(\.am|am\.com)/p/.*#i' => array( 'https://api.instagram.com/oembed', true ),
'#https?://(www\.)?rdio\.com/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
'#https?://rd\.io/x/.*#i' => array( 'http://www.rdio.com/api/oembed/', true ),
'#https?://(open|play)\.spotify\.com/.*#i' => array( 'https://embed.spotify.com/oembed/', true ),
'#https?://(.+\.)?imgur\.com/.*#i' => array( 'http://api.imgur.com/oembed', true ),
'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'http://api.meetup.com/oembed', true ),
'#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'http://issuu.com/oembed_wp', true ),
'#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'http://www.collegehumor.com/oembed.{format}', true ),
'#https?://(www\.)?mixcloud\.com/.*#i' => array( 'http://www.mixcloud.com/oembed', true ),
'#https?://(www\.|embed\.)?ted\.com/talks/.*#i' => array( 'http://www.ted.com/talks/oembed.{format}', true ),
'#https?://(www\.)?(animoto|video214)\.com/play/.*#i' => array( 'http://animoto.com/oembeds/create', true ),
'#https?://(.+)\.tumblr\.com/post/.*#i' => array( 'https://www.tumblr.com/oembed/1.0', true ),
'#https?://(www\.)?kickstarter\.com/projects/.*#i' => array( 'https://www.kickstarter.com/services/oembed', true ),
'#https?://kck\.st/.*#i' => array( 'https://www.kickstarter.com/services/oembed', true ),
);
if ( ! empty( self::$early_providers['add'] ) ) {
foreach ( self::$early_providers['add'] as $format => $data ) {
$providers[ $format ] = $data;
}
}
if ( ! empty( self::$early_providers['remove'] ) ) {
foreach ( self::$early_providers['remove'] as $format ) {
unset( $providers[ $format ] );
}
}
self::$early_providers = array();
/**
* Filter the list of oEmbed providers.
*
* Discovery is disabled for users lacking the unfiltered_html capability.
* Only providers in this array will be used for those users.
*
* Supported providers:
*
* | ------------ | -------------------- | ----- | --------- |
* | Provider | Flavor | SSL | Since |
* | ------------ | -------------------- | ----- | --------- |
* | Blip | blip.tv | ! | 2.9.0 |
* | Dailymotion | dailymotion.com | Yes | 2.9.0 |
* | Flickr | flickr.com | Yes | 2.9.0 |
* | Hulu | hulu.com | Yes | 2.9.0 |
* | Photobucket | photobucket.com | ! | 2.9.0 |
* | Scribd | scribd.com | Yes | 2.9.0 |
* | Vimeo | vimeo.com | Yes | 2.9.0 |
* | WordPress.tv | wordpress.tv | Yes | 2.9.0 |
* | YouTube | youtube.com/watch | Yes | 2.9.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Funny or Die | funnyordie.com | Yes | 3.0.0 |
* | Polldaddy | polldaddy.com | Yes | 3.0.0 |
* | SmugMug | smugmug.com | Yes | 3.0.0 |
* | YouTube | youtu.be | Yes | 3.0.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Twitter | twitter.com | Yes | 3.4.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Instagram | instagram.com | Yes | 3.5.0 |
* | Instagram | instagr.am | Yes | 3.5.0 |
* | Slideshare | slideshare.net | Yes | 3.5.0 |
* | SoundCloud | soundcloud.com | Yes | 3.5.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Dailymotion | dai.ly | ! | 3.6.0 |
* | Flickr | flic.kr | Yes | 3.6.0 |
* | Rdio | rdio.com | Yes | 3.6.0 |
* | Rdio | rd.io | Yes | 3.6.0 |
* | Spotify | spotify.com | Yes | 3.6.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Imgur | imgur.com | Yes | 3.9.0 |
* | Meetup.com | meetup.com | Yes | 3.9.0 |
* | Meetup.com | meetu.ps | Yes | 3.9.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Animoto | animoto.com | Yes | 4.0.0 |
* | Animoto | video214.com | Yes | 4.0.0 |
* | CollegeHumor | collegehumor.com | Yes | 4.0.0 |
* | Issuu | issuu.com | Yes | 4.0.0 |
* | Mixcloud | mixcloud.com | Yes | 4.0.0 |
* | Polldaddy | poll.fm | Yes | 4.0.0 |
* | TED | ted.com | Yes | 4.0.0 |
* | YouTube | youtube.com/playlist | Yes | 4.0.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Vine | vine.co | Yes | 4.1.0 |
* | ------------ | -------------------- | ----- | --------- |
* | Tumblr | tumblr.com | Yes | 4.2.0 |
* | Kickstarter | kickstarter.com | Yes | 4.2.0 |
* | Kickstarter | kck.st | Yes | 4.2.0 |
* | ------------ | -------------------- | ----- | --------- |
*
* No longer supported providers:
*
* | ------------ | -------------------- | ----- | --------- | --------- |
* | Provider | Flavor | SSL | Since | Removed |
* | ------------ | -------------------- | ----- | --------- | --------- |
* | Qik | qik.com | Yes | 2.9.0 | 3.9.0 |
* | ------------ | -------------------- | ----- | --------- | --------- |
* | Viddler | viddler.com | Yes | 2.9.0 | 4.0.0 |
* | ------------ | -------------------- | ----- | --------- | --------- |
* | Revision3 | revision3.com | ! | 2.9.0 | 4.2.0 |
* | ------------ | -------------------- | ----- | --------- | --------- |
*
* @see wp_oembed_add_provider()
*
* @since 2.9.0
*
* @param array $providers An array of popular oEmbed providers.
*/
$this->providers = apply_filters( 'oembed_providers', $providers );
// Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
add_filter( 'oembed_dataparse', array($this, '_strip_newlines'), 10, 3 );
}
/**
* The do-it-all function that takes a URL and attempts to return the HTML.
* Make private/protected methods readable for backwards compatibility.
*
* @since 4.0.0
* @access public
*
* @param callable $name Method to call.
* @param array $arguments Arguments to pass when calling.
* @return mixed|bool Return value of the callback, false otherwise.
*/
public function __call( $name, $arguments ) {
if ( in_array( $name, $this->compat_methods ) ) {
return call_user_func_array( array( $this, $name ), $arguments );
}
return false;
}
/**
* Takes a URL and returns the corresponding oEmbed provider's URL, if there is one.
*
* @since 4.0.0
* @access public
*
* @see WP_oEmbed::discover()
* @see WP_oEmbed::fetch()
* @see WP_oEmbed::data2html()
*
* @param string $url The URL to the content that should be attempted to be embedded.
* @param array $args Optional arguments. Usually passed from a shortcode.
* @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
* @param string $url The URL to the content.
* @param string|array $args Optional provider arguments.
* @return bool|string False on failure, otherwise the oEmbed provider URL.
*/
function get_html( $url, $args = '' ) {
public function get_provider( $url, $args = '' ) {
$provider = false;
if ( !isset($args['discover']) )
@@ -97,29 +222,124 @@ class WP_oEmbed {
if ( !$provider && $args['discover'] )
$provider = $this->discover( $url );
return $provider;
}
/**
* Add an oEmbed provider just-in-time when wp_oembed_add_provider() is called
* before the 'plugins_loaded' hook.
*
* The just-in-time addition is for the benefit of the 'oembed_providers' filter.
*
* @since 4.0.0
* @access public
* @static
*
* @see wp_oembed_add_provider()
*
* @param string $format Format of URL that this provider can handle. You can use
* asterisks as wildcards.
* @param string $provider The URL to the oEmbed provider..
* @param bool $regex Optional. Whether the $format parameter is in a regex format.
* Default false.
*/
public static function _add_provider_early( $format, $provider, $regex = false ) {
if ( empty( self::$early_providers['add'] ) ) {
self::$early_providers['add'] = array();
}
self::$early_providers['add'][ $format ] = array( $provider, $regex );
}
/**
* Remove an oEmbed provider just-in-time when wp_oembed_remove_provider() is called
* before the 'plugins_loaded' hook.
*
* The just-in-time removal is for the benefit of the 'oembed_providers' filter.
*
* @since 4.0.0
* @access public
* @static
*
* @see wp_oembed_remove_provider()
*
* @param string $format The format of URL that this provider can handle. You can use
* asterisks as wildcards.
*/
public static function _remove_provider_early( $format ) {
if ( empty( self::$early_providers['remove'] ) ) {
self::$early_providers['remove'] = array();
}
self::$early_providers['remove'][] = $format;
}
/**
* The do-it-all function that takes a URL and attempts to return the HTML.
*
* @see WP_oEmbed::fetch()
* @see WP_oEmbed::data2html()
*
* @param string $url The URL to the content that should be attempted to be embedded.
* @param array $args Optional arguments. Usually passed from a shortcode.
* @return false|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
*/
public function get_html( $url, $args = '' ) {
$provider = $this->get_provider( $url, $args );
if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) )
return false;
/**
* Filter the HTML returned by the oEmbed provider.
*
* @since 2.9.0
*
* @param string $data The returned oEmbed HTML.
* @param string $url URL of the content to be embedded.
* @param array $args Optional arguments, usually passed from a shortcode.
*/
return apply_filters( 'oembed_result', $this->data2html( $data, $url ), $url, $args );
}
/**
* Attempts to find oEmbed provider discovery <link> tags at the given URL.
* Attempts to discover link tags at the given URL for an oEmbed provider.
*
* @param string $url The URL that should be inspected for discovery <link> tags.
* @param string $url The URL that should be inspected for discovery `<link>` tags.
* @return bool|string False on failure, otherwise the oEmbed provider URL.
*/
function discover( $url ) {
public function discover( $url ) {
$providers = array();
// Fetch URL content
if ( $html = wp_remote_retrieve_body( wp_safe_remote_get( $url ) ) ) {
/**
* Filter oEmbed remote get arguments.
*
* @since 4.0.0
*
* @see WP_Http::request()
*
* @param array $args oEmbed remote get arguments.
* @param string $url URL to be inspected.
*/
$args = apply_filters( 'oembed_remote_get_args', array(), $url );
// <link> types that contain oEmbed provider URLs
// Fetch URL content
$request = wp_safe_remote_get( $url, $args );
if ( $html = wp_remote_retrieve_body( $request ) ) {
/**
* Filter the link types that contain oEmbed provider URLs.
*
* @since 2.9.0
*
* @param array $format Array of oEmbed link types. Accepts 'application/json+oembed',
* 'text/xml+oembed', and 'application/xml+oembed' (incorrect,
* used by at least Vimeo).
*/
$linktypes = apply_filters( 'oembed_linktypes', array(
'application/json+oembed' => 'json',
'text/xml+oembed' => 'xml',
'application/xml+oembed' => 'xml', // Incorrect, but used by at least Vimeo
'application/xml+oembed' => 'xml',
) );
// Strip <body>
@@ -134,12 +354,12 @@ class WP_oEmbed {
}
}
if ( $tagfound && preg_match_all( '/<link([^<>]+)>/i', $html, $links ) ) {
if ( $tagfound && preg_match_all( '#<link([^<>]+)/?>#iU', $html, $links ) ) {
foreach ( $links[1] as $link ) {
$atts = shortcode_parse_atts( $link );
if ( !empty($atts['type']) && !empty($linktypes[$atts['type']]) && !empty($atts['href']) ) {
$providers[$linktypes[$atts['type']]] = $atts['href'];
$providers[$linktypes[$atts['type']]] = htmlspecialchars_decode( $atts['href'] );
// Stop here if it's JSON (that's all we need)
if ( 'json' == $linktypes[$atts['type']] )
@@ -166,13 +386,22 @@ class WP_oEmbed {
* @param array $args Optional arguments. Usually passed from a shortcode.
* @return bool|object False on failure, otherwise the result in the form of an object.
*/
function fetch( $provider, $url, $args = '' ) {
$args = wp_parse_args( $args, wp_embed_defaults() );
public function fetch( $provider, $url, $args = '' ) {
$args = wp_parse_args( $args, wp_embed_defaults( $url ) );
$provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider );
$provider = add_query_arg( 'maxheight', (int) $args['height'], $provider );
$provider = add_query_arg( 'url', urlencode($url), $provider );
/**
* Filter the oEmbed URL to be fetched.
*
* @since 2.9.0
*
* @param string $provider URL of the oEmbed provider.
* @param string $url URL of the content to be embedded.
* @param array $args Optional arguments, usually passed from a shortcode.
*/
$provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );
foreach( array( 'json', 'xml' ) as $format ) {
@@ -193,9 +422,13 @@ class WP_oEmbed {
* @param string $format Format to use
* @return bool|object False on failure, otherwise the result in the form of an object.
*/
function _fetch_with_format( $provider_url_with_args, $format ) {
private function _fetch_with_format( $provider_url_with_args, $format ) {
$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );
$response = wp_safe_remote_get( $provider_url_with_args );
/** This filter is documented in wp-includes/class-oembed.php */
$args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args );
$response = wp_safe_remote_get( $provider_url_with_args, $args );
if ( 501 == wp_remote_retrieve_response_code( $response ) )
return new WP_Error( 'not-implemented' );
if ( ! $body = wp_remote_retrieve_body( $response ) )
@@ -210,7 +443,7 @@ class WP_oEmbed {
* @since 3.0.0
* @access private
*/
function _parse_json( $response_body ) {
private function _parse_json( $response_body ) {
return ( ( $data = json_decode( trim( $response_body ) ) ) && is_object( $data ) ) ? $data : false;
}
@@ -220,7 +453,7 @@ class WP_oEmbed {
* @since 3.0.0
* @access private
*/
function _parse_xml( $response_body ) {
private function _parse_xml( $response_body ) {
if ( ! function_exists( 'libxml_disable_entity_loader' ) )
return false;
@@ -275,9 +508,9 @@ class WP_oEmbed {
*
* @param object $data A data object result from an oEmbed provider.
* @param string $url The URL to the content that is desired to be embedded.
* @return bool|string False on error, otherwise the HTML needed to embed.
* @return false|string False on error, otherwise the HTML needed to embed.
*/
function data2html( $data, $url ) {
public function data2html( $data, $url ) {
if ( ! is_object( $data ) || empty( $data->type ) )
return false;
@@ -309,24 +542,56 @@ class WP_oEmbed {
$return = false;
}
// You can use this filter to add support for custom data types or to filter the result
/**
* Filter the returned oEmbed HTML.
*
* Use this filter to add support for custom data types, or to filter the result.
*
* @since 2.9.0
*
* @param string $return The returned oEmbed HTML.
* @param object $data A data object result from an oEmbed provider.
* @param string $url The URL of the content to be embedded.
*/
return apply_filters( 'oembed_dataparse', $return, $data, $url );
}
/**
* Strip any new lines from the HTML.
*
* @access private
* @access public
* @param string $html Existing HTML.
* @param object $data Data object from WP_oEmbed::data2html()
* @param string $url The original URL passed to oEmbed.
* @return string Possibly modified $html
*/
function _strip_newlines( $html, $data, $url ) {
if ( false !== strpos( $html, "\n" ) )
$html = str_replace( array( "\r\n", "\n" ), '', $html );
public function _strip_newlines( $html, $data, $url ) {
if ( false === strpos( $html, "\n" ) ) {
return $html;
}
return $html;
$count = 1;
$found = array();
$token = '__PRE__';
$search = array( "\t", "\n", "\r", ' ' );
$replace = array( '__TAB__', '__NL__', '__CR__', '__SPACE__' );
$tokenized = str_replace( $search, $replace, $html );
preg_match_all( '#(<pre[^>]*>.+?</pre>)#i', $tokenized, $matches, PREG_SET_ORDER );
foreach ( $matches as $i => $match ) {
$tag_html = str_replace( $replace, $search, $match[0] );
$tag_token = $token . $i;
$found[ $tag_token ] = $tag_html;
$html = str_replace( $tag_html, $tag_token, $html, $count );
}
$replaced = str_replace( $replace, $search, $html );
$stripped = str_replace( array( "\r\n", "\n" ), '', $replaced );
$pre = array_values( $found );
$tokens = array_keys( $found );
return str_replace( $tokens, $pre, $stripped );
}
}
@@ -337,7 +602,6 @@ class WP_oEmbed {
* @access private
*
* @see WP_oEmbed
* @uses WP_oEmbed
*
* @return WP_oEmbed object.
*/
+10 -2
View File
@@ -2,7 +2,7 @@
/**
* Portable PHP password hashing framework.
* @package phpass
* @since 2.5
* @since 2.5.0
* @version 0.3 / WordPress
* @link http://www.openwall.com/phpass/
*/
@@ -31,7 +31,7 @@
* @package phpass
* @version 0.3 / WordPress
* @link http://www.openwall.com/phpass/
* @since 2.5
* @since 2.5.0
*/
class PasswordHash {
var $itoa64;
@@ -214,6 +214,10 @@ class PasswordHash {
function HashPassword($password)
{
if ( strlen( $password ) > 4096 ) {
return '*';
}
$random = '';
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
@@ -249,6 +253,10 @@ class PasswordHash {
function CheckPassword($password, $stored_hash)
{
if ( strlen( $password ) > 4096 ) {
return false;
}
$hash = $this->crypt_private($password, $stored_hash);
if ($hash[0] == '*')
$hash = crypt($password, $stored_hash);
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -26,7 +26,7 @@ function wp_simplepie_autoload( $class ) {
return;
$file = ABSPATH . WPINC . '/' . str_replace( '_', '/', $class ) . '.php';
include $file;
include( $file );
}
if ( function_exists( 'spl_autoload_register' ) ) {
@@ -1612,7 +1612,7 @@ class SimplePie
}
/**
* Get the error message for the occured error
* Get the error message for the occurred error.
*
* @return string|array Error message, or array of messages for multifeeds
*/
+872 -932
View File
File diff suppressed because it is too large. Load diff
+44 -17
View File
@@ -16,11 +16,10 @@ class WP_Admin_Bar {
switch ( $name ) {
case 'proto' :
return is_ssl() ? 'https://' : 'http://';
break;
case 'menu' :
_deprecated_argument( 'WP_Admin_Bar', '3.3', 'Modify admin bar nodes with WP_Admin_Bar::get_node(), WP_Admin_Bar::add_node(), and WP_Admin_Bar::remove_node(), not the <code>menu</code> property.' );
return array(); // Sorry, folks.
break;
}
}
@@ -46,7 +45,11 @@ class WP_Admin_Bar {
add_action( 'admin_head', 'wp_admin_bar_header' );
if ( current_theme_supports( 'admin-bar' ) ) {
$admin_bar_args = get_theme_support( 'admin-bar' ); // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
/**
* To remove the default padding styles from WordPress for the Toolbar, use the following code:
* add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) );
*/
$admin_bar_args = get_theme_support( 'admin-bar' );
$header_callback = $admin_bar_args[0]['callback'];
}
@@ -58,6 +61,11 @@ class WP_Admin_Bar {
wp_enqueue_script( 'admin-bar' );
wp_enqueue_style( 'admin-bar' );
/**
* Fires after WP_Admin_Bar is initialized.
*
* @since 3.1.0
*/
do_action( 'admin_bar_init' );
}
@@ -72,13 +80,17 @@ class WP_Admin_Bar {
/**
* Add a node to the menu.
*
* @param array $args - The arguments for each node.
* - id - string - The ID of the item.
* - title - string - The title of the node.
* - parent - string - The ID of the parent node. Optional.
* - href - string - The link for the item. Optional.
* - group - boolean - If the node is a group. Optional. Default false.
* - meta - array - Meta data including the following keys: html, class, onclick, target, title, tabindex.
* @param array $args {
* Arguments for adding a node.
*
* @type string $id ID of the item.
* @type string $title Title of the node.
* @type string $parent Optional. ID of the parent node.
* @type string $href Optional. Link for the item.
* @type bool $group Optional. Whether or not the node is a group. Default false.
* @type array $meta Meta data including the following keys: 'html', 'class', 'rel',
* 'onclick', 'target', 'title', 'tabindex'. Default empty.
* }
*/
public function add_node( $args ) {
// Shim for old method signature: add_node( $parent_id, $menu_obj, $args )
@@ -178,10 +190,14 @@ class WP_Admin_Bar {
*
* @since 3.3.0
*
* @param array $args - The arguments for each node.
* - id - string - The ID of the item.
* - parent - string - The ID of the parent node. Optional. Default root.
* - meta - array - Meta data including the following keys: class, onclick, target, title.
* @param array $args {
* Array of arguments for adding a group.
*
* @type string $id ID of the item.
* @type string $parent Optional. ID of the parent node. Default 'root'.
* @type array $meta Meta data for the group including the following keys:
* 'class', 'onclick', 'target', and 'title'.
* }
*/
final public function add_group( $args ) {
$args['group'] = true;
@@ -347,9 +363,11 @@ class WP_Admin_Bar {
}
?>
<div id="wpadminbar" class="<?php echo $class; ?>" role="navigation">
<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e('Skip to toolbar'); ?></a>
<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e('Top navigation toolbar.'); ?>" tabindex="0">
<div id="wpadminbar" class="<?php echo $class; ?>">
<?php if ( ! is_admin() ) { ?>
<a class="screen-reader-shortcut" href="#wp-toolbar" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a>
<?php } ?>
<div class="quicklinks" id="wp-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>" tabindex="0">
<?php foreach ( $root->children as $group ) {
$this->_render_group( $group );
} ?>
@@ -429,6 +447,9 @@ class WP_Admin_Bar {
if ( ! empty( $node->meta['title'] ) ) :
?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php
endif;
if ( ! empty( $node->meta['rel'] ) ) :
?> rel="<?php echo esc_attr( $node->meta['rel'] ); ?>"<?php
endif;
?>><?php
else:
?><div class="ab-item ab-empty-item" <?php echo $aria_attributes;
@@ -473,6 +494,7 @@ class WP_Admin_Bar {
add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );
// Site related.
add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
@@ -487,6 +509,11 @@ class WP_Admin_Bar {
add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );
/**
* Fires after menus are added to the menu bar.
*
* @since 3.1.0
*/
do_action( 'add_admin_bar_menus' );
}
}
+28 -22
View File
@@ -11,9 +11,8 @@ class WP_Ajax_Response {
*
* @since 2.1.0
* @var array
* @access private
*/
var $responses = array();
public $responses = array();
/**
* Constructor - Passes args to {@link WP_Ajax_Response::add()}.
@@ -22,9 +21,8 @@ class WP_Ajax_Response {
* @see WP_Ajax_Response::add()
*
* @param string|array $args Optional. Will be passed to add() method.
* @return WP_Ajax_Response
*/
function __construct( $args = '' ) {
public function __construct( $args = '' ) {
if ( !empty($args) )
$this->add($args);
}
@@ -52,7 +50,7 @@ class WP_Ajax_Response {
* @param string|array $args Override defaults.
* @return string XML response.
*/
function add( $args = '' ) {
public function add( $args = '' ) {
$defaults = array(
'what' => 'object', 'action' => false,
'id' => '0', 'old_id' => false,
@@ -61,33 +59,40 @@ class WP_Ajax_Response {
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$position = preg_replace( '/[^a-z0-9:_-]/i', '', $position );
if ( is_wp_error($id) ) {
$position = preg_replace( '/[^a-z0-9:_-]/i', '', $r['position'] );
$id = $r['id'];
$what = $r['what'];
$action = $r['action'];
$old_id = $r['old_id'];
$data = $r['data'];
if ( is_wp_error( $id ) ) {
$data = $id;
$id = 0;
}
$response = '';
if ( is_wp_error($data) ) {
if ( is_wp_error( $data ) ) {
foreach ( (array) $data->get_error_codes() as $code ) {
$response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message($code) . "]]></wp_error>";
if ( !$error_data = $data->get_error_data($code) )
$response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message( $code ) . "]]></wp_error>";
if ( ! $error_data = $data->get_error_data( $code ) ) {
continue;
}
$class = '';
if ( is_object($error_data) ) {
$class = ' class="' . get_class($error_data) . '"';
$error_data = get_object_vars($error_data);
if ( is_object( $error_data ) ) {
$class = ' class="' . get_class( $error_data ) . '"';
$error_data = get_object_vars( $error_data );
}
$response .= "<wp_error_data code='$code'$class>";
if ( is_scalar($error_data) ) {
if ( is_scalar( $error_data ) ) {
$response .= "<![CDATA[$error_data]]>";
} elseif ( is_array($error_data) ) {
foreach ( $error_data as $k => $v )
} elseif ( is_array( $error_data ) ) {
foreach ( $error_data as $k => $v ) {
$response .= "<$k><![CDATA[$v]]></$k>";
}
}
$response .= "</wp_error_data>";
@@ -97,15 +102,16 @@ class WP_Ajax_Response {
}
$s = '';
if ( is_array($supplemental) ) {
foreach ( $supplemental as $k => $v )
if ( is_array( $r['supplemental'] ) ) {
foreach ( $r['supplemental'] as $k => $v ) {
$s .= "<$k><![CDATA[$v]]></$k>";
}
$s = "<supplemental>$s</supplemental>";
}
if ( false === $action )
if ( false === $action ) {
$action = $_POST['action'];
}
$x = '';
$x .= "<response action='{$action}_$id'>"; // The action attribute in the xml output is formatted like a nonce action
$x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
@@ -125,7 +131,7 @@ class WP_Ajax_Response {
*
* @since 2.1.0
*/
function send() {
public function send() {
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) );
echo "<?xml version='1.0' encoding='" . get_option( 'blog_charset' ) . "' standalone='yes'?><wp_ajax>";
foreach ( (array) $this->responses as $response )
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+333
View File
@@ -0,0 +1,333 @@
<?php
/**
* WordPress Customize Panel classes
*
* @package WordPress
* @subpackage Customize
* @since 4.0.0
*/
/**
* Customize Panel class.
*
* A UI container for sections, managed by the WP_Customize_Manager.
*
* @since 4.0.0
*
* @see WP_Customize_Manager
*/
class WP_Customize_Panel {
/**
* Incremented with each new class instantiation, then stored in $instance_number.
*
* Used when sorting two instances whose priorities are equal.
*
* @since 4.1.0
* @access protected
* @var int
*/
protected static $instance_count = 0;
/**
* Order in which this instance was created in relation to other instances.
*
* @since 4.1.0
* @access public
* @var int
*/
public $instance_number;
/**
* WP_Customize_Manager instance.
*
* @since 4.0.0
* @access public
* @var WP_Customize_Manager
*/
public $manager;
/**
* Unique identifier.
*
* @since 4.0.0
* @access public
* @var string
*/
public $id;
/**
* Priority of the panel, defining the display order of panels and sections.
*
* @since 4.0.0
* @access public
* @var integer
*/
public $priority = 160;
/**
* Capability required for the panel.
*
* @since 4.0.0
* @access public
* @var string
*/
public $capability = 'edit_theme_options';
/**
* Theme feature support for the panel.
*
* @since 4.0.0
* @access public
* @var string|array
*/
public $theme_supports = '';
/**
* Title of the panel to show in UI.
*
* @since 4.0.0
* @access public
* @var string
*/
public $title = '';
/**
* Description to show in the UI.
*
* @since 4.0.0
* @access public
* @var string
*/
public $description = '';
/**
* Customizer sections for this panel.
*
* @since 4.0.0
* @access public
* @var array
*/
public $sections;
/**
* Type of this panel.
*
* @since 4.1.0
* @access public
* @var string
*/
public $type = 'default';
/**
* Active callback.
*
* @since 4.1.0
* @access public
*
* @see WP_Customize_Section::active()
*
* @var callable Callback is called with one argument, the instance of
* {@see WP_Customize_Section}, and returns bool to indicate
* whether the section is active (such as it relates to the URL
* currently being previewed).
*/
public $active_callback = '';
/**
* Constructor.
*
* Any supplied $args override class property defaults.
*
* @since 4.0.0
*
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id An specific ID for the panel.
* @param array $args Panel arguments.
*/
public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) );
foreach ( $keys as $key ) {
if ( isset( $args[ $key ] ) ) {
$this->$key = $args[ $key ];
}
}
$this->manager = $manager;
$this->id = $id;
if ( empty( $this->active_callback ) ) {
$this->active_callback = array( $this, 'active_callback' );
}
self::$instance_count += 1;
$this->instance_number = self::$instance_count;
$this->sections = array(); // Users cannot customize the $sections array.
}
/**
* Check whether panel is active to current Customizer preview.
*
* @since 4.1.0
* @access public
*
* @return bool Whether the panel is active to the current preview.
*/
final public function active() {
$panel = $this;
$active = call_user_func( $this->active_callback, $this );
/**
* Filter response of WP_Customize_Panel::active().
*
* @since 4.1.0
*
* @param bool $active Whether the Customizer panel is active.
* @param WP_Customize_Panel $panel {@see WP_Customize_Panel} instance.
*/
$active = apply_filters( 'customize_panel_active', $active, $panel );
return $active;
}
/**
* Default callback used when invoking {@see WP_Customize_Panel::active()}.
*
* Subclasses can override this with their specific logic, or they may
* provide an 'active_callback' argument to the constructor.
*
* @since 4.1.0
* @access public
*
* @return bool Always true.
*/
public function active_callback() {
return true;
}
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 4.1.0
*
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$array = wp_array_slice_assoc( (array) $this, array( 'title', 'description', 'priority', 'type' ) );
$array['content'] = $this->get_content();
$array['active'] = $this->active();
$array['instanceNumber'] = $this->instance_number;
return $array;
}
/**
* Checks required user capabilities and whether the theme has the
* feature support required by the panel.
*
* @since 4.0.0
*
* @return bool False if theme doesn't support the panel or the user doesn't have the capability.
*/
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
return false;
}
if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
return false;
}
return true;
}
/**
* Get the panel's content template for insertion into the Customizer pane.
*
* @since 4.1.0
*
* @return string Content for the panel.
*/
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
ob_end_clean();
return $template;
}
/**
* Check capabilities and render the panel.
*
* @since 4.0.0
*/
final public function maybe_render() {
if ( ! $this->check_capabilities() ) {
return;
}
/**
* Fires before rendering a Customizer panel.
*
* @since 4.0.0
*
* @param WP_Customize_Panel $this WP_Customize_Panel instance.
*/
do_action( 'customize_render_panel', $this );
/**
* Fires before rendering a specific Customizer panel.
*
* The dynamic portion of the hook name, `$this->id`, refers to
* the ID of the specific Customizer panel to be rendered.
*
* @since 4.0.0
*/
do_action( "customize_render_panel_{$this->id}" );
$this->render();
}
/**
* Render the panel container, and then its contents.
*
* @since 4.0.0
* @access protected
*/
protected function render() {
$classes = 'accordion-section control-section control-panel control-panel-' . $this->type;
?>
<li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title" tabindex="0">
<?php echo esc_html( $this->title ); ?>
<span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span>
</h3>
<ul class="accordion-sub-container control-panel-content">
<?php $this->render_content(); ?>
</ul>
</li>
<?php
}
/**
* Render the sections that have been added to the panel.
*
* @since 4.1.0
* @access protected
*/
protected function render_content() {
?>
<li class="panel-meta accordion-section control-section<?php if ( empty( $this->description ) ) { echo ' cannot-expand'; } ?>">
<div class="accordion-section-title" tabindex="0">
<span class="preview-notice"><?php
/* translators: %s is the site/panel title in the Customizer */
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title">' . esc_html( $this->title ) . '</strong>' );
?></span>
</div>
<?php if ( ! empty( $this->description ) ) : ?>
<div class="accordion-section-content description">
<?php echo $this->description; ?>
</div>
<?php endif; ?>
</li>
<?php
}
}
+387 -27
View File
@@ -1,93 +1,453 @@
<?php
/**
* Customize Section Class.
* WordPress Customize Section classes
*
* @package WordPress
* @subpackage Customize
* @since 3.4.0
*/
/**
* Customize Section class.
*
* A UI container for controls, managed by the WP_Customize_Manager class.
*
* @since 3.4.0
*
* @see WP_Customize_Manager
*/
class WP_Customize_Section {
/**
* Incremented with each new class instantiation, then stored in $instance_number.
*
* Used when sorting two instances whose priorities are equal.
*
* @since 4.1.0
* @access protected
* @var int
*/
protected static $instance_count = 0;
/**
* Order in which this instance was created in relation to other instances.
*
* @since 4.1.0
* @access public
* @var int
*/
public $instance_number;
/**
* WP_Customize_Manager instance.
*
* @since 3.4.0
* @access public
* @var WP_Customize_Manager
*/
public $manager;
/**
* Unique identifier.
*
* @since 3.4.0
* @access public
* @var string
*/
public $id;
public $priority = 10;
public $capability = 'edit_theme_options';
/**
* Priority of the section which informs load order of sections.
*
* @since 3.4.0
* @access public
* @var integer
*/
public $priority = 160;
/**
* Panel in which to show the section, making it a sub-section.
*
* @since 4.0.0
* @access public
* @var string
*/
public $panel = '';
/**
* Capability required for the section.
*
* @since 3.4.0
* @access public
* @var string
*/
public $capability = 'edit_theme_options';
/**
* Theme feature support for the section.
*
* @since 3.4.0
* @access public
* @var string|array
*/
public $theme_supports = '';
public $title = '';
public $description = '';
/**
* Title of the section to show in UI.
*
* @since 3.4.0
* @access public
* @var string
*/
public $title = '';
/**
* Description to show in the UI.
*
* @since 3.4.0
* @access public
* @var string
*/
public $description = '';
/**
* Customizer controls for this section.
*
* @since 3.4.0
* @access public
* @var array
*/
public $controls;
/**
* Type of this section.
*
* @since 4.1.0
* @access public
* @var string
*/
public $type = 'default';
/**
* Active callback.
*
* @since 4.1.0
* @access public
*
* @see WP_Customize_Section::active()
*
* @var callable Callback is called with one argument, the instance of
* {@see WP_Customize_Section}, and returns bool to indicate
* whether the section is active (such as it relates to the URL
* currently being previewed).
*/
public $active_callback = '';
/**
* Constructor.
*
* Any supplied $args override class property defaults.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $manager
* @param string $id An specific ID of the section.
* @param array $args Section arguments.
* @param WP_Customize_Manager $manager Customizer bootstrap instance.
* @param string $id An specific ID of the section.
* @param array $args Section arguments.
*/
function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_class_vars( __CLASS__ ) );
public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) );
foreach ( $keys as $key ) {
if ( isset( $args[ $key ] ) )
if ( isset( $args[ $key ] ) ) {
$this->$key = $args[ $key ];
}
}
$this->manager = $manager;
$this->id = $id;
if ( empty( $this->active_callback ) ) {
$this->active_callback = array( $this, 'active_callback' );
}
self::$instance_count += 1;
$this->instance_number = self::$instance_count;
$this->controls = array(); // Users cannot customize the $controls array.
return $this;
}
/**
* Check if the theme supports the section and check user capabilities.
* Check whether section is active to current Customizer preview.
*
* @since 4.1.0
* @access public
*
* @return bool Whether the section is active to the current preview.
*/
final public function active() {
$section = $this;
$active = call_user_func( $this->active_callback, $this );
/**
* Filter response of {@see WP_Customize_Section::active()}.
*
* @since 4.1.0
*
* @param bool $active Whether the Customizer section is active.
* @param WP_Customize_Section $section {@see WP_Customize_Section} instance.
*/
$active = apply_filters( 'customize_section_active', $active, $section );
return $active;
}
/**
* Default callback used when invoking {@see WP_Customize_Section::active()}.
*
* Subclasses can override this with their specific logic, or they may provide
* an 'active_callback' argument to the constructor.
*
* @since 4.1.0
* @access public
*
* @return bool Always true.
*/
public function active_callback() {
return true;
}
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 4.1.0
*
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$array = wp_array_slice_assoc( (array) $this, array( 'title', 'description', 'priority', 'panel', 'type' ) );
$array['content'] = $this->get_content();
$array['active'] = $this->active();
$array['instanceNumber'] = $this->instance_number;
return $array;
}
/**
* Checks required user capabilities and whether the theme has the
* feature support required by the section.
*
* @since 3.4.0
*
* @return bool False if theme doesn't support the section or user doesn't have the capability.
*/
public final function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) ) {
return false;
}
if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) )
if ( $this->theme_supports && ! call_user_func_array( 'current_theme_supports', (array) $this->theme_supports ) ) {
return false;
}
return true;
}
/**
* Get the section's content template for insertion into the Customizer pane.
*
* @since 4.1.0
*
* @return string Contents of the section.
*/
final public function get_content() {
ob_start();
$this->maybe_render();
$template = trim( ob_get_contents() );
ob_end_clean();
return $template;
}
/**
* Check capabilities and render the section.
*
* @since 3.4.0
*/
public final function maybe_render() {
if ( ! $this->check_capabilities() )
final public function maybe_render() {
if ( ! $this->check_capabilities() ) {
return;
}
/**
* Fires before rendering a Customizer section.
*
* @since 3.4.0
*
* @param WP_Customize_Section $this WP_Customize_Section instance.
*/
do_action( 'customize_render_section', $this );
do_action( 'customize_render_section_' . $this->id );
/**
* Fires before rendering a specific Customizer section.
*
* The dynamic portion of the hook name, `$this->id`, refers to the ID
* of the specific Customizer section to be rendered.
*
* @since 3.4.0
*/
do_action( "customize_render_section_{$this->id}" );
$this->render();
}
/**
* Render the section.
* Render the section, and the controls that have been added to it.
*
* @since 3.4.0
*/
protected function render() {
$classes = 'accordion-section control-section control-section-' . $this->type;
?>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="control-section accordion-section">
<h3 class="accordion-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title" tabindex="0">
<?php echo esc_html( $this->title ); ?>
<span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span>
</h3>
<ul class="accordion-section-content">
<?php
foreach ( $this->controls as $control )
$control->maybe_render();
?>
<?php if ( ! empty( $this->description ) ) : ?>
<li class="customize-section-description-container">
<p class="description customize-section-description"><?php echo $this->description; ?></p>
</li>
<?php endif; ?>
</ul>
</li>
<?php
}
}
/**
* Customize Themes Section class.
*
* A UI container for theme controls, which behaves like a backwards Panel.
*
* @since 4.2.0
*
* @see WP_Customize_Section
*/
class WP_Customize_Themes_Section extends WP_Customize_Section {
/**
* Customize section type.
*
* @since 4.2.0
* @access public
* @var string
*/
public $type = 'themes';
/**
* Render the themes section, which behaves like a panel.
*
* @since 4.2.0
* @access protected
*/
protected function render() {
$classes = 'accordion-section control-section control-section-' . $this->type;
?>
<li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
<h3 class="accordion-section-title">
<?php
if ( $this->manager->is_theme_active() ) {
/* translators: %s: theme name */
printf( __( '<span>Active theme</span> %s' ), $this->title );
} else {
/* translators: %s: theme name */
printf( __( '<span>Previewing theme</span> %s' ), $this->title );
}
?>
<button type="button" class="button change-theme"><?php _ex( 'Change', 'theme' ); ?></button>
</h3>
<div class="customize-themes-panel control-panel-content themes-php">
<h2>
<?php _e( 'Themes' ); ?>
<span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /* Active theme */; ?></span>
</h2>
<h3 class="accordion-section-title customize-section-title">
<?php
if ( $this->manager->is_theme_active() ) {
/* translators: %s: theme name */
printf( __( '<span>Active theme</span> %s' ), $this->title );
} else {
/* translators: %s: theme name */
printf( __( '<span>Previewing theme</span> %s' ), $this->title );
}
?>
<button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button>
</h3>
<div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
<div id="customize-container"></div>
<?php if ( count( $this->controls ) > 4 ) : ?>
<p><label for="themes-filter">
<span class="screen-reader-text"><?php _e( 'Search installed themes...' ); ?></span>
<input type="text" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes...' ); ?>" />
</label></p>
<?php endif; ?>
<div class="theme-browser rendered">
<ul class="themes accordion-section-content">
</ul>
</div>
</div>
</li>
<?php }
}
/**
* Customizer section representing widget area (sidebar).
*
* @since 4.1.0
*
* @see WP_Customize_Section
*/
class WP_Customize_Sidebar_Section extends WP_Customize_Section {
/**
* Type of this section.
*
* @since 4.1.0
* @access public
* @var string
*/
public $type = 'sidebar';
/**
* Unique identifier.
*
* @since 4.1.0
* @access public
* @var string
*/
public $sidebar_id;
/**
* Gather the parameters passed to client JavaScript via JSON.
*
* @since 4.1.0
*
* @return array The array to be exported to the client as JSON.
*/
public function json() {
$json = parent::json();
$json['sidebarId'] = $this->sidebar_id;
return $json;
}
/**
* Whether the current sidebar is rendered on the page.
*
* @since 4.1.0
* @access public
*
* @return bool Whether sidebar is rendered.
*/
public function active_callback() {
return $this->manager->widgets->is_sidebar_rendered( $this->sidebar_id );
}
}
+240 -50
View File
@@ -1,40 +1,95 @@
<?php
/**
* Customize Setting Class.
* WordPress Customize Setting classes
*
* @package WordPress
* @subpackage Customize
* @since 3.4.0
*/
/**
* Customize Setting class.
*
* Handles saving and sanitizing of settings.
*
* @since 3.4.0
*
* @see WP_Customize_Manager
*/
class WP_Customize_Setting {
/**
* @access public
* @var WP_Customize_Manager
*/
public $manager;
/**
* @access public
* @var string
*/
public $id;
public $type = 'theme_mod';
public $capability = 'edit_theme_options';
/**
* @access public
* @var string
*/
public $type = 'theme_mod';
/**
* Capability required to edit this setting.
*
* @var string
*/
public $capability = 'edit_theme_options';
/**
* Feature a theme is required to support to enable this setting.
*
* @access public
* @var string
*/
public $theme_supports = '';
public $default = '';
public $transport = 'refresh';
/**
* Server-side sanitization callback for the setting's value.
*
* @var callback
*/
public $sanitize_callback = '';
public $sanitize_js_callback = '';
/**
* Whether or not the setting is initially dirty when created.
*
* This is used to ensure that a setting will be sent from the pane to the
* preview when loading the Customizer. Normally a setting only is synced to
* the preview if it has been changed. This allows the setting to be sent
* from the start.
*
* @since 4.2.0
* @access public
* @var bool
*/
public $dirty = false;
protected $id_data = array();
private $_post_value; // Cached, sanitized $_POST value.
/**
* Constructor.
*
* Any supplied $args override class property defaults.
*
* @since 3.4.0
*
* @param WP_Customize_Manager $manager
* @param string $id An specific ID of the setting. Can be a
* theme mod or option name.
* @param array $args Setting arguments.
* @return WP_Customize_Setting
* @param string $id An specific ID of the setting. Can be a
* theme mod or option name.
* @param array $args Setting arguments.
*/
function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_class_vars( __CLASS__ ) );
public function __construct( $manager, $id, $args = array() ) {
$keys = array_keys( get_object_vars( $this ) );
foreach ( $keys as $key ) {
if ( isset( $args[ $key ] ) )
$this->$key = $args[ $key ];
@@ -57,16 +112,54 @@ class WP_Customize_Setting {
if ( $this->sanitize_js_callback )
add_filter( "customize_sanitize_js_{$this->id}", $this->sanitize_js_callback, 10, 2 );
return $this;
}
/**
* The ID for the current blog when the preview() method was called.
*
* @since 4.2.0
* @access protected
* @var int
*/
protected $_previewed_blog_id;
/**
* Return true if the current blog is not the same as the previewed blog.
*
* @since 4.2.0
* @access public
*
* @return bool|null Returns null if preview() has not been called yet.
*/
public function is_current_blog_previewed() {
if ( ! isset( $this->_previewed_blog_id ) ) {
return null;
}
return ( get_current_blog_id() === $this->_previewed_blog_id );
}
/**
* Original non-previewed value stored by the preview method.
*
* @see WP_Customize_Setting::preview()
* @since 4.1.1
* @var mixed
*/
protected $_original_value;
/**
* Handle previewing the setting.
*
* @since 3.4.0
*/
public function preview() {
if ( ! isset( $this->_original_value ) ) {
$this->_original_value = $this->value();
}
if ( ! isset( $this->_previewed_blog_id ) ) {
$this->_previewed_blog_id = get_current_blog_id();
}
switch( $this->type ) {
case 'theme_mod' :
add_filter( 'theme_mod_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) );
@@ -80,13 +173,40 @@ class WP_Customize_Setting {
}
break;
default :
do_action( 'customize_preview_' . $this->id );
/**
* Fires when the {@see WP_Customize_Setting::preview()} method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
*
* @since 3.4.0
*
* @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance.
*/
do_action( "customize_preview_{$this->id}", $this );
/**
* Fires when the {@see WP_Customize_Setting::preview()} method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, `$this->type`, refers to the setting type.
*
* @since 4.1.0
*
* @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance.
*/
do_action( "customize_preview_{$this->type}", $this );
}
}
/**
* Callback function to filter the theme mods and options.
*
* If switch_to_blog() was called after the preview() method, and the current
* blog is now not the same blog, then this method does a no-op and returns
* the original value.
*
* @since 3.4.0
* @uses WP_Customize_Setting::multidimensional_replace()
*
@@ -94,45 +214,60 @@ class WP_Customize_Setting {
* @return mixed New or old value.
*/
public function _preview_filter( $original ) {
return $this->multidimensional_replace( $original, $this->id_data[ 'keys' ], $this->post_value() );
if ( ! $this->is_current_blog_previewed() ) {
return $original;
}
$undefined = new stdClass(); // symbol hack
$post_value = $this->post_value( $undefined );
if ( $undefined === $post_value ) {
$value = $this->_original_value;
} else {
$value = $post_value;
}
return $this->multidimensional_replace( $original, $this->id_data['keys'], $value );
}
/**
* Set the value of the parameter for a specific theme.
* Check user capabilities and theme supports, and then save
* the value of the setting.
*
* @since 3.4.0
*
* @return bool False if cap check fails or value isn't set.
* @return false|null False if cap check fails or value isn't set.
*/
public final function save() {
final public function save() {
$value = $this->post_value();
if ( ! $this->check_capabilities() || ! isset( $value ) )
return false;
do_action( 'customize_save_' . $this->id_data[ 'base' ] );
/**
* Fires when the WP_Customize_Setting::save() method is called.
*
* The dynamic portion of the hook name, `$this->id_data['base']` refers to
* the base slug of the setting name.
*
* @since 3.4.0
*
* @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance.
*/
do_action( 'customize_save_' . $this->id_data[ 'base' ], $this );
$this->update( $value );
}
/**
* Fetches, validates, and sanitizes the $_POST value.
* Fetch and sanitize the $_POST value for the setting.
*
* @since 3.4.0
*
* @param mixed $default A default value which is used as a fallback. Default is null.
* @return mixed The default value on failure, otherwise the sanitized value.
*/
public final function post_value( $default = null ) {
if ( isset( $this->_post_value ) )
return $this->_post_value;
$result = $this->manager->post_value( $this );
if ( isset( $result ) )
return $this->_post_value = $result;
else
return $default;
final public function post_value( $default = null ) {
return $this->manager->post_value( $this, $default );
}
/**
@@ -145,11 +280,20 @@ class WP_Customize_Setting {
*/
public function sanitize( $value ) {
$value = wp_unslash( $value );
/**
* Filter a Customize setting value in un-slashed form.
*
* @since 3.4.0
*
* @param mixed $value Value of the setting.
* @param WP_Customize_Setting $this WP_Customize_Setting instance.
*/
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
}
/**
* Set the value of the parameter for a specific theme.
* Save the value of the setting, using the related API.
*
* @since 3.4.0
*
@@ -160,12 +304,24 @@ class WP_Customize_Setting {
switch( $this->type ) {
case 'theme_mod' :
return $this->_update_theme_mod( $value );
break;
case 'option' :
return $this->_update_option( $value );
break;
default :
return do_action( 'customize_update_' . $this->type, $value );
/**
* Fires when the {@see WP_Customize_Setting::update()} method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, `$this->type`, refers to the type of setting.
*
* @since 3.4.0
*
* @param mixed $value Value of the setting.
* @param WP_Customize_Setting $this WP_Customize_Setting instance.
*/
return do_action( 'customize_update_' . $this->type, $value, $this );
}
}
@@ -190,12 +346,12 @@ class WP_Customize_Setting {
}
/**
* Update the theme mod from the value of the parameter.
* Update the option from the value of the setting.
*
* @since 3.4.0
*
* @param mixed $value The value to update.
* @return mixed The result of saving the value.
* @return bool|null The result of saving the value.
*/
protected function _update_option( $value ) {
// Handle non-array option.
@@ -210,13 +366,14 @@ class WP_Customize_Setting {
}
/**
* Fetch the value of the parameter for a specific theme.
* Fetch the value of the setting.
*
* @since 3.4.0
*
* @return mixed The requested value.
* @return mixed The value.
*/
public function value() {
// Get the callback that corresponds to the setting type.
switch( $this->type ) {
case 'theme_mod' :
$function = 'get_theme_mod';
@@ -225,6 +382,20 @@ class WP_Customize_Setting {
$function = 'get_option';
break;
default :
/**
* Filter a Customize setting value not handled as a theme_mod or option.
*
* The dynamic portion of the hook name, `$this->id_date['base']`, refers to
* the base slug of the setting name.
*
* For settings handled as theme_mods or options, see those corresponding
* functions for available hooks.
*
* @since 3.4.0
*
* @param mixed $default The setting default value. Default empty.
*/
return apply_filters( 'customize_value_' . $this->id_data[ 'base' ], $this->default );
}
@@ -238,13 +409,24 @@ class WP_Customize_Setting {
}
/**
* Escape the parameter's value for use in JavaScript.
* Sanitize the setting's value for use in JavaScript.
*
* @since 3.4.0
*
* @return mixed The requested escaped value.
*/
public function js_value() {
/**
* Filter a Customize setting value for use in JavaScript.
*
* The dynamic portion of the hook name, `$this->id`, refers to the setting ID.
*
* @since 3.4.0
*
* @param mixed $value The setting value.
* @param WP_Customize_Setting $this {@see WP_Customize_Setting} instance.
*/
$value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );
if ( is_string( $value ) )
@@ -254,13 +436,13 @@ class WP_Customize_Setting {
}
/**
* Check if the theme supports the setting and check user capabilities.
* Validate user capabilities whether the theme supports the setting.
*
* @since 3.4.0
*
* @return bool False if theme doesn't support the setting or user can't change setting, otherwise true.
*/
public final function check_capabilities() {
final public function check_capabilities() {
if ( $this->capability && ! call_user_func_array( 'current_user_can', (array) $this->capability ) )
return false;
@@ -300,8 +482,15 @@ class WP_Customize_Setting {
$node = &$node[ $key ];
}
if ( $create && ! isset( $node[ $last ] ) )
$node[ $last ] = array();
if ( $create ) {
if ( ! is_array( $node ) ) {
// account for an array overriding a string or object value
$node = array();
}
if ( ! isset( $node[ $last ] ) ) {
$node[ $last ] = array();
}
}
if ( ! isset( $node[ $last ] ) )
return;
@@ -344,7 +533,7 @@ class WP_Customize_Setting {
*
* @param $root
* @param $keys
* @param $default A default value which is used as a fallback. Default is null.
* @param mixed $default A default value which is used as a fallback. Default is null.
* @return mixed The requested value or the default value.
*/
final protected function multidimensional_get( $root, $keys, $default = null ) {
@@ -375,9 +564,9 @@ class WP_Customize_Setting {
*
* Results should be properly handled using another setting or callback.
*
* @package WordPress
* @subpackage Customize
* @since 3.4.0
*
* @see WP_Customize_Setting
*/
class WP_Customize_Filter_Setting extends WP_Customize_Setting {
@@ -392,9 +581,9 @@ class WP_Customize_Filter_Setting extends WP_Customize_Setting {
*
* Results should be properly handled using another setting or callback.
*
* @package WordPress
* @subpackage Customize
* @since 3.4.0
*
* @see WP_Customize_Setting
*/
final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
public $id = 'header_image_data';
@@ -420,16 +609,17 @@ final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
}
/**
* @package WordPress
* @subpackage Customize
* Customizer Background Image Setting class.
*
* @since 3.4.0
*
* @see WP_Customize_Setting
*/
final class WP_Customize_Background_Image_Setting extends WP_Customize_Setting {
public $id = 'background_image_thumb';
/**
* @since 3.4.0
* @uses remove_theme_mod()
*
* @param $value
*/
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+137 -57
View File
@@ -7,15 +7,21 @@
* @since 2.9.0
*/
class WP_Embed {
var $handlers = array();
var $post_ID;
var $usecache = true;
var $linkifunknown = true;
public $handlers = array();
public $post_ID;
public $usecache = true;
public $linkifunknown = true;
/**
* When an URL cannot be embedded, return false instead of returning a link
* or the URL. Bypasses the 'embed_maybe_make_link' filter.
*/
public $return_false_on_fail = false;
/**
* Constructor
*/
function __construct() {
public function __construct() {
// Hack to get the [embed] shortcode to run before wpautop()
add_filter( 'the_content', array( $this, 'run_shortcode' ), 8 );
@@ -25,9 +31,6 @@ class WP_Embed {
// Attempts to embed all URLs in a post
add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
// When a post is saved, invalidate the oEmbed cache
add_action( 'pre_post_update', array( $this, 'delete_oembed_caches' ) );
// After a post is saved, cache oEmbed items via AJAX
add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );
}
@@ -40,14 +43,11 @@ class WP_Embed {
* calls {@link do_shortcode()}, and then re-registers the old shortcodes.
*
* @uses $shortcode_tags
* @uses remove_all_shortcodes()
* @uses add_shortcode()
* @uses do_shortcode()
*
* @param string $content Content to parse
* @return string Content with shortcode parsed
*/
function run_shortcode( $content ) {
public function run_shortcode( $content ) {
global $shortcode_tags;
// Back up current registered shortcodes and clear them all out
@@ -69,19 +69,17 @@ class WP_Embed {
* If a post/page was saved, then output JavaScript to make
* an AJAX request that will call WP_Embed::cache_oembed().
*/
function maybe_run_ajax_cache() {
public function maybe_run_ajax_cache() {
$post = get_post();
if ( ! $post || empty($_GET['message']) || 1 != $_GET['message'] )
if ( ! $post || empty( $_GET['message'] ) )
return;
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery(document).ready(function($){
$.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>");
});
/* ]]> */
</script>
<?php
}
@@ -95,7 +93,7 @@ class WP_Embed {
* @param callback $callback The callback function that will be called if the regex is matched.
* @param int $priority Optional. Used to specify the order in which the registered handlers will be tested (default: 10). Lower numbers correspond with earlier testing, and handlers with the same priority are tested in the order in which they were added to the action.
*/
function register_handler( $id, $regex, $callback, $priority = 10 ) {
public function register_handler( $id, $regex, $callback, $priority = 10 ) {
$this->handlers[$priority][$id] = array(
'regex' => $regex,
'callback' => $callback,
@@ -108,7 +106,7 @@ class WP_Embed {
* @param string $id The handler ID that should be removed.
* @param int $priority Optional. The priority of the handler to be removed (default: 10).
*/
function unregister_handler( $id, $priority = 10 ) {
public function unregister_handler( $id, $priority = 10 ) {
if ( isset($this->handlers[$priority][$id]) )
unset($this->handlers[$priority][$id]);
}
@@ -119,32 +117,32 @@ class WP_Embed {
* Attempts to convert a URL into embed HTML. Starts by checking the URL against the regex of the registered embed handlers.
* If none of the regex matches and it's enabled, then the URL will be given to the {@link WP_oEmbed} class.
*
* @uses wp_oembed_get()
* @uses wp_parse_args()
* @uses wp_embed_defaults()
* @uses WP_Embed::maybe_make_link()
* @uses get_option()
* @uses author_can()
* @uses wp_cache_get()
* @uses wp_cache_set()
* @uses get_post_meta()
* @uses update_post_meta()
* @param array $attr {
* Shortcode attributes. Optional.
*
* @param array $attr Shortcode attributes.
* @type int $width Width of the embed in pixels.
* @type int $height Height of the embed in pixels.
* }
* @param string $url The URL attempting to be embedded.
* @return string The embed HTML on success, otherwise the original URL.
* @return string|false The embed HTML on success, otherwise the original URL.
* `->maybe_make_link()` can return false on failure.
*/
function shortcode( $attr, $url = '' ) {
public function shortcode( $attr, $url = '' ) {
$post = get_post();
if ( empty( $url ) && ! empty( $attr['src'] ) ) {
$url = $attr['src'];
}
if ( empty( $url ) )
return '';
$rawattr = $attr;
$attr = wp_parse_args( $attr, wp_embed_defaults() );
$attr = wp_parse_args( $attr, wp_embed_defaults( $url ) );
// kses converts & into &amp; and we need to undo this
// See http://core.trac.wordpress.org/ticket/11311
// See https://core.trac.wordpress.org/ticket/11311
$url = str_replace( '&amp;', '&', $url );
// Look for known internal handlers
@@ -153,6 +151,17 @@ class WP_Embed {
foreach ( $handlers as $id => $handler ) {
if ( preg_match( $handler['regex'], $url, $matches ) && is_callable( $handler['callback'] ) ) {
if ( false !== $return = call_user_func( $handler['callback'], $matches, $attr, $url, $rawattr ) )
/**
* Filter the returned embed handler.
*
* @since 2.9.0
*
* @see WP_Embed::shortcode()
*
* @param mixed $return The shortcode callback function to call.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
*/
return apply_filters( 'embed_handler_html', $return, $url, $attr );
}
}
@@ -166,29 +175,80 @@ class WP_Embed {
if ( $post_ID ) {
// Check for a cached result (stored in the post meta)
$cachekey = '_oembed_' . md5( $url . serialize( $attr ) );
if ( $this->usecache ) {
$cache = get_post_meta( $post_ID, $cachekey, true );
$key_suffix = md5( $url . serialize( $attr ) );
$cachekey = '_oembed_' . $key_suffix;
$cachekey_time = '_oembed_time_' . $key_suffix;
// Failures are cached
/**
* Filter the oEmbed TTL value (time to live).
*
* @since 4.0.0
*
* @param int $time Time to live (in seconds).
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param int $post_ID Post ID.
*/
$ttl = apply_filters( 'oembed_ttl', DAY_IN_SECONDS, $url, $attr, $post_ID );
$cache = get_post_meta( $post_ID, $cachekey, true );
$cache_time = get_post_meta( $post_ID, $cachekey_time, true );
if ( ! $cache_time ) {
$cache_time = 0;
}
$cached_recently = ( time() - $cache_time ) < $ttl;
if ( $this->usecache || $cached_recently ) {
// Failures are cached. Serve one if we're using the cache.
if ( '{{unknown}}' === $cache )
return $this->maybe_make_link( $url );
if ( ! empty( $cache ) )
if ( ! empty( $cache ) ) {
/**
* Filter the cached oEmbed HTML.
*
* @since 2.9.0
*
* @see WP_Embed::shortcode()
*
* @param mixed $cache The cached HTML result, stored in post meta.
* @param string $url The attempted embed URL.
* @param array $attr An array of shortcode attributes.
* @param int $post_ID Post ID.
*/
return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
}
}
/**
* Filter whether to inspect the given URL for discoverable link tags.
*
* @since 2.9.0
*
* @see WP_oEmbed::discover()
*
* @param bool $enable Whether to enable `<link>` tag discovery. Default false.
*/
$attr['discover'] = ( apply_filters( 'embed_oembed_discover', false ) && author_can( $post_ID, 'unfiltered_html' ) );
// Use oEmbed to get the HTML
$attr['discover'] = ( apply_filters('embed_oembed_discover', false) && author_can( $post_ID, 'unfiltered_html' ) );
$html = wp_oembed_get( $url, $attr );
// Cache the result
$cache = ( $html ) ? $html : '{{unknown}}';
update_post_meta( $post_ID, $cachekey, $cache );
// Maybe cache the result
if ( $html ) {
update_post_meta( $post_ID, $cachekey, $html );
update_post_meta( $post_ID, $cachekey_time, time() );
} elseif ( ! $cache ) {
update_post_meta( $post_ID, $cachekey, '{{unknown}}' );
}
// If there was a result, return it
if ( $html )
if ( $html ) {
/** This filter is documented in wp-includes/class-wp-embed.php */
return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
}
}
// Still unknown
@@ -196,11 +256,11 @@ class WP_Embed {
}
/**
* Delete all oEmbed caches.
* Delete all oEmbed caches. Unused by core as of 4.0.0.
*
* @param int $post_ID Post ID to delete the caches for.
*/
function delete_oembed_caches( $post_ID ) {
public function delete_oembed_caches( $post_ID ) {
$post_metas = get_post_custom_keys( $post_ID );
if ( empty($post_metas) )
return;
@@ -216,14 +276,23 @@ class WP_Embed {
*
* @param int $post_ID Post ID to do the caching for.
*/
function cache_oembed( $post_ID ) {
public function cache_oembed( $post_ID ) {
$post = get_post( $post_ID );
if ( empty($post->ID) || !in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', array( 'post', 'page' ) ) ) )
$post_types = get_post_types( array( 'show_ui' => true ) );
/**
* Filter the array of post types to cache oEmbed results for.
*
* @since 2.9.0
*
* @param array $post_types Array of post types to cache oEmbed results for. Defaults to post types with `show_ui` set to true.
*/
if ( empty( $post->ID ) || ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) ){
return;
}
// Trigger a caching
if ( !empty($post->post_content) ) {
if ( ! empty( $post->post_content ) ) {
$this->post_ID = $post->ID;
$this->usecache = false;
@@ -242,35 +311,46 @@ class WP_Embed {
* @param string $content The content to be searched.
* @return string Potentially modified $content.
*/
function autoembed( $content ) {
return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
public function autoembed( $content ) {
return preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content );
}
/**
* Callback function for {@link WP_Embed::autoembed()}.
*
* @uses WP_Embed::shortcode()
*
* @param array $match A regex match array.
* @return string The embed HTML on success, otherwise the original URL.
*/
function autoembed_callback( $match ) {
public function autoembed_callback( $match ) {
$oldval = $this->linkifunknown;
$this->linkifunknown = false;
$return = $this->shortcode( array(), $match[1] );
$return = $this->shortcode( array(), $match[2] );
$this->linkifunknown = $oldval;
return "\n$return\n";
return $match[1] . $return . $match[3];
}
/**
* Conditionally makes a hyperlink based on an internal class variable.
*
* @param string $url URL to potentially be linked.
* @return string Linked URL or the original URL.
* @return false|string Linked URL or the original URL. False if 'return_false_on_fail' is true.
*/
function maybe_make_link( $url ) {
public function maybe_make_link( $url ) {
if ( $this->return_false_on_fail ) {
return false;
}
$output = ( $this->linkifunknown ) ? '<a href="' . esc_url($url) . '">' . esc_html($url) . '</a>' : $url;
/**
* Filter the returned, maybe-linked embed URL.
*
* @since 2.9.0
*
* @param string $output The linked or original URL.
* @param string $url The original URL.
*/
return apply_filters( 'embed_maybe_make_link', $output, $url );
}
}
+35 -24
View File
@@ -24,37 +24,35 @@ class WP_Error {
*
* @since 2.1.0
* @var array
* @access private
*/
var $errors = array();
public $errors = array();
/**
* Stores the list of data for error codes.
*
* @since 2.1.0
* @var array
* @access private
*/
var $error_data = array();
public $error_data = array();
/**
* Constructor - Sets up error message.
* Initialize the error.
*
* If code parameter is empty then nothing will be done. It is possible to
* add multiple messages to the same code, but with other methods in the
* class.
* If `$code` is empty, the other parameters will be ignored.
* When `$code` is not empty, `$message` will be used even if
* it is empty. The `$data` parameter will be used only if it
* is not empty.
*
* All parameters are optional, but if the code parameter is set, then the
* data parameter is optional.
* Though the class is constructed with a single error code and
* message, multiple codes can be added using the `add()` method.
*
* @since 2.1.0
*
* @param string|int $code Error code
* @param string $message Error message
* @param mixed $data Optional. Error data.
* @return WP_Error
*/
function __construct($code = '', $message = '', $data = '') {
public function __construct( $code = '', $message = '', $data = '' ) {
if ( empty($code) )
return;
@@ -72,7 +70,7 @@ class WP_Error {
*
* @return array List of error codes, if available.
*/
function get_error_codes() {
public function get_error_codes() {
if ( empty($this->errors) )
return array();
@@ -87,7 +85,7 @@ class WP_Error {
*
* @return string|int Empty string, if no error codes.
*/
function get_error_code() {
public function get_error_code() {
$codes = $this->get_error_codes();
if ( empty($codes) )
@@ -104,7 +102,7 @@ class WP_Error {
* @param string|int $code Optional. Retrieve messages matching code, if exists.
* @return array Error strings on success, or empty array on failure (if using code parameter).
*/
function get_error_messages($code = '') {
public function get_error_messages($code = '') {
// Return all messages if no code specified.
if ( empty($code) ) {
$all_messages = array();
@@ -131,7 +129,7 @@ class WP_Error {
* @param string|int $code Optional. Error code to retrieve message.
* @return string
*/
function get_error_message($code = '') {
public function get_error_message($code = '') {
if ( empty($code) )
$code = $this->get_error_code();
$messages = $this->get_error_messages($code);
@@ -148,7 +146,7 @@ class WP_Error {
* @param string|int $code Optional. Error code.
* @return mixed Null, if no errors.
*/
function get_error_data($code = '') {
public function get_error_data($code = '') {
if ( empty($code) )
$code = $this->get_error_code();
@@ -158,7 +156,7 @@ class WP_Error {
}
/**
* Append more error messages to list of error messages.
* Add an error or append additional message to an existing error.
*
* @since 2.1.0
* @access public
@@ -167,7 +165,7 @@ class WP_Error {
* @param string $message Error message.
* @param mixed $data Optional. Error data.
*/
function add($code, $message, $data = '') {
public function add($code, $message, $data = '') {
$this->errors[$code][] = $message;
if ( ! empty($data) )
$this->error_data[$code] = $data;
@@ -183,12 +181,27 @@ class WP_Error {
* @param mixed $data Error data.
* @param string|int $code Error code.
*/
function add_data($data, $code = '') {
public function add_data($data, $code = '') {
if ( empty($code) )
$code = $this->get_error_code();
$this->error_data[$code] = $data;
}
/**
* Removes the specified error.
*
* This function removes all error messages associated with the specified
* error code, along with any error data for that code.
*
* @since 4.1.0
*
* @param string|int $code Error code.
*/
public function remove( $code ) {
unset( $this->errors[ $code ] );
unset( $this->error_data[ $code ] );
}
}
/**
@@ -201,8 +214,6 @@ class WP_Error {
* @param mixed $thing Check if unknown variable is a WP_Error object.
* @return bool True, if WP_Error. False, if not WP_Error.
*/
function is_wp_error($thing) {
if ( is_object($thing) && is_a($thing, 'WP_Error') )
return true;
return false;
function is_wp_error( $thing ) {
return ( $thing instanceof WP_Error );
}
+19 -3
View File
@@ -7,8 +7,19 @@
*
*/
class WP_HTTP_IXR_Client extends IXR_Client {
public $scheme;
/**
* @var IXR_Error
*/
public $error;
function __construct($server, $path = false, $port = false, $timeout = 15) {
/**
* @param string $server
* @param string|bool $path
* @param int|bool $port
* @param int $timeout
*/
public function __construct($server, $path = false, $port = false, $timeout = 15) {
if ( ! $path ) {
// Assume we have been given a URL instead
$bits = parse_url($server);
@@ -18,8 +29,13 @@ class WP_HTTP_IXR_Client extends IXR_Client {
$this->path = !empty($bits['path']) ? $bits['path'] : '/';
// Make absolutely sure we have a path
if ( ! $this->path )
if ( ! $this->path ) {
$this->path = '/';
}
if ( ! empty( $bits['query'] ) ) {
$this->path .= '?' . $bits['query'];
}
} else {
$this->scheme = 'http';
$this->server = $server;
@@ -30,7 +46,7 @@ class WP_HTTP_IXR_Client extends IXR_Client {
$this->timeout = $timeout;
}
function query() {
public function query() {
$args = func_get_args();
$method = array_shift($args);
$request = new IXR_Request($method, $args);
+77 -29
View File
@@ -15,10 +15,12 @@
* @uses WP_Image_Editor Extends class
*/
class WP_Image_Editor_GD extends WP_Image_Editor {
/**
* @var resource
*/
protected $image; // GD Resource
protected $image = false; // GD Resource
function __destruct() {
public function __destruct() {
if ( $this->image ) {
// we don't need the original in memory anymore
imagedestroy( $this->image );
@@ -77,7 +79,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @since 3.5.0
* @access protected
*
* @return boolean|\WP_Error
* @return boolean|WP_Error True if loaded successfully; WP_Error on failure.
*/
public function load() {
if ( $this->image )
@@ -86,8 +88,17 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
return new WP_Error( 'error_loading_image', __('File doesn&#8217;t exist?'), $this->file );
/**
* Filter the memory limit allocated for image manipulation.
*
* @since 3.5.0
*
* @param int|string $limit Maximum memory limit to allocate for images. Default WP_MAX_MEMORY_LIMIT.
* Accepts an integer (bytes), or a shorthand string notation, such as '256M'.
*/
// Set artificially high because GD uses uncompressed images in memory
@ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
$this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
if ( ! is_resource( $this->image ) )
@@ -105,7 +116,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
$this->update_size( $size[0], $size[1] );
$this->mime_type = $size['mime'];
return true;
return $this->set_quality();
}
/**
@@ -131,12 +142,16 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* Resizes current image.
* Wraps _resize, since _resize returns a GD Resource.
*
* At minimum, either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @since 3.5.0
* @access public
*
* @param int $max_w
* @param int $max_h
* @param boolean $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param boolean $crop
* @return boolean|WP_Error
*/
public function resize( $max_w, $max_h, $crop = false ) {
@@ -175,32 +190,50 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
}
/**
* Processes current image and saves to disk
* multiple sizes from single source.
*
* 'width' and 'height' are required.
* 'crop' defaults to false when not provided.
* Resize multiple images from a single source.
*
* @since 3.5.0
* @access public
*
* @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
* @return array
* @param array $sizes {
* An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
*
* Either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @type array $size {
* @type int ['width'] Optional. Image width.
* @type int ['height'] Optional. Image height.
* @type bool ['crop'] Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images' metadata by size.
*/
public function multi_resize( $sizes ) {
$metadata = array();
$orig_size = $this->size;
foreach ( $sizes as $size => $size_data ) {
if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {
continue;
}
if ( ! isset( $size_data['crop'] ) )
if ( ! isset( $size_data['width'] ) ) {
$size_data['width'] = null;
}
if ( ! isset( $size_data['height'] ) ) {
$size_data['height'] = null;
}
if ( ! isset( $size_data['crop'] ) ) {
$size_data['crop'] = false;
}
$image = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
$duplicate = ( ( $orig_size['width'] == $size_data['width'] ) && ( $orig_size['height'] == $size_data['height'] ) );
if( ! is_wp_error( $image ) ) {
if ( ! is_wp_error( $image ) && ! $duplicate ) {
$resized = $this->_save( $image );
imagedestroy( $image );
@@ -223,7 +256,6 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @since 3.5.0
* @access public
*
* @param string|int $src The source file or Attachment ID.
* @param int $src_x The start x position to crop from.
* @param int $src_y The start y position to crop from.
* @param int $src_w The width to crop.
@@ -275,9 +307,12 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
*/
public function rotate( $angle ) {
if ( function_exists('imagerotate') ) {
$rotated = imagerotate( $this->image, $angle, 0 );
$transparency = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 );
$rotated = imagerotate( $this->image, $angle, $transparency );
if ( is_resource( $rotated ) ) {
imagealphablending( $rotated, true );
imagesavealpha( $rotated, true );
imagedestroy( $this->image );
$this->image = $rotated;
$this->update_size();
@@ -323,8 +358,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @since 3.5.0
* @access public
*
* @param string $destfilename
* @param string $mime_type
* @param string|null $filename
* @param string|null $mime_type
* @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string}
*/
public function save( $filename = null, $mime_type = null ) {
@@ -338,6 +373,12 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return $saved;
}
/**
* @param resource $image
* @param string|null $filename
* @param string|null $mime_type
* @return WP_Error|array
*/
protected function _save( $image, $filename = null, $mime_type = null ) {
list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type );
@@ -357,7 +398,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
}
elseif ( 'image/jpeg' == $mime_type ) {
if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, apply_filters( 'jpeg_quality', $this->quality, 'image_resize' ) ) ) )
if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) )
return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
}
else {
@@ -369,12 +410,19 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
$perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
@ chmod( $filename, $perms );
/**
* Filter the name of the saved image file.
*
* @since 2.6.0
*
* @param string $filename Name of the file.
*/
return array(
'path' => $filename,
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],
'mime-type'=> $mime_type,
'path' => $filename,
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],
'mime-type' => $mime_type,
);
}
@@ -398,7 +446,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
return imagegif( $this->image );
default:
header( 'Content-Type: image/jpeg' );
return imagejpeg( $this->image, null, $this->quality );
return imagejpeg( $this->image, null, $this->get_quality() );
}
}
+69 -30
View File
@@ -15,10 +15,12 @@
* @uses WP_Image_Editor Extends class
*/
class WP_Image_Editor_Imagick extends WP_Image_Editor {
/**
* @var Imagick
*/
protected $image; // Imagick Object
protected $image = null; // Imagick Object
function __destruct() {
public function __destruct() {
if ( $this->image instanceof Imagick ) {
// we don't need the original in memory anymore
$this->image->clear();
@@ -119,6 +121,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
return new WP_Error( 'error_loading_image', __('File doesn&#8217;t exist?'), $this->file );
/** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
// Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits
@ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
@@ -139,8 +142,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
}
$updated_size = $this->update_size();
if ( is_wp_error( $updated_size ) )
return $updated_size;
if ( is_wp_error( $updated_size ) ) {
return $updated_size;
}
return $this->set_quality();
}
@@ -152,15 +156,19 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @access public
*
* @param int $quality Compression Quality. Range: [1,100]
* @return boolean|WP_Error
* @return boolean|WP_Error True if set successfully; WP_Error on failure.
*/
public function set_quality( $quality = null ) {
if ( !$quality )
$quality = $this->quality;
$quality_result = parent::set_quality( $quality );
if ( is_wp_error( $quality_result ) ) {
return $quality_result;
} else {
$quality = $this->get_quality();
}
try {
if( 'image/jpeg' == $this->mime_type ) {
$this->image->setImageCompressionQuality( apply_filters( 'jpeg_quality', $quality, 'image_resize' ) );
if ( 'image/jpeg' == $this->mime_type ) {
$this->image->setImageCompressionQuality( $quality );
$this->image->setImageCompression( imagick::COMPRESSION_JPEG );
}
else {
@@ -171,7 +179,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
return new WP_Error( 'image_quality_error', $e->getMessage() );
}
return parent::set_quality( $quality );
return true;
}
/**
@@ -182,6 +190,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
*
* @param int $width
* @param int $height
*
* @return true|WP_Error
*/
protected function update_size( $width = null, $height = null ) {
$size = null;
@@ -206,12 +216,16 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
/**
* Resizes current image.
*
* At minimum, either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @since 3.5.0
* @access public
*
* @param int $max_w
* @param int $max_h
* @param boolean $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param boolean $crop
* @return boolean|WP_Error
*/
public function resize( $max_w, $max_h, $crop = false ) {
@@ -242,17 +256,25 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
}
/**
* Processes current image and saves to disk
* multiple sizes from single source.
*
* 'width' and 'height' are required.
* 'crop' defaults to false when not provided.
* Resize multiple images from a single source.
*
* @since 3.5.0
* @access public
*
* @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
* @return array
* @param array $sizes {
* An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
*
* Either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @type array $size {
* @type int ['width'] Optional. Image width.
* @type int ['height'] Optional. Image height.
* @type bool $crop Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images' metadata by size.
*/
public function multi_resize( $sizes ) {
$metadata = array();
@@ -263,15 +285,25 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
if ( ! $this->image )
$this->image = $orig_image->getImage();
if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {
continue;
}
if ( ! isset( $size_data['crop'] ) )
if ( ! isset( $size_data['width'] ) ) {
$size_data['width'] = null;
}
if ( ! isset( $size_data['height'] ) ) {
$size_data['height'] = null;
}
if ( ! isset( $size_data['crop'] ) ) {
$size_data['crop'] = false;
}
$resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
$duplicate = ( ( $orig_size['width'] == $size_data['width'] ) && ( $orig_size['height'] == $size_data['height'] ) );
if( ! is_wp_error( $resize_result ) ) {
if ( ! is_wp_error( $resize_result ) && ! $duplicate ) {
$resized = $this->_save( $this->image );
$this->image->clear();
@@ -298,7 +330,6 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @since 3.5.0
* @access public
*
* @param string|int $src The source file or Attachment ID.
* @param int $src_x The start x position to crop from.
* @param int $src_y The start y position to crop from.
* @param int $src_w The width to crop.
@@ -352,11 +383,18 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
*/
try {
$this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
// Since this changes the dimensions of the image, update the size.
$result = $this->update_size();
if ( is_wp_error( $result ) )
return $result;
$this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 );
}
catch ( Exception $e ) {
return new WP_Error( 'image_rotate_error', $e->getMessage() );
}
return $this->update_size();
return true;
}
/**
@@ -436,11 +474,12 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
$perms = $stat['mode'] & 0000666; //same permissions as parent folder, strip off the executable bits
@ chmod( $filename, $perms );
/** This filter is documented in wp-includes/class-wp-image-editor-gd.php */
return array(
'path' => $filename,
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],
'path' => $filename,
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],
'mime-type' => $mime_type,
);
}
+103 -21
View File
@@ -16,7 +16,8 @@ abstract class WP_Image_Editor {
protected $size = null;
protected $mime_type = null;
protected $default_mime_type = 'image/jpeg';
protected $quality = 90;
protected $quality = false;
protected $default_quality = 90;
/**
* Each instance handles a single file.
@@ -82,30 +83,38 @@ abstract class WP_Image_Editor {
/**
* Resizes current image.
*
* At minimum, either a height or width must be provided.
* If one of the two is set to null, the resize will
* maintain aspect ratio according to the provided dimension.
*
* @since 3.5.0
* @access public
* @abstract
*
* @param int $max_w
* @param int $max_h
* @param boolean $crop
* @param int|null $max_w Image width.
* @param int|null $max_h Image height.
* @param boolean $crop
* @return boolean|WP_Error
*/
abstract public function resize( $max_w, $max_h, $crop = false );
/**
* Processes current image and saves to disk
* multiple sizes from single source.
*
* 'width' and 'height' are required.
* 'crop' defaults to false when not provided.
* Resize multiple images from a single source.
*
* @since 3.5.0
* @access public
* @abstract
*
* @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
* @return array
* @param array $sizes {
* An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
*
* @type array $size {
* @type int $width Image width.
* @type int $height Image height.
* @type bool $crop Optional. Whether to crop the image. Default false.
* }
* }
* @return array An array of resized images metadata by size.
*/
abstract public function multi_resize( $sizes );
@@ -116,7 +125,6 @@ abstract class WP_Image_Editor {
* @access public
* @abstract
*
* @param string|int $src The source file or Attachment ID.
* @param int $src_x The start x position to crop from.
* @param int $src_y The start y position to crop from.
* @param int $src_w The width to crop.
@@ -185,6 +193,7 @@ abstract class WP_Image_Editor {
*
* @param int $width
* @param int $height
* @return true
*/
protected function update_size( $width = null, $height = null ) {
$this->size = array(
@@ -194,6 +203,22 @@ abstract class WP_Image_Editor {
return true;
}
/**
* Gets the Image Compression quality on a 1-100% scale.
*
* @since 4.0.0
* @access public
*
* @return int $quality Compression Quality. Range: [1,100]
*/
public function get_quality() {
if ( ! $this->quality ) {
$this->set_quality();
}
return $this->quality;
}
/**
* Sets Image Compression quality on a 1-100% scale.
*
@@ -201,12 +226,61 @@ abstract class WP_Image_Editor {
* @access public
*
* @param int $quality Compression Quality. Range: [1,100]
* @return boolean
* @return boolean|WP_Error True if set successfully; WP_Error on failure.
*/
public function set_quality( $quality ) {
$this->quality = apply_filters( 'wp_editor_set_quality', $quality );
public function set_quality( $quality = null ) {
if ( null === $quality ) {
/**
* Filter the default image compression quality setting.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
*
* set_quality() has priority over the filter.
*
* @since 3.5.0
*
* @param int $quality Quality level between 1 (low) and 100 (high).
* @param string $mime_type Image mime type.
*/
$quality = apply_filters( 'wp_editor_set_quality', $this->default_quality, $this->mime_type );
return ( (bool) $this->quality );
if ( 'image/jpeg' == $this->mime_type ) {
/**
* Filter the JPEG compression quality for backward-compatibility.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
*
* set_quality() has priority over the filter.
*
* The filter is evaluated under two contexts: 'image_resize', and 'edit_image',
* (when a JPEG image is saved to file).
*
* @since 2.5.0
*
* @param int $quality Quality level between 0 (low) and 100 (high) of the JPEG.
* @param string $context Context of the filter.
*/
$quality = apply_filters( 'jpeg_quality', $quality, 'image_resize' );
}
if ( $quality < 0 || $quality > 100 ) {
$quality = $this->default_quality;
}
}
// Allow 0, but squash to 1 due to identical images in GD, and for backwards compatibility.
if ( 0 === $quality ) {
$quality = 1;
}
if ( ( $quality >= 1 ) && ( $quality <= 100 ) ) {
$this->quality = $quality;
return true;
} else {
return new WP_Error( 'invalid_image_quality', __('Attempted to set image quality outside of the range [1,100].') );
}
}
/**
@@ -225,8 +299,7 @@ abstract class WP_Image_Editor {
* @return array { filename|null, extension, mime-type }
*/
protected function get_output_format( $filename = null, $mime_type = null ) {
$new_ext = $file_ext = null;
$file_mime = null;
$new_ext = null;
// By default, assume specified type takes priority
if ( $mime_type ) {
@@ -253,6 +326,15 @@ abstract class WP_Image_Editor {
// Double-check that the mime-type selected is supported by the editor.
// If not, choose a default instead.
if ( ! $this->supports_mime_type( $mime_type ) ) {
/**
* Filter default mime type prior to getting the file extension.
*
* @see wp_get_mime_types()
*
* @since 3.5.0
*
* @param string $mime_type Mime type string.
*/
$mime_type = apply_filters( 'image_editor_default_mime_type', $this->default_mime_type );
$new_ext = $this->get_extension( $mime_type );
}
@@ -306,7 +388,7 @@ abstract class WP_Image_Editor {
* @since 3.5.0
* @access public
*
* @return string suffix
* @return false|string suffix
*/
public function get_suffix() {
if ( ! $this->get_size() )
@@ -330,8 +412,8 @@ abstract class WP_Image_Editor {
if ( $stream = wp_is_stream( $filename ) ) {
ob_start();
} else {
// The directory containing the original file may no longer exist when using a replication plugin.
wp_mkdir_p( dirname( $filename ) );
// The directory containing the original file may no longer exist when using a replication plugin.
wp_mkdir_p( dirname( $filename ) );
}
$result = call_user_func_array( $function, $arguments );
+54 -17
View File
@@ -43,6 +43,16 @@ final class WP_Theme implements ArrayAccess {
'twentyeleven' => 'Twenty Eleven',
'twentytwelve' => 'Twenty Twelve',
'twentythirteen' => 'Twenty Thirteen',
'twentyfourteen' => 'Twenty Fourteen',
'twentyfifteen' => 'Twenty Fifteen',
);
/**
* Renamed theme tags.
*/
private static $tag_map = array(
'fixed-width' => 'fixed-layout',
'flexible-width' => 'fluid-layout',
);
/**
@@ -170,6 +180,7 @@ final class WP_Theme implements ArrayAccess {
// Initialize caching on first run.
if ( ! isset( self::$persistently_cache ) ) {
/** This action is documented in wp-includes/theme.php */
self::$persistently_cache = apply_filters( 'wp_cache_themes_persistently', false, 'WP_Theme' );
if ( self::$persistently_cache ) {
wp_cache_add_global_groups( 'themes' );
@@ -206,7 +217,7 @@ final class WP_Theme implements ArrayAccess {
} elseif ( ! file_exists( $this->theme_root . '/' . $theme_file ) ) {
$this->headers['Name'] = $this->stylesheet;
if ( ! file_exists( $this->theme_root . '/' . $this->stylesheet ) )
$this->errors = new WP_Error( 'theme_not_found', __( 'The theme directory does not exist.' ) );
$this->errors = new WP_Error( 'theme_not_found', sprintf( __( 'The theme directory "%s" does not exist.' ), $this->stylesheet ) );
else
$this->errors = new WP_Error( 'theme_no_stylesheet', __( 'Stylesheet is missing.' ) );
$this->template = $this->stylesheet;
@@ -263,7 +274,7 @@ final class WP_Theme implements ArrayAccess {
// Set the parent, if we're a child theme.
if ( $this->template != $this->stylesheet ) {
// If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
if ( is_a( $_child, 'WP_Theme' ) && $_child->template == $this->stylesheet ) {
if ( $_child instanceof WP_Theme && $_child->template == $this->stylesheet ) {
$_child->parent = null;
$_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
$_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
@@ -525,7 +536,7 @@ final class WP_Theme implements ArrayAccess {
* @since 3.4.0
*
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
* @return string String on success, false on failure.
* @return string|bool String on success, false on failure.
*/
public function get( $header ) {
if ( ! isset( $this->headers[ $header ] ) )
@@ -561,10 +572,13 @@ final class WP_Theme implements ArrayAccess {
* @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
* @param bool $markup Optional. Whether to mark up the header. Defaults to true.
* @param bool $translate Optional. Whether to translate the header. Defaults to true.
* @return string Processed header, false on failure.
* @return string|bool Processed header, false on failure.
*/
public function display( $header, $markup = true, $translate = true ) {
$value = $this->get( $header );
if ( false === $value ) {
return false;
}
if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) )
$translate = false;
@@ -622,6 +636,9 @@ final class WP_Theme implements ArrayAccess {
case 'Tags' :
$value = array_filter( array_map( 'trim', explode( ',', strip_tags( $value ) ) ) );
break;
case 'Version' :
$value = strip_tags( $value );
break;
}
return $value;
@@ -649,10 +666,7 @@ final class WP_Theme implements ArrayAccess {
break;
case 'Author' :
if ( $this->get('AuthorURI') ) {
static $attr = null;
if ( ! isset( $attr ) )
$attr = esc_attr__( 'Visit author homepage' );
$value = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $this->display( 'AuthorURI', true, $translate ), $attr, $value );
$value = sprintf( '<a href="%1$s">%2$s</a>', $this->display( 'AuthorURI', true, $translate ), $value );
} elseif ( ! $value ) {
$value = __( 'Anonymous' );
}
@@ -705,12 +719,15 @@ final class WP_Theme implements ArrayAccess {
}
foreach ( $value as &$tag ) {
if ( isset( $tags_list[ $tag ] ) )
if ( isset( $tags_list[ $tag ] ) ) {
$tag = $tags_list[ $tag ];
} elseif ( isset( self::$tag_map[ $tag ] ) ) {
$tag = $tags_list[ self::$tag_map[ $tag ] ];
}
}
return $value;
break;
default :
$value = translate( $value, $this->get('TextDomain') );
}
@@ -841,8 +858,6 @@ final class WP_Theme implements ArrayAccess {
* for all other URLs returned by WP_Theme, so we pass it to the public function
* get_theme_root_uri() and allow it to run the theme_root_uri filter.
*
* @uses get_theme_root_uri()
*
* @since 3.4.0
* @access public
*
@@ -918,9 +933,10 @@ final class WP_Theme implements ArrayAccess {
* @since 3.4.0
* @access public
*
* @param WP_Post|null $post Optional. The post being edited, provided for context.
* @return array Array of page templates, keyed by filename, with the value of the translated header name.
*/
public function get_page_templates() {
public function get_page_templates( $post = null ) {
// If you screw up your current theme and we invalidate your parent, most things still work. Let it slide.
if ( $this->errors() && $this->errors()->get_error_codes() !== array( 'theme_parent_invalid' ) )
return array();
@@ -948,9 +964,23 @@ final class WP_Theme implements ArrayAccess {
}
if ( $this->parent() )
$page_templates += $this->parent()->get_page_templates();
$page_templates += $this->parent()->get_page_templates( $post );
return $page_templates;
/**
* Filter list of page templates for a theme.
*
* This filter does not currently allow for page templates to be added.
*
* @since 3.9.0
*
* @param array $page_templates Array of page templates. Keys are filenames,
* values are translated names.
* @param WP_Theme $this The theme object.
* @param WP_Post|null $post The post being edited, provided for context, or null.
*/
$return = apply_filters( 'theme_page_templates', $page_templates, $this, $post );
return array_intersect_assoc( $return, $page_templates );
}
/**
@@ -1006,8 +1036,8 @@ final class WP_Theme implements ArrayAccess {
* @since 3.4.0
* @access public
*
* @return True if the textdomain was successfully loaded or has already been loaded. False if
* no textdomain was specified in the file headers, or if the domain could not be loaded.
* @return bool True if the textdomain was successfully loaded or has already been loaded.
* False if no textdomain was specified in the file headers, or if the domain could not be loaded.
*/
public function load_textdomain() {
if ( isset( $this->textdomain_loaded ) )
@@ -1074,6 +1104,13 @@ final class WP_Theme implements ArrayAccess {
* @return array Array of stylesheet names.
*/
public static function get_allowed( $blog_id = null ) {
/**
* Filter the array of themes allowed on the site or network.
*
* @since MU
*
* @param array $allowed_themes An array of theme stylesheet names.
*/
$network = (array) apply_filters( 'allowed_themes', self::get_allowed_on_network() );
return $network + self::get_allowed_on_site( $blog_id );
}
+90 -71
View File
@@ -2,14 +2,13 @@
/**
* A class for displaying various tree-like structures.
*
* Extend the Walker class to use it, see examples at the below. Child classes
* Extend the Walker class to use it, see examples below. Child classes
* do not need to implement all of the abstract methods in the class. The child
* only needs to implement the methods that are needed. Also, the methods are
* not strictly abstract in that the parameter definition needs to be followed.
* The child classes can have additional parameters.
* only needs to implement the methods that are needed.
*
* @since 2.1.0
*
* @package WordPress
* @since 2.1.0
* @abstract
*/
class Walker {
@@ -17,83 +16,98 @@ class Walker {
* What the class handles.
*
* @since 2.1.0
* @var string
* @access public
* @var string
*/
var $tree_type;
public $tree_type;
/**
* DB fields to use.
*
* @since 2.1.0
* @var array
* @access protected
*/
var $db_fields;
public $db_fields;
/**
* Max number of pages walked by the paged walker
*
* @since 2.7.0
* @var int
* @access protected
*/
var $max_pages = 1;
public $max_pages = 1;
/**
* Whether the current element has children or not.
*
* To be used in start_el().
*
* @since 4.0.0
* @var bool
*/
public $has_children;
/**
* Starts the list before the elements are added.
*
* Additional parameters are used in child classes. The args parameter holds
* additional values that may be used with the child class methods. This
* method is called at the start of the output list.
* The $args parameter holds additional values that may be used with the child
* class methods. This method is called at the start of the output list.
*
* @since 2.1.0
* @abstract
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of the item.
* @param array $args An array of additional arguments.
*/
function start_lvl( &$output, $depth = 0, $args = array() ) {}
public function start_lvl( &$output, $depth = 0, $args = array() ) {}
/**
* Ends the list of after the elements are added.
*
* Additional parameters are used in child classes. The args parameter holds
* additional values that may be used with the child class methods. This
* method finishes the list at the end of output of the elements.
* The $args parameter holds additional values that may be used with the child
* class methods. This method finishes the list at the end of output of the elements.
*
* @since 2.1.0
* @abstract
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of the item.
* @param array $args An array of additional arguments.
*/
function end_lvl( &$output, $depth = 0, $args = array() ) {}
public function end_lvl( &$output, $depth = 0, $args = array() ) {}
/**
* Start the element output.
*
* Additional parameters are used in child classes. The args parameter holds
* additional values that may be used with the child class methods. Includes
* the element output also.
* The $args parameter holds additional values that may be used with the child
* class methods. Includes the element output also.
*
* @since 2.1.0
* @abstract
*
* @param string $output Passed by reference. Used to append additional content.
* @param string $output Passed by reference. Used to append additional content.
* @param object $object The data object.
* @param int $depth Depth of the item.
* @param array $args An array of additional arguments.
* @param int $current_object_id ID of the current item.
*/
function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {}
/**
* Ends the element output, if needed.
*
* Additional parameters are used in child classes. The args parameter holds
* additional values that may be used with the child class methods.
* The $args parameter holds additional values that may be used with the child class methods.
*
* @since 2.1.0
* @abstract
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $object The data object.
* @param int $depth Depth of the item.
* @param array $args An array of additional arguments.
*/
function end_el( &$output, $object, $depth = 0, $args = array() ) {}
public function end_el( &$output, $object, $depth = 0, $args = array() ) {}
/**
* Traverse elements to create list from elements.
@@ -103,33 +117,35 @@ class Walker {
* depth and no ignore elements under that depth. It is possible to set the
* max depth to include all depths, see walk() method.
*
* This method shouldn't be called directly, use the walk() method instead.
* This method should not be called directly, use the walk() method instead.
*
* @since 2.5.0
*
* @param object $element Data object
* @param array $children_elements List of elements to continue traversing.
* @param int $max_depth Max depth to traverse.
* @param int $depth Depth of current element.
* @param array $args
* @param string $output Passed by reference. Used to append additional content.
* @param object $element Data object.
* @param array $children_elements List of elements to continue traversing.
* @param int $max_depth Max depth to traverse.
* @param int $depth Depth of current element.
* @param array $args An array of arguments.
* @param string $output Passed by reference. Used to append additional content.
* @return null Null on failure with no changes to parameters.
*/
function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
if ( !$element )
return;
$id_field = $this->db_fields['id'];
$id = $element->$id_field;
//display this element
if ( isset( $args[0] ) && is_array( $args[0] ) )
$args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
$this->has_children = ! empty( $children_elements[ $id ] );
if ( isset( $args[0] ) && is_array( $args[0] ) ) {
$args[0]['has_children'] = $this->has_children; // Backwards compatibility.
}
$cb_args = array_merge( array(&$output, $element, $depth), $args);
call_user_func_array(array($this, 'start_el'), $cb_args);
$id = $element->$id_field;
// descend only when the depth is right and there are childrens for this element
if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
@@ -160,18 +176,19 @@ class Walker {
/**
* Display array of elements hierarchically.
*
* It is a generic function which does not assume any existing order of
* elements. max_depth = -1 means flatly display every element. max_depth =
* 0 means display all levels. max_depth > 0 specifies the number of
* display levels.
* Does not assume any existing order of elements.
*
* $max_depth = -1 means flatly display every element.
* $max_depth = 0 means display all levels.
* $max_depth > 0 specifies the number of display levels.
*
* @since 2.1.0
*
* @param array $elements
* @param int $max_depth
* @return string
* @param array $elements An array of elements.
* @param int $max_depth The maximum hierarchical depth.
* @return string The hierarchical item output.
*/
function walk( $elements, $max_depth) {
public function walk( $elements, $max_depth) {
$args = array_slice(func_get_args(), 2);
$output = '';
@@ -182,7 +199,6 @@ class Walker {
if (empty($elements)) //nothing to walk
return $output;
$id_field = $this->db_fields['id'];
$parent_field = $this->db_fields['parent'];
// flat display
@@ -194,10 +210,10 @@ class Walker {
}
/*
* need to display in hierarchical order
* separate elements into two buckets: top level and children elements
* children_elements is two dimensional array, eg.
* children_elements[10][] contains all sub-elements whose parent is 10.
* Need to display in hierarchical order.
* Separate elements into two buckets: top level and children elements.
* Children_elements is two dimensional array, eg.
* Children_elements[10][] contains all sub-elements whose parent is 10.
*/
$top_level_elements = array();
$children_elements = array();
@@ -209,8 +225,8 @@ class Walker {
}
/*
* when none of the elements is top level
* assume the first one must be root of the sub elements
* When none of the elements is top level.
* Assume the first one must be root of the sub elements.
*/
if ( empty($top_level_elements) ) {
@@ -231,8 +247,8 @@ class Walker {
$this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
/*
* if we are displaying all levels, and remaining children_elements is not empty,
* then we got orphans, which should be displayed regardless
* If we are displaying all levels, and remaining children_elements is not empty,
* then we got orphans, which should be displayed regardless.
*/
if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
$empty_array = array();
@@ -251,13 +267,16 @@ class Walker {
* and number of elements per page, this function first determines all top level root elements
* belonging to that page, then lists them and all of their children in hierarchical order.
*
* @package WordPress
* @since 2.7
* @param int $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels.
* @param int $page_num the specific page number, beginning with 1.
* @return XHTML of the specified page of elements
* $max_depth = 0 means display all levels.
* $max_depth > 0 specifies the number of display levels.
*
* @since 2.7.0
*
* @param int $max_depth The maximum hierarchical depth.
* @param int $page_num The specific page number, beginning with 1.
* @return string XHTML of the specified page of elements
*/
function paged_walk( $elements, $max_depth, $page_num, $per_page ) {
public function paged_walk( $elements, $max_depth, $page_num, $per_page ) {
/* sanity check */
if ( empty($elements) || $max_depth < -1 )
@@ -266,7 +285,6 @@ class Walker {
$args = array_slice( func_get_args(), 4 );
$output = '';
$id_field = $this->db_fields['id'];
$parent_field = $this->db_fields['parent'];
$count = -1;
@@ -309,9 +327,9 @@ class Walker {
}
/*
* separate elements into two buckets: top level and children elements
* children_elements is two dimensional array, eg.
* children_elements[10][] contains all sub-elements whose parent is 10.
* Separate elements into two buckets: top level and children elements.
* Children_elements is two dimensional array, e.g.
* $children_elements[10][] contains all sub-elements whose parent is 10.
*/
$top_level_elements = array();
$children_elements = array();
@@ -342,7 +360,7 @@ class Walker {
foreach ( $top_level_elements as $e ) {
$count++;
//for the last page, need to unset earlier children in order to keep track of orphans
// For the last page, need to unset earlier children in order to keep track of orphans.
if ( $end >= $total_top && $count < $start )
$this->unset_children( $e, $children_elements );
@@ -365,7 +383,7 @@ class Walker {
return $output;
}
function get_number_of_root_elements( $elements ){
public function get_number_of_root_elements( $elements ){
$num = 0;
$parent_field = $this->db_fields['parent'];
@@ -377,8 +395,8 @@ class Walker {
return $num;
}
// unset all the children for a given top level element
function unset_children( $e, &$children_elements ){
// Unset all the children for a given top level element.
public function unset_children( $e, &$children_elements ){
if ( !$e || !$children_elements )
return;
@@ -394,4 +412,5 @@ class Walker {
unset( $children_elements[$id] );
}
}
} // Walker
File diff suppressed because it is too large. Load diff
+137 -68
View File
@@ -15,7 +15,7 @@ class WP {
* @access public
* @var array
*/
var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
public $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type');
/**
* Private query variables.
@@ -25,7 +25,7 @@ class WP {
* @since 2.0.0
* @var array
*/
var $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent__in', 'post_parent__not_in' );
public $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in' );
/**
* Extra query variables set by the user.
@@ -33,7 +33,7 @@ class WP {
* @since 2.1.0
* @var array
*/
var $extra_query_vars = array();
public $extra_query_vars = array();
/**
* Query variables for setting up the WordPress Query Loop.
@@ -41,7 +41,7 @@ class WP {
* @since 2.0.0
* @var array
*/
var $query_vars;
public $query_vars;
/**
* String parsed to set the query variables.
@@ -49,7 +49,7 @@ class WP {
* @since 2.0.0
* @var string
*/
var $query_string;
public $query_string;
/**
* Permalink or requested URI.
@@ -57,7 +57,7 @@ class WP {
* @since 2.0.0
* @var string
*/
var $request;
public $request;
/**
* Rewrite rule the request matched.
@@ -65,7 +65,7 @@ class WP {
* @since 2.0.0
* @var string
*/
var $matched_rule;
public $matched_rule;
/**
* Rewrite query the request matched.
@@ -73,7 +73,7 @@ class WP {
* @since 2.0.0
* @var string
*/
var $matched_query;
public $matched_query;
/**
* Whether already did the permalink.
@@ -81,7 +81,7 @@ class WP {
* @since 2.0.0
* @var bool
*/
var $did_permalink = false;
public $did_permalink = false;
/**
* Add name to list of public query variables.
@@ -90,7 +90,7 @@ class WP {
*
* @param string $qv Query variable name.
*/
function add_query_var($qv) {
public function add_query_var($qv) {
if ( !in_array($qv, $this->public_query_vars) )
$this->public_query_vars[] = $qv;
}
@@ -103,7 +103,7 @@ class WP {
* @param string $key Query variable name.
* @param mixed $value Query variable value.
*/
function set_query_var($key, $value) {
public function set_query_var($key, $value) {
$this->query_vars[$key] = $value;
}
@@ -117,20 +117,29 @@ class WP {
*
* @param array|string $extra_query_vars Set the extra query variables.
*/
function parse_request($extra_query_vars = '') {
public function parse_request($extra_query_vars = '') {
global $wp_rewrite;
/**
* Filter whether to parse the request.
*
* @since 3.5.0
*
* @param bool $bool Whether or not to parse the request. Default true.
* @param WP $this Current WordPress environment instance.
* @param array|string $extra_query_vars Extra passed query variables.
*/
if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) )
return;
$this->query_vars = array();
$post_type_query_vars = array();
if ( is_array($extra_query_vars) )
if ( is_array( $extra_query_vars ) ) {
$this->extra_query_vars = & $extra_query_vars;
else if (! empty($extra_query_vars))
parse_str($extra_query_vars, $this->extra_query_vars);
} elseif ( ! empty( $extra_query_vars ) ) {
parse_str( $extra_query_vars, $this->extra_query_vars );
}
// Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
// Fetch the rewrite rules.
@@ -141,22 +150,13 @@ class WP {
$error = '404';
$this->did_permalink = true;
if ( isset($_SERVER['PATH_INFO']) )
$pathinfo = $_SERVER['PATH_INFO'];
else
$pathinfo = '';
$pathinfo_array = explode('?', $pathinfo);
$pathinfo = str_replace("%", "%25", $pathinfo_array[0]);
$req_uri = $_SERVER['REQUEST_URI'];
$req_uri_array = explode('?', $req_uri);
$req_uri = $req_uri_array[0];
$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
list( $pathinfo ) = explode( '?', $pathinfo );
$pathinfo = str_replace( "%", "%25", $pathinfo );
list( $req_uri ) = explode( '?', $_SERVER['REQUEST_URI'] );
$self = $_SERVER['PHP_SELF'];
$home_path = parse_url(home_url());
if ( isset($home_path['path']) )
$home_path = $home_path['path'];
else
$home_path = '';
$home_path = trim($home_path, '/');
$home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
// Trim path info from the end and the leading home path from the
// front. For path info requests, this leaves us with the requesting
@@ -205,7 +205,7 @@ class WP {
preg_match("#^$match#", urldecode($request_match), $matches) ) {
if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
// this is a verbose page match, lets check to be sure about it
// This is a verbose page match, let's check to be sure about it.
if ( ! get_page_by_path( $matches[ $varmatch[1] ] ) )
continue;
}
@@ -245,9 +245,20 @@ class WP {
}
}
$this->public_query_vars = apply_filters('query_vars', $this->public_query_vars);
/**
* Filter the query variables whitelist before processing.
*
* Allows (publicly allowed) query vars to be added, removed, or changed prior
* to executing the query. Needed to allow custom rewrite rules using your own arguments
* to work, or any other custom query variables you want to be publicly available.
*
* @since 1.5.0
*
* @param array $public_query_vars The array of whitelisted query variables.
*/
$this->public_query_vars = apply_filters( 'query_vars', $this->public_query_vars );
foreach ( $GLOBALS['wp_post_types'] as $post_type => $t )
foreach ( get_post_types( array(), 'objects' ) as $post_type => $t )
if ( $t->query_var )
$post_type_query_vars[$t->query_var] = $post_type;
@@ -280,7 +291,7 @@ class WP {
}
// Convert urldecoded spaces back into +
foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t )
foreach ( get_taxonomies( array() , 'objects' ) as $taxonomy => $t )
if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) )
$this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
@@ -303,9 +314,23 @@ class WP {
if ( isset($error) )
$this->query_vars['error'] = $error;
$this->query_vars = apply_filters('request', $this->query_vars);
/**
* Filter the array of parsed query variables.
*
* @since 2.1.0
*
* @param array $query_vars The array of requested query variables.
*/
$this->query_vars = apply_filters( 'request', $this->query_vars );
do_action_ref_array('parse_request', array(&$this));
/**
* Fires once all query variables for the current request have been parsed.
*
* @since 2.1.0
*
* @param WP &$this Current WordPress environment instance (passed by reference).
*/
do_action_ref_array( 'parse_request', array( &$this ) );
}
/**
@@ -316,7 +341,7 @@ class WP {
*
* @since 2.0.0
*/
function send_headers() {
public function send_headers() {
$headers = array('X-Pingback' => get_bloginfo('pingback_url'));
$status = null;
$exit_required = false;
@@ -332,11 +357,12 @@ class WP {
} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
$exit_required = true;
}
} else if ( empty($this->query_vars['feed']) ) {
} elseif ( empty( $this->query_vars['feed'] ) ) {
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
} else {
// We're showing a feed, so WP is indeed the only thing that last changed
if ( !empty($this->query_vars['withcomments'])
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|| ( empty($this->query_vars['withoutcomments'])
&& ( !empty($this->query_vars['p'])
|| !empty($this->query_vars['name'])
@@ -374,7 +400,15 @@ class WP {
}
}
$headers = apply_filters('wp_headers', $headers, $this);
/**
* Filter the HTTP headers before they're sent to the browser.
*
* @since 2.8.0
*
* @param array $headers The list of headers to be sent.
* @param WP $this Current WordPress environment instance.
*/
$headers = apply_filters( 'wp_headers', $headers, $this );
if ( ! empty( $status ) )
status_header( $status );
@@ -404,7 +438,14 @@ class WP {
if ( $exit_required )
exit();
do_action_ref_array('send_headers', array(&$this));
/**
* Fires once the requested HTTP headers for caching, content type, etc. have been sent.
*
* @since 2.1.0
*
* @param WP &$this Current WordPress environment instance (passed by reference).
*/
do_action_ref_array( 'send_headers', array( &$this ) );
}
/**
@@ -415,7 +456,7 @@ class WP {
*
* @since 2.0.0
*/
function build_query_string() {
public function build_query_string() {
$this->query_string = '';
foreach ( (array) array_keys($this->query_vars) as $wpvar) {
if ( '' != $this->query_vars[$wpvar] ) {
@@ -426,9 +467,16 @@ class WP {
}
}
// query_string filter deprecated. Use request filter instead.
if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in.
$this->query_string = apply_filters('query_string', $this->query_string);
if ( has_filter( 'query_string' ) ) { // Don't bother filtering and parsing if no plugins are hooked in.
/**
* Filter the query string before parsing.
*
* @since 1.5.0
* @deprecated 2.1.0 Use 'query_vars' or 'request' filters instead.
*
* @param string $query_string The query string to modify.
*/
$this->query_string = apply_filters( 'query_string', $this->query_string );
parse_str($this->query_string, $this->query_vars);
}
}
@@ -441,27 +489,35 @@ class WP {
* WordPress environment.
*
* @global string $query_string Query string for the loop.
* @global array $posts The found posts.
* @global WP_Post|null $post The current post, if available.
* @global string $request The SQL statement for the request.
* @global int $more Only set, if single page or post.
* @global int $single If single page or post. Only set, if single page or post.
* @global WP_User $authordata Only set, if author archive.
*
* @since 2.0.0
*/
function register_globals() {
public function register_globals() {
global $wp_query;
// Extract updated query vars back into global namespace.
foreach ( (array) $wp_query->query_vars as $key => $value) {
$GLOBALS[$key] = $value;
foreach ( (array) $wp_query->query_vars as $key => $value ) {
$GLOBALS[ $key ] = $value;
}
$GLOBALS['query_string'] = $this->query_string;
$GLOBALS['posts'] = & $wp_query->posts;
$GLOBALS['post'] = (isset($wp_query->post)) ? $wp_query->post : null;
$GLOBALS['post'] = isset( $wp_query->post ) ? $wp_query->post : null;
$GLOBALS['request'] = $wp_query->request;
if ( is_single() || is_page() ) {
$GLOBALS['more'] = 1;
if ( $wp_query->is_single() || $wp_query->is_page() ) {
$GLOBALS['more'] = 1;
$GLOBALS['single'] = 1;
}
if ( $wp_query->is_author() && isset( $wp_query->post ) )
$GLOBALS['authordata'] = get_userdata( $wp_query->post->post_author );
}
/**
@@ -469,24 +525,23 @@ class WP {
*
* @since 2.0.0
*/
function init() {
public function init() {
wp_get_current_user();
}
/**
* Set up the Loop based on the query variables.
*
* @uses WP::$query_vars
* @since 2.0.0
*/
function query_posts() {
public function query_posts() {
global $wp_the_query;
$this->build_query_string();
$wp_the_query->query($this->query_vars);
}
/**
* Set the Headers for 404, if nothing is found for requested URL.
* Set the Headers for 404, if nothing is found for requested URL.
*
* Issue a 404 if a request doesn't match any posts and doesn't match
* any object (e.g. an existing-but-empty category, tag, author) and a 404 was not already
@@ -496,7 +551,7 @@ class WP {
*
* @since 2.0.0
*/
function handle_404() {
public function handle_404() {
global $wp_query;
// If we've already issued a 404, bail.
@@ -512,14 +567,21 @@ class WP {
// We will 404 for paged queries, as no posts were found.
if ( ! is_paged() ) {
// Don't 404 for authors without posts as long as they matched an author on this site.
$author = get_query_var( 'author' );
if ( is_author() && is_numeric( $author ) && $author > 0 && is_user_member_of_blog( $author ) ) {
status_header( 200 );
return;
}
// Don't 404 for these queries if they matched an object.
if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() ) {
if ( ( is_tag() || is_category() || is_tax() || is_post_type_archive() ) && get_queried_object() ) {
status_header( 200 );
return;
}
// Don't 404 for these queries either.
if ( is_home() || is_search() ) {
if ( is_home() || is_search() || is_feed() ) {
status_header( 200 );
return;
}
@@ -542,14 +604,22 @@ class WP {
*
* @param string|array $query_args Passed to {@link parse_request()}
*/
function main($query_args = '') {
public function main($query_args = '') {
$this->init();
$this->parse_request($query_args);
$this->send_headers();
$this->query_posts();
$this->handle_404();
$this->register_globals();
do_action_ref_array('wp', array(&$this));
/**
* Fires once the WordPress environment has been set up.
*
* @since 2.1.0
*
* @param WP &$this Current WordPress environment instance (passed by reference).
*/
do_action_ref_array( 'wp', array( &$this ) );
}
}
@@ -566,7 +636,7 @@ class WP_MatchesMapRegex {
* @access private
* @var array
*/
var $_matches;
private $_matches;
/**
* store for mapping result
@@ -574,7 +644,7 @@ class WP_MatchesMapRegex {
* @access public
* @var string
*/
var $output;
public $output;
/**
* subject to perform mapping on (query string containing $matches[] references
@@ -582,23 +652,22 @@ class WP_MatchesMapRegex {
* @access private
* @var string
*/
var $_subject;
private $_subject;
/**
* regexp pattern to match $matches[] references
*
* @var string
*/
var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number
public $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number
/**
* constructor
*
* @param string $subject subject if regex
* @param array $matches data to use in map
* @return self
*/
function WP_MatchesMapRegex($subject, $matches) {
public function __construct($subject, $matches) {
$this->_subject = $subject;
$this->_matches = $matches;
$this->output = $this->_map();
@@ -625,7 +694,7 @@ class WP_MatchesMapRegex {
* @access private
* @return string
*/
function _map() {
private function _map() {
$callback = array($this, 'callback');
return preg_replace_callback($this->_pattern, $callback, $this->_subject);
}
@@ -637,7 +706,7 @@ class WP_MatchesMapRegex {
* @param array $matches preg_replace regexp matches
* @return string
*/
function callback($matches) {
public function callback($matches) {
$index = intval(substr($matches[0], 9, -1));
return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' );
}
+321 -73
View File
@@ -1,51 +1,124 @@
<?php
/**
* BackPress Scripts enqueue.
* BackPress Scripts enqueue
*
* These classes were refactored from the WordPress WP_Scripts and WordPress
* script enqueue API.
* Classes were refactored from the WP_Scripts and WordPress script enqueue API.
*
* @package BackPress
* @since r74
*/
/**
* BackPress enqueued dependiences class.
* @since BackPress r74
*
* @package BackPress
* @uses _WP_Dependency
* @since r74
*/
class WP_Dependencies {
var $registered = array();
var $queue = array();
var $to_do = array();
var $done = array();
var $args = array();
var $groups = array();
var $group = 0;
/**
* An array of registered handle objects.
*
* @access public
* @since 2.6.8
* @var array
*/
public $registered = array();
/**
* Do the dependencies
* An array of queued _WP_Dependency handle objects.
*
* Process the items passed to it or the queue. Processes all dependencies.
*
* @param mixed $handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
* @return array Items that have been processed
* @access public
* @since 2.6.8
* @var array
*/
function do_items( $handles = false, $group = false ) {
// Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
public $queue = array();
/**
* An array of _WP_Dependency handle objects to queue.
*
* @access public
* @since 2.6.0
* @var array
*/
public $to_do = array();
/**
* An array of _WP_Dependency handle objects already queued.
*
* @access public
* @since 2.6.0
* @var array
*/
public $done = array();
/**
* An array of additional arguments passed when a handle is registered.
*
* Arguments are appended to the item query string.
*
* @access public
* @since 2.6.0
* @var array
*/
public $args = array();
/**
* An array of handle groups to enqueue.
*
* @access public
* @since 2.8.0
* @var array
*/
public $groups = array();
/**
* A handle group to enqueue.
*
* @access public
* @since 2.8.0
* @var int
*/
public $group = 0;
/**
* Process the items and dependencies.
*
* Processes the items passed to it or the queue, and their dependencies.
*
* @access public
* @since 2.1.0
*
* @param mixed $handles Optional. Items to be processed: Process queue (false), process item (string), process items (array of strings).
* @param mixed $group Group level: level (int), no groups (false).
* @return array Handles of items that have been processed.
*/
public function do_items( $handles = false, $group = false ) {
/*
* If nothing is passed, print the queue. If a string is passed,
* print that item. If an array is passed, print those items.
*/
$handles = false === $handles ? $this->queue : (array) $handles;
$this->all_deps( $handles );
foreach( $this->to_do as $key => $handle ) {
if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) {
if ( ! $this->registered[$handle]->src ) { // Defines a group.
/*
* A single item may alias a set of items, by having dependencies,
* but no source. Queuing the item queues the dependencies.
*
* Example: The extending class WP_Scripts is used to register 'scriptaculous' as a set of registered handles:
* <code>add( 'scriptaculous', false, array( 'scriptaculous-dragdrop', 'scriptaculous-slider', 'scriptaculous-controls' ) );</code>
*
* The src property is false.
*/
if ( ! $this->registered[$handle]->src ) {
$this->done[] = $handle;
continue;
}
/*
* Attempt to process the item. If successful,
* add the handle to the done array.
*
* Unset the item from the to_do array.
*/
if ( $this->do_item( $handle, $group ) )
$this->done[] = $handle;
@@ -56,20 +129,34 @@ class WP_Dependencies {
return $this->done;
}
function do_item( $handle ) {
/**
* Process a dependency.
*
* @access public
* @since 2.6.0
*
* @param string $handle Name of the item. Should be unique.
* @return bool True on success, false if not set.
*/
public function do_item( $handle ) {
return isset($this->registered[$handle]);
}
/**
* Determines dependencies
* Determine dependencies.
*
* Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.
* Recursively builds an array of items to process taking
* dependencies into account. Does NOT catch infinite loops.
*
* @access public
* @since 2.1.0
*
* @param mixed $handles Accepts (string) dep name or (array of strings) dep names
* @param bool $recursion Used internally when function calls itself
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
* @param bool $recursion Internal flag that function is calling itself.
* @param mixed $group Group level: (int) level, (false) no groups.
* @return bool True on success, false on failure.
*/
function all_deps( $handles, $recursion = false, $group = false ) {
public function all_deps( $handles, $recursion = false, $group = false ) {
if ( !$handles = (array) $handles )
return false;
@@ -88,20 +175,20 @@ class WP_Dependencies {
$keep_going = true;
if ( !isset($this->registered[$handle]) )
$keep_going = false; // Script doesn't exist
$keep_going = false; // Item doesn't exist.
elseif ( $this->registered[$handle]->deps && array_diff($this->registered[$handle]->deps, array_keys($this->registered)) )
$keep_going = false; // Script requires deps which don't exist (not a necessary check. efficiency?)
$keep_going = false; // Item requires dependencies that don't exist.
elseif ( $this->registered[$handle]->deps && !$this->all_deps( $this->registered[$handle]->deps, true, $group ) )
$keep_going = false; // Script requires deps which don't exist
$keep_going = false; // Item requires dependencies that don't exist.
if ( !$keep_going ) { // Either script or its deps don't exist.
if ( ! $keep_going ) { // Either item or its dependencies don't exist.
if ( $recursion )
return false; // Abort this branch.
else
continue; // We're at the top level. Move on to the next one.
}
if ( $queued ) // Already grobbed it and its deps
if ( $queued ) // Already grabbed it and its dependencies.
continue;
if ( isset($handle_parts[1]) )
@@ -114,17 +201,21 @@ class WP_Dependencies {
}
/**
* Adds item
* Register an item.
*
* Adds the item only if no item of that name already exists
* Registers the item if no item of that name already exists.
*
* @param string $handle Script name
* @param string $src Script url
* @param array $deps (optional) Array of script names on which this script depends
* @param string $ver (optional) Script version (used for cache busting)
* @return array Hierarchical array of dependencies
* @access public
* @since 2.1.0
*
* @param string $handle Unique item name.
* @param string $src The item url.
* @param array $deps Optional. An array of item handle strings on which this item depends.
* @param string $ver Optional. Version (used for cache busting).
* @param mixed $args Optional. Custom property of the item. NOT the class property $args. Examples: $media, $in_footer.
* @return bool True on success, false on failure.
*/
function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
public function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
if ( isset($this->registered[$handle]) )
return false;
$this->registered[$handle] = new _WP_Dependency( $handle, $src, $deps, $ver, $args );
@@ -132,16 +223,19 @@ class WP_Dependencies {
}
/**
* Adds extra data
* Add extra item data.
*
* Adds data only if script has already been added.
* Adds data to a registered item.
*
* @param string $handle Script name
* @param string $key
* @param mixed $value
* @return bool success
* @access public
* @since 2.6.0
*
* @param string $handle Name of the item. Should be unique.
* @param string $key The data key.
* @param mixed $value The data value.
* @return bool True on success, false on failure.
*/
function add_data( $handle, $key, $value ) {
public function add_data( $handle, $key, $value ) {
if ( !isset( $this->registered[$handle] ) )
return false;
@@ -149,17 +243,18 @@ class WP_Dependencies {
}
/**
* Get extra data
* Get extra item data.
*
* Gets data associated with a certain handle.
* Gets data associated with a registered item.
*
* @since WP 3.3
* @access public
* @since 3.3.0
*
* @param string $handle Script name
* @param string $key
* @return mixed
* @param string $handle Name of the item. Should be unique.
* @param string $key The data key.
* @return mixed Extra item data (string), false otherwise.
*/
function get_data( $handle, $key ) {
public function get_data( $handle, $key ) {
if ( !isset( $this->registered[$handle] ) )
return false;
@@ -169,12 +264,34 @@ class WP_Dependencies {
return $this->registered[$handle]->extra[$key];
}
function remove( $handles ) {
/**
* Un-register an item or items.
*
* @access public
* @since 2.1.0
*
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
* @return void
*/
public function remove( $handles ) {
foreach ( (array) $handles as $handle )
unset($this->registered[$handle]);
}
function enqueue( $handles ) {
/**
* Queue an item or items.
*
* Decodes handles and arguments, then queues handles and stores
* arguments in the class property $args. For example in extending
* classes, $args is appended to the item url as a query string.
* Note $args is NOT the $args property of items in the $registered array.
*
* @access public
* @since 2.1.0
*
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
*/
public function enqueue( $handles ) {
foreach ( (array) $handles as $handle ) {
$handle = explode('?', $handle);
if ( !in_array($handle[0], $this->queue) && isset($this->registered[$handle[0]]) ) {
@@ -185,7 +302,18 @@ class WP_Dependencies {
}
}
function dequeue( $handles ) {
/**
* Dequeue an item or items.
*
* Decodes handles and arguments, then dequeues handles
* and removes arguments from the class property $args.
*
* @access public
* @since 2.1.0
*
* @param mixed $handles Item handle and argument (string) or item handles and arguments (array of strings).
*/
public function dequeue( $handles ) {
foreach ( (array) $handles as $handle ) {
$handle = explode('?', $handle);
$key = array_search($handle[0], $this->queue);
@@ -196,8 +324,42 @@ class WP_Dependencies {
}
}
/**
* Recursively search the passed dependency tree for $handle
*
* @since 4.0.0
*
* @param array $queue An array of queued _WP_Dependency handle objects.
* @param string $handle Name of the item. Should be unique.
* @return boolean Whether the handle is found after recursively searching the dependency tree.
*/
protected function recurse_deps( $queue, $handle ) {
foreach ( $queue as $queued ) {
if ( ! isset( $this->registered[ $queued ] ) ) {
continue;
}
function query( $handle, $list = 'registered' ) {
if ( in_array( $handle, $this->registered[ $queued ]->deps ) ) {
return true;
} elseif ( $this->recurse_deps( $this->registered[ $queued ]->deps, $handle ) ) {
return true;
}
}
return false;
}
/**
* Query list for an item.
*
* @access public
* @since 2.1.0
*
* @param string $handle Name of the item. Should be unique.
* @param string $list Property name of list array.
* @return bool Found, or object Item data.
*/
public function query( $handle, $list = 'registered' ) {
switch ( $list ) {
case 'registered' :
case 'scripts': // back compat
@@ -207,7 +369,10 @@ class WP_Dependencies {
case 'enqueued' :
case 'queue' :
return in_array( $handle, $this->queue );
if ( in_array( $handle, $this->queue ) ) {
return true;
}
return $this->recurse_deps( $this->queue, $handle );
case 'to_do' :
case 'to_print': // back compat
@@ -220,7 +385,18 @@ class WP_Dependencies {
return false;
}
function set_group( $handle, $recursion, $group ) {
/**
* Set item group, unless already in a lower group.
*
* @access public
* @since 2.8.0
*
* @param string $handle Name of the item. Should be unique.
* @param bool $recursion Internal flag that calling function was called recursively.
* @param mixed $group Group level.
* @return bool Not already in the group or a lower group
*/
public function set_group( $handle, $recursion, $group ) {
$group = (int) $group;
if ( $recursion )
@@ -235,27 +411,99 @@ class WP_Dependencies {
return true;
}
}
} // WP_Dependencies
/**
* Class _WP_Dependency
*
* Helper class to register a handle and associated data.
*
* @access private
* @since 2.6.0
*/
class _WP_Dependency {
var $handle;
var $src;
var $deps = array();
var $ver = false;
var $args = null;
/**
* The handle name.
*
* @access public
* @since 2.6.0
* @var null
*/
public $handle;
var $extra = array();
/**
* The handle source.
*
* @access public
* @since 2.6.0
* @var null
*/
public $src;
function __construct() {
/**
* An array of handle dependencies.
*
* @access public
* @since 2.6.0
* @var array
*/
public $deps = array();
/**
* The handle version.
*
* Used for cache-busting.
*
* @access public
* @since 2.6.0
* @var bool|string
*/
public $ver = false;
/**
* Additional arguments for the handle.
*
* @access public
* @since 2.6.0
* @var null
*/
public $args = null; // Custom property, such as $in_footer or $media.
/**
* Extra data to supply to the handle.
*
* @access public
* @since 2.6.0
* @var array
*/
public $extra = array();
/**
* Setup dependencies.
*
* @since 2.6.0
*/
public function __construct() {
@list( $this->handle, $this->src, $this->deps, $this->ver, $this->args ) = func_get_args();
if ( ! is_array($this->deps) )
$this->deps = array();
}
function add_data( $name, $data ) {
/**
* Add handle data.
*
* @access public
* @since 2.6.0
*
* @param string $name The data key to add.
* @param mixed $data The data value to add.
* @return bool False if not scalar, true otherwise.
*/
public function add_data( $name, $data ) {
if ( !is_scalar($name) )
return false;
$this->extra[$name] = $data;
return true;
}
}
} // _WP_Dependencies
+113 -46
View File
@@ -17,48 +17,57 @@
* @since r16
*/
class WP_Scripts extends WP_Dependencies {
var $base_url; // Full URL with trailing slash
var $content_url;
var $default_version;
var $in_footer = array();
var $concat = '';
var $concat_version = '';
var $do_concat = false;
var $print_html = '';
var $print_code = '';
var $ext_handles = '';
var $ext_version = '';
var $default_dirs;
public $base_url; // Full URL with trailing slash
public $content_url;
public $default_version;
public $in_footer = array();
public $concat = '';
public $concat_version = '';
public $do_concat = false;
public $print_html = '';
public $print_code = '';
public $ext_handles = '';
public $ext_version = '';
public $default_dirs;
function __construct() {
public function __construct() {
$this->init();
add_action( 'init', array( $this, 'init' ), 0 );
}
function init() {
public function init() {
/**
* Fires when the WP_Scripts instance is initialized.
*
* @since 2.6.0
*
* @param WP_Scripts &$this WP_Scripts instance, passed by reference.
*/
do_action_ref_array( 'wp_default_scripts', array(&$this) );
}
/**
* Prints scripts
* Prints scripts.
*
* Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
*
* @param mixed $handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
* @param int $group (optional) If scripts were queued in groups prints this group number.
* @return array Scripts that have been printed
* @param mixed $handles Optional. Scripts to be printed. (void) prints queue, (string) prints
* that script, (array of strings) prints those scripts. Default false.
* @param int $group Optional. If scripts were queued in groups prints this group number.
* Default false.
* @return array Scripts that have been printed.
*/
function print_scripts( $handles = false, $group = false ) {
public function print_scripts( $handles = false, $group = false ) {
return $this->do_items( $handles, $group );
}
// Deprecated since 3.3, see print_extra_script()
function print_scripts_l10n( $handle, $echo = true ) {
public function print_scripts_l10n( $handle, $echo = true ) {
_deprecated_function( __FUNCTION__, '3.3', 'print_extra_script()' );
return $this->print_extra_script( $handle, $echo );
}
function print_extra_script( $handle, $echo = true ) {
public function print_extra_script( $handle, $echo = true ) {
if ( !$output = $this->get_data( $handle, 'data' ) )
return;
@@ -74,7 +83,7 @@ class WP_Scripts extends WP_Dependencies {
return true;
}
function do_item( $handle, $group = false ) {
public function do_item( $handle, $group = false ) {
if ( !parent::do_item($handle) )
return false;
@@ -86,19 +95,37 @@ class WP_Scripts extends WP_Dependencies {
if ( false === $group && in_array($handle, $this->in_footer, true) )
$this->in_footer = array_diff( $this->in_footer, (array) $handle );
if ( null === $this->registered[$handle]->ver )
$obj = $this->registered[$handle];
if ( null === $obj->ver ) {
$ver = '';
else
$ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version;
} else {
$ver = $obj->ver ? $obj->ver : $this->default_version;
}
if ( isset($this->args[$handle]) )
$ver = $ver ? $ver . '&amp;' . $this->args[$handle] : $this->args[$handle];
$src = $this->registered[$handle]->src;
$src = $obj->src;
$cond_before = $cond_after = '';
$conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : '';
if ( $conditional ) {
$cond_before = "<!--[if {$conditional}]>\n";
$cond_after = "<![endif]-->\n";
}
if ( $this->do_concat ) {
/**
* Filter the script loader source.
*
* @since 2.2.0
*
* @param string $src Script loader source path.
* @param string $handle Script handle.
*/
$srce = apply_filters( 'script_loader_src', $src, $handle );
if ( $this->in_default_dir($srce) ) {
if ( $this->in_default_dir( $srce ) && ! $conditional ) {
$this->print_code .= $this->print_extra_script( $handle, false );
$this->concat .= "$handle,";
$this->concat_version .= "$handle$ver";
@@ -109,20 +136,49 @@ class WP_Scripts extends WP_Dependencies {
}
}
$has_conditional_data = $conditional && $this->get_data( $handle, 'data' );
if ( $has_conditional_data ) {
echo $cond_before;
}
$this->print_extra_script( $handle );
if ( !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
if ( $has_conditional_data ) {
echo $cond_after;
}
if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) {
$src = $this->base_url . $src;
}
if ( !empty($ver) )
$src = add_query_arg('ver', $ver, $src);
if ( ! empty( $ver ) )
$src = add_query_arg( 'ver', $ver, $src );
/** This filter is documented in wp-includes/class.wp-scripts.php */
$src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) );
if ( $this->do_concat )
$this->print_html .= "<script type='text/javascript' src='$src'></script>\n";
else
echo "<script type='text/javascript' src='$src'></script>\n";
if ( ! $src )
return true;
$tag = "{$cond_before}<script type='text/javascript' src='$src'></script>\n{$cond_after}";
/**
* Filter the HTML script tag of an enqueued script.
*
* @since 4.1.0
*
* @param string $tag The `<script>` tag for the enqueued script.
* @param string $handle The script's registered handle.
* @param string $src The script's source URL.
*/
$tag = apply_filters( 'script_loader_tag', $tag, $handle, $src );
if ( $this->do_concat ) {
$this->print_html .= $tag;
} else {
echo $tag;
}
return true;
}
@@ -132,7 +188,7 @@ class WP_Scripts extends WP_Dependencies {
*
* Localizes only if the script has already been added
*/
function localize( $handle, $object_name, $l10n ) {
public function localize( $handle, $object_name, $l10n ) {
if ( $handle === 'jquery' )
$handle = 'jquery-core';
@@ -148,7 +204,7 @@ class WP_Scripts extends WP_Dependencies {
$l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
}
$script = "var $object_name = " . json_encode($l10n) . ';';
$script = "var $object_name = " . wp_json_encode( $l10n ) . ';';
if ( !empty($after) )
$script .= "\n$after;";
@@ -161,7 +217,7 @@ class WP_Scripts extends WP_Dependencies {
return $this->add_data( $handle, 'data', $script );
}
function set_group( $handle, $recursion, $group = false ) {
public function set_group( $handle, $recursion, $group = false ) {
if ( $this->registered[$handle]->args === 1 )
$grp = 1;
@@ -174,38 +230,49 @@ class WP_Scripts extends WP_Dependencies {
return parent::set_group( $handle, $recursion, $grp );
}
function all_deps( $handles, $recursion = false, $group = false ) {
public function all_deps( $handles, $recursion = false, $group = false ) {
$r = parent::all_deps( $handles, $recursion );
if ( !$recursion )
if ( ! $recursion ) {
/**
* Filter the list of script dependencies left to print.
*
* @since 2.3.0
*
* @param array $to_do An array of script dependencies.
*/
$this->to_do = apply_filters( 'print_scripts_array', $this->to_do );
}
return $r;
}
function do_head_items() {
public function do_head_items() {
$this->do_items(false, 0);
return $this->done;
}
function do_footer_items() {
public function do_footer_items() {
$this->do_items(false, 1);
return $this->done;
}
function in_default_dir($src) {
if ( ! $this->default_dirs )
public function in_default_dir( $src ) {
if ( ! $this->default_dirs ) {
return true;
}
if ( 0 === strpos( $src, '/wp-includes/js/l10n' ) )
if ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) {
return false;
}
foreach ( (array) $this->default_dirs as $test ) {
if ( 0 === strpos($src, $test) )
if ( 0 === strpos( $src, $test ) ) {
return true;
}
}
return false;
}
function reset() {
public function reset() {
$this->do_concat = false;
$this->print_code = '';
$this->concat = '';
+116 -38
View File
@@ -17,22 +17,33 @@
* @since r74
*/
class WP_Styles extends WP_Dependencies {
var $base_url;
var $content_url;
var $default_version;
var $text_direction = 'ltr';
var $concat = '';
var $concat_version = '';
var $do_concat = false;
var $print_html = '';
var $print_code = '';
var $default_dirs;
public $base_url;
public $content_url;
public $default_version;
public $text_direction = 'ltr';
public $concat = '';
public $concat_version = '';
public $do_concat = false;
public $print_html = '';
public $print_code = '';
public $default_dirs;
function __construct() {
public function __construct() {
/**
* Fires when the WP_Styles instance is initialized.
*
* @since 2.6.0
*
* @param WP_Styles &$this WP_Styles instance, passed by reference.
*/
do_action_ref_array( 'wp_default_styles', array(&$this) );
}
function do_item( $handle ) {
/**
* @param string $handle
* @return bool
*/
public function do_item( $handle ) {
if ( !parent::do_item($handle) )
return false;
@@ -62,90 +73,157 @@ class WP_Styles extends WP_Dependencies {
$media = 'all';
$href = $this->_css_href( $obj->src, $ver, $handle );
if ( empty( $href ) ) {
// Turns out there is nothing to print.
return true;
}
$rel = isset($obj->extra['alt']) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';
$title = isset($obj->extra['title']) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
$end_cond = $tag = '';
if ( isset($obj->extra['conditional']) && $obj->extra['conditional'] ) {
$tag .= "<!--[if {$obj->extra['conditional']}]>\n";
$end_cond = "<![endif]-->\n";
}
$tag .= apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
/**
* Filter the HTML link tag of an enqueued style.
*
* @since 2.6.0
*
* @param string The link tag for the enqueued style.
* @param string $handle The style's registered handle.
*/
$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
if ( is_bool( $obj->extra['rtl'] ) ) {
if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
$suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
$rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $obj->src , $ver, "$handle-rtl" ));
} else {
$rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" );
}
$tag .= apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
/** This filter is documented in wp-includes/class.wp-styles.php */
$rtl_tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle );
if ( $obj->extra['rtl'] === 'replace' ) {
$tag = $rtl_tag;
} else {
$tag .= $rtl_tag;
}
}
$tag .= $end_cond;
$conditional_pre = $conditional_post = '';
if ( isset( $obj->extra['conditional'] ) && $obj->extra['conditional'] ) {
$conditional_pre = "<!--[if {$obj->extra['conditional']}]>\n";
$conditional_post = "<![endif]-->\n";
}
if ( $this->do_concat ) {
$this->print_html .= $conditional_pre;
$this->print_html .= $tag;
$this->print_html .= $this->print_inline_style( $handle, false );
if ( $inline_style = $this->print_inline_style( $handle, false ) ) {
$this->print_html .= sprintf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $inline_style );
}
$this->print_html .= $conditional_post;
} else {
echo $conditional_pre;
echo $tag;
$this->print_inline_style( $handle );
echo $conditional_post;
}
return true;
}
function add_inline_style( $handle, $code ) {
if ( !$code )
/**
* @param string $handle
* @param string $code
*/
public function add_inline_style( $handle, $code ) {
if ( ! $code ) {
return false;
}
$after = $this->get_data( $handle, 'after' );
if ( !$after )
if ( ! $after ) {
$after = array();
}
$after[] = $code;
return $this->add_data( $handle, 'after', $after );
}
function print_inline_style( $handle, $echo = true ) {
/**
* @param string $handle
* @param bool $echo
* @return bool
*/
public function print_inline_style( $handle, $echo = true ) {
$output = $this->get_data( $handle, 'after' );
if ( empty( $output ) )
if ( empty( $output ) ) {
return false;
}
$output = implode( "\n", $output );
if ( !$echo )
if ( ! $echo ) {
return $output;
}
echo "<style type='text/css'>\n";
echo "$output\n";
echo "</style>\n";
printf( "<style id='%s-inline-css' type='text/css'>\n%s\n</style>\n", esc_attr( $handle ), $output );
return true;
}
function all_deps( $handles, $recursion = false, $group = false ) {
/**
* @param mixed $handles
* @param bool $recursion
* @param mixed $group
* @return bool
*/
public function all_deps( $handles, $recursion = false, $group = false ) {
$r = parent::all_deps( $handles, $recursion );
if ( !$recursion )
if ( !$recursion ) {
/**
* Filter the array of enqueued styles before processing for output.
*
* @since 2.6.0
*
* @param array $to_do The list of enqueued styles about to be processed.
*/
$this->to_do = apply_filters( 'print_styles_array', $this->to_do );
}
return $r;
}
function _css_href( $src, $ver, $handle ) {
/**
* @param string $src
* @param string $ver
* @param string $handle
* @return string
*/
public function _css_href( $src, $ver, $handle ) {
if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
$src = $this->base_url . $src;
}
if ( !empty($ver) )
$src = add_query_arg('ver', $ver, $src);
/**
* Filter an enqueued style's fully-qualified URL.
*
* @since 2.6.0
*
* @param string $src The source URL of the enqueued style.
* @param string $handle The style's registered handle.
*/
$src = apply_filters( 'style_loader_src', $src, $handle );
return esc_url( $src );
}
function in_default_dir($src) {
/**
* @param string $src
* @return bool
*/
public function in_default_dir($src) {
if ( ! $this->default_dirs )
return true;
@@ -156,12 +234,12 @@ class WP_Styles extends WP_Dependencies {
return false;
}
function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
public function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
$this->do_items(false, 1);
return $this->done;
}
function reset() {
public function reset() {
$this->do_concat = false;
$this->concat = '';
$this->concat_version = '';
File diff suppressed because it is too large. Load diff
+1357 -377
View File
File diff suppressed because it is too large. Load diff
+65 -12
View File
@@ -13,25 +13,43 @@ if ( !function_exists('_') ) {
}
}
if ( !function_exists('mb_substr') ):
function mb_substr( $str, $start, $length=null, $encoding=null ) {
return _mb_substr($str, $start, $length, $encoding);
if ( ! function_exists( 'mb_substr' ) ) :
function mb_substr( $str, $start, $length = null, $encoding = null ) {
return _mb_substr( $str, $start, $length, $encoding );
}
endif;
function _mb_substr( $str, $start, $length=null, $encoding=null ) {
// the solution below, works only for utf-8, so in case of a different
// charset, just use built-in substr
function _mb_substr( $str, $start, $length = null, $encoding = null ) {
// The solution below works only for UTF-8,
// so in case of a different charset just use built-in substr()
$charset = get_option( 'blog_charset' );
if ( !in_array( $charset, array('utf8', 'utf-8', 'UTF8', 'UTF-8') ) ) {
return is_null( $length )? substr( $str, $start ) : substr( $str, $start, $length);
if ( ! in_array( $charset, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
return is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );
}
// use the regex unicode support to separate the UTF-8 characters into an array
// Use the regex unicode support to separate the UTF-8 characters into an array
preg_match_all( '/./us', $str, $match );
$chars = is_null( $length )? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
$chars = is_null( $length ) ? array_slice( $match[0], $start ) : array_slice( $match[0], $start, $length );
return implode( '', $chars );
}
if ( ! function_exists( 'mb_strlen' ) ) :
function mb_strlen( $str, $encoding = null ) {
return _mb_strlen( $str, $encoding );
}
endif;
function _mb_strlen( $str, $encoding = null ) {
// The solution below works only for UTF-8,
// so in case of a different charset just use built-in strlen()
$charset = get_option( 'blog_charset' );
if ( ! in_array( $charset, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) ) ) {
return strlen( $str );
}
// Use the regex unicode support to separate the UTF-8 characters into an array
preg_match_all( '/./us', $str, $match );
return count( $match[0] );
}
if ( !function_exists('hash_hmac') ):
function hash_hmac($algo, $data, $key, $raw_output = false) {
return _hash_hmac($algo, $data, $key, $raw_output);
@@ -65,7 +83,7 @@ if ( !function_exists('json_encode') ) {
function json_encode( $string ) {
global $wp_json;
if ( !is_a($wp_json, 'Services_JSON') ) {
if ( ! ( $wp_json instanceof Services_JSON ) ) {
require_once( ABSPATH . WPINC . '/class-json.php' );
$wp_json = new Services_JSON();
}
@@ -78,7 +96,7 @@ if ( !function_exists('json_decode') ) {
function json_decode( $string, $assoc_array = false ) {
global $wp_json;
if ( !is_a($wp_json, 'Services_JSON') ) {
if ( ! ($wp_json instanceof Services_JSON ) ) {
require_once( ABSPATH . WPINC . '/class-json.php' );
$wp_json = new Services_JSON();
}
@@ -94,3 +112,38 @@ if ( !function_exists('json_decode') ) {
return is_array($data) ? array_map(__FUNCTION__, $data) : $data;
}
}
if ( ! function_exists( 'hash_equals' ) ) :
/**
* Compare two strings in constant time.
*
* This function was added in PHP 5.6.
* It can leak the length of a string.
*
* @since 3.9.2
*
* @param string $a Expected string.
* @param string $b Actual string.
* @return bool Whether strings are equal.
*/
function hash_equals( $a, $b ) {
$a_length = strlen( $a );
if ( $a_length !== strlen( $b ) ) {
return false;
}
$result = 0;
// Do not attempt to "optimize" this.
for ( $i = 0; $i < $a_length; $i++ ) {
$result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );
}
return $result === 0;
}
endif;
// JSON_PRETTY_PRINT was introduced in PHP 5.4
// Defined here to prevent a notice when using it with wp_json_encode()
if ( ! defined( 'JSON_PRETTY_PRINT' ) ) {
define( 'JSON_PRETTY_PRINT', 128 );
}
+88 -32
View File
@@ -13,21 +13,29 @@
* WordPress site, if the schedule time has passed.
*
* @since 2.1.0
* @link http://codex.wordpress.org/Function_Reference/wp_schedule_single_event
* @link https://codex.wordpress.org/Function_Reference/wp_schedule_single_event
*
* @param int $timestamp Timestamp for when to run the event.
* @param string $hook Action hook to execute when cron is run.
* @param array $args Optional. Arguments to pass to the hook's callback function.
*/
function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
// don't schedule a duplicate if there's already an identical event due in the next 10 minutes
// don't schedule a duplicate if there's already an identical event due within 10 minutes of it
$next = wp_next_scheduled($hook, $args);
if ( $next && $next <= $timestamp + 10 * MINUTE_IN_SECONDS )
if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) {
return;
}
$crons = _get_cron_array();
$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );
$event = apply_filters('schedule_event', $event);
/**
* Filter a single event before it is scheduled.
*
* @since 3.1.0
*
* @param object $event An object containing an event's data.
*/
$event = apply_filters( 'schedule_event', $event );
// A plugin disallowed this event
if ( ! $event )
@@ -58,7 +66,7 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
* @param string $recurrence How often the event should recur.
* @param string $hook Action hook to execute when cron is run.
* @param array $args Optional. Arguments to pass to the hook's callback function.
* @return bool|null False on failure, null when complete with scheduling event.
* @return false|null False on failure, null when complete with scheduling event.
*/
function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
$crons = _get_cron_array();
@@ -68,7 +76,8 @@ function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
return false;
$event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
$event = apply_filters('schedule_event', $event);
/** This filter is documented in wp-includes/cron.php */
$event = apply_filters( 'schedule_event', $event );
// A plugin disallowed this event
if ( ! $event )
@@ -90,30 +99,34 @@ function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
* @param string $recurrence How often the event should recur.
* @param string $hook Action hook to execute when cron is run.
* @param array $args Optional. Arguments to pass to the hook's callback function.
* @return bool|null False on failure. Null when event is rescheduled.
* @return false|null False on failure. Null when event is rescheduled.
*/
function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) {
function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
$crons = _get_cron_array();
$schedules = wp_get_schedules();
$key = md5(serialize($args));
$key = md5( serialize( $args ) );
$interval = 0;
// First we try to get it from the schedule
if ( 0 == $interval )
$interval = $schedules[$recurrence]['interval'];
if ( isset( $schedules[ $recurrence ] ) ) {
$interval = $schedules[ $recurrence ]['interval'];
}
// Now we try to get it from the saved interval in case the schedule disappears
if ( 0 == $interval )
$interval = $crons[$timestamp][$hook][$key]['interval'];
if ( 0 == $interval ) {
$interval = $crons[ $timestamp ][ $hook ][ $key ]['interval'];
}
// Now we assume something is wrong and fail to schedule
if ( 0 == $interval )
if ( 0 == $interval ) {
return false;
}
$now = time();
if ( $timestamp >= $now )
if ( $timestamp >= $now ) {
$timestamp = $now + $interval;
else
$timestamp = $now + ($interval - (($now - $timestamp) % $interval));
} else {
$timestamp = $now + ( $interval - ( ( $now - $timestamp ) % $interval ) );
}
wp_schedule_event( $timestamp, $recurrence, $hook, $args );
}
@@ -160,8 +173,19 @@ function wp_clear_scheduled_hook( $hook, $args = array() ) {
$args = array_slice( func_get_args(), 1 );
}
while ( $timestamp = wp_next_scheduled( $hook, $args ) )
wp_unschedule_event( $timestamp, $hook, $args );
// This logic duplicates wp_next_scheduled()
// It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing,
// and, wp_next_scheduled() returns the same schedule in an infinite loop.
$crons = _get_cron_array();
if ( empty( $crons ) )
return;
$key = md5( serialize( $args ) );
foreach ( $crons as $timestamp => $cron ) {
if ( isset( $cron[ $hook ][ $key ] ) ) {
wp_unschedule_event( $timestamp, $hook, $args );
}
}
}
/**
@@ -222,9 +246,10 @@ function spawn_cron( $gmt_time = 0 ) {
if ( isset($keys[0]) && $keys[0] > $gmt_time )
return;
if ( defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ) {
if ( !empty($_POST) || defined('DOING_AJAX') )
if ( defined( 'ALTERNATE_WP_CRON' ) && ALTERNATE_WP_CRON ) {
if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'XMLRPC_REQUEST' ) ) {
return;
}
$doing_wp_cron = sprintf( '%.22F', $gmt_time );
set_transient( 'doing_cron', $doing_wp_cron );
@@ -244,10 +269,34 @@ function spawn_cron( $gmt_time = 0 ) {
$doing_wp_cron = sprintf( '%.22F', $gmt_time );
set_transient( 'doing_cron', $doing_wp_cron );
/**
* Filter the cron request arguments.
*
* @since 3.5.0
*
* @param array $cron_request_array {
* An array of cron request URL arguments.
*
* @type string $url The cron request URL.
* @type int $key The 22 digit GMT microtime.
* @type array $args {
* An array of cron request arguments.
*
* @type int $timeout The request timeout in seconds. Default .01 seconds.
* @type bool $blocking Whether to set blocking for the request. Default false.
* @type bool $sslverify Whether SSL should be verified for the request. Default false.
* }
* }
*/
$cron_request = apply_filters( 'cron_request', array(
'url' => site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ),
'key' => $doing_wp_cron,
'args' => array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', true ) )
'url' => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ),
'key' => $doing_wp_cron,
'args' => array(
'timeout' => 0.01,
'blocking' => false,
/** This filter is documented in wp-includes/class-http.php */
'sslverify' => apply_filters( 'https_local_ssl_verify', false )
)
) );
wp_remote_post( $cron_request['url'], $cron_request['args'] );
@@ -300,17 +349,17 @@ function wp_cron() {
* 60*60*24*7 or 604800. The value of 'interval' would then be 604800.
*
* The 'display' is the description. For the 'weekly' key, the 'display' would
* be <code>__('Once Weekly')</code>.
* be `__( 'Once Weekly' )`.
*
* For your plugin, you will be passed an array. you can easily add your
* schedule by doing the following.
* <code>
* // filter parameter variable name is 'array'
* $array['weekly'] = array(
* 'interval' => 604800,
* 'display' => __('Once Weekly')
* );
* </code>
*
* // Filter parameter variable name is 'array'.
* $array['weekly'] = array(
* 'interval' => 604800,
* 'display' => __( 'Once Weekly' )
* );
*
*
* @since 2.1.0
*
@@ -322,6 +371,13 @@ function wp_get_schedules() {
'twicedaily' => array( 'interval' => 12 * HOUR_IN_SECONDS, 'display' => __( 'Twice Daily' ) ),
'daily' => array( 'interval' => DAY_IN_SECONDS, 'display' => __( 'Once Daily' ) ),
);
/**
* Filter the non-default cron schedules.
*
* @since 2.1.0
*
* @param array $new_schedules An array of non-default cron schedules. Default empty.
*/
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
}
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +1 @@
#wpadminbar *{font-family:Tahoma,Arial,Helvetica,sans-serif}#wpadminbar{direction:rtl;font-family:Tahoma,Arial,Helvetica,sans-serif;left:auto;right:0}#wpadminbar .quicklinks ul{text-align:right}#wpadminbar li{float:right}#wpadminbar .quicklinks>ul>li{border-right:0;border-left:1px solid #555}#wpadminbar .quicklinks>ul>li>a,#wpadminbar .quicklinks>ul>li>.ab-empty-item{border-right:0;border-left:1px solid #333}#wpadminbar .quicklinks .ab-top-secondary>li{border-left:0;border-right:1px solid #333;float:left}#wpadminbar .quicklinks .ab-top-secondary>li>a,#wpadminbar .quicklinks .ab-top-secondary>li>.ab-empty-item{border-right:1px solid #555;border-left:0}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0 -1px 0 0}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{left:auto;right:0}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{right:auto;left:0;margin:0 0 0 -1px}#wpadminbar .menupop li:hover>.ab-sub-wrapper,#wpadminbar .menupop li.hover>.ab-sub-wrapper{margin-left:0;margin-right:100%}#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper{margin-left:inherit;margin-right:0;left:100%;right:inherit}#wpadminbar .menupop .menupop>.ab-item{background-position:5% -46px;padding-left:2em;padding-right:1em}#wpadminbar .ab-top-secondary .menupop .menupop>.ab-item{background-position:95% -20px;padding-left:1em;padding-right:2em}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary{right:0;left:auto}#wpadminbar .ab-top-secondary{float:left;right:auto;left:0}#wpadminbar ul li:last-child,#wpadminbar ul li:last-child .ab-item{border-left:0}#wpadminbar .screen-reader-shortcut:focus{left:auto;right:6px}#wpadminbar #wp-admin-bar-my-account.with-avatar #wp-admin-bar-user-actions>li{margin-right:88px;margin-left:16px}#wp-admin-bar-user-actions>li>.ab-item{padding-left:0;padding-right:8px}#wp-admin-bar-user-info .avatar{left:auto;right:-72px}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{margin-left:-1px;margin-right:4px}#wpadminbar .quicklinks li .blavatar{margin-right:0;margin-left:4px}#wpadminbar #adminbarsearch .adminbar-input{font-family:Tahoma,Arial,Helvetica,sans-serif;padding:0 24px 0 3px;margin:0;background-position:50% 2px}#wpadminbar #adminbarsearch .adminbar-input:focus,#wpadminbar.ie7 #adminbarsearch .adminbar-input{background-position:99% 2px}#wpadminbar .ab-icon{float:right}.ie7 #wp-admin-bar-wp-logo>.ab-item .ab-icon{position:static}#wpadminbar.ie7 .ab-icon{float:left;left:12px}#wpadminbar .ab-label{margin-left:0;margin-right:4px;float:left}#wpadminbar.ie7 .ab-label{margin-right:0}#wpadminbar.ie7 #wp-admin-bar-comments>a{min-width:25px}#wpadminbar a:hover .ab-comments-icon-arrow{border-right-color:#bbb}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{right:0}#wpadminbar .quicklinks .menupop ul li a{position:relative}* html #wpadminbar .quicklinks ul li a{float:right}
#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-shadow:none;text-transform:none;letter-spacing:normal;font:400 13px/32px "Open Sans",sans-serif;-webkit-border-radius:0;border-radius:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-transition:none;transition:none;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto}.rtl #wpadminbar *{font-family:Tahoma,sans-serif}html:lang(he-il) .rtl #wpadminbar *{font-family:Arial,sans-serif}#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#eee}#wpadminbar #wp-admin-bar-my-sites a.ab-item,#wpadminbar #wp-admin-bar-site-name a.ab-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wpadminbar ul li:after,#wpadminbar ul li:before{content:normal}#wpadminbar a,#wpadminbar a img,#wpadminbar a img:hover,#wpadminbar a:hover{outline:0;border:none;text-decoration:none;background:0 0}#wpadminbar a:active,#wpadminbar a:focus,#wpadminbar div,#wpadminbar input[type=email],#wpadminbar input[type=number],#wpadminbar input[type=password],#wpadminbar input[type=search],#wpadminbar input[type=text],#wpadminbar input[type=url],#wpadminbar select,#wpadminbar textarea{-webkit-box-shadow:none;box-shadow:none;outline:0}#wpadminbar{direction:rtl;color:#ccc;font:400 13px/32px "Open Sans",sans-serif;height:32px;position:fixed;top:0;right:0;width:100%;min-width:600px;z-index:99999;background:#23282d}#wpadminbar .ab-sub-wrapper,#wpadminbar ul,#wpadminbar ul li{background:0 0;clear:none;list-style:none;margin:0;padding:0;position:relative;text-indent:0;z-index:99999}#wpadminbar ul#wp-admin-bar-root-default>li{margin-left:0}#wpadminbar .quicklinks ul{text-align:right}#wpadminbar li{float:right}#wpadminbar .ab-empty-item{outline:0}#wpadminbar .quicklinks .ab-top-secondary>li{float:left}#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .quicklinks a,#wpadminbar .shortlink-input{height:32px;display:block;padding:0 10px;margin:0}#wpadminbar .quicklinks>ul>li>a{padding:0 7px 0 8px}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0;padding:0;-webkit-box-shadow:0 3px 5px rgba(0,0,0,.2);box-shadow:0 3px 5px rgba(0,0,0,.2);background:#32373c;display:none;position:absolute;float:none}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{top:32px;right:0}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper{min-width:100%}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{left:0;right:auto}#wpadminbar .ab-submenu{padding:6px 0}#wpadminbar .selected .shortlink-input{display:block}#wpadminbar .quicklinks .menupop ul li{float:none}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:700}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar .shortlink-input,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item{line-height:26px;height:26px;white-space:nowrap;min-width:140px}#wpadminbar .shortlink-input{width:200px}#wpadminbar li.hover>.ab-sub-wrapper,#wpadminbar.nojs li:hover>.ab-sub-wrapper{display:block}#wpadminbar .menupop li.hover>.ab-sub-wrapper,#wpadminbar .menupop li:hover>.ab-sub-wrapper{margin-right:100%;margin-top:-32px}#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper{margin-right:0;right:inherit;left:100%}#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus{background:#32373c;color:#00b9eb}#wpadminbar>#wp-toolbar a:focus span.ab-label,#wpadminbar>#wp-toolbar li.hover span.ab-label,#wpadminbar>#wp-toolbar li:hover span.ab-label{color:#00b9eb}#wpadminbar .ab-icon,#wpadminbar .ab-item:before,#wpadminbar>#wp-toolbar>#wp-admin-bar-root-default .ab-icon{position:relative;float:right;font:400 20px/1 dashicons;speak:none;padding:4px 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-image:none!important;margin-left:6px}#wpadminbar #adminbarsearch:before,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:before{color:#a0a5aa;color:rgba(240,245,250,.6);position:relative;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}#wpadminbar .ab-label{display:inline-block;height:32px}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#b4b9be;color:rgba(240,245,250,.7)}#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbLine truncated
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1 +1 @@
#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;font:normal 13px/28px sans-serif;color:#ccc;text-shadow:#444 0 -1px 0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}#wpadminbar ul li:before,#wpadminbar ul li:after{content:normal}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:0;border:0;text-decoration:none;background:0}#wpadminbar a:focus,#wpadminbar a:active,#wpadminbar input[type="text"],#wpadminbar input[type="password"],#wpadminbar input[type="number"],#wpadminbar input[type="search"],#wpadminbar input[type="email"],#wpadminbar input[type="url"],#wpadminbar select,#wpadminbar textarea,#wpadminbar div{outline:0}#wpadminbar{direction:ltr;color:#ccc;font:normal 13px/28px sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;min-width:600px;z-index:99999;background:#464646;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#373737),color-stop(18%,#464646));background-image:-webkit-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-o-linear-gradient(bottom,#373737 0,#464646 5px);background-image:linear-gradient(to top,#373737 0,#464646 5px)}#wpadminbar .ab-sub-wrapper,#wpadminbar ul,#wpadminbar ul li{background:0;clear:none;list-style:none;margin:0;padding:0;position:relative;text-indent:0;z-index:99999}#wpadminbar .quicklinks{border-left:1px solid transparent}#wpadminbar .quicklinks ul{text-align:left}#wpadminbar li{float:left}#wpadminbar .ab-empty-item{outline:0}#wpadminbar .quicklinks>ul>li{border-right:1px solid #555}#wpadminbar .quicklinks>ul>li>a,#wpadminbar .quicklinks>ul>li>.ab-empty-item{border-right:1px solid #333}#wpadminbar .quicklinks .ab-top-secondary>li{border-left:1px solid #333;border-right:0;float:right}#wpadminbar .quicklinks .ab-top-secondary>li>a,#wpadminbar .quicklinks .ab-top-secondary>li>.ab-empty-item{border-left:1px solid #555;border-right:0}#wpadminbar .quicklinks a,#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .shortlink-input{height:28px;display:block;padding:0 12px;margin:0}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0 0 0 -1px;padding:0;-webkit-box-shadow:0 4px 4px rgba(0,0,0,0.2);box-shadow:0 4px 4px rgba(0,0,0,0.2);background:#fff;display:none;position:absolute;float:none;border-width:0 1px 1px 1px;border-style:solid;border-color:#dfdfdf}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{top:28px;left:0}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper{min-width:100%}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{right:0;left:auto;margin:0 -1px 0 0}#wpadminbar .ab-sub-wrapper>.ab-submenu:first-child{border-top:0}#wpadminbar .ab-submenu{padding:6px 0;border-top:1px solid #dfdfdf}#wpadminbar .selected .shortlink-input{display:block}#wpadminbar .quicklinks .menupop ul li{float:none}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:bold}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item,#wpadminbar .shortlink-input{line-height:26px;height:26px;text-shadow:none;white-space:nowrap;min-width:140px}#wpadminbar .shortlink-input{width:200px}#wpadminbar.nojs li:hover>.ab-sub-wrapper,#wpadminbar li.hover>.ab-sub-wrapper{display:block}#wpadminbar .menupop li:hover>.ab-sub-wrapper,#wpadminbar .menupop li.hover>.ab-sub-wrapper{margin-left:100%;margin-top:-33px;border-width:1px}#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper{margin-left:0;left:inherit;right:100%}#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus{color:#fafafa;background:#222;background-image:-webkit-gradient(linear,left bottom,left top,from(#3a3a3a),to(#222));background-image:-webkit-linear-gradient(bottom,#3a3a3a,#222);background-image:-moz-linear-gradient(bottom,#3a3a3a,#222);background-image:-o-linear-gradient(bottom,#3a3a3a,#222);background-image:linear-gradient(to top,#3a3a3a,#222)}#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item{background:#fff;color:#333;text-shadow:none;border-right-color:transparent;border-left-color:transparent}#wpadminbar .hover .ab-label,#wpadminbar.nojq .ab-item:focus .ab-label{color:#fafafa}#wpadminbar .menupop.hover .ab-label{color:#333;text-shadow:none}#wpadminbar .menupop li:hover,#wpadminbar .menupop li.hover,#wpadminbar .quicklinks .menupop .ab-item:focus,#wpadminbar .quicklinks .ab-top-menu .menupop .ab-item:focus{background-color:#eaf2fa}#wpadminbarLine truncated
#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-shadow:none;text-transform:none;letter-spacing:normal;font:400 13px/32px "Open Sans",sans-serif;-webkit-border-radius:0;border-radius:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-transition:none;transition:none;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:auto}.rtl #wpadminbar *{font-family:Tahoma,sans-serif}html:lang(he-il) .rtl #wpadminbar *{font-family:Arial,sans-serif}#wpadminbar a.ab-item,#wpadminbar>#wp-toolbar span.ab-label,#wpadminbar>#wp-toolbar span.noticon{color:#eee}#wpadminbar #wp-admin-bar-my-sites a.ab-item,#wpadminbar #wp-admin-bar-site-name a.ab-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wpadminbar ul li:after,#wpadminbar ul li:before{content:normal}#wpadminbar a,#wpadminbar a img,#wpadminbar a img:hover,#wpadminbar a:hover{outline:0;border:none;text-decoration:none;background:0 0}#wpadminbar a:active,#wpadminbar a:focus,#wpadminbar div,#wpadminbar input[type=email],#wpadminbar input[type=number],#wpadminbar input[type=password],#wpadminbar input[type=search],#wpadminbar input[type=text],#wpadminbar input[type=url],#wpadminbar select,#wpadminbar textarea{-webkit-box-shadow:none;box-shadow:none;outline:0}#wpadminbar{direction:ltr;color:#ccc;font:400 13px/32px "Open Sans",sans-serif;height:32px;position:fixed;top:0;left:0;width:100%;min-width:600px;z-index:99999;background:#23282d}#wpadminbar .ab-sub-wrapper,#wpadminbar ul,#wpadminbar ul li{background:0 0;clear:none;list-style:none;margin:0;padding:0;position:relative;text-indent:0;z-index:99999}#wpadminbar ul#wp-admin-bar-root-default>li{margin-right:0}#wpadminbar .quicklinks ul{text-align:left}#wpadminbar li{float:left}#wpadminbar .ab-empty-item{outline:0}#wpadminbar .quicklinks .ab-top-secondary>li{float:right}#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .quicklinks a,#wpadminbar .shortlink-input{height:32px;display:block;padding:0 10px;margin:0}#wpadminbar .quicklinks>ul>li>a{padding:0 8px 0 7px}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0;padding:0;-webkit-box-shadow:0 3px 5px rgba(0,0,0,.2);box-shadow:0 3px 5px rgba(0,0,0,.2);background:#32373c;display:none;position:absolute;float:none}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{top:32px;left:0}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper{min-width:100%}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{right:0;left:auto}#wpadminbar .ab-submenu{padding:6px 0}#wpadminbar .selected .shortlink-input{display:block}#wpadminbar .quicklinks .menupop ul li{float:none}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:700}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar .shortlink-input,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item{line-height:26px;height:26px;white-space:nowrap;min-width:140px}#wpadminbar .shortlink-input{width:200px}#wpadminbar li.hover>.ab-sub-wrapper,#wpadminbar.nojs li:hover>.ab-sub-wrapper{display:block}#wpadminbar .menupop li.hover>.ab-sub-wrapper,#wpadminbar .menupop li:hover>.ab-sub-wrapper{margin-left:100%;margin-top:-32px}#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper{margin-left:0;left:inherit;right:100%}#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus{background:#32373c;color:#00b9eb}#wpadminbar>#wp-toolbar a:focus span.ab-label,#wpadminbar>#wp-toolbar li.hover span.ab-label,#wpadminbar>#wp-toolbar li:hover span.ab-label{color:#00b9eb}#wpadminbar .ab-icon,#wpadminbar .ab-item:before,#wpadminbar>#wp-toolbar>#wp-admin-bar-root-default .ab-icon{position:relative;float:left;font:400 20px/1 dashicons;speak:none;padding:4px 0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-image:none!important;margin-right:6px}#wpadminbar #adminbarsearch:before,#wpadminbar .ab-icon:before,#wpadminbar .ab-item:before{color:#a0a5aa;color:rgba(240,245,250,.6);position:relative;-webkit-transition:all .1s ease-in-out;transition:all .1s ease-in-out}#wpadminbar .ab-label{display:inline-block;height:32px}#wpadminbar .ab-submenu .ab-item,#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#b4b9be;color:rgba(240,245,250,.7)}#wpadminbar .quicklinks .menupop ul li a:focus,#wpadminbar .quicklinks .menupop ul li a:focus strong,#wpadminbar .quicklinks .menupop ul li a:hover,#wpadminbar .quicklinks .menupop ul li a:hover strong,#wpadminbar .quicklinks .menupop.hover ul li a:focus,#wpadminbar .quicklinks .menupop.hover ul li a:hover,#wpadminbar lLine truncated
+360
View File
@@ -0,0 +1,360 @@
/* ----------------------------------------------------------------------------
NOTE: If you edit this file, you should make sure that the CSS rules for
buttons in the following files are updated.
* jquery-ui-dialog.css
* editor.css
WordPress-style Buttons
=======================
Create a button by adding the `.button` class to an element. For backwards
compatibility, we support several other classes (such as `.button-secondary`),
but these will *not* work with the stackable classes described below.
Button Styles
-------------
To display a primary button style, add the `.button-primary` class to a button.
Button Sizes
------------
Adjust a button's size by adding the `.button-large` or `.button-small` class.
Button States
-------------
Lock the state of a button by adding the name of the pseudoclass as
an actual class (e.g. `.hover` for `:hover`).
TABLE OF CONTENTS:
------------------
1.0 - Button Layouts
2.0 - Default Button Style
3.0 - Primary Button Style
4.0 - Button Groups
5.0 - Responsive Button Styles
---------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------
1.0 - Button Layouts
---------------------------------------------------------------------------- */
.wp-core-ui .button,
.wp-core-ui .button-primary,
.wp-core-ui .button-secondary {
display: inline-block;
text-decoration: none;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
padding: 0 10px 1px;
cursor: pointer;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
-webkit-border-radius: 3px;
border-radius: 3px;
white-space: nowrap;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Remove the dotted border on :focus and the extra padding in Firefox */
.wp-core-ui button::-moz-focus-inner,
.wp-core-ui input[type="reset"]::-moz-focus-inner,
.wp-core-ui input[type="button"]::-moz-focus-inner,
.wp-core-ui input[type="submit"]::-moz-focus-inner {
border-width: 0;
border-style: none;
padding: 0;
}
.wp-core-ui .button.button-large,
.wp-core-ui .button-group.button-large .button {
height: 30px;
line-height: 28px;
padding: 0 12px 2px;
}
.wp-core-ui .button.button-small,
.wp-core-ui .button-group.button-small .button {
height: 24px;
line-height: 22px;
padding: 0 8px 1px;
font-size: 11px;
}
.wp-core-ui .button.button-hero,
.wp-core-ui .button-group.button-hero .button {
font-size: 14px;
height: 46px;
line-height: 44px;
padding: 0 36px;
}
.wp-core-ui .button:active,
.wp-core-ui .button:focus {
outline: none;
}
.wp-core-ui .button.hidden {
display: none;
}
/* Style Reset buttons as simple text links */
.wp-core-ui input[type="reset"],
.wp-core-ui input[type="reset"]:hover,
.wp-core-ui input[type="reset"]:active,
.wp-core-ui input[type="reset"]:focus {
background: none;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
padding: 0 2px 1px;
width: auto;
}
/* ----------------------------------------------------------------------------
2.0 - Default Button Style
---------------------------------------------------------------------------- */
.wp-core-ui .button,
.wp-core-ui .button-secondary {
color: #555;
border-color: #cccccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
vertical-align: top;
}
.wp-core-ui p .button {
vertical-align: baseline;
}
.wp-core-ui .button.hover,
.wp-core-ui .button:hover,
.wp-core-ui .button-secondary:hover,
.wp-core-ui .button.focus,
.wp-core-ui .button:focus,
.wp-core-ui .button-secondary:focus {
background: #fafafa;
border-color: #999;
color: #23282d;
}
.wp-core-ui .button.focus,
.wp-core-ui .button:focus,
.wp-core-ui .button-secondary:focus {
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button.active,
.wp-core-ui .button.active:hover,
.wp-core-ui .button:active,
.wp-core-ui .button-secondary:active {
background: #eee;
border-color: #999;
color: #32373c;
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
}
.wp-core-ui .button.active:focus {
-webkit-box-shadow:
inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button[disabled],
.wp-core-ui .button:disabled,
.wp-core-ui .button.disabled,
.wp-core-ui .button-secondary[disabled],
.wp-core-ui .button-secondary:disabled,
.wp-core-ui .button-secondary.disabled,
.wp-core-ui .button-disabled {
color: #a0a5aa !important;
border-color: #ddd !important;
background: #f7f7f7 !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 1px 0 #fff !important;
cursor: default;
}
/* ----------------------------------------------------------------------------
3.0 - Primary Button Style
---------------------------------------------------------------------------- */
.wp-core-ui .button-primary {
background: #00a0d2;
border-color: #0073aa;
-webkit-box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5), 0 1px 0 rgba( 0, 0, 0, 0.15 );
box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5 ), 0 1px 0 rgba( 0, 0, 0, 0.15 );
color: #fff;
text-decoration: none;
}
.wp-core-ui .button-primary.hover,
.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary.focus,
.wp-core-ui .button-primary:focus {
background: #0091cd;
border-color: #0073aa;
-webkit-box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.6 );
box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.6 );
color: #fff;
}
.wp-core-ui .button-primary.focus,
.wp-core-ui .button-primary:focus {
border-color: #0e3950;
-webkit-box-shadow:
inset 0 1px 0 rgba( 120, 200, 230, 0.6 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
inset 0 1px 0 rgba( 120, 200, 230, 0.6 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button-primary.active,
.wp-core-ui .button-primary.active:hover,
.wp-core-ui .button-primary.active:focus,
.wp-core-ui .button-primary:active {
background: #0073aa;
border-color: #005082;
color: rgba( 255, 255, 255, 0.95 );
-webkit-box-shadow: inset 0 1px 0 rgba( 0, 0, 0, 0.1 );
box-shadow: inset 0 1px 0 rgba( 0, 0, 0, 0.1 );
vertical-align: top;
}
.wp-core-ui .button-primary[disabled],
.wp-core-ui .button-primary:disabled,
.wp-core-ui .button-primary-disabled,
.wp-core-ui .button-primary.disabled {
color: #94cde7 !important;
background: #298cba !important;
border-color: #1b607f !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.1 ) !important;
cursor: default;
}
/* ----------------------------------------------------------------------------
4.0 - Button Groups
---------------------------------------------------------------------------- */
.wp-core-ui .button-group {
position: relative;
display: inline-block;
white-space: nowrap;
font-size: 0;
vertical-align: middle;
}
.wp-core-ui .button-group > .button {
display: inline-block;
-webkit-border-radius: 0;
border-radius: 0;
margin-left: -1px;
z-index: 10;
}
.wp-core-ui .button-group > .button-primary {
z-index: 100;
}
.wp-core-ui .button-group > .button:hover {
z-index: 20;
}
.wp-core-ui .button-group > .button:first-child {
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.wp-core-ui .button-group > .button:last-child {
-webkit-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.wp-core-ui .button-group > .button:focus {
position: relative;
z-index: 1;
}
/* ----------------------------------------------------------------------------
5.0 - Responsive Button Styles
---------------------------------------------------------------------------- */
@media screen and ( max-width: 782px ) {
.wp-core-ui .button,
.wp-core-ui .button.button-large,
.wp-core-ui .button.button-small,
input#publish,
input#save-post,
a.preview {
padding: 6px 14px;
line-height: normal;
font-size: 14px;
vertical-align: middle;
height: auto;
margin-bottom: 4px;
}
#media-upload.wp-core-ui .button {
padding: 0 10px 1px;
height: 24px;
line-height: 22px;
font-size: 13px;
}
.media-frame.mode-grid .bulk-select .button {
margin-bottom: 0;
}
/* Publish Metabox Options */
.wp-core-ui .save-post-status.button {
position: relative;
margin: 0 10px 0 14px; /* 14px right margin to match all other buttons */
}
/* Reset responsive styles in Press This, Customizer */
.wp-core-ui.wp-customizer .button {
padding: 0 10px 1px;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
vertical-align: inherit;
}
/* Reset responsive styles on Log in button on iframed login form */
.interim-login .button.button-large {
height: 30px;
line-height: 28px;
padding: 0 12px 2px;
}
}
+1
View File
@@ -0,0 +1 @@
.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:0;border-style:none;padding:0}.wp-core-ui .button-group.button-large .button,.wp-core-ui .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button-group.button-small .button,.wp-core-ui .button.button-small{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button-group.button-hero .button,.wp-core-ui .button.button-hero{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active,.wp-core-ui .button:focus{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus,.wp-core-ui input[type=reset]:hover{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button-secondary:focus,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button.hover,.wp-core-ui .button:focus,.wp-core-ui .button:hover{background:#fafafa;border-color:#999;color:#23282d}.wp-core-ui .button-secondary:focus,.wp-core-ui .button.focus,.wp-core-ui .button:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-secondary:active,.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button:active{background:#eee;border-color:#999;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button.active:focus{-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-disabled,.wp-core-ui .button-secondary.disabled,.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button.disabled,.wp-core-ui .button:disabled,.wp-core-ui .button[disabled]{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#00a0d2;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#0091cd;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#0073aa;border-color:#005082;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;-webkit-border-radius:0;border-radius:0;margin-left:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.wpLine truncated
+161 -89
View File
@@ -1,5 +1,10 @@
/* ----------------------------------------------------------------------------
NOTE: If you edit this file, you should make sure that the CSS rules for
buttons in the following files are updated.
* jquery-ui-dialog.css
* editor.css
WordPress-style Buttons
=======================
@@ -27,6 +32,7 @@ TABLE OF CONTENTS:
2.0 - Default Button Style
3.0 - Primary Button Style
4.0 - Button Groups
5.0 - Responsive Button Styles
---------------------------------------------------------------------------- */
@@ -39,21 +45,21 @@ TABLE OF CONTENTS:
.wp-core-ui .button-secondary {
display: inline-block;
text-decoration: none;
font-size: 12px;
line-height: 23px;
height: 24px;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
padding: 0 10px 1px;
cursor: pointer;
border-width: 1px;
border-style: solid;
-webkit-border-radius: 3px;
-webkit-appearance: none;
-webkit-border-radius: 3px;
border-radius: 3px;
white-space: nowrap;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Remove the dotted border on :focus and the extra padding in Firefox */
@@ -61,9 +67,8 @@ TABLE OF CONTENTS:
.wp-core-ui input[type="reset"]::-moz-focus-inner,
.wp-core-ui input[type="button"]::-moz-focus-inner,
.wp-core-ui input[type="submit"]::-moz-focus-inner {
border-width: 1px 0;
border-style: solid none;
border-color: transparent;
border-width: 0;
border-style: none;
padding: 0;
}
@@ -76,9 +81,10 @@ TABLE OF CONTENTS:
.wp-core-ui .button.button-small,
.wp-core-ui .button-group.button-small .button {
height: 21px;
line-height: 20px;
height: 24px;
line-height: 22px;
padding: 0 8px 1px;
font-size: 11px;
}
.wp-core-ui .button.button-hero,
@@ -89,7 +95,8 @@ TABLE OF CONTENTS:
padding: 0 36px;
}
.wp-core-ui .button:active {
.wp-core-ui .button:active,
.wp-core-ui .button:focus {
outline: none;
}
@@ -97,21 +104,36 @@ TABLE OF CONTENTS:
display: none;
}
/* Style Reset buttons as simple text links */
.wp-core-ui input[type="reset"],
.wp-core-ui input[type="reset"]:hover,
.wp-core-ui input[type="reset"]:active,
.wp-core-ui input[type="reset"]:focus {
background: none;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
padding: 0 2px 1px;
width: auto;
}
/* ----------------------------------------------------------------------------
2.0 - Default Button Style
---------------------------------------------------------------------------- */
.wp-core-ui .button,
.wp-core-ui .button-secondary {
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);
border-color: #bbb;
color: #333;
text-shadow: 0 1px 0 #fff;
color: #555;
border-color: #cccccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
vertical-align: top;
}
.wp-core-ui p .button {
vertical-align: baseline;
}
.wp-core-ui .button.hover,
@@ -120,58 +142,56 @@ TABLE OF CONTENTS:
.wp-core-ui .button.focus,
.wp-core-ui .button:focus,
.wp-core-ui .button-secondary:focus {
background: #f3f3f3;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
background-image: -o-linear-gradient(top, #fff, #f3f3f3);
background-image: linear-gradient(to bottom, #fff, #f3f3f3);
background: #fafafa;
border-color: #999;
color: #222;
color: #23282d;
}
.wp-core-ui .button.focus,
.wp-core-ui .button:focus,
.wp-core-ui .button-secondary:focus {
-webkit-box-shadow: 1px 1px 1px rgba(0,0,0,.2);
box-shadow: 1px 1px 1px rgba(0,0,0,.2);
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button.active,
.wp-core-ui .button.active:hover,
.wp-core-ui .button.active:focus,
.wp-core-ui .button:active,
.wp-core-ui .button-secondary:active {
background: #eee;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#fefefe));
background-image: -webkit-linear-gradient(top, #f4f4f4, #fefefe);
background-image: -moz-linear-gradient(top, #f4f4f4, #fefefe);
background-image: -ms-linear-gradient(top, #f4f4f4, #fefefe);
background-image: -o-linear-gradient(top, #f4f4f4, #fefefe);
background-image: linear-gradient(to bottom, #f4f4f4, #fefefe);
border-color: #999;
color: #333;
text-shadow: 0 -1px 0 #fff;
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
color: #32373c;
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
}
.wp-core-ui .button.active:focus {
-webkit-box-shadow:
inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button[disabled],
.wp-core-ui .button:disabled,
.wp-core-ui .button.disabled,
.wp-core-ui .button-secondary[disabled],
.wp-core-ui .button-secondary:disabled,
.wp-core-ui .button-secondary.disabled,
.wp-core-ui .button-disabled {
color: #aaa !important;
color: #a0a5aa !important;
border-color: #ddd !important;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#f4f4f4)) !important;
background-image: -webkit-linear-gradient(top, #f9f9f9, #f4f4f4) !important;
background-image: -moz-linear-gradient(top, #f9f9f9, #f4f4f4) !important;
background-image: -ms-linear-gradient(top, #f9f9f9, #f4f4f4) !important;
background-image: -o-linear-gradient(top, #f9f9f9, #f4f4f4) !important;
background-image: linear-gradient(to bottom, #f9f9f9, #f4f4f4) !important;
background: #f7f7f7 !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 1px 0 #fff !important;
cursor: default;
}
@@ -181,74 +201,60 @@ TABLE OF CONTENTS:
---------------------------------------------------------------------------- */
.wp-core-ui .button-primary {
background-color: #21759b;
background-image: -webkit-gradient(linear, left top, left bottom, from(#2a95c5), to(#21759b));
background-image: -webkit-linear-gradient(top, #2a95c5, #21759b);
background-image: -moz-linear-gradient(top, #2a95c5, #21759b);
background-image: -ms-linear-gradient(top, #2a95c5, #21759b);
background-image: -o-linear-gradient(top, #2a95c5, #21759b);
background-image: linear-gradient(to bottom, #2a95c5, #21759b);
border-color: #21759b;
border-bottom-color: #1e6a8d;
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
background: #00a0d2;
border-color: #0073aa;
-webkit-box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5), 0 1px 0 rgba( 0, 0, 0, 0.15 );
box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5 ), 0 1px 0 rgba( 0, 0, 0, 0.15 );
color: #fff;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
}
.wp-core-ui .button-primary.hover,
.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary.focus,
.wp-core-ui .button-primary:focus {
background-color: #278ab7;
background-image: -webkit-gradient(linear, left top, left bottom, from(#2e9fd2), to(#21759b));
background-image: -webkit-linear-gradient(top, #2e9fd2, #21759b);
background-image: -moz-linear-gradient(top, #2e9fd2, #21759b);
background-image: -ms-linear-gradient(top, #2e9fd2, #21759b);
background-image: -o-linear-gradient(top, #2e9fd2, #21759b);
background-image: linear-gradient(to bottom, #2e9fd2, #21759b);
border-color: #1b607f;
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
background: #0091cd;
border-color: #0073aa;
-webkit-box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.6 );
box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.6 );
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
.wp-core-ui .button-primary.focus,
.wp-core-ui .button-primary:focus {
border-color: #0e3950;
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6), 1px 1px 2px rgba(0,0,0,0.4);
-webkit-box-shadow:
inset 0 1px 0 rgba( 120, 200, 230, 0.6 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
box-shadow:
inset 0 1px 0 rgba( 120, 200, 230, 0.6 ),
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
}
.wp-core-ui .button-primary.active,
.wp-core-ui .button-primary.active:hover,
.wp-core-ui .button-primary.active:focus,
.wp-core-ui .button-primary:active {
background: #1b607f;
background-image: -webkit-gradient(linear, left top, left bottom, from(#21759b), to(#278ab7));
background-image: -webkit-linear-gradient(top, #21759b, #278ab7);
background-image: -moz-linear-gradient(top, #21759b, #278ab7);
background-image: -ms-linear-gradient(top, #21759b, #278ab7);
background-image: -o-linear-gradient(top, #21759b, #278ab7);
background-image: linear-gradient(to bottom, #21759b, #278ab7);
border-color: #124560 #2382ae #2382ae #2382ae;
color: rgba(255,255,255,0.95);
-webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
text-shadow: 0 1px 0 rgba(0,0,0,0.1);
background: #0073aa;
border-color: #005082;
color: rgba( 255, 255, 255, 0.95 );
-webkit-box-shadow: inset 0 1px 0 rgba( 0, 0, 0, 0.1 );
box-shadow: inset 0 1px 0 rgba( 0, 0, 0, 0.1 );
vertical-align: top;
}
.wp-core-ui .button-primary[disabled],
.wp-core-ui .button-primary:disabled,
.wp-core-ui .button-primary-disabled {
.wp-core-ui .button-primary-disabled,
.wp-core-ui .button-primary.disabled {
color: #94cde7 !important;
background: #298cba !important;
border-color: #1b607f !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 -1px 0 rgba(0,0,0,0.1) !important;
box-shadow: none !important;
text-shadow: 0 -1px 0 rgba( 0, 0, 0, 0.1 ) !important;
cursor: default;
}
@@ -266,6 +272,7 @@ TABLE OF CONTENTS:
.wp-core-ui .button-group > .button {
display: inline-block;
-webkit-border-radius: 0;
border-radius: 0;
margin-right: -1px;
z-index: 10;
@@ -280,9 +287,74 @@ TABLE OF CONTENTS:
}
.wp-core-ui .button-group > .button:first-child {
-webkit-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.wp-core-ui .button-group > .button:last-child {
-webkit-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.wp-core-ui .button-group > .button:focus {
position: relative;
z-index: 1;
}
/* ----------------------------------------------------------------------------
5.0 - Responsive Button Styles
---------------------------------------------------------------------------- */
@media screen and ( max-width: 782px ) {
.wp-core-ui .button,
.wp-core-ui .button.button-large,
.wp-core-ui .button.button-small,
input#publish,
input#save-post,
a.preview {
padding: 6px 14px;
line-height: normal;
font-size: 14px;
vertical-align: middle;
height: auto;
margin-bottom: 4px;
}
#media-upload.wp-core-ui .button {
padding: 0 10px 1px;
height: 24px;
line-height: 22px;
font-size: 13px;
}
.media-frame.mode-grid .bulk-select .button {
margin-bottom: 0;
}
/* Publish Metabox Options */
.wp-core-ui .save-post-status.button {
position: relative;
margin: 0 14px 0 10px; /* 14px right margin to match all other buttons */
}
/* Reset responsive styles in Press This, Customizer */
.wp-core-ui.wp-customizer .button {
padding: 0 10px 1px;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
vertical-align: inherit;
}
/* Reset responsive styles on Log in button on iframed login form */
.interim-login .button.button-large {
height: 30px;
line-height: 28px;
padding: 0 12px 2px;
}
}
+1 -1
View File
@@ -1 +1 @@
.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:12px;line-height:23px;height:24px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type="reset"]::-moz-focus-inner,.wp-core-ui input[type="button"]::-moz-focus-inner,.wp-core-ui input[type="submit"]::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.wp-core-ui .button.button-large,.wp-core-ui .button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button.button-small,.wp-core-ui .button-group.button-small .button{height:21px;line-height:20px;padding:0 8px 1px}.wp-core-ui .button.button-hero,.wp-core-ui .button-group.button-hero .button{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui .button,.wp-core-ui .button-secondary{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);border-color:#bbb;color:#333;text-shadow:0 1px 0 #fff}.wp-core-ui .button.hover,.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f3f3f3));background-image:-webkit-linear-gradient(top,#fff,#f3f3f3);background-image:-moz-linear-gradient(top,#fff,#f3f3f3);background-image:-ms-linear-gradient(top,#fff,#f3f3f3);background-image:-o-linear-gradient(top,#fff,#f3f3f3);background-image:linear-gradient(to bottom,#fff,#f3f3f3);border-color:#999;color:#222}.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button.active:focus,.wp-core-ui .button:active,.wp-core-ui .button-secondary:active{background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#f4f4f4),to(#fefefe));background-image:-webkit-linear-gradient(top,#f4f4f4,#fefefe);background-image:-moz-linear-gradient(top,#f4f4f4,#fefefe);background-image:-ms-linear-gradient(top,#f4f4f4,#fefefe);background-image:-o-linear-gradient(top,#f4f4f4,#fefefe);background-image:linear-gradient(to bottom,#f4f4f4,#fefefe);border-color:#999;color:#333;text-shadow:0 -1px 0 #fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,0.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,0.5)}.wp-core-ui .button[disabled],.wp-core-ui .button:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-disabled{color:#aaa!important;border-color:#ddd!important;background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f4f4f4))!important;background-image:-webkit-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-moz-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-ms-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-o-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:linear-gradient(to bottom,#f9f9f9,#f4f4f4)!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background-color:#21759b;background-image:-webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));background-image:-webkit-linear-gradient(top,#2a95c5,#21759b);background-image:-moz-linear-gradient(top,#2a95c5,#21759b);background-image:-ms-linear-gradient(top,#2a95c5,#21759b);background-image:-o-linear-gradient(top,#2a95c5,#21759b);background-image:linear-gradient(to bottom,#2a95c5,#21759b);border-color:#21759b;border-bottom-color:#1e6a8d;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:hover,.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{background-color:#278ab7;background-image:-webkit-gradient(linear,left top,left bottom,from(#2e9fd2),to(#21759b));background-image:-webkit-linear-gradient(top,#2e9fd2,#21759b);background-image:-moz-linear-gradient(top,#2e9fd2,#21759b);background-image:-ms-linear-gradient(top,#2e9fd2,#21759b);background-image:-o-linear-gradient(top,#2e9fd2,#21759b);backgroundLine truncated
.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:0;border-style:none;padding:0}.wp-core-ui .button-group.button-large .button,.wp-core-ui .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button-group.button-small .button,.wp-core-ui .button.button-small{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button-group.button-hero .button,.wp-core-ui .button.button-hero{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active,.wp-core-ui .button:focus{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus,.wp-core-ui input[type=reset]:hover{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button-secondary:focus,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button.hover,.wp-core-ui .button:focus,.wp-core-ui .button:hover{background:#fafafa;border-color:#999;color:#23282d}.wp-core-ui .button-secondary:focus,.wp-core-ui .button.focus,.wp-core-ui .button:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-secondary:active,.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button:active{background:#eee;border-color:#999;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button.active:focus{-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-disabled,.wp-core-ui .button-secondary.disabled,.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button.disabled,.wp-core-ui .button:disabled,.wp-core-ui .button[disabled]{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#00a0d2;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:focus,.wp-core-ui .button-primary:hover{background:#0091cd;border-color:#0073aa;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary:active{background:#0073aa;border-color:#005082;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary-disabled,.wp-core-ui .button-primary.disabled,.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary[disabled]{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;-webkit-border-radius:0;border-radius:0;margin-right:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.wLine truncated
+958
View File
@@ -0,0 +1,958 @@
@font-face {
font-family: "dashicons";
src: url(../fonts/dashicons.eot);
}
@font-face {
font-family: "dashicons";
src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAGBQAA4AAAAAm3wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcbYyDmkdERUYAAAFgAAAAHgAAACABIwAET1MvMgAAAYAAAABAAAAAYJYFaatjbWFwAAABwAAAASoAAAKC/cQq02dhc3AAAALsAAAACAAAAAj//wADZ2x5ZgAAAvQAAFSXAACESOAO2gZoZWFkAABXjAAAAC4AAAA2CEgozmhoZWEAAFe8AAAAGgAAACQPogifaG10eAAAV9gAAAEcAAAD2GOq3ltsb2NhAABY9AAAAe4AAAHu4pbA6m1heHAAAFrkAAAAHwAAACABSQC1bmFtZQAAWwQAAAGKAAADLCbHbA5wb3N0AABckAAAA7UAAAmnz3C/rndlYmYAAGBIAAAABgAAAAY81VSHAAAAAQAAAADMPaLPAAAAANCh83cAAAAA0KztU3jaY2BkYGDgA2IJBhBgYmAEwq9AzALmMQAADtEBKAAAeNpjYGY/yTiBgZWBhVWEZQMDA8M0CM20h8GIKQLIB0phB6He4X4MDqp/vqqzXwDxgaQGkGJEUqLAwAgAMrcKp3ja3ZA7SwNRFITPNTGy7N3jglosWCxIkHRBVAw2q6JJQEWMILGQ9dHEKjZCwCKNhZ2t/8hGG1EwWKuVOvehjbouCVhYWzlw5jAwfMUQUYZ6N0oidRLHaRLdnBVx+jcoon4azn/AwRACjKGAIqZRwgIWUUEdO2ighRMllKMCVVAlFal57ehAF3RJV03VbJq6iU3DtMypObdZ69jAjicJUUol+BhBiHxKncAMopRaRg0x9nCItiKVUb4KVbFLFdrXoS7qyFTMWpe6a5qmbc4s2Zz1bZgknYHBLH/xJ7/zG7/yCz/zEz/yA9/zLd/wFV/wKq9wmed4lqd40jvymt6Bt+9ty1huybqsyXW5LJdk5HbcO/favewt8/cSOfpBi77U+n4X6N/rG5Q9gGkAAAAAAAH//wACeNqsvQd8FGX6OD7vzM7Mbtpmsy1tN9lsS9nUbSFlEyD00EKLBaQsPWAUaRJQMSIqJTZsiA0Re1TkLBxnO107clFPDz3Uk+PUO/WOrwdJ9vX3PO/sJhvE+973//lnM/O+887MO++85enPM5zIwR85xR/iBE7iNFwKp+W4Sp1NJ+hterOO2JKJTk9O9T5CH4s8QneQ6Y9EHuEPRZvIDdzPtOdnQqMfcj8TD+W5nznCJfxVchzPhbmo/ILUC3X6OU5DgiFiMluJ2SoEghoiS4Y8YjLIabwswc7Kh0gwEAzxwUAVlFcFxf3R+l1Z626pKX1gWknd7JYVNdGHovVPWSzLLJacUYtNI+y+KRXy2CWXXOIr8KY2+3It0+DUNIuwiX91V26q3WXdUpaZa0slKdGH+FefYmenW3ICY9Mr7b5LLlkyVq6Y7Cto0q0cmcPq5AjxcBGpUVZzGdAntiqTUWeQSgjR2Qtcfp0vQE4JnS1r1rREaEoEUlm9piXa1LKGppBTa1r4Qy1r4LUF7t9QxyfSR9CXaawes6whbg3xe0UC3Yqb1HjHsuj66Ppl/I+kKxLdz7f2TRHyabtq0x3L+GtZOW2P3Bl9OPooP4NqySmaAvVGuF1ym1zDZXIurg7qNaVrSRpxkwYS8LldBVpCXAHI52vYsSQTyWA2BWRikrREyne70htIiJhZaZX0j02b7mj5chmRmpsbGhqebphIn7AMa7n9CrKw/1velJdX0JoX/RaTMrLHiifo7iuUW+j8xsaGp6VDWHJ7yzArESc2QwWNjc30iWVfttyxqW8WVHB+Xj5vjX7D0jfIPezEpk1k0Sa4xULnNTzd2MBxKpgfYXinNk7P5XBFOEeIzucqIW6bbC+QoPdNXltVgKsyGaQCl0+06Vga8FaZdTbo0IFD0VBb9NA1tP2ah4pqa4uEk0W10cYjN9105CbhIDkFyU1LzDm0B/pUyQud/KGi2kiktijaBDfwz2DxEVXfiSV4j0jOUHkpvZ8dcPzAnBBgRDkcPtFmtOm8fKtwsu+AkN+fGSGnREPvd+GIaMDx/4Y7If1FOsmp4Z0cOOvdJICzXgwSOY3YbbJU4Hb5GuBNAxrljEzEPHroRdKUfaHLndH/+gXCNWurvp1HOzo8HR6Pp6NekEhTFp7LpoekXOVSvdt1wdvt/RumV42Ai0o2ejpI59xTdC+cyoBT2fRFWH8R7nUpKvVzRs4GbZdUboI9FiSujGDAYdbwJgkXGps/sBqlzgX0H5dHvxp/9Jbx/Dafb8EcolpD/0yyibWoune3dbrFarVMt1qEnxf4fNHLxt9ydBxvvZxkLJhT7aF/pidI3uqfo3kWS+xCTiAe4pHV0l5Y/yXcGGV07bbBkSVeHNoSYsSBrCd2HM1a7BhYevEjPx5Z4leyIffL6tqi3u9wrEVDUW1/ZhizYUuxZSBDTp2jrEvVjfm+KTjoltqW2l1Gi8W4CzK8C3P0/sSy6KeYY+CR6+Lul0fLrTCiHIFhdEm49MwydKcKupK4g6YAri6V4SDf8ZtJr4ya0KT3/eZHejJAPwy85SfmH6GwacIovXT/weg1B336URNGvTz54I/0b4G3AqQULvgnK2x6BeabAebbIZhvmVwFPLugTFVOXCHBWwXzJE0UnJBaSJrKXlDGl0PnhIhXZbpwasCTpRMESSppWBRavLUsjah0mSX+TST9sj9s1Pof3PvlwkVfPHGj233ZB5ervK76cePq9frg8gUTStc8MlvOGjN8yjD614Nbjq44I2rd1kyzrSAl+Uz7e5sVGB6W1dAeN1cOb2+XZHhvSTba/C637A663HadNxB0B82BoN9mNJmDZtlk9nJVAZ+rQDLI6k+zg3cevbN1Me1Z3Hpnz53BzE8/MQ+DkhltxMNKhpk/6a863d19ulvIXz4TzsAln2YG4UzrYlK0cDaUBHJiJbMX0uHdeC1rV0QukKcCjIVR4UwZgEVUbkEUbG5lemdUBfysDVLDS6NGzW2nb259kX64i/aEhZwxlavmEr585aRJKyfJZS9RSn+e2+5vpM/m0W0RgdxAGlbNHRU9Pqk6CFfgs0ih3AbzWIcrmlSpzHIZzE9J9mqIN5Dh0Bc43EErzNFA0K4h9jRBOHkn0c1/NPTCsrt/LDhJ76f3H8l8hZQ+fhf9YaCUzCFzjmRsOPi9tHdT+6stc1+7lbaTrv0kY09vZ6yAdNH2TZ/dO5tDWBmB91XWUhas5qJfriYuX2WWVPkOd0DF3ttURQBS+eHH1stWtl7WwXoJkhbi27CBvkOfoO9s2MA/uGbvmjV7Yf56ercSj5CPoA0v7s+EvTBuz44de2A7jhetie4Ph8PQnlQuAmu7DeaFFqC3GcYgD2ZICcyRIFfLNcBqn3CO9W7T2fTQJG9si0P2ILTTCeeGHMN5VcKx3Abv4GDvcKyottfBQC7xKP99K4otsMIj2GF8KyLM/mhCyaGhV5AuBBsxEKL6BAo8EfZHUyzsqnAYcLonnocTsSy8N+KDsLSX0QjWoVSCLUYluIOwMGCVwFIAiuFkjGKgPZAR9vb2huP/SD/0H4/TD0J+y5r+JxJOIy7hYMyPwLNk6OU8xCV6ux5oCQcb3YBPcJrMLnuBSnY57AVyICicjJrKIhW3CCeFk/3DW2oBioX50vZMX9Eh+vLs2fTlQ4X+zHbhJCnuO6haXYt9EWavFv39n299Vn5+9+7n5WdvVXCePFJeA9SgDikYINIQ8dmAfkN0Jkt3bLdYaEvfAVXJAeu06F/5rB3Rk2Pk1u1AY9Gp/cPEYwcspP8mPnNH9K89HNCV8AfvcQRmip1rhZW7jGuHonS+jDjyVWmET8+wEpi5IQJz2JSRzuM0dkFpgNGMLlmyF7gDDi8sPJdkNAAFaTKbAGkAzRMiCHjZFS4AlJIpj+g1JKRyw3leQ1y830f0eLt8ZOHzP9H36Qv0/Z+eXwh5UklGk8qfnu97nawkE3/cseNH+gy9iT6DOVJP319qSNMbr5pu068k89+7k5jbfLPNpmxRqGrIz6c/Gl1qtUFrMGyebl9qdxggO72dPEdEQW3SyElzPuw9Rja99T9C8derNy5eLIxSHrXwrCaIs4Y8dCJrSF+R4Ffz3nKSRPa9snKBPGG8ZXhhkVqctaXueEsL/w+iVgl80EeSJV4g/iBR0yPRXP55Oaul5cphj/zhT3SbcFPfyQXk2m+foW9HdxZbOTE2Z9tgRslcMluxHK5FAhB7yOYR1/VuVTX3Hwe6hm18a3S/3Hb6tLgO1kTP4AYwcQbpkkU5DWiLEqjN5y4DvJgRdKepzAgJgwHnL4uEmWOrHh+X9d59D8x/ds+KqvTsrx65bd584clzlfIfbb6wwZW+kwyf+pfyLQfePXPlH/pbW3edqxCnlzhAS6qA8krh0vEd9UBv2wgAErbBC2qIDZBZdH/fFOJRdfdNUXVH90f3C/kIMeS2vinR/eIxeMF2BACYklNYN59Ap7oQBxZIlkGuwMtAwAAc0JFYuaq5Zep1tAc5hRa+tWUNbggJesKQiut2jH+O9hDPmhZyCstpO2wpAAwGymDJMByHz9UAvNVBT2dxFi4f3wuf5oSHiIJXb7MLXhLfYJlqeCBYi2pPn64lz0fCAKbDkTDQQ/EdAvlTyrjWFp15iZdCRbVhfOzgBnTtyf5MoZO203ZG/yjvH0YYRJwBIMfgVfNd6YwSF3Vp+MrKgS/Av6iaVFj7Lv383XdvHDexvyMj0nkjy1ZLuyNSQ0mk7x9wTAretfOrIv2dVz7G8kJtoT+BH9AyjmB4/E0Nkj0OXOH9uDh284Vk78C5KqsqD9Z9lZU3fyGl+caN8535J+zFf/du5Q8pCO5+IiYZLWU1LRUKbiuaWOOzZ0mSKr26cUn74pHeZLktdpsPqzjzEi4HoZchPtqjzm6Z0jZ7zshihheL+EOeMTNLine truncated
url(../fonts/dashicons.ttf) format("truetype"),
url(../fonts/dashicons.svg#dashicons) format("svg");
font-weight: normal;
font-style: normal;
}
.dashicons,
.dashicons-before:before {
display: inline-block;
width: 20px;
height: 20px;
font-size: 20px;
line-height: 1;
font-family: "dashicons";
text-decoration: inherit;
font-weight: normal;
font-style: normal;
vertical-align: top;
text-align: center;
-webkit-transition: color .1s ease-in 0;
transition: color .1s ease-in 0;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Admin Menu Icons */
.dashicons-menu:before {
content: "\f333";
}
.dashicons-admin-site:before {
content: "\f319";
}
.dashicons-dashboard:before {
content: "\f226";
}
.dashicons-admin-media:before {
content: "\f104";
}
.dashicons-admin-page:before {
content: "\f105";
}
.dashicons-admin-comments:before {
content: "\f101";
}
.dashicons-admin-appearance:before {
content: "\f100";
}
.dashicons-admin-plugins:before {
content: "\f106";
}
.dashicons-admin-users:before {
content: "\f110";
}
.dashicons-admin-tools:before {
content: "\f107";
}
.dashicons-admin-settings:before {
content: "\f108";
}
.dashicons-admin-network:before {
content: "\f112";
}
.dashicons-admin-generic:before {
content: "\f111";
}
.dashicons-admin-home:before {
content: "\f102";
}
.dashicons-admin-collapse:before {
content: "\f148";
}
/* Both Admin Menu and Post Formats */
.dashicons-admin-links:before,
.dashicons-format-links:before {
content: "\f103";
}
.dashicons-admin-post:before,
.dashicons-format-standard:before {
content: "\f109";
}
/* Post Format Icons */
.dashicons-format-image:before {
content: "\f128";
}
.dashicons-format-gallery:before {
content: "\f161";
}
.dashicons-format-audio:before {
content: "\f127";
}
.dashicons-format-video:before {
content: "\f126";
}
.dashicons-format-chat:before {
content: "\f125";
}
.dashicons-format-status:before {
content: "\f130";
}
.dashicons-format-aside:before {
content: "\f123";
}
.dashicons-format-quote:before {
content: "\f122";
}
/* Welcome Screen Icons */
.dashicons-welcome-write-blog:before,
.dashicons-welcome-edit-page:before {
content: "\f119";
}
.dashicons-welcome-add-page:before {
content: "\f133";
}
.dashicons-welcome-view-site:before {
content: "\f115";
}
.dashicons-welcome-widgets-menus:before {
content: "\f116";
}
.dashicons-welcome-comments:before {
content: "\f117";
}
.dashicons-welcome-learn-more:before {
content: "\f118";
}
/* Image Editing Icons */
.dashicons-image-crop:before {
content: "\f165";
}
.dashicons-image-rotate-left:before {
content: "\f166";
}
.dashicons-image-rotate-right:before {
content: "\f167";
}
.dashicons-image-flip-vertical:before {
content: "\f168";
}
.dashicons-image-flip-horizontal:before {
content: "\f169";
}
/* Both Image Editing and TinyMCE */
.dashicons-undo:before {
content: "\f171";
}
.dashicons-redo:before {
content: "\f172";
}
/* TinyMCE Icons */
.dashicons-editor-bold:before {
content: "\f200";
}
.dashicons-editor-italic:before {
content: "\f201";
}
.dashicons-editor-ul:before {
content: "\f203";
}
.dashicons-editor-ol:before {
content: "\f204";
}
.dashicons-editor-quote:before {
content: "\f205";
}
.dashicons-editor-alignleft:before {
content: "\f206";
}
.dashicons-editor-aligncenter:before {
content: "\f207";
}
.dashicons-editor-alignright:before {
content: "\f208";
}
.dashicons-editor-insertmore:before {
content: "\f209";
}
.dashicons-editor-spellcheck:before {
content: "\f210";
}
.dashicons-editor-distractionfree:before,
.dashicons-editor-expand:before {
content: "\f211";
}
.dashicons-editor-contract:before {
content: "\f506";
}
.dashicons-editor-kitchensink:before {
content: "\f212";
}
.dashicons-editor-underline:before {
content: "\f213";
}
.dashicons-editor-justify:before {
content: "\f214";
}
.dashicons-editor-textcolor:before {
content: "\f215";
}
.dashicons-editor-paste-word:before {
content: "\f216";
}
.dashicons-editor-paste-text:before {
content: "\f217";
}
.dashicons-editor-removeformatting:before {
content: "\f218";
}
.dashicons-editor-video:before {
content: "\f219";
}
.dashicons-editor-customchar:before {
content: "\f220";
}
.dashicons-editor-outdent:before {
content: "\f221";
}
.dashicons-editor-indent:before {
content: "\f222";
}
.dashicons-editor-help:before {
content: "\f223";
}
.dashicons-editor-strikethrough:before {
content: "\f224";
}
.dashicons-editor-unlink:before {
content: "\f225";
}
.dashicons-editor-rtl:before {
content: "\f320";
}
.dashicons-editor-break:before {
content: "\f474";
}
.dashicons-editor-code:before {
content: "\f475";
}
.dashicons-editor-paragraph:before {
content: "\f476";
}
/* Post Icons */
.dashicons-align-left:before {
content: "\f135";
}
.dashicons-align-right:before {
content: "\f136";
}
.dashicons-align-center:before {
content: "\f134";
}
.dashicons-align-none:before {
content: "\f138";
}
.dashicons-lock:before {
content: "\f160";
}
.dashicons-calendar:before {
content: "\f145";
}
.dashicons-calendar-alt:before {
content: "\f508";
}
.dashicons-visibility:before {
content: "\f177";
}
.dashicons-post-status:before {
content: "\f173";
}
.dashicons-edit:before {
content: "\f464";
}
.dashicons-post-trash:before,
.dashicons-trash:before {
content: "\f182";
}
/* Sorting */
.dashicons-external:before {
content: "\f504";
}
.dashicons-arrow-up:before {
content: "\f142";
}
.dashicons-arrow-down:before {
content: "\f140";
}
.dashicons-arrow-left:before {
content: "\f141";
}
.dashicons-arrow-right:before {
content: "\f139";
}
.dashicons-arrow-up-alt:before {
content: "\f342";
}
.dashicons-arrow-down-alt:before {
content: "\f346";
}
.dashicons-arrow-left-alt:before {
content: "\f340";
}
.dashicons-arrow-right-alt:before {
content: "\f344";
}
.dashicons-arrow-up-alt2:before {
content: "\f343";
}
.dashicons-arrow-down-alt2:before {
content: "\f347";
}
.dashicons-arrow-left-alt2:before {
content: "\f341";
}
.dashicons-arrow-right-alt2:before {
content: "\f345";
}
.dashicons-leftright:before {
content: "\f229";
}
.dashicons-sort:before {
content: "\f156";
}
.dashicons-randomize:before {
content: "\f503"
}
.dashicons-list-view:before {
content: "\f163";
}
.dashicons-exerpt-view:before, /* Misspelled. Use .dashicons-excerpt-view instead. */
.dashicons-excerpt-view:before {
content: "\f164";
}
.dashicons-grid-view:before {
content: "\f509";
}
/* WPorg specific icons: Jobs, Profiles, WordCamps */
.dashicons-hammer:before {
content: "\f308";
}
.dashicons-art:before {
content: "\f309";
}
.dashicons-migrate:before {
content: "\f310";
}
.dashicons-performance:before {
content: "\f311";
}
.dashicons-universal-access:before {
content: "\f483";
}
.dashicons-universal-access-alt:before {
content: "\f507";
}
.dashicons-tickets:before {
content: "\f486";
}
.dashicons-nametag:before {
content: "\f484";
}
.dashicons-clipboard:before {
content: "\f481";
}
.dashicons-heart:before {
content: "\f487";
}
.dashicons-megaphone:before {
content: "\f488";
}
.dashicons-schedule:before {
content: "\f489";
}
/* Internal/Products */
.dashicons-wordpress:before {
content: "\f120";
}
.dashicons-wordpress-alt:before {
content: "\f324";
}
.dashicons-pressthis:before {
content: "\f157";
}
.dashicons-update:before {
content: "\f463";
}
.dashicons-screenoptions:before {
content: "\f180";
}
.dashicons-info:before {
content: "\f348";
}
.dashicons-cart:before {
content: "\f174";
}
.dashicons-feedback:before {
content: "\f175";
}
.dashicons-cloud:before {
content: "\f176";
}
.dashicons-translation:before {
content: "\f326";
}
/* Taxonomies */
.dashicons-tag:before {
content: "\f323";
}
.dashicons-category:before {
content: "\f318";
}
/* Widget icons */
.dashicons-archive:before {
content: "\f480";
}
.dashicons-tagcloud:before {
content: "\f479";
}
.dashicons-text:before {
content: "\f478";
}
/* Media icons */
.dashicons-media-archive:before {
content: "\f501"
}
.dashicons-media-audio:before {
content: "\f500"
}
.dashicons-media-code:before {
content: "\f499"
}
.dashicons-media-default:before {
content: "\f498"
}
.dashicons-media-document:before {
content: "\f497"
}
.dashicons-media-interactive:before {
content: "\f496"
}
.dashicons-media-spreadsheet:before {
content: "\f495"
}
.dashicons-media-text:before {
content: "\f491"
}
.dashicons-media-video:before {
content: "\f490"
}
.dashicons-playlist-audio:before {
content: "\f492"
}
.dashicons-playlist-video:before {
content: "\f493"
}
.dashicons-controls-play:before {
content: "\f522"
}
.dashicons-controls-pause:before {
content: "\f523"
}
.dashicons-controls-forward:before {
content: "\f519"
}
.dashicons-controls-skipforward:before {
content: "\f517"
}
.dashicons-controls-back:before {
content: "\f518"
}
.dashicons-controls-skipback:before {
content: "\f516"
}
.dashicons-controls-repeat:before {
content: "\f515"
}
.dashicons-controls-volumeon:before {
content: "\f521"
}
.dashicons-controls-volumeoff:before {
content: "\f520"
}
/* Alerts/Notifications/Flags */
.dashicons-yes:before {
content: "\f147";
}
.dashicons-no:before {
content: "\f158";
}
.dashicons-no-alt:before {
content: "\f335";
}
.dashicons-plus:before {
content: "\f132";
}
.dashicons-plus-alt:before {
content: "\f502"
}
.dashicons-minus:before {
content: "\f460";
}
.dashicons-dismiss:before {
content: "\f153";
}
.dashicons-marker:before {
content: "\f159";
}
.dashicons-star-filled:before {
content: "\f155";
}
.dashicons-star-half:before {
content: "\f459";
}
.dashicons-star-empty:before {
content: "\f154";
}
.dashicons-flag:before {
content: "\f227";
}
/* Social Icons */
.dashicons-share:before {
content: "\f237";
}
.dashicons-share1:before {
content: "\f237";
}
.dashicons-share-alt:before {
content: "\f240";
}
.dashicons-share-alt2:before {
content: "\f242";
}
.dashicons-twitter:before {
content: "\f301";
}
.dashicons-rss:before {
content: "\f303";
}
.dashicons-email:before {
content: "\f465";
}
.dashicons-email-alt:before {
content: "\f466";
}
.dashicons-facebook:before {
content: "\f304";
}
.dashicons-facebook-alt:before {
content: "\f305";
}
.dashicons-networking:before {
content: "\f325";
}
.dashicons-googleplus:before {
content: "\f462";
}
/* Misc/CPT */
.dashicons-location:before {
content: "\f230";
}
.dashicons-location-alt:before {
content: "\f231";
}
.dashicons-camera:before {
content: "\f306";
}
.dashicons-images-alt:before {
content: "\f232";
}
.dashicons-images-alt2:before {
content: "\f233";
}
.dashicons-video-alt:before {
content: "\f234";
}
.dashicons-video-alt2:before {
content: "\f235";
}
.dashicons-video-alt3:before {
content: "\f236";
}
.dashicons-vault:before {
content: "\f178";
}
.dashicons-shield:before {
content: "\f332";
}
.dashicons-shield-alt:before {
content: "\f334";
}
.dashicons-sos:before {
content: "\f468";
}
.dashicons-search:before {
content: "\f179";
}
.dashicons-slides:before {
content: "\f181";
}
.dashicons-analytics:before {
content: "\f183";
}
.dashicons-chart-pie:before {
content: "\f184";
}
.dashicons-chart-bar:before {
content: "\f185";
}
.dashicons-chart-line:before {
content: "\f238";
}
.dashicons-chart-area:before {
content: "\f239";
}
.dashicons-groups:before {
content: "\f307";
}
.dashicons-businessman:before {
content: "\f338";
}
.dashicons-id:before {
content: "\f336";
}
.dashicons-id-alt:before {
content: "\f337";
}
.dashicons-products:before {
content: "\f312";
}
.dashicons-awards:before {
content: "\f313";
}
.dashicons-forms:before {
content: "\f314";
}
.dashicons-testimonial:before {
content: "\f473";
}
.dashicons-portfolio:before {
content: "\f322";
}
.dashicons-book:before {
content: "\f330";
}
.dashicons-book-alt:before {
content: "\f331";
}
.dashicons-download:before {
content: "\f316";
}
.dashicons-upload:before {
content: "\f317";
}
.dashicons-backup:before {
content: "\f321";
}
.dashicons-clock:before {
content: "\f469";
}
.dashicons-lightbulb:before {
content: "\f339";
}
.dashicons-microphone:before {
content: "\f482";
}
.dashicons-desktop:before {
content: "\f472";
}
.dashicons-tablet:before {
content: "\f471";
}
.dashicons-smartphone:before {
content: "\f470";
}
.dashicons-phone:before {
content: "\f525";
}
.dashicons-smiley:before {
content: "\f328";
}
.dashicons-index-card:before {
content: "\f510";
}
.dashicons-carrot:before {
content: "\f511";
}
.dashicons-building:before {
content: "\f512";
}
.dashicons-store:before {
content: "\f513";
}
.dashicons-album:before {
content: "\f514";
}
.dashicons-palmtree:before {
content: "\f527";
}
.dashicons-tickets-alt:before {
content: "\f524";
}
.dashicons-money:before {
content: "\f526";
}
+1
View File
@@ -0,0 +1 @@
@font-face{font-family:dashicons;src:url(../fonts/dashicons.eot)}@font-face{font-family:dashicons;src:url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAGBQAA4AAAAAm3wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABwAAAAcbYyDmkdERUYAAAFgAAAAHgAAACABIwAET1MvMgAAAYAAAABAAAAAYJYFaatjbWFwAAABwAAAASoAAAKC/cQq02dhc3AAAALsAAAACAAAAAj//wADZ2x5ZgAAAvQAAFSXAACESOAO2gZoZWFkAABXjAAAAC4AAAA2CEgozmhoZWEAAFe8AAAAGgAAACQPogifaG10eAAAV9gAAAEcAAAD2GOq3ltsb2NhAABY9AAAAe4AAAHu4pbA6m1heHAAAFrkAAAAHwAAACABSQC1bmFtZQAAWwQAAAGKAAADLCbHbA5wb3N0AABckAAAA7UAAAmnz3C/rndlYmYAAGBIAAAABgAAAAY81VSHAAAAAQAAAADMPaLPAAAAANCh83cAAAAA0KztU3jaY2BkYGDgA2IJBhBgYmAEwq9AzALmMQAADtEBKAAAeNpjYGY/yTiBgZWBhVWEZQMDA8M0CM20h8GIKQLIB0phB6He4X4MDqp/vqqzXwDxgaQGkGJEUqLAwAgAMrcKp3ja3ZA7SwNRFITPNTGy7N3jglosWCxIkHRBVAw2q6JJQEWMILGQ9dHEKjZCwCKNhZ2t/8hGG1EwWKuVOvehjbouCVhYWzlw5jAwfMUQUYZ6N0oidRLHaRLdnBVx+jcoon4azn/AwRACjKGAIqZRwgIWUUEdO2ighRMllKMCVVAlFal57ehAF3RJV03VbJq6iU3DtMypObdZ69jAjicJUUol+BhBiHxKncAMopRaRg0x9nCItiKVUb4KVbFLFdrXoS7qyFTMWpe6a5qmbc4s2Zz1bZgknYHBLH/xJ7/zG7/yCz/zEz/yA9/zLd/wFV/wKq9wmed4lqd40jvymt6Bt+9ty1huybqsyXW5LJdk5HbcO/favewt8/cSOfpBi77U+n4X6N/rG5Q9gGkAAAAAAAH//wACeNqsvQd8FGX6OD7vzM7Mbtpmsy1tN9lsS9nUbSFlEyD00EKLBaQsPWAUaRJQMSIqJTZsiA0Re1TkLBxnO107clFPDz3Uk+PUO/WOrwdJ9vX3PO/sJhvE+973//lnM/O+887MO++85enPM5zIwR85xR/iBE7iNFwKp+W4Sp1NJ+hterOO2JKJTk9O9T5CH4s8QneQ6Y9EHuEPRZvIDdzPtOdnQqMfcj8TD+W5nznCJfxVchzPhbmo/ILUC3X6OU5DgiFiMluJ2SoEghoiS4Y8YjLIabwswc7Kh0gwEAzxwUAVlFcFxf3R+l1Z626pKX1gWknd7JYVNdGHovVPWSzLLJacUYtNI+y+KRXy2CWXXOIr8KY2+3It0+DUNIuwiX91V26q3WXdUpaZa0slKdGH+FefYmenW3ICY9Mr7b5LLlkyVq6Y7Cto0q0cmcPq5AjxcBGpUVZzGdAntiqTUWeQSgjR2Qtcfp0vQE4JnS1r1rREaEoEUlm9piXa1LKGppBTa1r4Qy1r4LUF7t9QxyfSR9CXaawes6whbg3xe0UC3Yqb1HjHsuj66Ppl/I+kKxLdz7f2TRHyabtq0x3L+GtZOW2P3Bl9OPooP4NqySmaAvVGuF1ym1zDZXIurg7qNaVrSRpxkwYS8LldBVpCXAHI52vYsSQTyWA2BWRikrREyne70htIiJhZaZX0j02b7mj5chmRmpsbGhqebphIn7AMa7n9CrKw/1velJdX0JoX/RaTMrLHiifo7iuUW+j8xsaGp6VDWHJ7yzArESc2QwWNjc30iWVfttyxqW8WVHB+Xj5vjX7D0jfIPezEpk1k0Sa4xULnNTzd2MBxKpgfYXinNk7P5XBFOEeIzucqIW6bbC+QoPdNXltVgKsyGaQCl0+06Vga8FaZdTbo0IFD0VBb9NA1tP2ah4pqa4uEk0W10cYjN9105CbhIDkFyU1LzDm0B/pUyQud/KGi2kiktijaBDfwz2DxEVXfiSV4j0jOUHkpvZ8dcPzAnBBgRDkcPtFmtOm8fKtwsu+AkN+fGSGnREPvd+GIaMDx/4Y7If1FOsmp4Z0cOOvdJICzXgwSOY3YbbJU4Hb5GuBNAxrljEzEPHroRdKUfaHLndH/+gXCNWurvp1HOzo8HR6Pp6NekEhTFp7LpoekXOVSvdt1wdvt/RumV42Ai0o2ejpI59xTdC+cyoBT2fRFWH8R7nUpKvVzRs4GbZdUboI9FiSujGDAYdbwJgkXGps/sBqlzgX0H5dHvxp/9Jbx/Dafb8EcolpD/0yyibWoune3dbrFarVMt1qEnxf4fNHLxt9ydBxvvZxkLJhT7aF/pidI3uqfo3kWS+xCTiAe4pHV0l5Y/yXcGGV07bbBkSVeHNoSYsSBrCd2HM1a7BhYevEjPx5Z4leyIffL6tqi3u9wrEVDUW1/ZhizYUuxZSBDTp2jrEvVjfm+KTjoltqW2l1Gi8W4CzK8C3P0/sSy6KeYY+CR6+Lul0fLrTCiHIFhdEm49MwydKcKupK4g6YAri6V4SDf8ZtJr4ya0KT3/eZHejJAPwy85SfmH6GwacIovXT/weg1B336URNGvTz54I/0b4G3AqQULvgnK2x6BeabAebbIZhvmVwFPLugTFVOXCHBWwXzJE0UnJBaSJrKXlDGl0PnhIhXZbpwasCTpRMESSppWBRavLUsjah0mSX+TST9sj9s1Pof3PvlwkVfPHGj233ZB5ervK76cePq9frg8gUTStc8MlvOGjN8yjD614Nbjq44I2rd1kyzrSAl+Uz7e5sVGB6W1dAeN1cOb2+XZHhvSTba/C637A663HadNxB0B82BoN9mNJmDZtlk9nJVAZ+rQDLI6k+zg3cevbN1Me1Z3Hpnz53BzE8/MQ+DkhltxMNKhpk/6a863d19ulvIXz4TzsAln2YG4UzrYlK0cDaUBHJiJbMX0uHdeC1rV0QukKcCjIVR4UwZgEVUbkEUbG5lemdUBfysDVLDS6NGzW2nb259kX64i/aEhZwxlavmEr585aRJKyfJZS9RSn+e2+5vpM/m0W0RgdxAGlbNHRU9Pqk6CFfgs0ih3AbzWIcrmlSpzHIZzE9J9mqIN5Dh0Bc43EErzNFA0K4h9jRBOHkn0c1/NPTCsrt/LDhJ76f3H8l8hZQ+fhf9YaCUzCFzjmRsOPi9tHdT+6stc1+7lbaTrv0kY09vZ6yAdNH2TZ/dO5tDWBmB91XWUhas5qJfriYuX2WWVPkOd0DF3ttURQBS+eHH1stWtl7WwXoJkhbi27CBvkOfoO9s2MA/uGbvmjV7Yf56ercSj5CPoA0v7s+EvTBuz44de2A7jhetie4Ph8PQnlQuAmu7DeaFFqC3GcYgD2ZICcyRIFfLNcBqn3CO9W7T2fTQJG9si0P2ILTTCeeGHMN5VcKx3Abv4GDvcKyottfBQC7xKP99K4otsMIj2GF8KyLM/mhCyaGhV5AuBBsxEKL6BAo8EfZHUyzsqnAYcLonnocTsSy8N+KDsLSX0QjWoVSCLUYluIOwMGCVwFIAiuFkjGKgPZAR9vb2huP/SD/0H4/TD0J+y5r+JxJOIy7hYMyPwLNk6OU8xCV6ux5oCQcb3YBPcJrMLnuBSnY57AVyICicjJrKIhW3CCeFk/3DW2oBioX50vZMX9Eh+vLs2fTlQ4X+zHbhJCnuO6haXYt9EWavFv39n299Vn5+9+7n5WdvVXCePFJeA9SgDikYINIQ8dmAfkN0Jkt3bLdYaEvfAVXJAeu06F/5rB3Rk2Pk1u1AY9Gp/cPEYwcspP8mPnNH9K89HNCV8AfvcQRmip1rhZW7jGuHonS+jDjyVWmET8+wEpi5IQJz2JSRzuM0dkFpgNGMLlmyF7gDDi8sPJdkNAAFaTKbAGkAzRMiCHjZFS4AlJIpj+g1JKRyw3leQ1y830f0eLt8ZOHzP9H36Qv0/Z+eXwh5UklGk8qfnu97nawkE3/cseNH+gy9iT6DOVJP319qSNMbr5pu068k89+7k5jbfLPNpmxRqGrIz6c/Gl1qtUFrMGyebl9qdxggO72dPEdEQW3SyElzPuw9Rja99T9C8derNy5eLIxSHrXwrCaIs4Y8dCJrSF+R4Ffz3nKSRPa9snKBPGG8ZXhhkVqctaXueEsL/w+iVgl80EeSJV4g/iBR0yPRXP55Oaul5cphj/zhT3SbcFPfyQXk2m+foW9HdxZbOTE2Z9tgRslcMluxHK5FAhB7yOYR1/VuVTX3Hwe6hm18a3S/3Hb6tLgO1kTP4AYwcQbpkkU5DWiLEqjN5y4DvJgRdKepzAgJgwHnL4uEmWOrHh+X9d59D8x/ds+KqvTsrx65bd584clzlfIfbb6wwZW+kwyf+pfyLQfePXPlH/pbW3edqxCnlzhAS6qA8krh0vEd9UBv2wgAErbBC2qIDZBZdH/fFOJRdfdNUXVH90f3C/kIMeS2vinR/eIxeMF2BACYklNYN59Ap7oQBxZIlkGuwMtAwAAc0JFYuaq5Zep1tAc5hRa+tWUNbggJesKQiut2jH+O9hDPmhZyCstpO2wpAAwGymDJMByHz9UAvNVBT2dxFi4f3wuf5oSHiIJXb7MLXhLfYJlqeCBYi2pPn64lz0fCAKbDkTDQQ/EdAvlTyrjWFp15iZdCRbVhfOzgBnTtyf5MoZO203ZG/yjvH0YYRJwBIMfgVfNd6YwSF3Vp+MrKgS/Av6iaVFj7Lv383XdvHDexvyMj0nkjy1ZLuyNSQ0mk7x9wTAretfOrIv2dVz7G8kJtoT+BH9AyjmB4/E0Nkj0OXOH9uDh284Vk78C5KqsqD9Z9lZU3fyGl+caN8535J+zLine truncated
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);-webkit-transition:none;transition:none}.mce-window{-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3);-webkit-font-smoothing:subpixel-antialiased;-webkit-transition:none;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #dfdfdf;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 16px 0 36px}.mce-window .mce-window-head .mce-close{color:transparent;top:0;left:0;width:36px;height:36px;line-height:36px;text-align:center}.mce-window .mce-window-head .mce-close:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window .mce-window-head .mce-close:hover:before{color:#00a0d2}.mce-window .mce-window-head .mce-dragh{width:-webkit-calc(100% - 36px);width:calc(100% - 36px)}.mce-wp-help .mce-window-head{border-bottom:none}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);-webkit-transition:.05s all ease-in-out;transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0 3px 5px rgba(0,0,0,.2);box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff;-webkit-filter:none;filter:none}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #dedede;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.15);box-shadow:0 1px 3px rgba(0,0,0,.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;right:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:''}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-18px;border-bottom-color:#a0a5aa;border-width:9px;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-18px;border-top-color:#a0a5aa;border-width:9px;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-16px;border-bottom-color:#f5f5f5;border-width:8px;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-16px;border-top-color:#f5f5f5;border-width:8px;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{right:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-full{left:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-left:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px;line-height:18px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none;cursor:pointer}#wp-fullscreen-buttons .mce-btn,.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;background-image:none;-webkit-border-radius:2px;border-radius:2px;-webkit-filter:none;filter:none}#wp-fullscreen-buttons .mce-btn:focus,#wp-fullscreen-buttons .mce-btn:hover,.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qtLine truncated
+1563 -1709
View File
File diff suppressed because it is too large. Load diff
+1 -28
View File
@@ -1,28 +1 @@
.wp_themeSkin table,.wp_themeSkin tbody,.wp_themeSkin a,.wp_themeSkin img,.wp_themeSkin tr,.wp_themeSkin div,.wp_themeSkin td,.wp_themeSkin iframe,.wp_themeSkin span,.wp_themeSkin *,.wp_themeSkin .mceText{border:0;margin:0;padding:0;white-space:nowrap;text-decoration:none;font-weight:normal;cursor:default;vertical-align:baseline;width:auto;border-collapse:separate}.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{text-decoration:none;font-weight:normal;cursor:default}.wp_themeSkin table td{vertical-align:middle}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#555}.wp_themeSkin iframe{display:block}.wp_themeSkin #mce_fullscreen_ifr{background-color:#fff}.wp_themeSkin .mceToolbar{padding:1px}.wp_themeSkin .mceExternalToolbar{position:absolute;border-bottom:0;display:none}.wp_themeSkin .mceExternalToolbar td.mceToolbar{padding-right:13px}.wp_themeSkin .mceExternalClose{position:absolute;top:3px;right:3px;width:7px;height:7px;background:url("../js/tinymce/themes/advanced/img/icons.gif") -820px 0}.wp_themeSkin table.mceToolbar,.wp_themeSkin tr.mceFirst .mceToolbar tr td,.wp_themeSkin tr.mceLast .mceToolbar tr td{border:0;margin:0;padding:0}.wp_themeSkin table.mceLayout{border:0}.wp_themeSkin .mceStatusbar{display:block;font-family:sans-serif;font-size:12px;line-height:16px;padding:0 0 0 8px;overflow:visible;height:20px;border-top:1px solid #dfdfdf;color:#000;background-color:#f5f5f5}.rtl .wp_themeSkin .mceStatusbar{padding:0 8px 0 0}.wp_themeSkin .mceStatusbar *{color:#555}.wp_themeSkin .mceStatusbar div{float:left;padding:2px}.rtl .wp_themeSkin .mceStatusbar div{float:right}.wp_themeSkin .mceStatusbar a.mceResize{display:block;float:right;background:url("../js/tinymce/themes/advanced/img/icons.gif") -800px 0;width:20px;height:20px;cursor:se-resize}.rtl .wp_themeSkin .mceStatusbar a.mceResize{float:left}.wp_themeSkin .mceStatusbar a:hover{text-decoration:underline}.wp_themeSkin table.mceToolbar{margin:0 6px 2px}.wp_themeSkin table.mceToolbar :active,.wp_themeSkin table.mceToolbar :focus,.wp_themeSkin table.mceToolbar:focus,.wp_themeSkin span.mceSeparator:focus{outline:0}.wp_themeSkin #content_toolbar1{margin-top:2px}.wp_themeSkin .mceToolbar .mceToolbarEndListBox span{display:none}.wp_themeSkin span.mceIcon,.wp_themeSkin img.mceIcon{display:block;width:20px;height:20px}.wp_themeSkin .mceIcon{background:url("../js/tinymce/themes/advanced/img/icons.gif") no-repeat 20px 20px}.wp_themeSkin .mceButton{display:block;width:20px;height:20px;cursor:default;padding:1px 2px;margin:1px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin a.mceButtonEnabled:hover{background-image:inherit 0 -10px}.wp_themeSkin .mceOldBoxModel a.mceButton span,.wp_themeSkin .mceOldBoxModel a.mceButton img{margin:0 0 0 1px}.wp_themeSkin .mceButtonDisabled .mceIcon{opacity:.2;filter:alpha(opacity=20)}.wp_themeSkin .mceSeparator{display:none}.wp_themeSkin .mceListBox,.wp_themeSkin .mceListBox a{display:block}.wp_themeSkin .mceListBox .mceText{padding:1px 4px 1px 5px;width:70px;text-align:left;text-decoration:none;-webkit-border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;border-bottom-left-radius:2px;border-top-left-radius:2px;font-family:sans-serif;font-size:12px;height:20px;line-height:20px;overflow:hidden}.wp_themeSkin .mceListBox{margin:1px;direction:ltr;background-color:#fff;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.wp_themeSkin .mceListBox .mceOpen{width:12px;height:20px;border-collapse:separate;padding:1px;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.wp_themeSkin .mceListBox .mceFirst a{border-style:solid;border-width:1px;border-bottom-right-radius:2px;border-top-right-radius:2px}.wp_themeSkin .mceListBoxMenu .mce_formatPreview{line-height:normal}.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin table.mceListBoxEnabled .mceOpen{background-image:url("../images/down_arrow.gif");background-position:3px 1px;background-repeat:no-repeat}.wp_themeSkin .mceListBoxDisabled .mceText{color:gray}.wp_themeSkin .mceListBoxMenu{overflow:auto;overflow-x:hidden}.wp_themeSkin .mceOldBoxModel .mceListBox .mceText{height:22px}.wp_themeSkin select.mceListBox{font-family:sans-serif;font-size:12px;border-color:#b2b2b2;background-color:#fff}.wp_themeSkin .mceSplitButton a,.wp_themeSkin .mceSplitButton span{display:block;height:20px}.wp_themeSkin .mceSplitButton{display:block;direction:ltr}.wp_themeSkin table.mceSplitButton td{padding:2px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin table.mceSplitButton:hover td{background-image:inherit 0 -10px}.wp_themeSkin .mceSplitButton a.mceAction{height:20px;width:20px;padding:1px 2px;border-right:0 none}.wp_themeSkin .mceSplitButton span.mceAction{bacLine truncated
* jQuery UI CSS Framework 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}/*!
* jQuery UI Resizable 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}/*!
* jQuery UI Dialog 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{padding:0;z-index:300002;border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3);background-color:#f5f5f5;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-content{padding:0}.wp-dialog .ui-dialog-titlebar-close{cursor:pointer;-webkit-appearance:none;border:0;width:29px;height:16px;top:13px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px}.wp-dialog .ui-dialog-titlebar-close .ui-button-text{display:none}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{z-index:300001;background-color:#000;opacity:.6;filter:alpha(opacity=60)}.rtl .wp-dialog .ui-dialog-titlebar-close{right:auto;left:6px}.rtl #wp-link #internal-toggle{padding-right:18px;padding-left:0}.rtl #wp-link #link-options label span,.rtl #wp-link #search-panel label span.search-label{text-align:left;padding-right:0;padding-left:5px}.rtl #wp-link #link-options label #url-field{direction:ltr}.rtl #wp-link .link-search-field,.rtl #wp-link .link-search-wrapper span{float:right}.rtl #wp-link .link-target{margin-right:87px;margin-left:0}.rtl #wp-link .item-info{left:5px;right:auto;top:4px;bottom:0}.rtl #wp-link #search-panel{float:right}.rtl #wp-link-cancel{float:right}.rtl #wp-link-update{float:left}.rtl #wp-link .toggle-arrow{background-position:top right}.rtl #wp-link .toggle-arrow-active{background-position:center right}.rtl .wp_themeSkin .mceListBox .mceText{text-align:right}.rtl .wp_themeSkin .mceNoIcons a .mceText{padding-right:10px;padding-left:25px}.rtl .mceListBoxMenu.mceNoIcons{direction:rtl}.clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999}.clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999}.clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999}.clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999}.clearlooks2 .mceFocus .mceTop span{color:#e5e5e5}.fullscreen-overlay{z-index:149999;display:none;position:fixed;top:0;bottom:0;left:0;right:0;filter:inherit}.fullscreen-active .fullscreen-overlay,.fullscreen-active #wp-fullscreen-body{display:block}.fullscreen-fader{z-index:200000}.fullscreen-active .fullscreen-fader{display:none}#wp-fullscreen-body{width:100%;z-index:150005;display:none;position:absolute;top:0;left:0;font-size:12px}#wp-fullscreen-wrap{margin:0 auto 50px;position:relative;padding-top:60px}#wp-fullscreen-title{font-size:1.7em;line-height:100%;outline:medium none;padding:6px 7px;width:100%;margin-bottom:30px;-webkit-box-shadow:none;box-shadow:none}#wp-fullscreen-container{padding:4px 10px 50px}#wp-fullscreen-title,#wp-fullscreen-container{-webkit-border-radius:0;border-radius:0;border:1px dashed transparent;background:transparent;-moz-transition-property:border-color;-moz-transition-duration:.6s;-webkit-transition-property:border-color;-webkit-transition-duration:.6s;-o-transition-property:border-color;-o-transition-duration:.6s;transition-property:borLine truncated
.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);-webkit-transition:none;transition:none}.mce-window{-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3);-webkit-font-smoothing:subpixel-antialiased;-webkit-transition:none;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #dfdfdf;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.mce-window .mce-window-head .mce-close{color:transparent;top:0;right:0;width:36px;height:36px;line-height:36px;text-align:center}.mce-window .mce-window-head .mce-close:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window .mce-window-head .mce-close:hover:before{color:#00a0d2}.mce-window .mce-window-head .mce-dragh{width:-webkit-calc(100% - 36px);width:calc(100% - 36px)}.mce-wp-help .mce-window-head{border-bottom:none}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07);-webkit-transition:.05s all ease-in-out;transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;-webkit-box-shadow:0 0 2px rgba(30,140,190,.8);box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0 3px 5px rgba(0,0,0,.2);box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff;-webkit-filter:none;filter:none}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #dedede;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.15);box-shadow:0 1px 3px rgba(0,0,0,.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:''}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-18px;border-bottom-color:#a0a5aa;border-width:9px;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-18px;border-top-color:#a0a5aa;border-width:9px;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-16px;border-bottom-color:#f5f5f5;border-width:8px;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-16px;border-top-color:#f5f5f5;border-width:8px;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{left:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-full{right:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-right:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px;line-height:18px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;-webkit-box-shadow:none;box-shadow:none;text-shadow:none;cursor:pointer}#wp-fullscreen-buttons .mce-btn,.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;background-image:none;-webkit-border-radius:2px;border-radius:2px;-webkit-filter:none;filter:none}#wp-fullscreen-buttons .mce-btn:focus,#wp-fullscreen-buttons .mce-btn:hover,.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qt-dfLine truncated
+362
View File
@@ -0,0 +1,362 @@
/*!
* jQuery UI CSS Framework 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden {
display: none;
}
.ui-helper-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
.ui-helper-reset {
margin: 0;
padding: 0;
border: 0;
outline: 0;
line-height: 1.3;
text-decoration: none;
font-size: 100%;
list-style: none;
}
.ui-helper-clearfix:before,
.ui-helper-clearfix:after {
content: "";
display: table;
border-collapse: collapse;
}
.ui-helper-clearfix:after {
clear: both;
}
.ui-helper-clearfix {
min-height: 0; /* support: IE7 */
}
.ui-helper-zfix {
width: 100%;
height: 100%;
top: 0;
right: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
z-index: 100;
}
/* Interaction Cues
----------------------------------*/
.ui-state-disabled {
cursor: default !important;
}
/* Icons
----------------------------------*/
/* states and images */
.ui-icon {
display: block;
text-indent: -99999px;
overflow: hidden;
background-repeat: no-repeat;
}
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay {
position: fixed;
top: 0;
right: 0;
width: 100%;
height: 100%;
}
/*!
* jQuery UI Resizable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
right: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
right: 0;
}
/* rtl:ignore */
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
/* rtl:ignore */
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
/* rtl:ignore */
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
/* rtl:ignore */
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
/* rtl:ignore */
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
/* rtl:ignore */
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
/* WP buttons: see buttons.css. */
.ui-button {
display: inline-block;
text-decoration: none;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
padding: 0 10px 1px;
cursor: pointer;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
-webkit-border-radius: 3px;
border-radius: 3px;
white-space: nowrap;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #555;
border-color: #cccccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
vertical-align: top;
}
.ui-button:active,
.ui-button:focus {
outline: none;
}
/* Remove the dotted border on :focus and the extra padding in Firefox */
.ui-button::-moz-focus-inner {
border-width: 1px 0;
border-style: solid none;
border-color: transparent;
padding: 0;
}
.ui-button:hover,
.ui-button:focus {
background: #fafafa;
border-color: #999;
color: #23282d;
}
.ui-button:focus {
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba( 30, 140, 190, 0.8 );
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba( 30, 140, 190, 0.8 );
}
.ui-button:active {
background: #eee;
border-color: #999;
color: #32373c;
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
}
.ui-button[disabled],
.ui-button:disabled {
color: #a0a5aa !important;
border-color: #ddd !important;
background: #f7f7f7 !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 1px 0 #fff !important;
cursor: default;
}
@media screen and ( max-width: 782px ) {
.ui-button {
padding: 10px 14px;
line-height: 1;
font-size: 14px;
vertical-align: middle;
height: auto;
margin-bottom: 4px;
}
}
/* WP Theme */
.ui-dialog {
position: absolute;
top: 0;
right: 0;
z-index: 100102;
background-color: #fff;
-webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
}
.ui-dialog-titlebar {
background: #fcfcfc;
border-bottom: 1px solid #dfdfdf;
height: 36px;
font-size: 18px;
font-weight: 600;
line-height: 36px;
padding: 0 16px 0 36px;
}
.ui-button.ui-dialog-titlebar-close {
background: none;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
color: #666;
cursor: pointer;
display: block;
padding: 0;
position: absolute;
top: 0;
left: 0;
width: 36px;
height: 36px;
text-align: center;
}
.ui-dialog-titlebar-close:before {
font: normal 20px/1 'dashicons';
vertical-align: top;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 36px;
width: 36px;
height: 36px;
content: '\f158';
}
.ui-button.ui-dialog-titlebar-close:hover {
color: #00a0d2;
}
.ui-dialog-titlebar-close .ui-button-text {
display: none;
}
.ui-dialog-content {
padding: 16px;
overflow: auto;
}
.ui-dialog-buttonpane {
background: #fcfcfc;
border-top: 1px solid #dfdfdf;
padding: 16px;
}
.ui-dialog-buttonpane .ui-button {
margin-right: 16px;
}
.ui-dialog-buttonpane .ui-dialog-buttonset {
float: left;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
.ui-widget-overlay {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
min-height: 360px;
background: #000;
opacity: 0.7;
filter: alpha(opacity=70);
z-index: 100101;
}
+17
View File
@@ -0,0 +1,17 @@
/*!
* jQuery UI CSS Framework 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/theming/
*/.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;right:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{width:100%;height:100%}/*!
* jQuery UI Resizable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;right:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;right:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-button{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.ui-button:active,.ui-button:focus{outline:0}.ui-button::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.ui-button:focus,.ui-button:hover{background:#fafafa;border-color:#999;color:#23282d}.ui-button:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ui-button:active{background:#eee;border-color:#999;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.ui-button:disabled,.ui-button[disabled]{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}@media screen and (max-width:782px){.ui-button{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}}.ui-dialog{position:absolute;top:0;right:0;z-index:100102;background-color:#fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}.ui-dialog-titlebar{background:#fcfcfc;border-bottom:1px solid #dfdfdf;height:36px;font-size:18px;font-weight:600;line-height:36px;padding:0 16px 0 36px}.ui-button.ui-dialog-titlebar-close{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;color:#666;cursor:pointer;display:block;padding:0;position:absolute;top:0;left:0;width:36px;height:36px;text-align:center}.ui-dialog-titlebar-close:before{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:36px;width:36px;height:36px;content:'\f158'}.ui-button.ui-dialog-titlebar-close:hover{color:#00a0d2}.ui-dialog-titlebar-close .ui-button-text{display:none}.ui-dialog-content{padding:16px;overflow:auto}.ui-dialog-buttonpane{background:#fcfcfc;border-top:1px solid #dfdfdf;padding:16px}.ui-dialog-buttonpane .ui-button{margin-right:16px}.ui-dialog-buttonpane .ui-dialog-buttonset{float:left}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-widget-overlay{position:fixed;top:0;right:0;left:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100101}
+179 -124
View File
@@ -1,12 +1,12 @@
/*!
* jQuery UI CSS Framework 1.10.1
* jQuery UI CSS Framework 1.11.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
* http://api.jqueryui.com/category/theming/
*/
/* Layout helpers
@@ -53,7 +53,7 @@
left: 0;
position: absolute;
opacity: 0;
filter:Alpha(Opacity=0);
filter:Alpha(Opacity=0); /* support: IE8 */
}
.ui-front {
@@ -92,16 +92,13 @@
height: 100%;
}
/*!
* jQuery UI Resizable 1.10.1
* jQuery UI Resizable 1.11.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable {
position: relative;
@@ -110,6 +107,8 @@
position: absolute;
font-size: 0.1px;
display: block;
-ms-touch-action: none;
touch-action: none;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
@@ -129,6 +128,7 @@
bottom: -5px;
left: 0;
}
/* rtl:ignore */
.ui-resizable-e {
cursor: e-resize;
width: 7px;
@@ -136,6 +136,7 @@
top: 0;
height: 100%;
}
/* rtl:ignore */
.ui-resizable-w {
cursor: w-resize;
width: 7px;
@@ -143,6 +144,7 @@
top: 0;
height: 100%;
}
/* rtl:ignore */
.ui-resizable-se {
cursor: se-resize;
width: 12px;
@@ -150,6 +152,7 @@
right: 1px;
bottom: 1px;
}
/* rtl:ignore */
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
@@ -157,6 +160,7 @@
left: -5px;
bottom: -5px;
}
/* rtl:ignore */
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
@@ -164,6 +168,7 @@
left: -5px;
top: -5px;
}
/* rtl:ignore */
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
@@ -172,136 +177,186 @@
top: -5px;
}
/*!
* jQuery UI Dialog 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/
/* WP buttons: see buttons.css. */
.ui-button {
display: inline-block;
text-decoration: none;
font-size: 13px;
line-height: 26px;
height: 28px;
margin: 0;
padding: 0 10px 1px;
cursor: pointer;
border-width: 1px;
border-style: solid;
-webkit-appearance: none;
-webkit-border-radius: 3px;
border-radius: 3px;
white-space: nowrap;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #555;
border-color: #cccccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
vertical-align: top;
}
.ui-button:active,
.ui-button:focus {
outline: none;
}
/* Remove the dotted border on :focus and the extra padding in Firefox */
.ui-button::-moz-focus-inner {
border-width: 1px 0;
border-style: solid none;
border-color: transparent;
padding: 0;
}
.ui-button:hover,
.ui-button:focus {
background: #fafafa;
border-color: #999;
color: #23282d;
}
.ui-button:focus {
-webkit-box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba( 30, 140, 190, 0.8 );
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba( 30, 140, 190, 0.8 );
}
.ui-button:active {
background: #eee;
border-color: #999;
color: #32373c;
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
}
.ui-button[disabled],
.ui-button:disabled {
color: #a0a5aa !important;
border-color: #ddd !important;
background: #f7f7f7 !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: 0 1px 0 #fff !important;
cursor: default;
}
@media screen and ( max-width: 782px ) {
.ui-button {
padding: 10px 14px;
line-height: 1;
font-size: 14px;
vertical-align: middle;
height: auto;
margin-bottom: 4px;
}
}
/* WP Theme */
.ui-dialog {
position: absolute;
top: 0;
left: 0;
padding: .2em;
outline: 0;
z-index: 100102;
background-color: #fff;
-webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
}
.ui-dialog .ui-dialog-titlebar {
padding: .4em 1em;
position: relative;
.ui-dialog-titlebar {
background: #fcfcfc;
border-bottom: 1px solid #dfdfdf;
height: 36px;
font-size: 18px;
font-weight: 600;
line-height: 36px;
padding: 0 36px 0 16px;
}
.ui-dialog .ui-dialog-title {
float: left;
margin: .1em 0;
white-space: nowrap;
width: 90%;
overflow: hidden;
text-overflow: ellipsis;
}
.ui-dialog .ui-dialog-titlebar-close {
position: absolute;
right: .3em;
top: 50%;
width: 21px;
margin: -10px 0 0 0;
padding: 1px;
height: 20px;
}
.ui-dialog .ui-dialog-content {
position: relative;
border: 0;
padding: .5em 1em;
.ui-button.ui-dialog-titlebar-close {
background: none;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
color: #666;
cursor: pointer;
display: block;
padding: 0;
position: absolute;
top: 0;
right: 0;
width: 36px;
height: 36px;
text-align: center;
}
.ui-dialog-titlebar-close:before {
font: normal 20px/1 'dashicons';
vertical-align: top;
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
line-height: 36px;
width: 36px;
height: 36px;
content: '\f158';
}
.ui-button.ui-dialog-titlebar-close:hover {
color: #00a0d2;
}
.ui-dialog-titlebar-close .ui-button-text {
display: none;
}
.ui-dialog-content {
padding: 16px;
overflow: auto;
}
.ui-dialog .ui-dialog-buttonpane {
text-align: left;
border-width: 1px 0 0 0;
background-image: none;
margin-top: .5em;
padding: .3em 1em .5em .4em;
.ui-dialog-buttonpane {
background: #fcfcfc;
border-top: 1px solid #dfdfdf;
padding: 16px;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
.ui-dialog-buttonpane .ui-button {
margin-left: 16px;
}
.ui-dialog-buttonpane .ui-dialog-buttonset {
float: right;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: .5em .4em .5em 0;
cursor: pointer;
}
.ui-dialog .ui-resizable-se {
width: 12px;
height: 12px;
right: -5px;
bottom: -5px;
background-position: 16px 16px;
}
.ui-draggable .ui-dialog-titlebar {
cursor: move;
}
/* WP jQuery Dialog Theme */
.wp-dialog {
padding: 0;
z-index: 300002;
border: 1px solid #999;
-webkit-box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
background-color: #f5f5f5;
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
}
.wp-dialog .ui-dialog-title {
display: block;
text-align: center;
padding: 1px 0 2px;
}
.wp-dialog .ui-dialog-titlebar {
padding: 0 1em;
background-color: #444;
font-weight: bold;
font-size: 11px;
line-height: 18px;
color: #e5e5e5;
-webkit-border-top-left-radius: 3px;
border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
border-top-right-radius: 3px;
}
.wp-dialog .ui-dialog-content {
padding: 0;
}
.wp-dialog .ui-dialog-titlebar-close {
cursor: pointer;
-webkit-appearance: none;
border: 0;
width: 29px;
height: 16px;
top: 13px;
right: 6px;
background: url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;
}
.wp-dialog .ui-dialog-titlebar-close .ui-button-text {
display: none;
}
.wp-dialog .ui-dialog-titlebar-close:hover,
.wp-dialog .ui-dialog-titlebar-close:focus {
background-position: -87px -32px;
}
.ui-widget-overlay {
z-index: 300001;
background-color: #000;
opacity: 0.6;
filter: alpha(opacity=60);
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
min-height: 360px;
background: #000;
opacity: 0.7;
filter: alpha(opacity=70);
z-index: 100101;
}
+7 -18
View File
@@ -1,28 +1,17 @@
/*!
* jQuery UI CSS Framework 1.10.1
* jQuery UI CSS Framework 1.11.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Theming/API
*/.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}/*!
* jQuery UI Resizable 1.10.1
* http://api.jqueryui.com/category/theming/
*/.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{width:100%;height:100%}/*!
* jQuery UI Resizable 1.11.4
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}/*!
* jQuery UI Dialog 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog#theming
*/.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{padding:0;z-index:300002;border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3);background-color:#f5f5f5;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-content{padding:0}.wp-dialog .ui-dialog-titlebar-close{cursor:pointer;-webkit-appearance:none;border:0;width:29px;height:16px;top:13px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px}.wp-dialog .ui-dialog-titlebar-close .ui-button-text{display:none}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{z-index:300001;background-color:#000;opacity:.6;filter:alpha(opacity=60)}
*/.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-button{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.ui-button:active,.ui-button:focus{outline:0}.ui-button::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.ui-button:focus,.ui-button:hover{background:#fafafa;border-color:#999;color:#23282d}.ui-button:focus{-webkit-box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.ui-button:active{background:#eee;border-color:#999;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.ui-button:disabled,.ui-button[disabled]{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}@media screen and (max-width:782px){.ui-button{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}}.ui-dialog{position:absolute;top:0;left:0;z-index:100102;background-color:#fff;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}.ui-dialog-titlebar{background:#fcfcfc;border-bottom:1px solid #dfdfdf;height:36px;font-size:18px;font-weight:600;line-height:36px;padding:0 36px 0 16px}.ui-button.ui-dialog-titlebar-close{background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;color:#666;cursor:pointer;display:block;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center}.ui-dialog-titlebar-close:before{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:36px;width:36px;height:36px;content:'\f158'}.ui-button.ui-dialog-titlebar-close:hover{color:#00a0d2}.ui-dialog-titlebar-close .ui-button-text{display:none}.ui-dialog-content{padding:16px;overflow:auto}.ui-dialog-buttonpane{background:#fcfcfc;border-top:1px solid #dfdfdf;padding:16px}.ui-dialog-buttonpane .ui-button{margin-left:16px}.ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-widget-overlay{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100101}
File diff suppressed because it is too large. Load diff
+8 -1
View File
@@ -1 +1,8 @@
.media-modal-close{right:auto;left:7px}.media-toolbar-primary{float:left}.media-toolbar-secondary{float:right}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:0;margin-right:10px;float:right}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:0;margin-left:10px;float:right}.media-sidebar{right:auto;left:0;border-left:0;border-right:1px solid #dfdfdf}.media-sidebar .setting{float:right}.media-sidebar .setting .link-to-custom{direction:ltr}.media-sidebar .setting span{margin-right:0;margin-left:4%}.media-sidebar .setting span,.compat-item label span{float:right;text-align:left}.media-sidebar .setting input,.media-sidebar .setting textarea{float:left}.compat-item{float:right}.compat-item .label{margin-right:0;margin-left:4%;float:right;text-align:left}.compat-item .field{float:left;padding-right:0;padding-left:1px}.media-menu{border-right:0;border-left:1px solid #d9d9d9;box-shadow:inset 6px 0 6px -6px rgba(0,0,0,0.2)}.media-router>a{float:right;border-right:0;border-left:1px solid #dfdfdf}.media-router>a:last-child{border-left:0}.media-frame-menu{left:auto;right:0}.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:200px}.media-frame.hide-menu .media-frame-title,.media-frame.hide-menu .media-frame-router,.media-frame.hide-menu .media-frame-toolbar,.media-frame.hide-menu .media-frame-content{right:0}.media-frame.hide-menu .media-frame-menu{left:auto;right:-200px}.media-frame select.attachment-filters{margin-right:0;margin-left:10px}.media-toolbar-secondary .search{margin-right:0;margin-left:16px}.attachments{padding-right:0;padding-left:16px}.attachment{float:right}.attachment .thumbnail{left:auto;right:0}.attachment .close{right:auto;left:5px}.attachment .check{right:auto;left:-7px}.attachments-browser .media-toolbar{right:0;left:300px}.attachments-browser .attachments,.attachments-browser .uploader-inline{right:0;left:300px}.attachment-preview .media-progress-bar{left:auto;right:15%}.media-sidebar .media-uploader-status .upload-dismiss-errors{right:auto;left:0}.upload-errors .upload-error-label{margin-right:0;margin-left:8px;float:right;margin-top:-3px}.media-selection{right:0;left:350px;padding:0 16px 0 0}.media-selection .selection-info{margin-right:0;margin-left:10px}.media-selection .selection-info a{float:right;border-right:0;border-left:1px solid #dfdfdf;margin:1px -8px 1px 8px}.media-selection .selection-info a:last-child{border-right:1px;border-left:0;margin-left:0;margin-right:-8px}.media-selection:after{right:auto;left:0;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to right,rgba(255,255,255,1),rgba(255,255,255,0))}.attachment-info .thumbnail{float:right;margin-right:0;margin-left:10px}.attachment-info .details{float:right}.attachment-display-settings{float:right}.embed-url span{display:block;padding:4px 2px 6px 0}.media-embed .thumbnail{float:right}.media-embed .setting{float:right}.media-frame .embed-url input,.media-frame .link-to-custom{direction:ltr}@media only screen and (max-width:900px){.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:140px}.attachments-browser .attachments,.attachments-browser .uploader-inline,.attachments-browser .media-toolbar{right:0;left:180px}}
.media-modal *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.media-frame input,.media-frame select,.media-frame textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.media-frame,.media-modal{font-family:"Open Sans",sans-serif;font-size:12px;-webkit-overflow-scrolling:touch}.media-frame input,.media-frame textarea{padding:6px 8px}.media-frame select,.wp-admin .media-frame select{line-height:28px;margin-top:3px}.media-frame a{border-bottom:none;color:#21759b}.media-frame a:hover{color:#d54e21}.media-frame a.button{color:#32373c}.media-frame a.button:hover{color:#23282d}.media-frame a.button-primary,.media-frame a.button-primary:hover{color:#fff}.media-frame input[type=email],.media-frame input[type=number],.media-frame input[type=password],.media-frame input[type=search],.media-frame input[type=text],.media-frame input[type=url],.media-frame select,.media-frame textarea{font-family:"Open Sans",sans-serif;font-size:12px;border-width:1px;border-style:solid;border-color:#dfdfdf}.media-frame input[type=email]:focus,.media-frame input[type=number]:focus,.media-frame input[type=password]:focus,.media-frame input[type=search]:focus,.media-frame input[type=text]:focus,.media-frame input[type=url]:focus,.media-frame select:focus,.media-frame textarea:focus{border-color:#5b9dd9}.media-frame select{height:24px;padding:2px}.media-frame input:disabled,.media-frame input[readonly],.media-frame textarea:disabled,.media-frame textarea[readonly]{background-color:#eee}.media-frame input[type=search]{-webkit-appearance:textfield}.media-frame :-moz-placeholder{color:#a9a9a9}.media-frame .hidden{display:none}/*!
* jQuery UI Draggable/Sortable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/.ui-draggable-handle,.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.media-modal{position:fixed;top:30px;right:30px;left:30px;bottom:30px;z-index:160000}.wp-customizer .media-modal{z-index:560000}.media-modal-backdrop{position:fixed;top:0;right:0;left:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:159900}.wp-customizer .media-modal-backdrop{z-index:559900}.media-modal-close{position:absolute;text-decoration:none;top:10px;left:10px;width:30px;height:30px;z-index:1000;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.media-modal-close:active{-webkit-box-shadow:none;box-shadow:none}.media-modal-close span.media-modal-icon{display:block;margin-top:5px;width:30px;height:15px;background-image:none;text-align:center}.media-modal-close .media-modal-icon:before{content:'\f158';font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.media-modal-close:hover .media-modal-icon:before{color:#00a0d2}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;right:0;left:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.media-modal-icon{background-image:url(../images/uploader-icons.png);background-repeat:no-repeat}.media-toolbar{position:absolute;top:0;right:0;left:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf;overflow:hidden}.media-toolbar-primary{float:left;height:100%}.media-toolbar-secondary{float:right;height:100%}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-right:10px;float:right;margin-top:15px}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-left:10px;margin-top:15px}.media-sidebar{position:absolute;top:0;left:0;bottom:0;width:267px;padding:0 16px 24px;z-index:75;background:#f3f3f3;border-right:1px solid #ddd;overflow:auto;-webkit-overflow-scrolling:touch}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.image-details h3,.media-sidebar h3{position:relative;font-weight:700;text-transform:uppercase;font-size:12px;color:#666;margin:24px 0 8px}.attachment-details .setting,.media-sidebar .setting{display:block;float:right;width:100%;margin:1px 0}.attachment-details .setting label,.media-sidebar .setting label{display:block}.attachment-details .setting .link-to-custom,.media-sidebar .setting .link-to-custom{margin:3px 2px 0}.attachment-details .setting span,.media-sidebar .setting span{min-width:30%;margin-left:4%;font-size:12px;text-align:left;word-wrap:break-word}.media-sidebar .setting .name{max-width:80px}.attachment-details .setting select,.media-sidebar .setting select{max-width:65%}.attachment-details .field input[type=checkbox],.attachment-details .field input[type=radio],.attachment-details .setting input[type=checkbox],.attachment-details .setting input[type=radio],.media-sidebar .field input[type=checkbox],.media-sidebar .field input[type=radio],.media-sidebar .setting input[type=checkbox],.media-sidebar .setting input[type=radio]{float:none;margin:8px 3px 0;padding:0}.attachment-details .setting span,.compat-item label span,.media-sidebar .setting span{float:right;min-height:22px;padding-top:8px;line-height:16px;font-weight:400;color:#666}.compat-item label span{text-align:left}.attachment-details .setting .value,.attachment-details .setting input[type=email],.attachment-details .setting input[type=number],.attachment-details .setting input[type=password],.attachment-details .setting input[type=search],.attachment-details .setting input[type=tel],.attachment-details .setting input[type=text],.attachment-details .setting input[type=url],.attachment-details .setting textarea,.media-sidebar .setting .value,.media-sidebar .setting input[type=email],.media-sidebar .setting input[type=number],.media-sidebar .setting input[type=password],.media-sidebar .setting input[type=search],.media-sidebar .setting input[type=tel],.media-sidebar .setting input[type=text],.media-sidebar .setting input[type=url],.media-sidebar .setting textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px;width:65%;float:left}.attachment-details .setting .value,.media-sidebar .setting .value{margin:0 1px;text-align:right}.attachment-details .setting textarea,.compat-item .field textarea,.media-sidebar .setting textarea{height:62px;resize:vertical}.attachment-details select,.media-sidebar select{margin-top:3px}.compat-item{float:right;width:100%;overflow:hidden}.compat-item table{width:100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2Line truncated
File diff suppressed because it is too large. Load diff
+8 -1
View File
@@ -1 +1,8 @@
.media-modal,.media-frame{font-family:sans-serif;font-size:12px}.media-frame input,.media-frame textarea{padding:6px 8px;line-height:16px}.media-frame select,.wp-admin .media-frame select{line-height:28px;margin-top:3px}.media-frame a{border-bottom:0;color:#21759b}.media-frame a:hover{color:#d54e21}.media-frame a.button{color:#333}.media-frame a.button:hover{color:#222}.media-frame a.button-primary,.media-frame a.button-primary:hover{color:#fff}.media-frame input[type="text"],.media-frame input[type="password"],.media-frame input[type="number"],.media-frame input[type="search"],.media-frame input[type="email"],.media-frame input[type="url"],.media-frame textarea,.media-frame select{font-family:sans-serif;font-size:12px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;border-color:#dfdfdf}.media-frame select{height:24px;padding:2px}.media-frame input:disabled,.media-frame textarea:disabled,.media-frame input[readonly],.media-frame textarea[readonly]{background-color:#eee}.media-frame input[type="search"]{-webkit-appearance:textfield}.media-frame :-moz-placeholder{color:#a9a9a9}.ui-sortable,.ui-draggable{-ms-touch-action:none}.media-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:159900}.media-modal-close{position:absolute;top:7px;right:7px;width:30px;height:30px;z-index:1000}.media-modal-close span{display:block;margin:8px auto 0;width:15px;height:15px;background-position:-100px 0}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;background:#fff}.media-modal-icon{background-image:url(../images/uploader-icons.png);background-repeat:no-repeat}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf;overflow:hidden}.media-toolbar-primary{float:right;height:100%}.media-toolbar-secondary{float:left;height:100%}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:0;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto;-webkit-overflow-scrolling:touch}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-weight:200;font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color:#777;text-shadow:0 1px 0 #fff;margin:24px 0 8px}.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.media-sidebar .setting label{display:block}.media-sidebar .setting .link-to-custom{margin:3px 0}.media-sidebar .setting span{min-width:30%;margin-right:4%;font-size:12px}.media-sidebar .setting select{max-width:65%}.media-sidebar .setting input[type="checkbox"]{width:auto;float:none;margin-top:8px;padding:0}.media-sidebar .setting span,.compat-item label span{float:left;min-height:22px;padding-top:8px;line-height:16px;text-align:right;font-weight:normal;color:#999;text-shadow:0 1px 0 #fff}.media-sidebar .setting input,.media-sidebar .setting textarea{width:65%;float:right}.media-sidebar .setting textarea,.compat-item .field textarea{height:62px;resize:vertical}.media-sidebar select{margin-top:3px}.compat-item{float:left;width:100%;overflow:hidden}.compat-item table{width:100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2px 0;display:block;overflow:hidden}.compat-item .label,.compat-item .field{display:block;margin:0;padding:0}.compat-item .label{min-width:30%;margin-right:4%;float:left;text-align:right}.compat-item .label span{display:block;width:100%}.compat-item .field{float:right;width:65%;padding-right:1px}.compat-item .field input{width:100%;margin:0}.media-menu{position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:16px 0;border-right:1px solid #d9d9d9;box-shadow:inset -6px 0 6px -6px rgba(0,0,0,0.2);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.media-menu>a{display:block;position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff;text-decoration:none}.media-menu>a:hover{color:#21759b;background:rgba(0,0,0,0.04)}.media-menu>a:active{outline:0}.media-menu .active,.media-menu .active:hover{color:#333;font-weight:bold}.media-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}.media-Line truncated
.media-modal *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.media-frame input,.media-frame select,.media-frame textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.media-frame,.media-modal{font-family:"Open Sans",sans-serif;font-size:12px;-webkit-overflow-scrolling:touch}.media-frame input,.media-frame textarea{padding:6px 8px}.media-frame select,.wp-admin .media-frame select{line-height:28px;margin-top:3px}.media-frame a{border-bottom:none;color:#21759b}.media-frame a:hover{color:#d54e21}.media-frame a.button{color:#32373c}.media-frame a.button:hover{color:#23282d}.media-frame a.button-primary,.media-frame a.button-primary:hover{color:#fff}.media-frame input[type=email],.media-frame input[type=number],.media-frame input[type=password],.media-frame input[type=search],.media-frame input[type=text],.media-frame input[type=url],.media-frame select,.media-frame textarea{font-family:"Open Sans",sans-serif;font-size:12px;border-width:1px;border-style:solid;border-color:#dfdfdf}.media-frame input[type=email]:focus,.media-frame input[type=number]:focus,.media-frame input[type=password]:focus,.media-frame input[type=search]:focus,.media-frame input[type=text]:focus,.media-frame input[type=url]:focus,.media-frame select:focus,.media-frame textarea:focus{border-color:#5b9dd9}.media-frame select{height:24px;padding:2px}.media-frame input:disabled,.media-frame input[readonly],.media-frame textarea:disabled,.media-frame textarea[readonly]{background-color:#eee}.media-frame input[type=search]{-webkit-appearance:textfield}.media-frame :-moz-placeholder{color:#a9a9a9}.media-frame .hidden{display:none}/*!
* jQuery UI Draggable/Sortable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/.ui-draggable-handle,.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.media-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000}.wp-customizer .media-modal{z-index:560000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:159900}.wp-customizer .media-modal-backdrop{z-index:559900}.media-modal-close{position:absolute;text-decoration:none;top:10px;right:10px;width:30px;height:30px;z-index:1000;-webkit-transition:color .1s ease-in-out,background .1s ease-in-out;transition:color .1s ease-in-out,background .1s ease-in-out}.media-modal-close:active{-webkit-box-shadow:none;box-shadow:none}.media-modal-close span.media-modal-icon{display:block;margin-top:5px;width:30px;height:15px;background-image:none;text-align:center}.media-modal-close .media-modal-icon:before{content:'\f158';font:400 20px/1 dashicons;speak:none;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}.media-modal-close:hover .media-modal-icon:before{color:#00a0d2}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;-webkit-box-shadow:0 5px 15px rgba(0,0,0,.7);box-shadow:0 5px 15px rgba(0,0,0,.7);background:#fcfcfc;-webkit-font-smoothing:subpixel-antialiased}.media-modal-icon{background-image:url(../images/uploader-icons.png);background-repeat:no-repeat}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf;overflow:hidden}.media-toolbar-primary{float:right;height:100%}.media-toolbar-secondary{float:left;height:100%}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:10px;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:0;width:267px;padding:0 16px 24px;z-index:75;background:#f3f3f3;border-left:1px solid #ddd;overflow:auto;-webkit-overflow-scrolling:touch}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.image-details h3,.media-sidebar h3{position:relative;font-weight:700;text-transform:uppercase;font-size:12px;color:#666;margin:24px 0 8px}.attachment-details .setting,.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.attachment-details .setting label,.media-sidebar .setting label{display:block}.attachment-details .setting .link-to-custom,.media-sidebar .setting .link-to-custom{margin:3px 2px 0}.attachment-details .setting span,.media-sidebar .setting span{min-width:30%;margin-right:4%;font-size:12px;text-align:right;word-wrap:break-word}.media-sidebar .setting .name{max-width:80px}.attachment-details .setting select,.media-sidebar .setting select{max-width:65%}.attachment-details .field input[type=checkbox],.attachment-details .field input[type=radio],.attachment-details .setting input[type=checkbox],.attachment-details .setting input[type=radio],.media-sidebar .field input[type=checkbox],.media-sidebar .field input[type=radio],.media-sidebar .setting input[type=checkbox],.media-sidebar .setting input[type=radio]{float:none;margin:8px 3px 0;padding:0}.attachment-details .setting span,.compat-item label span,.media-sidebar .setting span{float:left;min-height:22px;padding-top:8px;line-height:16px;font-weight:400;color:#666}.compat-item label span{text-align:right}.attachment-details .setting .value,.attachment-details .setting input[type=email],.attachment-details .setting input[type=number],.attachment-details .setting input[type=password],.attachment-details .setting input[type=search],.attachment-details .setting input[type=tel],.attachment-details .setting input[type=text],.attachment-details .setting input[type=url],.attachment-details .setting textarea,.media-sidebar .setting .value,.media-sidebar .setting input[type=email],.media-sidebar .setting input[type=number],.media-sidebar .setting input[type=password],.media-sidebar .setting input[type=search],.media-sidebar .setting input[type=tel],.media-sidebar .setting input[type=text],.media-sidebar .setting input[type=url],.media-sidebar .setting textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px;width:65%;float:right}.attachment-details .setting .value,.media-sidebar .setting .value{margin:0 1px;text-align:left}.attachment-details .setting textarea,.compat-item .field textarea,.media-sidebar .setting textarea{height:62px;resize:vertical}.attachment-details select,.media-sidebar select{margin-top:3px}.compat-item{float:left;width:100%;overflow:hidden}.compat-item table{width:100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2Line truncated
+109
View File
@@ -0,0 +1,109 @@
/*------------------------------------------------------------------------------
Interim login dialog
------------------------------------------------------------------------------*/
#wp-auth-check-wrap.hidden {
display: none;
}
#wp-auth-check-wrap #wp-auth-check-bg {
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background: #000;
opacity: 0.7;
filter: alpha(opacity=70);
z-index: 1000010; /* needs to appear above .notification-dialog */
}
#wp-auth-check-wrap #wp-auth-check {
position: fixed;
right: 50%;
overflow: hidden;
top: 40px;
bottom: 20px;
max-height: 415px;
width: 380px;
margin: 0 -190px 0 0;
padding: 30px 0 0;
background-color: #f1f1f1;
z-index: 1000011; /* needs to appear above #wp-auth-check-bg */
-webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
}
@media screen and ( max-width: 380px ) {
#wp-auth-check-wrap #wp-auth-check {
right: 0;
width: 100%;
margin: 0;
}
}
#wp-auth-check-wrap.fallback #wp-auth-check {
max-height: 180px;
overflow: auto;
}
#wp-auth-check-wrap #wp-auth-check-form {
background: url(../images/spinner-2x.gif) no-repeat center center;
-webkit-background-size: 16px 16px;
background-size: 16px 16px;
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#wp-auth-check-wrap #wp-auth-check-form iframe {
height: 98%; /* Scrollbar fix */
width: 100%;
}
#wp-auth-check-wrap .wp-auth-check-close {
position: absolute;
top: 8px;
left: 8px;
height: 22px;
width: 22px;
cursor: pointer;
}
#wp-auth-check-wrap .wp-auth-check-close:before {
content: '\f158';
display: block !important;
font: normal 20px/1 'dashicons';
speak: none;
height: 22px;
margin: 2px 0;
text-align: center;
width: 22px;
color: #777;
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale;
}
#wp-auth-check-wrap .wp-auth-check-close:hover:before {
color: #0073aa;
}
#wp-auth-check-wrap .wp-auth-check-close:focus {
outline: 1px dotted #82878c;
}
#wp-auth-check-wrap .wp-auth-fallback-expired {
outline: 0;
}
#wp-auth-check-wrap .wp-auth-fallback {
font-size: 14px;
line-height: 21px;
padding: 0 25px;
display: none;
}
#wp-auth-check-wrap.fallback .wp-auth-fallback,
#wp-auth-check-wrap.fallback .wp-auth-check-close {
display: block;
}
+1
View File
@@ -0,0 +1 @@
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;right:0;left:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;right:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 -190px 0 0;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{right:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) center center/16px 16px no-repeat;-webkit-background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;left:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
+41 -26
View File
@@ -13,9 +13,9 @@
left: 0;
right: 0;
background: #000;
opacity: 0.5;
filter: alpha(opacity=50);
z-index: 1000000;
opacity: 0.7;
filter: alpha(opacity=70);
z-index: 1000010; /* needs to appear above .notification-dialog */
}
#wp-auth-check-wrap #wp-auth-check {
@@ -28,10 +28,18 @@
width: 380px;
margin: 0 0 0 -190px;
padding: 30px 0 0;
background-color: #fbfbfb;
-webkit-border-radius: 3px;
border-radius: 3px;
z-index: 1000001;
background-color: #f1f1f1;
z-index: 1000011; /* needs to appear above #wp-auth-check-bg */
-webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
}
@media screen and ( max-width: 380px ) {
#wp-auth-check-wrap #wp-auth-check {
left: 0;
width: 100%;
margin: 0;
}
}
#wp-auth-check-wrap.fallback #wp-auth-check {
@@ -40,31 +48,48 @@
}
#wp-auth-check-wrap #wp-auth-check-form {
background: url(../images/wpspin-2x.gif) no-repeat center center;
background: url(../images/spinner-2x.gif) no-repeat center center;
-webkit-background-size: 16px 16px;
background-size: 16px 16px;
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#wp-auth-check-wrap #wp-auth-check-form iframe {
height: 100%;
height: 98%; /* Scrollbar fix */
width: 100%;
overflow: auto;
}
#wp-auth-check-wrap .wp-auth-check-close {
position: absolute;
top: 8px;
right: 8px;
height: 14px;
width: 14px;
height: 22px;
width: 22px;
cursor: pointer;
background-image: url(../images/uploader-icons.png);
background-repeat: no-repeat;
background-position: -100px 0;
}
#wp-auth-check-wrap .wp-auth-check-close:before {
content: '\f158';
display: block !important;
font: normal 20px/1 'dashicons';
speak: none;
height: 22px;
margin: 2px 0;
text-align: center;
width: 22px;
color: #777;
-webkit-font-smoothing: antialiased !important;
-moz-osx-font-smoothing: grayscale;
}
#wp-auth-check-wrap .wp-auth-check-close:hover:before {
color: #0073aa;
}
#wp-auth-check-wrap .wp-auth-check-close:focus {
outline: 1px dotted #888;
outline: 1px dotted #82878c;
}
#wp-auth-check-wrap .wp-auth-fallback-expired {
@@ -82,13 +107,3 @@
#wp-auth-check-wrap.fallback .wp-auth-check-close {
display: block;
}
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
#wp-auth-check-wrap .wp-auth-check-close {
background-image: url(../images/uploader-icons-2x.png);
background-size: 134px 15px;
}
}
+1 -1
View File
@@ -1 +1 @@
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;left:0;right:0;background:#000;opacity:.5;filter:alpha(opacity=50);z-index:1000000}#wp-auth-check-wrap #wp-auth-check{position:fixed;left:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 0 0 -190px;padding:30px 0 0;background-color:#fbfbfb;-webkit-border-radius:3px;border-radius:3px;z-index:1000001}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/wpspin-2x.gif) no-repeat center center;background-size:16px 16px;height:100%}#wp-auth-check-wrap #wp-auth-check-form iframe{height:100%;width:100%;overflow:auto}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;right:8px;height:14px;width:14px;cursor:pointer;background-image:url(../images/uploader-icons.png);background-repeat:no-repeat;background-position:-100px 0}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:1px dotted #888}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-fallback,#wp-auth-check-wrap.fallback .wp-auth-check-close{display:block}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#wp-auth-check-wrap .wp-auth-check-close{background-image:url(../images/uploader-icons-2x.png);background-size:134px 15px}}
#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;left:0;right:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000010}#wp-auth-check-wrap #wp-auth-check{position:fixed;left:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 0 0 -190px;padding:30px 0 0;background-color:#f1f1f1;z-index:1000011;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.3);box-shadow:0 3px 6px rgba(0,0,0,.3)}@media screen and (max-width:380px){#wp-auth-check-wrap #wp-auth-check{left:0;width:100%;margin:0}}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/spinner-2x.gif) center center/16px 16px no-repeat;-webkit-background-size:16px 16px;height:100%;overflow:auto;-webkit-overflow-scrolling:touch}#wp-auth-check-wrap #wp-auth-check-form iframe{height:98%;width:100%}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;right:8px;height:22px;width:22px;cursor:pointer}#wp-auth-check-wrap .wp-auth-check-close:before{content:'\f158';display:block!important;font:400 20px/1 dashicons;speak:none;height:22px;margin:2px 0;text-align:center;width:22px;color:#777;-webkit-font-smoothing:antialiased!important;-moz-osx-font-smoothing:grayscale}#wp-auth-check-wrap .wp-auth-check-close:hover:before{color:#0073aa}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:#82878c dotted 1px}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-check-close,#wp-auth-check-wrap.fallback .wp-auth-fallback{display:block}
+212
View File
@@ -0,0 +1,212 @@
.wp-pointer-content {
padding: 0 0 10px;
position: relative;
font-size: 13px;
background: #fff;
border: 1px solid #dfdfdf;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,0.075);
box-shadow: 0 3px 6px rgba(0,0,0,0.075);
}
.wp-pointer-content h3 {
position: relative;
margin: -1px -1px 5px;
padding: 15px 60px 14px 18px;
border: 1px solid #3592b6;
border-bottom: none;
line-height: 1.4em;
font-size: 14px;
color: #fff;
background: #00a0d2;
}
.wp-pointer-content h3:before {
background: #fff;
-webkit-border-radius: 50%;
border-radius: 50%;
color: #00a0d2;
content: '\f227';
font: normal 20px/1.6 'dashicons';
position: absolute;
top: 8px;
right: 15px;
speak: none;
text-align: center;
width: 32px;
height: 32px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.wp-pointer-content p {
padding: 0 15px;
}
.wp-pointer-buttons {
margin: 0;
padding: 5px 15px;
overflow: auto;
}
.wp-pointer-buttons a {
float: left;
display: inline-block;
text-decoration: none;
}
.wp-pointer-buttons a.close {
padding-right: 3px;
position: relative;
}
.wp-pointer-buttons a.close:before {
background: none;
color: #b4b9be;
content: '\f153';
display: block !important;
font: normal 16px/1 'dashicons';
speak: none;
margin: 1px 0;
text-align: center;
-webkit-font-smoothing: antialiased !important;
width: 10px;
height: 100%;
position: absolute;
right: -15px;
top: 1px;
}
.wp-pointer-buttons a.close:hover:before {
color: #c00;
}
/* The arrow base class must take up no space, even with transparent borders. */
.wp-pointer-arrow,
.wp-pointer-arrow-inner {
position: absolute;
width: 0;
height: 0;
}
.wp-pointer-arrow {
z-index: 10;
width: 0;
height: 0;
border: 0 solid transparent;
}
.wp-pointer-arrow-inner {
z-index: 20;
}
/* Make Room for the Arrow! */
.wp-pointer-top,
.wp-pointer-undefined {
padding-top: 13px;
}
.wp-pointer-bottom {
margin-top: -13px;
padding-bottom: 13px;
}
/* rtl:ignore */
.wp-pointer-left {
padding-left: 13px;
}
/* rtl:ignore */
.wp-pointer-right {
margin-left: -13px;
padding-right: 13px;
}
/* Base Size & Positioning */
.wp-pointer-top .wp-pointer-arrow,
.wp-pointer-bottom .wp-pointer-arrow,
.wp-pointer-undefined .wp-pointer-arrow {
right: 50px;
}
.wp-pointer-left .wp-pointer-arrow,
.wp-pointer-right .wp-pointer-arrow {
top: 50%;
margin-top: -15px;
}
/* Arrow Sprite */
.wp-pointer-top .wp-pointer-arrow,
.wp-pointer-undefined .wp-pointer-arrow {
top: 0;
border-width: 0 13px 13px 13px;
border-bottom-color: #3592b6;
}
.wp-pointer-top .wp-pointer-arrow-inner,
.wp-pointer-undefined .wp-pointer-arrow-inner {
top: 1px;
margin-right: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-bottom-color: #00a0d2;
display: block;
content: ' ';
}
.wp-pointer-bottom .wp-pointer-arrow {
bottom: 0;
border-width: 13px 13px 0 13px;
border-top-color: #ccc;
}
.wp-pointer-bottom .wp-pointer-arrow-inner {
bottom: 1px;
margin-right: -13px;
margin-bottom: -13px;
border: 13px solid transparent;
border-top-color: #fff;
display: block;
content: ' ';
}
/* rtl:ignore */
.wp-pointer-left .wp-pointer-arrow {
left: 0;
border-width: 13px 13px 13px 0;
border-right-color: #ccc;
}
/* rtl:ignore */
.wp-pointer-left .wp-pointer-arrow-inner {
left: 1px;
margin-left: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-right-color: #fff;
display: block;
content: ' ';
}
/* rtl:ignore */
.wp-pointer-right .wp-pointer-arrow {
right: 0;
border-width: 13px 0 13px 13px;
border-left-color: #ccc;
}
/* rtl:ignore */
.wp-pointer-right .wp-pointer-arrow-inner {
right: 1px;
margin-right: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-left-color: #fff;
display: block;
content: ' ';
}
/* Disable pointers at responsive sizes */
@media screen and ( max-width: 782px ) {
.wp-pointer {
display: none;
}
}
+1
View File
@@ -0,0 +1 @@
.wp-pointer-content{padding:0 0 10px;position:relative;font-size:13px;background:#fff;border:1px solid #dfdfdf;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075)}.wp-pointer-content h3{position:relative;margin:-1px -1px 5px;padding:15px 60px 14px 18px;border:1px solid #3592b6;border-bottom:none;line-height:1.4em;font-size:14px;color:#fff;background:#00a0d2}.wp-pointer-content h3:before{background:#fff;-webkit-border-radius:50%;border-radius:50%;color:#00a0d2;content:'\f227';font:400 20px/1.6 dashicons;position:absolute;top:8px;right:15px;speak:none;text-align:center;width:32px;height:32px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-pointer-content p{padding:0 15px}.wp-pointer-buttons{margin:0;padding:5px 15px;overflow:auto}.wp-pointer-buttons a{float:left;display:inline-block;text-decoration:none}.wp-pointer-buttons a.close{padding-right:3px;position:relative}.wp-pointer-buttons a.close:before{background:0 0;color:#b4b9be;content:'\f153';display:block!important;font:400 16px/1 dashicons;speak:none;margin:1px 0;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;right:-15px;top:1px}.wp-pointer-buttons a.close:hover:before{color:#c00}.wp-pointer-arrow,.wp-pointer-arrow-inner{position:absolute;width:0;height:0}.wp-pointer-arrow{z-index:10;width:0;height:0;border:0 solid transparent}.wp-pointer-arrow-inner{z-index:20}.wp-pointer-top,.wp-pointer-undefined{padding-top:13px}.wp-pointer-bottom{margin-top:-13px;padding-bottom:13px}.wp-pointer-left{padding-left:13px}.wp-pointer-right{margin-left:-13px;padding-right:13px}.wp-pointer-bottom .wp-pointer-arrow,.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{right:50px}.wp-pointer-left .wp-pointer-arrow,.wp-pointer-right .wp-pointer-arrow{top:50%;margin-top:-15px}.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{top:0;border-width:0 13px 13px;border-bottom-color:#3592b6}.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer-undefined .wp-pointer-arrow-inner{top:1px;margin-right:-13px;margin-top:-13px;border:13px solid transparent;border-bottom-color:#00a0d2;display:block;content:' '}.wp-pointer-bottom .wp-pointer-arrow{bottom:0;border-width:13px 13px 0;border-top-color:#ccc}.wp-pointer-bottom .wp-pointer-arrow-inner{bottom:1px;margin-right:-13px;margin-bottom:-13px;border:13px solid transparent;border-top-color:#fff;display:block;content:' '}.wp-pointer-left .wp-pointer-arrow{left:0;border-width:13px 13px 13px 0;border-right-color:#ccc}.wp-pointer-left .wp-pointer-arrow-inner{left:1px;margin-left:-13px;margin-top:-13px;border:13px solid transparent;border-right-color:#fff;display:block;content:' '}.wp-pointer-right .wp-pointer-arrow{right:0;border-width:13px 0 13px 13px;border-left-color:#ccc}.wp-pointer-right .wp-pointer-arrow-inner{right:1px;margin-right:-13px;margin-top:-13px;border:13px solid transparent;border-left-color:#fff;display:block;content:' '}@media screen and (max-width:782px){.wp-pointer{display:none}}
+99 -115
View File
@@ -1,50 +1,41 @@
.wp-pointer {
}
.wp-pointer-content {
padding: 0 0 10px;
position: relative;
font-size: 13px;
background: #fff;
border-style: solid;
border-width: 1px;
/* Fallback for non-rgba-compliant browsers */
border-color: #dfdfdf;
/* Use rgba to look better against non-white backgrounds. */
border-color: rgba(0,0,0,.125);
-webkit-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 2px 4px rgba(0,0,0,.19);
box-shadow: 0 2px 4px rgba(0,0,0,.19);
border: 1px solid #dfdfdf;
-webkit-box-shadow: 0 3px 6px rgba(0,0,0,0.075);
box-shadow: 0 3px 6px rgba(0,0,0,0.075);
}
.wp-pointer-content h3 {
position: relative;
margin: 0 0 5px;
margin: -1px -1px 5px;
padding: 15px 18px 14px 60px;
border: 1px solid #3592b6;
border-bottom: none;
line-height: 1.4em;
font-size: 14px;
color: #fff;
border-radius: 3px 3px 0 0;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
background: #8cc1e9;
background-image: -webkit-gradient(linear, left bottom, left top, from(#72a7cf), to(#8cc1e9));
background-image: -webkit-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: -moz-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: -o-linear-gradient(bottom, #72a7cf, #8cc1e9);
background-image: linear-gradient(to top, #72a7cf, #8cc1e9);
background: #00a0d2;
}
.wp-pointer-content h3:before {
background: #fff;
-webkit-border-radius: 50%;
border-radius: 50%;
color: #00a0d2;
content: '\f227';
font: normal 20px/1.6 'dashicons';
position: absolute;
top: 0;
top: 8px;
left: 15px;
content: ' ';
width: 36px;
height: 100%;
background: url('../images/icon-pointer-flag.png') 0 50% no-repeat;
speak: none;
text-align: center;
width: 32px;
height: 32px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.wp-pointer-content p {
@@ -64,21 +55,29 @@
}
.wp-pointer-buttons a.close {
padding-left:3px;
padding-left: 3px;
position: relative;
}
.wp-pointer-buttons a.close:before {
content: ' ';
width:10px;
height:100%;
position:absolute;
left:-10px;
background:url('../images/xit.gif') 0 50% no-repeat;
background: none;
color: #b4b9be;
content: '\f153';
display: block !important;
font: normal 16px/1 'dashicons';
speak: none;
margin: 1px 0;
text-align: center;
-webkit-font-smoothing: antialiased !important;
width: 10px;
height: 100%;
position: absolute;
left: -15px;
top: 1px;
}
.wp-pointer-buttons a.close:hover:before {
background-position:100% 50%;
color: #c00;
}
/* The arrow base class must take up no space, even with transparent borders. */
@@ -91,7 +90,9 @@
.wp-pointer-arrow {
z-index: 10;
background:url('../images/arrow-pointer-blue.png') 0 0 no-repeat;
width: 0;
height: 0;
border: 0 solid transparent;
}
.wp-pointer-arrow-inner {
@@ -105,14 +106,17 @@
}
.wp-pointer-bottom {
margin-top: -13px;
padding-bottom: 13px;
}
/* rtl:ignore */
.wp-pointer-left {
padding-left: 13px;
}
/* rtl:ignore */
.wp-pointer-right {
margin-left: -13px;
padding-right: 13px;
}
@@ -121,108 +125,88 @@
.wp-pointer-bottom .wp-pointer-arrow,
.wp-pointer-undefined .wp-pointer-arrow {
left: 50px;
width: 30px;
height: 14px;
}
.wp-pointer-left .wp-pointer-arrow,
.wp-pointer-right .wp-pointer-arrow {
top: 50%;
margin-top: -15px;
width: 14px;
height: 30px;
}
/* Arrow Sprite */
.wp-pointer-top .wp-pointer-arrow,
.wp-pointer-undefined .wp-pointer-arrow {
top: 0;
background-position: 0 0;
border-width: 0 13px 13px 13px;
border-bottom-color: #3592b6;
}
.wp-pointer-top .wp-pointer-arrow-inner,
.wp-pointer-undefined .wp-pointer-arrow-inner {
top: 1px;
margin-left: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-bottom-color: #00a0d2;
display: block;
content: ' ';
}
.wp-pointer-bottom .wp-pointer-arrow {
bottom: 0;
background-position: 0 -46px;
border-width: 13px 13px 0 13px;
border-top-color: #ccc;
}
.wp-pointer-bottom .wp-pointer-arrow-inner {
bottom: 1px;
margin-left: -13px;
margin-bottom: -13px;
border: 13px solid transparent;
border-top-color: #fff;
display: block;
content: ' ';
}
/* rtl:ignore */
.wp-pointer-left .wp-pointer-arrow {
left: 0;
background-position: 0 -15px;
border-width: 13px 13px 13px 0;
border-right-color: #ccc;
}
/* rtl:ignore */
.wp-pointer-left .wp-pointer-arrow-inner {
left: 1px;
margin-left: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-right-color: #fff;
display: block;
content: ' ';
}
/* rtl:ignore */
.wp-pointer-right .wp-pointer-arrow {
right:0;
background-position:-16px -15px;
right: 0;
border-width: 13px 0 13px 13px;
border-left-color: #ccc;
}
/* - RTL
------------------------------------------------------------------------------*/
.rtl .wp-pointer-content h3 {
padding-right: 60px;
padding-left: 18px;
/* rtl:ignore */
.wp-pointer-right .wp-pointer-arrow-inner {
right: 1px;
margin-right: -13px;
margin-top: -13px;
border: 13px solid transparent;
border-left-color: #fff;
display: block;
content: ' ';
}
.rtl .wp-pointer-content h3:before {
right: 15px;
}
.rtl .wp-pointer-buttons a {
float: left;
}
.rtl .wp-pointer-buttons a.close {
padding-right:3px;
padding-left: 0;
}
.rtl .wp-pointer-buttons a.close:before {
right:-10px;
}
.rtl .wp-pointer-top .wp-pointer-arrow,
.rtl .wp-pointer-bottom .wp-pointer-arrow,
.rtl .wp-pointer-undefined .wp-pointer-arrow {
right: 50px;
}
/**
* HiDPI Displays
*/
@media print,
(-o-min-device-pixel-ratio: 5/4),
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.wp-pointer-buttons a.close:before {
background-image: url('../images/xit-2x.gif');
background-size: 20px auto;
}
.wp-pointer-content h3:before {
background-image: url('../images/icon-pointer-flag-2x.png');
background-size: 36px auto;
}
.wp-pointer-arrow {
background: url('../images/arrow-pointer-blue-2x.png') 0 0 no-repeat;
background-size: 30px 60px;
}
.wp-pointer-top .wp-pointer-arrow,
.wp-pointer-undefined .wp-pointer-arrow {
background-position: 0 1px;
}
.wp-pointer-bottom .wp-pointer-arrow {
background-position: 0 -47px;
}
.wp-pointer-left .wp-pointer-arrow {
background-position: 1px -15px;
}
.wp-pointer-right .wp-pointer-arrow {
background-position:-17px -15px;
/* Disable pointers at responsive sizes */
@media screen and ( max-width: 782px ) {
.wp-pointer {
display: none;
}
}
+1 -1
View File
@@ -1 +1 @@
.wp-pointer-content{padding:0 0 10px;position:relative;font-size:13px;background:#fff;border-style:solid;border-width:1px;border-color:#dfdfdf;border-color:rgba(0,0,0,.125);-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.19);box-shadow:0 2px 4px rgba(0,0,0,.19)}.wp-pointer-content h3{position:relative;margin:0 0 5px;padding:15px 18px 14px 60px;line-height:1.4em;font-size:14px;color:#fff;border-radius:3px 3px 0 0;text-shadow:0 -1px 0 rgba(0,0,0,0.3);background:#8cc1e9;background-image:-webkit-gradient(linear,left bottom,left top,from(#72a7cf),to(#8cc1e9));background-image:-webkit-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-moz-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-o-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:linear-gradient(to top,#72a7cf,#8cc1e9)}.wp-pointer-content h3:before{position:absolute;top:0;left:15px;content:' ';width:36px;height:100%;background:url('../images/icon-pointer-flag.png') 0 50% no-repeat}.wp-pointer-content p{padding:0 15px}.wp-pointer-buttons{margin:0;padding:5px 15px;overflow:auto}.wp-pointer-buttons a{float:right;display:inline-block;text-decoration:none}.wp-pointer-buttons a.close{padding-left:3px;position:relative}.wp-pointer-buttons a.close:before{content:' ';width:10px;height:100%;position:absolute;left:-10px;background:url('../images/xit.gif') 0 50% no-repeat}.wp-pointer-buttons a.close:hover:before{background-position:100% 50%}.wp-pointer-arrow,.wp-pointer-arrow-inner{position:absolute;width:0;height:0}.wp-pointer-arrow{z-index:10;background:url('../images/arrow-pointer-blue.png') 0 0 no-repeat}.wp-pointer-arrow-inner{z-index:20}.wp-pointer-top,.wp-pointer-undefined{padding-top:13px}.wp-pointer-bottom{padding-bottom:13px}.wp-pointer-left{padding-left:13px}.wp-pointer-right{padding-right:13px}.wp-pointer-top .wp-pointer-arrow,.wp-pointer-bottom .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{left:50px;width:30px;height:14px}.wp-pointer-left .wp-pointer-arrow,.wp-pointer-right .wp-pointer-arrow{top:50%;margin-top:-15px;width:14px;height:30px}.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{top:0;background-position:0 0}.wp-pointer-bottom .wp-pointer-arrow{bottom:0;background-position:0 -46px}.wp-pointer-left .wp-pointer-arrow{left:0;background-position:0 -15px}.wp-pointer-right .wp-pointer-arrow{right:0;background-position:-16px -15px}.rtl .wp-pointer-content h3{padding-right:60px;padding-left:18px}.rtl .wp-pointer-content h3:before{right:15px}.rtl .wp-pointer-buttons a{float:left}.rtl .wp-pointer-buttons a.close{padding-right:3px;padding-left:0}.rtl .wp-pointer-buttons a.close:before{right:-10px}.rtl .wp-pointer-top .wp-pointer-arrow,.rtl .wp-pointer-bottom .wp-pointer-arrow,.rtl .wp-pointer-undefined .wp-pointer-arrow{right:50px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-pointer-buttons a.close:before{background-image:url('../images/xit-2x.gif');background-size:20px auto}.wp-pointer-content h3:before{background-image:url('../images/icon-pointer-flag-2x.png');background-size:36px auto}.wp-pointer-arrow{background:url('../images/arrow-pointer-blue-2x.png') 0 0 no-repeat;background-size:30px 60px}.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{background-position:0 1px}.wp-pointer-bottom .wp-pointer-arrow{background-position:0 -47px}.wp-pointer-left .wp-pointer-arrow{background-position:1px -15px}.wp-pointer-right .wp-pointer-arrow{background-position:-17px -15px}}
.wp-pointer-content{padding:0 0 10px;position:relative;font-size:13px;background:#fff;border:1px solid #dfdfdf;-webkit-box-shadow:0 3px 6px rgba(0,0,0,.075);box-shadow:0 3px 6px rgba(0,0,0,.075)}.wp-pointer-content h3{position:relative;margin:-1px -1px 5px;padding:15px 18px 14px 60px;border:1px solid #3592b6;border-bottom:none;line-height:1.4em;font-size:14px;color:#fff;background:#00a0d2}.wp-pointer-content h3:before{background:#fff;-webkit-border-radius:50%;border-radius:50%;color:#00a0d2;content:'\f227';font:400 20px/1.6 dashicons;position:absolute;top:8px;left:15px;speak:none;text-align:center;width:32px;height:32px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wp-pointer-content p{padding:0 15px}.wp-pointer-buttons{margin:0;padding:5px 15px;overflow:auto}.wp-pointer-buttons a{float:right;display:inline-block;text-decoration:none}.wp-pointer-buttons a.close{padding-left:3px;position:relative}.wp-pointer-buttons a.close:before{background:0 0;color:#b4b9be;content:'\f153';display:block!important;font:400 16px/1 dashicons;speak:none;margin:1px 0;text-align:center;-webkit-font-smoothing:antialiased!important;width:10px;height:100%;position:absolute;left:-15px;top:1px}.wp-pointer-buttons a.close:hover:before{color:#c00}.wp-pointer-arrow,.wp-pointer-arrow-inner{position:absolute;width:0;height:0}.wp-pointer-arrow{z-index:10;width:0;height:0;border:0 solid transparent}.wp-pointer-arrow-inner{z-index:20}.wp-pointer-top,.wp-pointer-undefined{padding-top:13px}.wp-pointer-bottom{margin-top:-13px;padding-bottom:13px}.wp-pointer-left{padding-left:13px}.wp-pointer-right{margin-left:-13px;padding-right:13px}.wp-pointer-bottom .wp-pointer-arrow,.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{left:50px}.wp-pointer-left .wp-pointer-arrow,.wp-pointer-right .wp-pointer-arrow{top:50%;margin-top:-15px}.wp-pointer-top .wp-pointer-arrow,.wp-pointer-undefined .wp-pointer-arrow{top:0;border-width:0 13px 13px;border-bottom-color:#3592b6}.wp-pointer-top .wp-pointer-arrow-inner,.wp-pointer-undefined .wp-pointer-arrow-inner{top:1px;margin-left:-13px;margin-top:-13px;border:13px solid transparent;border-bottom-color:#00a0d2;display:block;content:' '}.wp-pointer-bottom .wp-pointer-arrow{bottom:0;border-width:13px 13px 0;border-top-color:#ccc}.wp-pointer-bottom .wp-pointer-arrow-inner{bottom:1px;margin-left:-13px;margin-bottom:-13px;border:13px solid transparent;border-top-color:#fff;display:block;content:' '}.wp-pointer-left .wp-pointer-arrow{left:0;border-width:13px 13px 13px 0;border-right-color:#ccc}.wp-pointer-left .wp-pointer-arrow-inner{left:1px;margin-left:-13px;margin-top:-13px;border:13px solid transparent;border-right-color:#fff;display:block;content:' '}.wp-pointer-right .wp-pointer-arrow{right:0;border-width:13px 0 13px 13px;border-left-color:#ccc}.wp-pointer-right .wp-pointer-arrow-inner{right:1px;margin-right:-13px;margin-top:-13px;border:13px solid transparent;border-left-color:#fff;display:block;content:' '}@media screen and (max-width:782px){.wp-pointer{display:none}}
+1013
View File
File diff suppressed because it is too large. Load diff
+24 -10
View File
@@ -41,7 +41,14 @@ function wp_initial_constants() {
// set memory limits.
if ( function_exists( 'memory_get_usage' ) ) {
$current_limit = @ini_get( 'memory_limit' );
if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || ( intval( $current_limit ) < abs( intval( WP_MEMORY_LIMIT ) ) ) ) )
$current_limit_int = intval( $current_limit );
if ( false !== strpos( $current_limit, 'G' ) )
$current_limit_int *= 1024;
$wp_limit_int = intval( WP_MEMORY_LIMIT );
if ( false !== strpos( WP_MEMORY_LIMIT, 'G' ) )
$wp_limit_int *= 1024;
if ( -1 != $current_limit && ( -1 == WP_MEMORY_LIMIT || $current_limit_int < $wp_limit_int ) )
@ini_set( 'memory_limit', WP_MEMORY_LIMIT );
}
@@ -147,13 +154,14 @@ function wp_plugin_directory_constants() {
/**
* Defines cookie related WordPress constants
*
* Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
* Defines constants after multisite is loaded.
* @since 3.0.0
*/
function wp_cookie_constants() {
/**
* Used to guarantee unique hash cookies
* @since 1.5
*
* @since 1.5.0
*/
if ( !defined( 'COOKIEHASH' ) ) {
$siteurl = get_site_option( 'siteurl' );
@@ -239,16 +247,22 @@ function wp_ssl_constants() {
/**
* @since 2.6.0
*/
if ( !defined('FORCE_SSL_ADMIN') )
define('FORCE_SSL_ADMIN', false);
force_ssl_admin(FORCE_SSL_ADMIN);
if ( !defined( 'FORCE_SSL_ADMIN' ) ) {
if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) {
define( 'FORCE_SSL_ADMIN', true );
} else {
define( 'FORCE_SSL_ADMIN', false );
}
}
force_ssl_admin( FORCE_SSL_ADMIN );
/**
* @since 2.6.0
* @deprecated 4.0.0
*/
if ( !defined('FORCE_SSL_LOGIN') )
define('FORCE_SSL_LOGIN', false);
force_ssl_login(FORCE_SSL_LOGIN);
if ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN ) {
force_ssl_admin( true );
}
}
/**
@@ -304,6 +318,6 @@ function wp_templating_constants() {
* @since 3.0.0
*/
if ( !defined('WP_DEFAULT_THEME') )
define( 'WP_DEFAULT_THEME', 'twentythirteen' );
define( 'WP_DEFAULT_THEME', 'twentyfifteen' );
}
+111 -23
View File
@@ -74,9 +74,7 @@ foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url'
}
// Slugs
foreach ( array( 'pre_term_slug' ) as $filter ) {
add_filter( $filter, 'sanitize_title' );
}
add_filter( 'pre_term_slug', 'sanitize_title' );
// Keys
foreach ( array( 'pre_post_type', 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) {
@@ -100,7 +98,7 @@ foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description',
}
// Format WordPress
foreach ( array( 'the_content', 'the_title' ) as $filter )
foreach ( array( 'the_content', 'the_title', 'wp_title' ) as $filter )
add_filter( $filter, 'capital_P_dangit', 11 );
add_filter( 'comment_text', 'capital_P_dangit', 31 );
@@ -119,9 +117,7 @@ foreach ( array( 'term_description' ) as $filter ) {
}
// Format for RSS
foreach ( array( 'term_name_rss' ) as $filter ) {
add_filter( $filter, 'convert_chars' );
}
add_filter( 'term_name_rss', 'convert_chars' );
// Pre save hierarchy
add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 );
@@ -160,17 +156,23 @@ add_filter( 'list_cats', 'wptexturize' );
add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );
// RSS filters
add_filter( 'the_title_rss', 'strip_tags' );
add_filter( 'the_title_rss', 'ent2ncr', 8 );
add_filter( 'the_title_rss', 'esc_html' );
add_filter( 'the_content_rss', 'ent2ncr', 8 );
add_filter( 'the_excerpt_rss', 'convert_chars' );
add_filter( 'the_excerpt_rss', 'ent2ncr', 8 );
add_filter( 'comment_author_rss', 'ent2ncr', 8 );
add_filter( 'comment_text_rss', 'ent2ncr', 8 );
add_filter( 'comment_text_rss', 'esc_html' );
add_filter( 'bloginfo_rss', 'ent2ncr', 8 );
add_filter( 'the_author', 'ent2ncr', 8 );
add_filter( 'the_title_rss', 'strip_tags' );
add_filter( 'the_title_rss', 'ent2ncr', 8 );
add_filter( 'the_title_rss', 'esc_html' );
add_filter( 'the_content_rss', 'ent2ncr', 8 );
add_filter( 'the_content_feed', 'wp_staticize_emoji' );
add_filter( 'the_excerpt_rss', 'convert_chars' );
add_filter( 'the_excerpt_rss', 'ent2ncr', 8 );
add_filter( 'comment_author_rss', 'ent2ncr', 8 );
add_filter( 'comment_text_rss', 'ent2ncr', 8 );
add_filter( 'comment_text_rss', 'esc_html' );
add_filter( 'comment_text_rss', 'wp_staticize_emoji' );
add_filter( 'bloginfo_rss', 'ent2ncr', 8 );
add_filter( 'the_author', 'ent2ncr', 8 );
add_filter( 'the_guid', 'esc_url' );
// Email filters
add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
// Misc filters
add_filter( 'option_ping_sites', 'privacy_ping_filter' );
@@ -179,6 +181,7 @@ add_filter( 'option_blog_charset', '_canonical_charset' );
add_filter( 'option_home', '_config_wp_home' );
add_filter( 'option_siteurl', '_config_wp_siteurl' );
add_filter( 'tiny_mce_before_init', '_mce_set_direction' );
add_filter( 'teeny_mce_before_init', '_mce_set_direction' );
add_filter( 'pre_kses', 'wp_pre_kses_less_than' );
add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 );
add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 3 );
@@ -195,10 +198,12 @@ add_filter( 'editable_slug', 'esc_textarea' );
add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );
add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' );
add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' );
add_filter( 'title_save_pre', 'trim' );
add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );
// Actions
add_action( 'wp_head', '_wp_render_title_tag', 1 );
add_action( 'wp_head', 'wp_enqueue_scripts', 1 );
add_action( 'wp_head', 'feed_links', 2 );
add_action( 'wp_head', 'feed_links_extra', 3 );
@@ -208,6 +213,7 @@ add_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
add_action( 'wp_head', 'locale_stylesheet' );
add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 );
add_action( 'wp_head', 'noindex', 1 );
add_action( 'wp_head', 'print_emoji_detection_script', 7 );
add_action( 'wp_head', 'wp_print_styles', 8 );
add_action( 'wp_head', 'wp_print_head_scripts', 9 );
add_action( 'wp_head', 'wp_generator' );
@@ -218,6 +224,7 @@ add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );
add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'init', 'check_theme_switched', 99 );
add_action( 'after_switch_theme', '_wp_sidebars_changed' );
add_action( 'wp_print_styles', 'print_emoji_styles' );
if ( isset( $_GET['replytocom'] ) )
add_action( 'wp_head', 'wp_no_robots' );
@@ -245,13 +252,16 @@ add_action( 'do_pings', 'do_all_pings',
add_action( 'do_robots', 'do_robots' );
add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 2 );
add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' );
add_action( 'admin_print_scripts', 'print_emoji_detection_script' );
add_action( 'admin_print_scripts', 'print_head_scripts', 20 );
add_action( 'admin_print_footer_scripts', '_wp_footer_scripts' );
add_action( 'admin_print_styles', 'print_emoji_styles' );
add_action( 'admin_print_styles', 'print_admin_styles', 20 );
add_action( 'init', 'smilies_init', 5 );
add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 );
add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 );
add_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
// Create a revision whenever a post is updated.
add_action( 'post_updated', 'wp_save_post_revision', 10, 1 );
add_action( 'publish_post', '_publish_post_hook', 5, 1 );
add_action( 'transition_post_status', '_transition_post_status', 5, 3 );
@@ -266,7 +276,7 @@ add_action( 'welcome_panel', 'wp_welcome_panel'
// Navigation menu actions
add_action( 'delete_post', '_wp_delete_post_menu_item' );
add_action( 'delete_term', '_wp_delete_tax_menu_item' );
add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 );
add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 );
// Post Thumbnail CSS class filtering
@@ -297,8 +307,86 @@ add_filter( 'default_option_embed_autourls', '__return_true' );
add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' );
// Check if the user is logged out
add_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );
add_filter( 'heartbeat_received', 'wp_auth_check', 10, 2 );
add_filter( 'heartbeat_nopriv_received', 'wp_auth_check', 10, 2 );
add_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );
add_filter( 'heartbeat_send', 'wp_auth_check' );
add_filter( 'heartbeat_nopriv_send', 'wp_auth_check' );
unset($filter, $action);
// Default authentication filters
add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 );
add_filter( 'determine_current_user', 'wp_validate_auth_cookie' );
add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 );
// Split term updates.
add_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 );
add_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 );
/**
* Filters formerly mixed into wp-includes
*/
// Theme
add_action( 'setup_theme', 'preview_theme' );
add_action( 'wp_loaded', '_custom_header_background_just_in_time' );
add_action( 'plugins_loaded', '_wp_customize_include' );
add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' );
add_action( 'delete_attachment', '_delete_attachment_theme_mod' );
// Calendar widget cache
add_action( 'save_post', 'delete_get_calendar_cache' );
add_action( 'delete_post', 'delete_get_calendar_cache' );
add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' );
add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' );
// Author
add_action( 'transition_post_status', '__clear_multi_author_cache' );
// Post
add_action( 'init', 'create_initial_post_types', 0 ); // highest priority
add_action( 'admin_menu', '_add_post_type_submenus' );
add_action( 'before_delete_post', '_reset_front_page_settings_for_post' );
add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' );
// Post Formats
add_filter( 'request', '_post_format_request' );
add_filter( 'term_link', '_post_format_link', 10, 3 );
add_filter( 'get_post_format', '_post_format_get_term' );
add_filter( 'get_terms', '_post_format_get_terms', 10, 3 );
add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
// KSES
add_action( 'init', 'kses_init' );
add_action( 'set_current_user', 'kses_init' );
// Script Loader
add_action( 'wp_default_scripts', 'wp_default_scripts' );
add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' );
add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' );
add_action( 'wp_default_styles', 'wp_default_styles' );
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );
// Taxonomy
add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
// Canonical
add_action( 'template_redirect', 'redirect_canonical' );
add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
// Shortcodes
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop()
// Media
add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' );
add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' );
// Nav menu
add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );
// Admin Bar
// Don't remove. Wrong way to disable.
add_action( 'template_redirect', '_wp_admin_bar_init', 0 );
add_action( 'admin_init', '_wp_admin_bar_init' );
add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
add_action( 'in_admin_header', 'wp_admin_bar_render', 0 );
unset( $filter, $action );
File diff suppressed because it is too large. Load diff
+284 -171
View File
File diff suppressed because it is too large. Load diff
Loaded 100 of 1572 files, more files were not shown because too many files have changed in this diff. Show more