Compare commits
157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ea8e9a4f0 | ||
|
|
665617103b | ||
|
|
befa21d88e | ||
|
|
89d7d9e70f | ||
|
|
fa47298720 | ||
|
|
ad0f68291a | ||
|
|
599e703836 | ||
|
|
5960939cca | ||
|
|
7b45f8189d | ||
|
|
281e5e828a | ||
|
|
0df6499c8d | ||
|
|
5094cbd599 | ||
|
|
39b785c7f9 | ||
|
|
75df12f322 | ||
|
|
3176a085da | ||
|
|
e0b6a13194 | ||
|
|
871bb10c9a | ||
|
|
31c9a63bfb | ||
|
|
63828d08a0 | ||
|
|
189e5449a3 | ||
|
|
d47305bfe4 | ||
|
|
aa13103db8 | ||
|
|
3027491963 | ||
|
|
ed77d76855 | ||
|
|
483fa89c88 | ||
|
|
95026e579b | ||
|
|
425d389d92 | ||
|
|
6cdd4b1250 | ||
|
|
4a804cac79 | ||
|
|
cc4a680493 | ||
|
|
d93d3febfe | ||
|
|
8cc3c97b85 | ||
|
|
2d20b59244 | ||
|
|
d4399a7082 | ||
|
|
ce7ab0d87f | ||
|
|
6124fbb02c | ||
|
|
b410db797b | ||
|
|
e87ab24ef8 | ||
|
|
6c457d4415 | ||
|
|
fb52c9599d | ||
|
|
8f7e4969bc | ||
|
|
b28d64fb46 | ||
|
|
61fb79c097 | ||
|
|
9edb03c095 | ||
|
|
bd0a38d439 | ||
|
|
8780e40de2 | ||
|
|
559e81937b | ||
|
|
8a2525a88d | ||
|
|
7d1db9607d | ||
|
|
6e8114742f | ||
|
|
cf9b1dbc1f | ||
|
|
bba21b983c | ||
|
|
e6ce714219 | ||
|
|
45e03c2576 | ||
|
|
540a3164a4 | ||
|
|
592f1be68e | ||
|
|
380cc5d7d6 | ||
|
|
0b813f2544 | ||
|
|
72d9177fc0 | ||
|
|
b24993e4cd | ||
|
|
db72974122 | ||
|
|
41d2ef99a6 | ||
|
|
6bfa2de24d | ||
|
|
948379bde8 | ||
|
|
3db97bd725 | ||
|
|
ca4d60134b | ||
|
|
e28a67c870 | ||
|
|
7ffc106c38 | ||
|
|
459ab62c8a | ||
|
|
a30c4df4b5 | ||
|
|
15a94f7c00 | ||
|
|
c3f619e2d0 | ||
|
|
900cd6c47d | ||
|
|
5fa8150d16 | ||
|
|
edcebaa160 | ||
|
|
01aaece3ea | ||
|
|
6663e03ced | ||
|
|
30bb628489 | ||
|
|
6738759b0c | ||
|
|
16cabf6b50 | ||
|
|
563dc76e7b | ||
|
|
537f4728bd | ||
|
|
e489c7e378 | ||
|
|
4135f92f3d | ||
|
|
8ea5b3b2d2 | ||
|
|
f594693fcd | ||
|
|
8ab4a55cbe | ||
|
|
0c0fa13a66 | ||
|
|
e58ec083da | ||
|
|
92c3c3453b | ||
|
|
0e7cc25529 | ||
|
|
c34a4c0ba3 | ||
|
|
16161be6ac | ||
|
|
ac2345ca32 | ||
|
|
8da7adb54f | ||
|
|
13ff476cc1 | ||
|
|
d6497ddf70 | ||
|
|
a1005ad7f9 | ||
|
|
082fa8f5ad | ||
|
|
70f46a9e84 | ||
|
|
3c4d5d2e6f | ||
|
|
8f1a4c9a56 | ||
|
|
e918433445 | ||
|
|
f012d52928 | ||
|
|
4fd3246c0d | ||
|
|
d150dd35b2 | ||
|
|
c720c0df8c | ||
|
|
1c4c7086a5 | ||
|
|
ea244bef6e | ||
|
|
dae13be262 | ||
|
|
250f92a59e | ||
|
|
b41001d4a1 | ||
|
|
7847fee343 | ||
|
|
83c0a40c05 | ||
|
|
93734bcbcb | ||
|
|
d344c40f57 | ||
|
|
afa325993e | ||
|
|
0dd3e5e34d | ||
|
|
3adc537233 | ||
|
|
4726c85ee5 | ||
|
|
19ba92e401 | ||
|
|
4727124583 | ||
|
|
0b152a7f2c | ||
|
|
77022af062 | ||
|
|
43eb2619e9 | ||
|
|
27af8391d0 | ||
|
|
4a0443e0db | ||
|
|
909e795ba4 | ||
|
|
e28ec68af6 | ||
|
|
f57ee7c1f1 | ||
|
|
d81e03da4e | ||
|
|
90cd5e5f80 | ||
|
|
816196aee7 | ||
|
|
b460e1fd0d | ||
|
|
a332bb92d2 | ||
|
|
41118e509a | ||
|
|
1d9a15ad4a | ||
|
|
cb6bdc2d4c | ||
|
|
bc1df6bef1 | ||
|
|
7b69275632 | ||
|
|
71169d688a | ||
|
|
02fa7656d1 | ||
|
|
29e03dd26c | ||
|
|
849d8db4fc | ||
|
|
f50646d6c4 | ||
|
|
413896af01 | ||
|
|
08ff35374b | ||
|
|
9650704689 | ||
|
|
b9cd04e8ad | ||
|
|
ea8b01eac6 | ||
|
|
6d161ba61a | ||
|
|
fa7b15c74e | ||
|
|
158d1b55b4 | ||
|
|
28ba2c0911 | ||
|
|
a8ef25ce7b | ||
|
|
acd9d9fad3 | ||
|
|
781d4e5b46 |
@@ -1,6 +1,6 @@
|
||||
WordPress - Web publishing software
|
||||
|
||||
Copyright 2011-2016 by the contributors
|
||||
Copyright 2011-2017 by the contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -59,9 +59,10 @@
|
||||
|
||||
<h3>Recommendations</h3>
|
||||
<ul>
|
||||
<li><a href="https://secure.php.net/">PHP</a> version <strong>5.6</strong> or higher.</li>
|
||||
<li><a href="https://secure.php.net/">PHP</a> version <strong>7</strong> or higher.</li>
|
||||
<li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.6</strong> or higher.</li>
|
||||
<li>The <a href="https://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> Apache module.</li>
|
||||
<li><a href="https://wordpress.org/news/2016/12/moving-toward-ssl/">HTTPS</a> support.</li>
|
||||
<li>A link to <a href="https://wordpress.org/">wordpress.org</a> on your site.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -18,22 +18,7 @@ if ( ! wp_is_mobile() ) {
|
||||
) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the height and width attributes with values for full size.
|
||||
*
|
||||
* wp_video_shortcode() limits the width to 640px.
|
||||
*
|
||||
* @since 4.6.0
|
||||
* @ignore
|
||||
*
|
||||
* @param $output Video shortcode HTML output.
|
||||
* @return string Filtered HTML content to display video.
|
||||
*/
|
||||
function _wp_override_admin_video_width_limit( $output ) {
|
||||
return str_replace( array( '640', '384' ), array( '1050', '630' ), $output );
|
||||
}
|
||||
|
||||
$video_url = 'https://videopress.com/embed/GbdhpGF3?hd=true';
|
||||
$video_url = 'https://videopress.com/embed/AHz0Ca46?hd=true';
|
||||
$lang_code = str_replace( '_', '-', get_user_locale() );
|
||||
list( $lang_code ) = explode( '-', $lang_code );
|
||||
if ( 'en' !== $lang_code ) {
|
||||
@@ -49,7 +34,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="wrap about-wrap">
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s changes a lot behind the scenes to make your WordPress experience even better!' ), $display_version ); ?></p>
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s helps you get your site set up the way you want it.' ), $display_version ); ?></p>
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
<h2 class="nav-tab-wrapper wp-clearfix">
|
||||
@@ -58,140 +43,198 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
|
||||
</h2>
|
||||
|
||||
<div class="changelog point-releases">
|
||||
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
|
||||
<p><?php printf( __( '<strong>Version %s</strong> addressed some security issues.' ), '4.7.2' ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.2' ); ?>
|
||||
</p>
|
||||
<p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 62 ), '4.7.1', number_format_i18n( 62 ) ); ?>
|
||||
<?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.7.1' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="headline-feature feature-video">
|
||||
<iframe width="1050" height="591" src="<?php echo esc_url( $video_url ); ?>" frameborder="0" allowfullscreen></iframe>
|
||||
<script src="https://videopress.com/videopress-iframe.js"></script>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr />
|
||||
|
||||
<div class="streamlined-updates feature-section one-col">
|
||||
<h2><?php _e( 'Streamlined Updates' ); ?></h2>
|
||||
<p><?php _e( 'Don’t lose your place: stay on the same page while you update, install, and delete your plugins and themes.' ); ?></p>
|
||||
<?php
|
||||
if ( ! wp_is_mobile() ) {
|
||||
add_filter( 'wp_video_shortcode', '_wp_override_admin_video_width_limit' );
|
||||
echo wp_video_shortcode( array(
|
||||
'mp4' => 'https://s.w.org/images/core/4.6/streamlined-updates.mp4',
|
||||
'webm' => 'https://s.w.org/images/core/4.6/streamlined-updates.webm',
|
||||
'poster' => 'https://s.w.org/images/core/4.6/streamlined-updates-2000.png?v1',
|
||||
'loop' => true,
|
||||
'autoplay' => true,
|
||||
'width' => 1050,
|
||||
'height' => 630,
|
||||
'class' => 'wp-video-shortcode feature-video',
|
||||
) );
|
||||
remove_filter( 'wp_video_shortcode', '_wp_override_admin_video_width_limit' );
|
||||
} else {
|
||||
echo '<img src="https://s.w.org/images/core/4.6/streamlined-updates-1057.png?v1" alt="" srcset="https://s.w.org/images/core/4.6/streamlined-updates-1664.png?v1 1664w, https://s.w.org/images/core/4.6/streamlined-updates-200.png?v1 200w, https://s.w.org/images/core/4.6/streamlined-updates-1057.png?v1 1057w, https://s.w.org/images/core/4.6/streamlined-updates-2000.png?v1 2000w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 782px) calc(100vw - 70px), (max-width: 959px) calc(100vw - 116px), (max-width: 1290px) calc(100vw - 240px), 1050px" />';
|
||||
}
|
||||
?>
|
||||
<div class="feature-section one-col">
|
||||
<h2><?php _e( 'Presenting Twenty Seventeen' ); ?></h2>
|
||||
<p class="lead-description"><?php _e( 'A brand new default theme brings your site to life with immersive featured images and video headers.' ); ?></p>
|
||||
<picture>
|
||||
<source media="(min-width: 450px)" srcset="https://s.w.org/images/core/4.7/twenty-seventeen-1600.jpg?v2 1600w, https://s.w.org/images/core/4.7/twenty-seventeen-493.jpg?v2 493w, https://s.w.org/images/core/4.7/twenty-seventeen-663.jpg?v2 663w, https://s.w.org/images/core/4.7/twenty-seventeen-804.jpg?v2 804w, https://s.w.org/images/core/4.7/twenty-seventeen-928.jpg?v2 928w, https://s.w.org/images/core/4.7/twenty-seventeen-1058.jpg?v2 1058w, https://s.w.org/images/core/4.7/twenty-seventeen-1173.jpg?v2 1173w, https://s.w.org/images/core/4.7/twenty-seventeen-1299.jpg?v2 1299w, https://s.w.org/images/core/4.7/twenty-seventeen-1410.jpg?v2 1410w, https://s.w.org/images/core/4.7/twenty-seventeen-1513.jpg?v2 1513w, https://s.w.org/images/core/4.7/twenty-seventeen-1595.jpg?v2 1595w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 782px) calc(100vw - 70px), (max-width: 959px) calc(100vw - 116px), (max-width: 1290px) calc(100vw - 240px), 1050px">
|
||||
<source srcset="https://s.w.org/images/core/4.7/twenty-seventeen-mobile-564.jpg?v2 564w, https://s.w.org/images/core/4.7/twenty-seventeen-mobile-280.jpg?v2 280w, https://s.w.org/images/core/4.7/twenty-seventeen-mobile-372.jpg?v2 372w, https://s.w.org/images/core/4.7/twenty-seventeen-mobile-454.jpg?v2 454w, https://s.w.org/images/core/4.7/twenty-seventeen-mobile-541.jpg?v2 541w" sizes="calc(100vw - 40px)">
|
||||
<img src="https://s.w.org/images/core/4.7/twenty-seventeen-1600.jpg?v2" srcset="https://s.w.org/images/core/4.7/twenty-seventeen-1600.jpg?v2 1600w, https://s.w.org/images/core/4.7/twenty-seventeen-280.jpg?v2 280w, https://s.w.org/images/core/4.7/twenty-seventeen-493.jpg?v2 493w, https://s.w.org/images/core/4.7/twenty-seventeen-663.jpg?v2 663w, https://s.w.org/images/core/4.7/twenty-seventeen-804.jpg?v2 804w, https://s.w.org/images/core/4.7/twenty-seventeen-928.jpg?v2 928w, https://s.w.org/images/core/4.7/twenty-seventeen-1058.jpg?v2 1058w, https://s.w.org/images/core/4.7/twenty-seventeen-1173.jpg?v2 1173w, https://s.w.org/images/core/4.7/twenty-seventeen-1299.jpg?v2 1299w, https://s.w.org/images/core/4.7/twenty-seventeen-1410.jpg?v2 1410w, https://s.w.org/images/core/4.7/twenty-seventeen-1513.jpg?v2 1513w, https://s.w.org/images/core/4.7/twenty-seventeen-1595.jpg?v2 1595w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 782px) calc(100vw - 70px), (max-width: 959px) calc(100vw - 116px), (max-width: 1290px) calc(100vw - 240px), 1050px" alt="" />
|
||||
</picture>
|
||||
<p><?php _e( 'Twenty Seventeen focuses on business sites and features a customizable front page with multiple sections. Personalize it with widgets, navigation, social menus, a logo, custom colors, and more. Our default theme for 2017 works great in many languages, on any device, and for a wide range of users.' ); ?></p>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="native-fonts feature-section one-col">
|
||||
<h2><?php _e( 'Native Fonts' ); ?></h2>
|
||||
<p><?php _e( 'The WordPress dashboard now takes advantage of the fonts you already have, making it load faster and letting you feel more at home on whatever device you use.' ); ?></p>
|
||||
<img src="https://s.w.org/images/core/4.6/native-fonts-992.png?v1" alt="" srcset="https://cldup.com/Hqmo5VLb-E.png?v1 922w, https://s.w.org/images/core/4.6/native-fonts-200.png?v1 200w,https://s.w.org/images/core/4.6/native-fonts-371.png?v1 371w,https://s.w.org/images/core/4.6/native-fonts-510.png?v1 510w, https://s.w.org/images/core/4.6/native-fonts-560.png?v1 560w, https://s.w.org/images/core/4.6/native-fonts-781.png?v1 781w, https://s.w.org/images/core/4.6/native-fonts-2000.png?v1 2000w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 782px) calc(100vw - 70px), (max-width: 959px) calc(100vw - 116px), (max-width: 1290px) calc(100vw - 240px), 1050px"/>
|
||||
<div class="feature-section one-col">
|
||||
<h2><?php _e( 'Your Site, Your Way' ); ?></h2>
|
||||
<p class="lead-description"><?php _e( 'WordPress 4.7 adds new features to the customizer to help take you through the initial setup of a theme, with non-destructive live previews of all your changes in one uninterrupted workflow.' ); ?></p>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="feature-section two-col">
|
||||
<h2><?php _e( 'Editor Improvements' ); ?></h2>
|
||||
<div class="col">
|
||||
<img src="https://s.w.org/images/core/4.6/inline-link-checker-608.png?v1" alt="" srcset="https://s.w.org/images/core/4.6/inline-link-checker-789.png?v1 789w, https://s.w.org/images/core/4.6/inline-link-checker-200.png?v1 200w, https://s.w.org/images/core/4.6/inline-link-checker-384.png?v1 384w, https://s.w.org/images/core/4.6/inline-link-checker-608.png?v1 608w, https://s.w.org/images/core/4.6/inline-link-checker-992.png?v1 992w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px"/>
|
||||
<h3><?php _e( 'Inline Link Checker' ); ?></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %s: Home URL appended with 'wordpress.org' */
|
||||
__( 'Ever accidentally made a link to %s? Now WordPress automatically checks to make sure you didn’t.' ),
|
||||
home_url( 'wordpress.org' )
|
||||
);
|
||||
?></p>
|
||||
<h3><?php _e( 'Theme Starter Content' ); ?></h3>
|
||||
<p><?php _e( 'To help give you a solid base to build from, individual themes can provide starter content that appears when you go to customize your brand new site. This can range from placing a business information widget in the best location to providing a sample menu with social icon links to a static front page complete with beautiful images. Don’t worry - nothing new will appear on the live site until you’re ready to save and publish your initial theme setup.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<img src="https://s.w.org/images/core/4.6/content-recovery-561.png?v1" alt="" srcset="https://s.w.org/images/core/4.6/content-recovery-701.png?v1 701w, https://s.w.org/images/core/4.6/content-recovery-200.png?v1 200w, https://s.w.org/images/core/4.6/content-recovery-400.png?v1 400w, https://s.w.org/images/core/4.6/content-recovery-561.png?v1 561w, https://s.w.org/images/core/4.6/content-recovery-992.png?v1 992w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px"/>
|
||||
<h3><?php _e( 'Content Recovery' ); ?></h3>
|
||||
<p><?php _e( 'As you type, WordPress saves your content to the browser. Recovering saved content is even easier with WordPress 4.6.' ); ?></p>
|
||||
<?php
|
||||
echo wp_video_shortcode( array(
|
||||
'mp4' => 'https://s.w.org/images/core/4.7/starter-content-v1.mp4',
|
||||
'poster' => 'https://s.w.org/images/core/4.7/starter-content.jpg?v2',
|
||||
'loop' => true,
|
||||
'autoplay' => true,
|
||||
'width' => 1140,
|
||||
'height' => 624,
|
||||
// 'class' => 'wp-video-shortcode feature-video',
|
||||
) );
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="feature-section two-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Edit Shortcuts' ); ?></h3>
|
||||
<?php
|
||||
echo wp_video_shortcode( array(
|
||||
'mp4' => 'https://s.w.org/images/core/4.7/edit-shortcuts-v1.mp4',
|
||||
'poster' => 'https://s.w.org/images/core/4.7/edit-shortcuts.jpg?v2',
|
||||
'loop' => true,
|
||||
'autoplay' => true,
|
||||
'width' => 2520,
|
||||
'height' => 1454,
|
||||
// 'class' => 'wp-video-shortcode feature-video',
|
||||
) );
|
||||
?>
|
||||
<p><?php _e( 'Visible icons appear to show you which parts of your site can be customized while live previewing. Click on a shortcut and get straight to editing. Paired with starter content, getting started with customizing your site is faster than ever.' );?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Video Headers' ); ?></h3>
|
||||
<?php
|
||||
echo wp_video_shortcode( array(
|
||||
'mp4' => 'https://s.w.org/images/core/4.7/header-video-v1.mp4',
|
||||
'poster' => 'https://s.w.org/images/core/4.7/header-video.jpg?v2',
|
||||
'loop' => true,
|
||||
'autoplay' => true,
|
||||
'width' => 2520,
|
||||
'height' => 1454,
|
||||
// 'class' => 'wp-video-shortcode feature-video',
|
||||
) );
|
||||
?>
|
||||
<p><?php _e( 'Sometimes a big atmospheric video as a moving header image is just what you need to showcase your wares; go ahead and try it out with Twenty Seventeen. Need some video inspiration? Try searching for sites with video headers available for download and use.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="feature-section two-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Smoother Menu Building' ); ?></h3>
|
||||
<img src="https://s.w.org/images/core/4.7/nav-menus-760.jpg?v2" srcset="https://s.w.org/images/core/4.7/nav-menus-760.jpg?v2 760w, https://s.w.org/images/core/4.7/nav-menus-280.jpg?v2 280w, https://s.w.org/images/core/4.7/nav-menus-536.jpg?v2 536w, https://s.w.org/images/core/4.7/nav-menus-745.jpg?v2 745w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px" alt="" />
|
||||
<p><?php _e( 'Many menus for sites contain links to the pages of your site, but what happens when you don’t have any pages yet? Now you can add new pages while building menus instead of leaving the customizer and abandoning your changes. Once you’ve published your customizations, you’ll have new pages ready for you to fill with content.' );?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Custom CSS' ); ?></h3>
|
||||
<img src="https://s.w.org/images/core/4.7/css-760.jpg?v2" srcset="https://s.w.org/images/core/4.7/css-760.jpg?v2 760w, https://s.w.org/images/core/4.7/css-280.jpg?v2 280w, https://s.w.org/images/core/4.7/css-547.jpg?v2 547w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px" alt="" />
|
||||
<p><?php _e( 'Sometimes you just need a few visual tweaks to make your site perfect. WordPress 4.7 allows you to add custom CSS and instantly see how your changes affect your site. The live preview allows you to work quickly without page refreshes slowing you down.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="feature-section no-heading two-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'PDF Thumbnail Previews' ); ?></h3>
|
||||
<img src="https://s.w.org/images/core/4.7/pdf-760.jpg?v2" srcset="https://s.w.org/images/core/4.7/pdf-760.jpg?v2 760w, https://s.w.org/images/core/4.7/pdf-280.jpg?v2 280w, https://s.w.org/images/core/4.7/pdf-412.jpg?v2 412w, https://s.w.org/images/core/4.7/pdf-516.jpg?v2 516w, https://s.w.org/images/core/4.7/pdf-615.jpg?v2 615w, https://s.w.org/images/core/4.7/pdf-716.jpg?v2 716w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px" alt="" />
|
||||
<p><?php _e( 'Managing your document collection is easier with WordPress 4.7. Uploading PDFs will generate thumbnail images so you can more easily distinguish between all your documents.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Dashboard in your language' ); ?></h3>
|
||||
<img src="https://s.w.org/images/core/4.7/language-760.jpg?v2" srcset="https://s.w.org/images/core/4.7/language-760.jpg?v2 760w, https://s.w.org/images/core/4.7/language-280.jpg?v2 280w, https://s.w.org/images/core/4.7/language-568.jpg?v2 568w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 781px) calc((100vw - 70px) * .466), (max-width: 959px) calc((100vw - 116px) * .469), (max-width: 1290px) calc((100vw - 240px) * .472), 496px" alt="" />
|
||||
<p><?php _e( 'Just because your site is in one language doesn’t mean that everybody helping manage it prefers that language for their admin. Add more languages to your site and a user language option will show up in your user’s profiles.' );?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="rest-api feature-section one-col">
|
||||
<h2><?php _e( 'Introducing REST API Content Endpoints' ); ?></h2>
|
||||
<p class="lead-description"><?php _e( 'WordPress 4.7 comes with REST API endpoints for posts, comments, terms, users, meta, and settings.' ); ?></p>
|
||||
<img src="https://s.w.org/images/core/4.7/api-1559.jpg?v2" srcset="https://s.w.org/images/core/4.7/api-2100.jpg?v2 2100w, https://s.w.org/images/core/4.7/api-280.jpg?v2 280w, https://s.w.org/images/core/4.7/api-1034.jpg?v2 1034w, https://s.w.org/images/core/4.7/api-1559.jpg?v2 1559w, https://s.w.org/images/core/4.7/api-2032.jpg?v2 2032w" sizes="(max-width: 500px) calc(100vw - 40px), (max-width: 782px) calc(100vw - 70px), (max-width: 959px) calc(100vw - 116px), (max-width: 1290px) calc(100vw - 240px), 1050px" alt="" />
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %s: https://developer.wordpress.org/rest-api/ */
|
||||
__( 'Content endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, paving the way for new and innovative methods of interacting with sites through plugins, themes, apps, and beyond. Ready to get started with development? <a href="%s">Check out the REST API reference.</a>' ),
|
||||
'https://developer.wordpress.org/rest-api/reference/'
|
||||
);
|
||||
?></p>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="changelog">
|
||||
<h2><?php _e( 'Under the Hood' ); ?></h2>
|
||||
<h2><?php
|
||||
printf(
|
||||
/* translators: %s: smiling face with smiling eyes emoji */
|
||||
__( 'Even More Developer Happiness %s' ),
|
||||
'😊'
|
||||
);
|
||||
?></h2>
|
||||
|
||||
<div class="under-the-hood three-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Resource Hints' ); ?></h3>
|
||||
<h3><a href="https://make.wordpress.org/core/2016/11/03/post-type-templates-in-4-7/"><?php _e( 'Post Type Templates' ); ?></a></h3>
|
||||
<p><?php _e( 'By opening up the page template functionality to all post types, theme developers have even more flexibility with the WordPress template hierarchy.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'More Theme API Goodies' ); ?></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %s: https://make.wordpress.org/core/2016/07/06/resource-hints-in-4-6/ */
|
||||
__( '<a href="%s">Resource hints help browsers</a> decide which resources to fetch and preprocess. WordPress 4.6 adds them automatically for your styles and scripts making your site even faster.' ),
|
||||
'https://make.wordpress.org/core/2016/07/06/resource-hints-in-4-6/'
|
||||
/* translators: %s: https://make.wordpress.org/core/2016/09/09/new-functions-hooks-and-behaviour-for-theme-developers-in-wordpress-4-7/ */
|
||||
__( 'WordPress 4.7 includes <a href="%s">new functions, hooks, and behavior</a> for theme developers.' ),
|
||||
'https://make.wordpress.org/core/2016/09/09/new-functions-hooks-and-behaviour-for-theme-developers-in-wordpress-4-7/'
|
||||
);
|
||||
?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Robust Requests' ); ?></h3>
|
||||
<p><?php _e( 'The HTTP API now leverages the Requests library, improving HTTP standard support and adding case-insensitive headers, parallel HTTP requests, and support for Internationalized Domain Names.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php
|
||||
/* translators: 1: WP_Term_Query, 2: WP_Post_Type */
|
||||
printf( __( '%1$s and %2$s' ), '<code>WP_Term_Query</code>', '<code>WP_Post_Type</code>' );
|
||||
?></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: 1: WP_Term_Query, 2: WP_Post_Type */
|
||||
__( 'A new %1$s class adds flexibility to query term information while a new %2$s object makes interacting with post types more predictable.' ),
|
||||
'<code>WP_Term_Query</code>',
|
||||
'<code>WP_Post_Type</code>'
|
||||
);
|
||||
?></p>
|
||||
<h3><a href="https://make.wordpress.org/core/2016/10/04/custom-bulk-actions/"><?php _e( 'Custom Bulk Actions' ); ?></a></h3>
|
||||
<p><?php _e( 'List tables, now with more than bulk edit and delete.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="under-the-hood three-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Meta Registration API' ); ?></h3>
|
||||
<h3><a href="https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/"><code>WP_Hook</code></a></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: %s: https://make.wordpress.org/core/2016/07/08/enhancing-register_meta-in-4-6/ */
|
||||
__( 'The Meta Registration API <a href="%s">has been expanded</a> to support types, descriptions, and REST API visibility.' ),
|
||||
'https://make.wordpress.org/core/2016/07/08/enhancing-register_meta-in-4-6/'
|
||||
/* translators: %s: https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/ */
|
||||
__( 'The code that lies beneath actions and filters has been overhauled and modernized, fixing bugs along the way.' ),
|
||||
'https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/'
|
||||
);
|
||||
?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Translations On Demand' ); ?></h3>
|
||||
<p><?php _e( 'WordPress will install and use the newest language packs for your plugins and themes as soon as they’re available from <a href="https://translate.wordpress.org/">WordPress.org’s community of translators</a>.' ); ?></p>
|
||||
<h3><?php _e( 'Settings Registration API' ); ?></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: 1: register_setting(), 2: https://make.wordpress.org/core/2016/10/26/registering-your-settings-in-wordpress-4-7/ */
|
||||
__( '%1$s <a href="%2$s">has been enhanced</a> to include type, description, and REST API visibility.' ),
|
||||
'<code>register_setting()</code>',
|
||||
'https://make.wordpress.org/core/2016/10/26/registering-your-settings-in-wordpress-4-7/'
|
||||
);
|
||||
?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'JavaScript Library Updates' ); ?></h3>
|
||||
<p><?php _e( 'Masonry 3.3.2, imagesLoaded 3.2.0, MediaElement.js 2.22.0, TinyMCE 4.4.1, and Backbone.js 1.3.3 are bundled.' ); ?></p>
|
||||
<h3><a href="https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/"><?php _e( 'Customize Changesets' ); ?></a></h3>
|
||||
<p><?php _e( 'Customize changesets make changes in the customizer persistent, like autosave drafts. They also make exciting new features like starter content possible.' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="under-the-hood two-col">
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Customizer APIs for Setting Validation and Notifications' ); ?></h3>
|
||||
<p><?php _e( 'Settings now have an <a href="https://make.wordpress.org/core/2016/07/05/customizer-apis-in-4-6-for-setting-validation-and-notifications/">API for enforcing validation constraints</a>. Likewise, customizer controls now support notifications, which are used to display validation errors instead of failing silently.' ); ?></p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h3><?php _e( 'Multisite, now faster than ever' ); ?></h3>
|
||||
<p><?php
|
||||
printf(
|
||||
/* translators: 1: WP_Site_Query, 2: WP_Network_Query */
|
||||
__( 'Cached and comprehensive site queries improve your network admin experience. The addition of %1$s and %2$s help craft advanced queries with less effort.' ),
|
||||
'<code>WP_Site_Query</code>',
|
||||
'<code>WP_Network_Query</code>'
|
||||
);
|
||||
?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -20,7 +20,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s changes a lot behind the scenes to make your WordPress experience even better!' ), $display_version ); ?></p>
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s helps you get your site set up the way you want it.' ), $display_version ); ?></p>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.about-wrap .jetpack-video-wrapper {
|
||||
@@ -93,7 +94,7 @@
|
||||
}
|
||||
|
||||
.about-wrap .feature-section p {
|
||||
max-width: 38em;
|
||||
max-width: 55em;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
@@ -108,8 +109,8 @@
|
||||
}
|
||||
|
||||
.about-wrap h2 {
|
||||
margin: 50px 0 1em;
|
||||
font-size: 1.8em;
|
||||
margin: 40px 0 .6em;
|
||||
font-size: 2.7em;
|
||||
line-height: 1.3;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
@@ -117,7 +118,7 @@
|
||||
|
||||
.about-wrap h3 {
|
||||
margin: 1.25em 0 .6em;
|
||||
font-size: 1.25em;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -125,6 +126,12 @@
|
||||
color: #23282d;
|
||||
}
|
||||
|
||||
.about-wrap .changelog h2 {
|
||||
font-size: 1.4em;
|
||||
font-weight: 600;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.about-wrap .changelog h3 {
|
||||
margin: 1.33em 0;
|
||||
font-size: 1em;
|
||||
@@ -193,11 +200,6 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.about-wrap .under-the-hood:nth-of-type(2n),
|
||||
.about-wrap .under-the-hood:nth-of-type(3n) {
|
||||
margin-top: 3em;
|
||||
}
|
||||
|
||||
.about-wrap .feature-video .mejs-controls {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -227,19 +229,6 @@
|
||||
|
||||
/* 2.1 - Typography */
|
||||
|
||||
.about-wrap .headline-feature h2 {
|
||||
margin: 30px 0 30px;
|
||||
font-size: 2.2em;
|
||||
font-weight: 300;
|
||||
line-height: 1.3;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature h3 {
|
||||
margin-top: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section.two-col h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -253,6 +242,11 @@
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
|
||||
.about-wrap .lead-description {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-wrap .two-col-text {
|
||||
-webkit-column-count: 2;
|
||||
-moz-column-count: 2;
|
||||
@@ -300,6 +294,10 @@
|
||||
padding: 0 0 40px;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section.no-heading {
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature {
|
||||
margin: 0 auto;
|
||||
max-width: 80%;
|
||||
@@ -309,6 +307,10 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.about-wrap .embed-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
2
wp-admin/css/about-rtl.min.css
vendored
2
wp-admin/css/about-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -40,6 +40,7 @@
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.about-wrap .jetpack-video-wrapper {
|
||||
@@ -93,7 +94,7 @@
|
||||
}
|
||||
|
||||
.about-wrap .feature-section p {
|
||||
max-width: 38em;
|
||||
max-width: 55em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
@@ -108,8 +109,8 @@
|
||||
}
|
||||
|
||||
.about-wrap h2 {
|
||||
margin: 50px 0 1em;
|
||||
font-size: 1.8em;
|
||||
margin: 40px 0 .6em;
|
||||
font-size: 2.7em;
|
||||
line-height: 1.3;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
@@ -117,7 +118,7 @@
|
||||
|
||||
.about-wrap h3 {
|
||||
margin: 1.25em 0 .6em;
|
||||
font-size: 1.25em;
|
||||
font-size: 1.4em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
@@ -125,6 +126,12 @@
|
||||
color: #23282d;
|
||||
}
|
||||
|
||||
.about-wrap .changelog h2 {
|
||||
font-size: 1.4em;
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.about-wrap .changelog h3 {
|
||||
margin: 1.33em 0;
|
||||
font-size: 1em;
|
||||
@@ -193,11 +200,6 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.about-wrap .under-the-hood:nth-of-type(2n),
|
||||
.about-wrap .under-the-hood:nth-of-type(3n) {
|
||||
margin-top: 3em;
|
||||
}
|
||||
|
||||
.about-wrap .feature-video .mejs-controls {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -227,19 +229,6 @@
|
||||
|
||||
/* 2.1 - Typography */
|
||||
|
||||
.about-wrap .headline-feature h2 {
|
||||
margin: 30px 0 30px;
|
||||
font-size: 2.2em;
|
||||
font-weight: 300;
|
||||
line-height: 1.3;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature h3 {
|
||||
margin-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section.two-col h3 {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -253,6 +242,11 @@
|
||||
margin-top: 0.6em;
|
||||
}
|
||||
|
||||
.about-wrap .lead-description {
|
||||
font-size: 1.5em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-wrap .two-col-text {
|
||||
-webkit-column-count: 2;
|
||||
-moz-column-count: 2;
|
||||
@@ -300,6 +294,10 @@
|
||||
padding: 0 0 40px;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section.no-heading {
|
||||
padding-top: 35px;
|
||||
}
|
||||
|
||||
.about-wrap .headline-feature {
|
||||
margin: 0 auto;
|
||||
max-width: 80%;
|
||||
@@ -309,6 +307,10 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.about-wrap .embed-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
2
wp-admin/css/about.min.css
vendored
2
wp-admin/css/about.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/colors/light/colors-rtl.min.css
vendored
2
wp-admin/css/colors/light/colors-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/colors/light/colors.min.css
vendored
2
wp-admin/css/colors/light/colors.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -301,19 +301,19 @@
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#accordion-panel-nav_menus .field-link-target,
|
||||
#accordion-panel-nav_menus .field-title-attribute,
|
||||
#accordion-panel-nav_menus .field-css-classes,
|
||||
#accordion-panel-nav_menus .field-xfn,
|
||||
#accordion-panel-nav_menus .field-description {
|
||||
.control-section-nav_menu .field-link-target,
|
||||
.control-section-nav_menu .field-title-attribute,
|
||||
.control-section-nav_menu .field-css-classes,
|
||||
.control-section-nav_menu .field-xfn,
|
||||
.control-section-nav_menu .field-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#accordion-panel-nav_menus.field-link-target-active .field-link-target,
|
||||
#accordion-panel-nav_menus.field-title-attribute-active .field-title-attribute,
|
||||
#accordion-panel-nav_menus.field-css-classes-active .field-css-classes,
|
||||
#accordion-panel-nav_menus.field-xfn-active .field-xfn,
|
||||
#accordion-panel-nav_menus.field-description-active .field-description {
|
||||
.control-section-nav_menu.field-link-target-active .field-link-target,
|
||||
.control-section-nav_menu.field-title-attribute-active .field-title-attribute,
|
||||
.control-section-nav_menu.field-css-classes-active .field-css-classes,
|
||||
.control-section-nav_menu.field-xfn-active .field-xfn,
|
||||
.control-section-nav_menu.field-description-active .field-description {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -811,7 +811,6 @@ li.assigned-to-menu-location .add-new-menu-item {
|
||||
.menu-delete:hover,
|
||||
.menu-delete:focus {
|
||||
color: #f00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu-item-handle {
|
||||
|
||||
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
2
wp-admin/css/customize-nav-menus-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -301,19 +301,19 @@
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#accordion-panel-nav_menus .field-link-target,
|
||||
#accordion-panel-nav_menus .field-title-attribute,
|
||||
#accordion-panel-nav_menus .field-css-classes,
|
||||
#accordion-panel-nav_menus .field-xfn,
|
||||
#accordion-panel-nav_menus .field-description {
|
||||
.control-section-nav_menu .field-link-target,
|
||||
.control-section-nav_menu .field-title-attribute,
|
||||
.control-section-nav_menu .field-css-classes,
|
||||
.control-section-nav_menu .field-xfn,
|
||||
.control-section-nav_menu .field-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#accordion-panel-nav_menus.field-link-target-active .field-link-target,
|
||||
#accordion-panel-nav_menus.field-title-attribute-active .field-title-attribute,
|
||||
#accordion-panel-nav_menus.field-css-classes-active .field-css-classes,
|
||||
#accordion-panel-nav_menus.field-xfn-active .field-xfn,
|
||||
#accordion-panel-nav_menus.field-description-active .field-description {
|
||||
.control-section-nav_menu.field-link-target-active .field-link-target,
|
||||
.control-section-nav_menu.field-title-attribute-active .field-title-attribute,
|
||||
.control-section-nav_menu.field-css-classes-active .field-css-classes,
|
||||
.control-section-nav_menu.field-xfn-active .field-xfn,
|
||||
.control-section-nav_menu.field-description-active .field-description {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -811,7 +811,6 @@ li.assigned-to-menu-location .add-new-menu-item {
|
||||
.menu-delete:hover,
|
||||
.menu-delete:focus {
|
||||
color: #f00;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.menu-item-handle {
|
||||
|
||||
2
wp-admin/css/customize-nav-menus.min.css
vendored
2
wp-admin/css/customize-nav-menus.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -336,7 +336,7 @@ form#tags-filter {
|
||||
}
|
||||
|
||||
#content-resize-handle {
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
||||
background: transparent url(../images/resize.gif) no-repeat scroll left bottom;
|
||||
width: 12px;
|
||||
cursor: row-resize;
|
||||
}
|
||||
@@ -1229,6 +1229,7 @@ table.links-table {
|
||||
}
|
||||
|
||||
.focus-on .wrap > h1,
|
||||
.focus-on .page-title-action,
|
||||
.focus-on #wpfooter,
|
||||
.focus-on .postbox-container > *,
|
||||
.focus-on div.updated,
|
||||
@@ -1252,6 +1253,7 @@ table.links-table {
|
||||
}
|
||||
|
||||
.focus-off .wrap > h1,
|
||||
.focus-off .page-title-action,
|
||||
.focus-off #wpfooter,
|
||||
.focus-off .postbox-container > *,
|
||||
.focus-off div.updated,
|
||||
@@ -1319,7 +1321,7 @@ table.links-table {
|
||||
(min-resolution: 120dpi) {
|
||||
#content-resize-handle,
|
||||
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
||||
background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
|
||||
background: transparent url(../images/resize-2x.gif) no-repeat scroll left bottom;
|
||||
-webkit-background-size: 11px 11px;
|
||||
background-size: 11px 11px;
|
||||
}
|
||||
|
||||
2
wp-admin/css/edit-rtl.min.css
vendored
2
wp-admin/css/edit-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -1229,6 +1229,7 @@ table.links-table {
|
||||
}
|
||||
|
||||
.focus-on .wrap > h1,
|
||||
.focus-on .page-title-action,
|
||||
.focus-on #wpfooter,
|
||||
.focus-on .postbox-container > *,
|
||||
.focus-on div.updated,
|
||||
@@ -1252,6 +1253,7 @@ table.links-table {
|
||||
}
|
||||
|
||||
.focus-off .wrap > h1,
|
||||
.focus-off .page-title-action,
|
||||
.focus-off #wpfooter,
|
||||
.focus-off .postbox-container > *,
|
||||
.focus-off div.updated,
|
||||
|
||||
2
wp-admin/css/edit.min.css
vendored
2
wp-admin/css/edit.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/forms-rtl.min.css
vendored
2
wp-admin/css/forms-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/forms.min.css
vendored
2
wp-admin/css/forms.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login-rtl.min.css
vendored
2
wp-admin/css/login-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
2
wp-admin/css/login.min.css
vendored
2
wp-admin/css/login.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -81,7 +81,7 @@ case 'add-tag':
|
||||
|
||||
$ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
|
||||
if ( $ret && !is_wp_error( $ret ) )
|
||||
$location = add_query_arg( 'message', 1, $location );
|
||||
$location = add_query_arg( 'message', 1, $referer );
|
||||
else
|
||||
$location = add_query_arg( array( 'error' => true, 'message' => 4 ), $referer );
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
|
||||
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s changes a lot behind the scenes to make your WordPress experience even better!' ), $display_version ); ?></p>
|
||||
<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s helps you get your site set up the way you want it.' ), $display_version ); ?></p>
|
||||
|
||||
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
echo "</strong>\n";
|
||||
|
||||
if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' === $mode && current_user_can( 'read_post', $post->ID ) ) {
|
||||
the_excerpt();
|
||||
echo esc_html( get_the_excerpt() );
|
||||
}
|
||||
|
||||
get_inline_data( $post );
|
||||
|
||||
@@ -119,10 +119,28 @@ class WP_Press_This {
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'draft',
|
||||
'post_format' => ( ! empty( $_POST['post_format'] ) ) ? sanitize_text_field( $_POST['post_format'] ) : '',
|
||||
'tax_input' => ( ! empty( $_POST['tax_input'] ) ) ? $_POST['tax_input'] : array(),
|
||||
'post_category' => ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array(),
|
||||
);
|
||||
|
||||
// Only accept categories if the user actually can assign
|
||||
$category_tax = get_taxonomy( 'category' );
|
||||
if ( current_user_can( $category_tax->cap->assign_terms ) ) {
|
||||
$post_data['post_category'] = ( ! empty( $_POST['post_category'] ) ) ? $_POST['post_category'] : array();
|
||||
}
|
||||
|
||||
// Only accept taxonomies if the user can actually assign
|
||||
if ( ! empty( $_POST['tax_input'] ) ) {
|
||||
$tax_input = $_POST['tax_input'];
|
||||
foreach ( $tax_input as $tax => $_ti ) {
|
||||
$tax_object = get_taxonomy( $tax );
|
||||
if ( ! $tax_object || ! current_user_can( $tax_object->cap->assign_terms ) ) {
|
||||
unset( $tax_input[ $tax ] );
|
||||
}
|
||||
}
|
||||
|
||||
$post_data['tax_input'] = $tax_input;
|
||||
}
|
||||
|
||||
// Toggle status to pending if user cannot actually publish
|
||||
if ( ! empty( $_POST['post_status'] ) && 'publish' === $_POST['post_status'] ) {
|
||||
if ( current_user_can( 'publish_posts' ) ) {
|
||||
$post_data['post_status'] = 'publish';
|
||||
@@ -453,7 +471,7 @@ class WP_Press_This {
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param string $src Embed source URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformattd embed URL.
|
||||
* @return string If not from a supported provider, an empty string. Otherwise, a reformatted embed URL.
|
||||
*/
|
||||
private function _limit_embed( $src ) {
|
||||
$src = $this->_limit_url( $src );
|
||||
@@ -853,6 +871,12 @@ class WP_Press_This {
|
||||
public function categories_html( $post ) {
|
||||
$taxonomy = get_taxonomy( 'category' );
|
||||
|
||||
// Bail if user cannot assign terms
|
||||
if ( ! current_user_can( $taxonomy->cap->assign_terms ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only show "add" if user can edit terms
|
||||
if ( current_user_can( $taxonomy->cap->edit_terms ) ) {
|
||||
?>
|
||||
<button type="button" class="add-cat-toggle button-link" aria-expanded="false">
|
||||
@@ -1272,6 +1296,12 @@ class WP_Press_This {
|
||||
wp_enqueue_script( 'json2' );
|
||||
wp_enqueue_script( 'editor' );
|
||||
|
||||
$categories_tax = get_taxonomy( 'category' );
|
||||
$show_categories = current_user_can( $categories_tax->cap->assign_terms ) || current_user_can( $categories_tax->cap->edit_terms );
|
||||
|
||||
$tag_tax = get_taxonomy( 'post_tag' );
|
||||
$show_tags = current_user_can( $tag_tax->cap->assign_terms );
|
||||
|
||||
$supports_formats = false;
|
||||
$post_format = 0;
|
||||
|
||||
@@ -1423,17 +1453,21 @@ class WP_Press_This {
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-link post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<button type="button" class="button-link post-option">
|
||||
<span class="dashicons dashicons-category"></span>
|
||||
<span class="post-option-title"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="button" class="button-link post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<button type="button" class="button-link post-option">
|
||||
<span class="dashicons dashicons-tag"></span>
|
||||
<span class="post-option-title"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="dashicons post-option-forward"></span>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if ( $supports_formats ) : ?>
|
||||
@@ -1447,23 +1481,27 @@ class WP_Press_This {
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-link modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_categories ) : ?>
|
||||
<div class="setting-modal is-off-screen is-hidden">
|
||||
<button type="button" class="button-link modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Categories' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->categories_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-link modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php if ( $show_tags ) : ?>
|
||||
<div class="setting-modal tags is-off-screen is-hidden">
|
||||
<button type="button" class="button-link modal-close">
|
||||
<span class="dashicons post-option-back"></span>
|
||||
<span class="setting-title" aria-hidden="true"><?php _e( 'Tags' ); ?></span>
|
||||
<span class="screen-reader-text"><?php _e( 'Back to post options' ) ?></span>
|
||||
</button>
|
||||
<?php $this->tags_html( $post ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .options-panel -->
|
||||
</div><!-- .wrapper -->
|
||||
|
||||
|
||||
@@ -915,7 +915,8 @@ final class WP_Screen {
|
||||
|
||||
switch ( $this->base ) {
|
||||
case 'widgets':
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
$nonce = wp_create_nonce( 'widgets-access' );
|
||||
$this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=' . urlencode( $nonce ) . '">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=' . urlencode( $nonce ) . '">' . __('Disable accessibility mode') . "</a></p>\n";
|
||||
break;
|
||||
case 'post' :
|
||||
$expand = '<fieldset class="editor-expand hidden"><legend>' . __( 'Additional settings' ) . '</legend><label for="editor-expand-toggle">';
|
||||
|
||||
43
wp-admin/includes/class-wp-upgrader-skins.php
Normal file
43
wp-admin/includes/class-wp-upgrader-skins.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* The User Interface "Skins" for the WordPress File Upgrader
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Upgrader
|
||||
* @since 2.8.0
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '4.7.0', 'class-wp-upgrader.php' );
|
||||
|
||||
/** WP_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php';
|
||||
|
||||
/** Plugin_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php';
|
||||
|
||||
/** Theme_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php';
|
||||
|
||||
/** Bulk_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php';
|
||||
|
||||
/** Bulk_Plugin_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php';
|
||||
|
||||
/** Bulk_Theme_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php';
|
||||
|
||||
/** Plugin_Installer_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php';
|
||||
|
||||
/** Theme_Installer_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php';
|
||||
|
||||
/** Language_Pack_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php';
|
||||
|
||||
/** Automatic_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php';
|
||||
|
||||
/** WP_Ajax_Upgrader_Skin class */
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php';
|
||||
@@ -221,14 +221,28 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
||||
$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
|
||||
|
||||
$sizes = array();
|
||||
$_wp_additional_image_sizes = wp_get_additional_image_sizes();
|
||||
|
||||
foreach ( $fallback_sizes as $s ) {
|
||||
$sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
|
||||
$sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
|
||||
if ( isset( $_wp_additional_image_sizes[ $s ]['width'] ) ) {
|
||||
$sizes[ $s ]['width'] = intval( $_wp_additional_image_sizes[ $s ]['width'] );
|
||||
} else {
|
||||
$sizes[ $s ]['width'] = get_option( "{$s}_size_w" );
|
||||
}
|
||||
|
||||
// Force thumbnails to be soft crops.
|
||||
if ( ! 'thumbnail' === $s ) {
|
||||
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
|
||||
if ( isset( $_wp_additional_image_sizes[ $s ]['height'] ) ) {
|
||||
$sizes[ $s ]['height'] = intval( $_wp_additional_image_sizes[ $s ]['height'] );
|
||||
} else {
|
||||
$sizes[ $s ]['height'] = get_option( "{$s}_size_h" );
|
||||
}
|
||||
|
||||
if ( isset( $_wp_additional_image_sizes[ $s ]['crop'] ) ) {
|
||||
$sizes[ $s ]['crop'] = $_wp_additional_image_sizes[ $s ]['crop'];
|
||||
} else {
|
||||
// Force thumbnails to be soft crops.
|
||||
if ( ! 'thumbnail' === $s ) {
|
||||
$sizes[ $s ]['crop'] = get_option( "{$s}_crop" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1154,33 +1154,6 @@ function wp_edit_attachments_query_vars( $q = false ) {
|
||||
return $q;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the SQL clauses of an attachment query to include filenames.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
|
||||
* DISTINCT, fields (SELECT), and LIMITS clauses.
|
||||
* @return array The modified clauses.
|
||||
*/
|
||||
function _filter_query_attachment_filenames( $clauses ) {
|
||||
global $wpdb;
|
||||
remove_filter( 'posts_clauses', __FUNCTION__ );
|
||||
|
||||
// Add a LEFT JOIN of the postmeta table so we don't trample existing JOINs.
|
||||
$clauses['join'] .= " LEFT JOIN {$wpdb->postmeta} AS sq1 ON ( {$wpdb->posts}.ID = sq1.post_id AND sq1.meta_key = '_wp_attached_file' )";
|
||||
|
||||
$clauses['groupby'] = "{$wpdb->posts}.ID";
|
||||
|
||||
$clauses['where'] = preg_replace(
|
||||
"/\({$wpdb->posts}.post_content (NOT LIKE|LIKE) (\'[^']+\')\)/",
|
||||
"$0 OR ( sq1.meta_value $1 $2 )",
|
||||
$clauses['where'] );
|
||||
|
||||
return $clauses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a query for attachments. An array of WP_Query arguments
|
||||
* can be passed in, which will override the arguments set by this function.
|
||||
|
||||
@@ -705,12 +705,6 @@ $_old_files = array(
|
||||
'wp-includes/theme-compat/comments-popup.php',
|
||||
// 4.6
|
||||
'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
|
||||
// 4.7
|
||||
'wp-admin/includes/class-wp-upgrader-skins.php',
|
||||
'wp-includes/class-feed.php',
|
||||
'wp-includes/locale.php',
|
||||
'wp-includes/session.php',
|
||||
'wp-includes/customize/class-wp-customize-themes-panel.php', // Removed in beta; when the feature comes back remember to remove it from this array. See #37661.
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -4746,13 +4746,8 @@
|
||||
};
|
||||
|
||||
if ( history.replaceState ) {
|
||||
saved.bind( function( isSaved ) {
|
||||
if ( ! isSaved ) {
|
||||
populateChangesetUuidParam( true );
|
||||
}
|
||||
} );
|
||||
changesetStatus.bind( function( newStatus ) {
|
||||
populateChangesetUuidParam( '' !== newStatus );
|
||||
populateChangesetUuidParam( '' !== newStatus && 'publish' !== newStatus );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -5305,7 +5300,7 @@
|
||||
} );
|
||||
|
||||
$textarea.on( 'keydown', function onKeydown( event ) {
|
||||
var selectionStart, selectionEnd, value, scroll, tabKeyCode = 9, escKeyCode = 27;
|
||||
var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
|
||||
|
||||
if ( escKeyCode === event.keyCode ) {
|
||||
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
|
||||
@@ -5330,10 +5325,8 @@
|
||||
value = textarea.value;
|
||||
|
||||
if ( selectionStart >= 0 ) {
|
||||
scroll = $textarea.scrollTop;
|
||||
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
|
||||
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
|
||||
textarea.scrollTop = scroll;
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
@@ -5372,16 +5365,20 @@
|
||||
|
||||
// Focus on the control that is associated with the given setting.
|
||||
api.previewer.bind( 'focus-control-for-setting', function( settingId ) {
|
||||
var matchedControl;
|
||||
var matchedControls = [];
|
||||
api.control.each( function( control ) {
|
||||
var settingIds = _.pluck( control.settings, 'id' );
|
||||
if ( -1 !== _.indexOf( settingIds, settingId ) ) {
|
||||
matchedControl = control;
|
||||
matchedControls.push( control );
|
||||
}
|
||||
} );
|
||||
|
||||
if ( matchedControl ) {
|
||||
matchedControl.focus();
|
||||
// Focus on the matched control with the lowest priority (appearing higher).
|
||||
if ( matchedControls.length ) {
|
||||
matchedControls.sort( function( a, b ) {
|
||||
return a.priority() - b.priority();
|
||||
} );
|
||||
matchedControls[0].focus();
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
2
wp-admin/js/customize-controls.min.js
vendored
2
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -80,8 +80,6 @@
|
||||
});
|
||||
api.Menus.availableMenuItems = new api.Menus.AvailableItemCollection( api.Menus.data.availableMenuItems );
|
||||
|
||||
api.Menus.insertedAutoDrafts = [];
|
||||
|
||||
/**
|
||||
* Insert a new `auto-draft` post.
|
||||
*
|
||||
@@ -104,8 +102,9 @@
|
||||
|
||||
request.done( function( response ) {
|
||||
if ( response.post_id ) {
|
||||
api.Menus.insertedAutoDrafts.push( response.post_id );
|
||||
api( 'nav_menus_created_posts' ).set( _.clone( api.Menus.insertedAutoDrafts ) );
|
||||
api( 'nav_menus_created_posts' ).set(
|
||||
api( 'nav_menus_created_posts' ).get().concat( [ response.post_id ] )
|
||||
);
|
||||
|
||||
if ( 'page' === params.post_type ) {
|
||||
|
||||
@@ -786,30 +785,23 @@
|
||||
},
|
||||
|
||||
/**
|
||||
* Show/hide/save screen options (columns). From common.js.
|
||||
* Update field visibility when clicking on the field toggles.
|
||||
*/
|
||||
ready: function() {
|
||||
var panel = this;
|
||||
this.container.find( '.hide-column-tog' ).click( function() {
|
||||
var $t = $( this ), column = $t.val();
|
||||
if ( $t.prop( 'checked' ) ) {
|
||||
panel.checked( column );
|
||||
} else {
|
||||
panel.unchecked( column );
|
||||
}
|
||||
|
||||
panel.container.find( '.hide-column-tog' ).click( function() {
|
||||
panel.saveManageColumnsState();
|
||||
});
|
||||
this.container.find( '.hide-column-tog' ).each( function() {
|
||||
var $t = $( this ), column = $t.val();
|
||||
if ( $t.prop( 'checked' ) ) {
|
||||
panel.checked( column );
|
||||
} else {
|
||||
panel.unchecked( column );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Save hidden column states.
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @private
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
saveManageColumnsState: _.debounce( function() {
|
||||
var panel = this;
|
||||
if ( panel._updateHiddenColumnsRequest ) {
|
||||
@@ -826,14 +818,24 @@
|
||||
} );
|
||||
}, 2000 ),
|
||||
|
||||
checked: function( column ) {
|
||||
this.container.addClass( 'field-' + column + '-active' );
|
||||
},
|
||||
/**
|
||||
* @deprecated Since 4.7.0 now that the nav_menu sections are responsible for toggling the classes on their own containers.
|
||||
*/
|
||||
checked: function() {},
|
||||
|
||||
unchecked: function( column ) {
|
||||
this.container.removeClass( 'field-' + column + '-active' );
|
||||
},
|
||||
/**
|
||||
* @deprecated Since 4.7.0 now that the nav_menu sections are responsible for toggling the classes on their own containers.
|
||||
*/
|
||||
unchecked: function() {},
|
||||
|
||||
/**
|
||||
* Get hidden fields.
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @private
|
||||
*
|
||||
* @returns {Array} Fields (columns) that are hidden.
|
||||
*/
|
||||
hidden: function() {
|
||||
return $( '.hide-column-tog' ).not( ':checked' ).map( function() {
|
||||
var id = this.id;
|
||||
@@ -871,7 +873,7 @@
|
||||
* Ready.
|
||||
*/
|
||||
ready: function() {
|
||||
var section = this;
|
||||
var section = this, fieldActiveToggles, handleFieldActiveToggle;
|
||||
|
||||
if ( 'undefined' === typeof section.params.menu_id ) {
|
||||
throw new Error( 'params.menu_id was not defined' );
|
||||
@@ -923,6 +925,20 @@
|
||||
section.container.find( '.menu-item.move-left-disabled .menus-move-left' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
|
||||
section.container.find( '.menu-item.move-right-disabled .menus-move-right' ).attr({ 'tabindex': '-1', 'aria-hidden': 'true' });
|
||||
} );
|
||||
|
||||
/**
|
||||
* Update the active field class for the content container for a given checkbox toggle.
|
||||
*
|
||||
* @this {jQuery}
|
||||
* @returns {void}
|
||||
*/
|
||||
handleFieldActiveToggle = function() {
|
||||
var className = 'field-' + $( this ).val() + '-active';
|
||||
section.contentContainer.toggleClass( className, $( this ).prop( 'checked' ) );
|
||||
};
|
||||
fieldActiveToggles = api.panel( 'nav_menus' ).contentContainer.find( '.metabox-prefs:first' ).find( '.hide-column-tog' );
|
||||
fieldActiveToggles.each( handleFieldActiveToggle );
|
||||
fieldActiveToggles.on( 'click', handleFieldActiveToggle );
|
||||
},
|
||||
|
||||
populateControls: function() {
|
||||
@@ -1029,7 +1045,7 @@
|
||||
},
|
||||
|
||||
onChangeExpanded: function( expanded, args ) {
|
||||
var section = this;
|
||||
var section = this, completeCallback;
|
||||
|
||||
if ( expanded ) {
|
||||
wpNavMenu.menuList = section.contentContainer;
|
||||
@@ -1045,13 +1061,22 @@
|
||||
}
|
||||
} );
|
||||
|
||||
if ( 'resolved' !== section.deferred.initSortables.state() ) {
|
||||
wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above.
|
||||
section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable.
|
||||
|
||||
// @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated.
|
||||
api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems();
|
||||
// Make sure Sortables is initialized after the section has been expanded to prevent `offset` issues.
|
||||
if ( args.completeCallback ) {
|
||||
completeCallback = args.completeCallback;
|
||||
}
|
||||
args.completeCallback = function() {
|
||||
if ( 'resolved' !== section.deferred.initSortables.state() ) {
|
||||
wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above.
|
||||
section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable.
|
||||
|
||||
// @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated.
|
||||
api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems();
|
||||
}
|
||||
if ( _.isFunction( completeCallback ) ) {
|
||||
completeCallback();
|
||||
}
|
||||
};
|
||||
}
|
||||
api.Section.prototype.onChangeExpanded.call( section, expanded, args );
|
||||
}
|
||||
@@ -1144,7 +1169,11 @@
|
||||
|
||||
// @todo It would be better if this was added directly on the setting itself, as opposed to the control.
|
||||
control.setting.validate = function( value ) {
|
||||
return parseInt( value, 10 );
|
||||
if ( '' === value ) {
|
||||
return 0;
|
||||
} else {
|
||||
return parseInt( value, 10 );
|
||||
}
|
||||
};
|
||||
|
||||
// Edit menu button.
|
||||
@@ -2771,9 +2800,17 @@
|
||||
if ( data.nav_menu_updates || data.nav_menu_item_updates ) {
|
||||
api.Menus.applySavedData( data );
|
||||
}
|
||||
} );
|
||||
|
||||
// Reset list of inserted auto draft post IDs.
|
||||
api.Menus.insertedAutoDrafts = [];
|
||||
/*
|
||||
* Reset the list of posts created in the customizer once published.
|
||||
* The setting is updated quietly (bypassing events being triggered)
|
||||
* so that the customized state doesn't become immediately dirty.
|
||||
*/
|
||||
api.state( 'changesetStatus' ).bind( function( status ) {
|
||||
if ( 'publish' === status ) {
|
||||
api( 'nav_menus_created_posts' )._value = [];
|
||||
}
|
||||
} );
|
||||
|
||||
// Open and focus menu control.
|
||||
|
||||
4
wp-admin/js/customize-nav-menus.min.js
vendored
4
wp-admin/js/customize-nav-menus.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -806,7 +806,7 @@ themes.view.Details = wp.Backbone.View.extend({
|
||||
|
||||
$( document ).one( 'wp-theme-delete-success', function( event, response ) {
|
||||
_this.$el.find( '.close' ).trigger( 'click' );
|
||||
$( '[data-slug="' + response.slug + '"' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
|
||||
$( '[data-slug="' + response.slug + '"]' ).css( { backgroundColor:'#faafaa' } ).fadeOut( 350, function() {
|
||||
$( this ).remove();
|
||||
_themes.data.themes = _.without( _themes.data.themes, _.findWhere( _themes.data.themes, { id: response.slug } ) );
|
||||
|
||||
|
||||
2
wp-admin/js/theme.min.js
vendored
2
wp-admin/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1516,11 +1516,11 @@
|
||||
* @param {string} message Error message.
|
||||
*/
|
||||
wp.updates.showErrorInCredentialsForm = function( message ) {
|
||||
var $modal = $( '#request-filesystem-credentials-form' );
|
||||
var $filesystemForm = $( '#request-filesystem-credentials-form' );
|
||||
|
||||
// Remove any existing error.
|
||||
$modal.find( '.notice' ).remove();
|
||||
$modal.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
|
||||
$filesystemForm.find( '.notice' ).remove();
|
||||
$filesystemForm.find( '#request-filesystem-credentials-title' ).after( '<div class="notice notice-alt notice-error"><p>' + message + '</p></div>' );
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1670,6 +1670,7 @@
|
||||
$( function() {
|
||||
var $pluginFilter = $( '#plugin-filter' ),
|
||||
$bulkActionForm = $( '#bulk-action-form' ),
|
||||
$filesystemForm = $( '#request-filesystem-credentials-form' ),
|
||||
$filesystemModal = $( '#request-filesystem-credentials-dialog' ),
|
||||
$pluginSearch = $( '.plugins-php .wp-filter-search' ),
|
||||
$pluginInstallSearch = $( '.plugin-install-php .wp-filter-search' );
|
||||
@@ -1725,7 +1726,7 @@
|
||||
*
|
||||
* @since 4.2.0
|
||||
*/
|
||||
$filesystemModal.on( 'change', 'input[name="connection_type"]', function() {
|
||||
$filesystemForm.on( 'change', 'input[name="connection_type"]', function() {
|
||||
$( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) );
|
||||
} ).change();
|
||||
|
||||
|
||||
4
wp-admin/js/updates.min.js
vendored
4
wp-admin/js/updates.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -250,6 +250,8 @@ function list_plugin_updates() {
|
||||
<tbody class="plugins">
|
||||
<?php
|
||||
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
|
||||
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
|
||||
|
||||
// Get plugin compat for running version of WordPress.
|
||||
if ( isset($plugin_data->update->tested) && version_compare($plugin_data->update->tested, $cur_wp_version, '>=') ) {
|
||||
$compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
|
||||
|
||||
@@ -22,6 +22,8 @@ if ( ! current_user_can( 'edit_theme_options' ) ) {
|
||||
|
||||
$widgets_access = get_user_setting( 'widgets_access' );
|
||||
if ( isset($_GET['widgets-access']) ) {
|
||||
check_admin_referer( 'widgets-access' );
|
||||
|
||||
$widgets_access = 'on' == $_GET['widgets-access'] ? 'on' : 'off';
|
||||
set_user_setting( 'widgets_access', $widgets_access );
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Fifteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 4.1
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Version: 1.6
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Version: 1.7
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
|
||||
@@ -55,6 +55,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.7 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
https://codex.wordpress.org/Twenty_Fifteen_Theme_Changelog#Version_1.7
|
||||
|
||||
= 1.6 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfifteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
|
||||
Version: 1.6
|
||||
Version: 1.7
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Fourteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.6
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Stable tag: 1.8
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 1.9
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
@@ -50,6 +50,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.9 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
https://codex.wordpress.org/Twenty_Fourteen_Theme_Changelog#Version_1.9
|
||||
|
||||
= 1.8 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfourteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: In 2014, our default theme lets you create a responsive magazine website with a sleek, modern design. Feature your favorite homepage content in either a grid or a slider. Use the three widget areas to customize your website, and change your content's layout with a full-width page template and a contributor page to show off your authors. Creating a magazine website with WordPress has never been easier.
|
||||
Version: 1.8
|
||||
Version: 1.9
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, news, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 4.7
|
||||
Tested up to: WordPress 4.7
|
||||
Version: 1.0
|
||||
Version: 1.1
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
|
||||
|
||||
|
||||
== Description ==
|
||||
|
||||
Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
|
||||
Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
|
||||
|
||||
For more information about Twenty Seventeen please go to https://codex.wordpress.org/Twenty_Seventeen.
|
||||
|
||||
@@ -39,7 +38,7 @@ GNU General Public License for more details.
|
||||
|
||||
Twenty Seventeen bundles the following third-party resources:
|
||||
|
||||
HTML5 Shiv v3.7.3, Copyright 2014 Alexander Farkas
|
||||
HTML5 Shiv, Copyright 2014 Alexander Farkas
|
||||
Licenses: MIT/GPL2
|
||||
Source: https://github.com/aFarkas/html5shiv
|
||||
|
||||
@@ -61,6 +60,14 @@ Source: https://unsplash.com/@englr?photo=bIhpiQA009k
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.1 =
|
||||
* Released: January 6, 2017
|
||||
|
||||
- Fix incorrect $content_width value in theme
|
||||
- Ensure functions in customize-controls.js don't count on Customizer sections always being present
|
||||
- Deprecate page_home nav menu item starter content
|
||||
- Introduce a theme-specific filter twentyseventeen_starter_content for customizing the starter content array
|
||||
|
||||
= 1.0 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
|
||||
@@ -474,8 +474,8 @@ body.colors-dark,
|
||||
}
|
||||
|
||||
/* Fixes linked images */
|
||||
.entry-content a img,
|
||||
.widget a img {
|
||||
.colors-dark .entry-content a img,
|
||||
.colors-dark .widget a img {
|
||||
-webkit-box-shadow: 0 0 0 8px #222;
|
||||
box-shadow: 0 0 0 8px #222;
|
||||
}
|
||||
@@ -496,6 +496,9 @@ body.colors-dark,
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.colors-dark .gallery-item a,
|
||||
.colors-dark .gallery-item a:hover,
|
||||
.colors-dark .gallery-item a:focus,
|
||||
.colors-dark .widget .tagcloud a,
|
||||
.colors-dark .widget .tagcloud a:focus,
|
||||
.colors-dark .widget .tagcloud a:hover,
|
||||
|
||||
@@ -65,7 +65,7 @@ img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.custom-header-image {
|
||||
.custom-header-media {
|
||||
background-position: bottom center;
|
||||
}
|
||||
|
||||
@@ -84,8 +84,7 @@ img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.has-header-image .custom-header-image img,
|
||||
.has-header-image .custom-header-image video {
|
||||
.has-header-image .custom-header-media img {
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
@@ -142,8 +141,8 @@ img {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.twentyseventeen-front-page .custom-header-image,
|
||||
.blog.home .custom-header-image {
|
||||
.twentyseventeen-front-page .custom-header-media,
|
||||
.blog.home .custom-header-media {
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,22 +4,26 @@ Description: IE9 specific styles.
|
||||
*/
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header {
|
||||
.has-header-video.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header,
|
||||
.has-header-video.home.blog .custom-header {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.has-header-image .custom-header-image img,
|
||||
.has-header-image .custom-header-image video,
|
||||
.has-header-image .custom-header-image iframe {
|
||||
.has-header-image .custom-header-media img,
|
||||
.has-header-video .custom-header-media video,
|
||||
.has-header-video .custom-header-media iframe {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 30em) {
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .custom-header,
|
||||
.has-header-video.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header,
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-image,
|
||||
.home.blog.has-header-image .custom-header-image,
|
||||
.has-header-video.home.blog .custom-header,
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-media,
|
||||
.home.blog.has-header-image .custom-header-media,
|
||||
.panel-image {
|
||||
height: 700px;
|
||||
}
|
||||
@@ -28,9 +32,11 @@ Description: IE9 specific styles.
|
||||
@media screen and (min-width: 48em) {
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .custom-header,
|
||||
.has-header-video.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header,
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-image,
|
||||
.home.blog.has-header-image .custom-header-image,
|
||||
.has-header-video.home.blog .custom-header,
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-media,
|
||||
.home.blog.has-header-image .custom-header-media,
|
||||
.panel-image {
|
||||
height: 1000px;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
});
|
||||
|
||||
// Detect when the front page sections section is expanded (or closed) so we can adjust the preview accordingly.
|
||||
wp.customize.section( 'theme_options' ).expanded.bind( function( isExpanding ) {
|
||||
wp.customize.section( 'theme_options', function( section ) {
|
||||
section.expanded.bind( function( isExpanding ) {
|
||||
|
||||
// Value of isExpanding will = true if you're entering the section, false if you're leaving it.
|
||||
wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });
|
||||
});
|
||||
// Value of isExpanding will = true if you're entering the section, false if you're leaving it.
|
||||
wp.customize.previewer.send( 'section-highlight', { expanded: isExpanding });
|
||||
} );
|
||||
} );
|
||||
});
|
||||
})( jQuery );
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
|
||||
// Collect information from customize-controls.js about which panels are opening.
|
||||
wp.customize.bind( 'preview-ready', function() {
|
||||
|
||||
// Initially hide the theme option placeholders on load
|
||||
$( '.panel-placeholder' ).hide();
|
||||
|
||||
wp.customize.preview.bind( 'section-highlight', function( data ) {
|
||||
|
||||
// Only on the front page.
|
||||
@@ -54,8 +58,14 @@
|
||||
clip: 'rect(1px, 1px, 1px, 1px)',
|
||||
position: 'absolute'
|
||||
});
|
||||
// Add class for different logo styles if title and description are hidden.
|
||||
$( 'body' ).addClass( 'title-tagline-hidden' );
|
||||
} else {
|
||||
|
||||
// Check if the text color has been removed and use default colors in theme stylesheet.
|
||||
if ( ! to.length ) {
|
||||
$( '#twentyseventeen-custom-header-styles' ).remove();
|
||||
}
|
||||
$( '.site-title, .site-description' ).css({
|
||||
clip: 'auto',
|
||||
position: 'relative'
|
||||
@@ -63,6 +73,7 @@
|
||||
$( '.site-branding, .site-branding a, .site-description, .site-description a' ).css({
|
||||
color: to
|
||||
});
|
||||
// Add class for different logo styles if title and description are visible.
|
||||
$( 'body' ).removeClass( 'title-tagline-hidden' );
|
||||
}
|
||||
});
|
||||
@@ -123,11 +134,15 @@
|
||||
$.each( [ 'external_header_video', 'header_image', 'header_video' ], function( index, settingId ) {
|
||||
wp.customize( settingId, function( setting ) {
|
||||
setting.bind(function() {
|
||||
if ( hasHeaderImage() || ( hasHeaderVideo() && $( 'body' ).hasClass( 'twentyseventeen-front-page' ) ) ) {
|
||||
if ( hasHeaderImage() ) {
|
||||
$( document.body ).addClass( 'has-header-image' );
|
||||
} else {
|
||||
$( document.body ).removeClass( 'has-header-image' );
|
||||
}
|
||||
|
||||
if ( ! hasHeaderVideo() ) {
|
||||
$( document.body ).removeClass( 'has-header-video' );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// Variables and DOM Caching.
|
||||
var $body = $( 'body' ),
|
||||
$customHeader = $body.find( '.custom-header' ),
|
||||
$customHeaderImage = $customHeader.find( '.custom-header-image' ),
|
||||
$branding = $customHeader.find( '.site-branding' ),
|
||||
$navigation = $body.find( '.navigation-top' ),
|
||||
$navWrap = $navigation.find( '.wrap' ),
|
||||
@@ -64,8 +63,8 @@
|
||||
// Make sure the nav isn't taller than two rows.
|
||||
if ( navIsNotTooTall ) {
|
||||
|
||||
// When there's a custom header image, the header offset includes the height of the navigation.
|
||||
if ( isFrontPage && $customHeaderImage.length ) {
|
||||
// When there's a custom header image or video, the header offset includes the height of the navigation.
|
||||
if ( isFrontPage && ( $body.hasClass( 'has-header-image' ) || $body.hasClass( 'has-header-video' ) ) ) {
|
||||
headerOffset = $customHeader.innerHeight() - navigationOuterHeight;
|
||||
} else {
|
||||
headerOffset = $customHeader.innerHeight();
|
||||
@@ -242,4 +241,9 @@
|
||||
setTimeout( adjustHeaderHeight, 1000 );
|
||||
});
|
||||
|
||||
// Add header video class after the video is loaded.
|
||||
$( document ).on( 'wp-custom-header-video-loaded', function() {
|
||||
$body.addClass( 'has-header-video' );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
(function( $ ) {
|
||||
var masthead, menuToggle, siteNavigation;
|
||||
var masthead, menuToggle, siteNavContain, siteNavigation;
|
||||
|
||||
function initMainNavigation( container ) {
|
||||
|
||||
@@ -17,8 +17,13 @@
|
||||
|
||||
container.find( '.menu-item-has-children > a, .page_item_has_children > a' ).after( dropdownToggle );
|
||||
|
||||
// Toggle buttons and submenu items with active children menu items.
|
||||
container.find( '.current-menu-ancestor > button' ).addClass( 'toggled-on' );
|
||||
// Set the active submenu dropdown toggle button initial state.
|
||||
container.find( '.current-menu-ancestor > button' )
|
||||
.addClass( 'toggled-on' )
|
||||
.attr( 'aria-expanded', 'true' )
|
||||
.find( '.screen-reader-text' )
|
||||
.text( twentyseventeenScreenReaderText.collapse );
|
||||
// Set the active submenu initial state.
|
||||
container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
|
||||
|
||||
container.find( '.dropdown-toggle' ).click( function( e ) {
|
||||
@@ -39,6 +44,7 @@
|
||||
|
||||
masthead = $( '#masthead' );
|
||||
menuToggle = masthead.find( '.menu-toggle' );
|
||||
siteNavContain = masthead.find( '.main-navigation' );
|
||||
siteNavigation = masthead.find( '.main-navigation > div > ul' );
|
||||
|
||||
// Enable menuToggle.
|
||||
@@ -49,15 +55,13 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Add an initial values for the attribute.
|
||||
menuToggle.add( siteNavigation ).attr( 'aria-expanded', 'false' );
|
||||
// Add an initial value for the attribute.
|
||||
menuToggle.attr( 'aria-expanded', 'false' );
|
||||
|
||||
menuToggle.on( 'click.twentyseventeen', function() {
|
||||
$( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' );
|
||||
siteNavContain.toggleClass( 'toggled-on' );
|
||||
|
||||
$( this )
|
||||
.add( siteNavigation )
|
||||
.attr( 'aria-expanded', $( this ).add( siteNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
|
||||
$( this ).attr( 'aria-expanded', siteNavContain.hasClass( 'toggled-on' ) );
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -102,32 +106,4 @@
|
||||
$( this ).parents( '.menu-item, .page_item' ).toggleClass( 'focus' );
|
||||
});
|
||||
})();
|
||||
|
||||
// Add the default ARIA attributes for the menu toggle and the navigations.
|
||||
function onResizeARIA() {
|
||||
if ( 'block' === $( '.menu-toggle' ).css( 'display' ) ) {
|
||||
|
||||
if ( menuToggle.hasClass( 'toggled-on' ) ) {
|
||||
menuToggle.attr( 'aria-expanded', 'true' );
|
||||
} else {
|
||||
menuToggle.attr( 'aria-expanded', 'false' );
|
||||
}
|
||||
|
||||
if ( siteNavigation.closest( '.main-navigation' ).hasClass( 'toggled-on' ) ) {
|
||||
siteNavigation.attr( 'aria-expanded', 'true' );
|
||||
} else {
|
||||
siteNavigation.attr( 'aria-expanded', 'false' );
|
||||
}
|
||||
} else {
|
||||
menuToggle.removeAttr( 'aria-expanded' );
|
||||
siteNavigation.removeAttr( 'aria-expanded' );
|
||||
menuToggle.removeAttr( 'aria-controls' );
|
||||
}
|
||||
}
|
||||
|
||||
$( document ).ready( function() {
|
||||
$( window ).on( 'load.twentyseventeen', onResizeARIA );
|
||||
$( window ).on( 'resize.twentyseventeen', onResizeARIA );
|
||||
});
|
||||
|
||||
})( jQuery );
|
||||
|
||||
@@ -55,6 +55,9 @@ function twentyseventeen_setup() {
|
||||
|
||||
add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true );
|
||||
|
||||
// Set the default content width.
|
||||
$GLOBALS['content_width'] = 525;
|
||||
|
||||
// This theme uses wp_nav_menu() in two locations.
|
||||
register_nav_menus( array(
|
||||
'top' => __( 'Top Menu', 'twentyseventeen' ),
|
||||
@@ -103,24 +106,29 @@ function twentyseventeen_setup() {
|
||||
*/
|
||||
add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) );
|
||||
|
||||
add_theme_support( 'starter-content', array(
|
||||
// Define and register starter content to showcase the theme on new sites.
|
||||
$starter_content = array(
|
||||
'widgets' => array(
|
||||
// Place three core-defined widgets in the sidebar area.
|
||||
'sidebar-1' => array(
|
||||
'text_business_info',
|
||||
'search',
|
||||
'text_about',
|
||||
),
|
||||
|
||||
// Add the core-defined business info widget to the footer 1 area.
|
||||
'sidebar-2' => array(
|
||||
'text_business_info',
|
||||
),
|
||||
|
||||
// Put two core-defined widgets in the footer 2 area.
|
||||
'sidebar-3' => array(
|
||||
'text_about',
|
||||
'search',
|
||||
),
|
||||
),
|
||||
|
||||
// Specify the core-defined pages to create and add custom thumbnails to some of them.
|
||||
'posts' => array(
|
||||
'home',
|
||||
'about' => array(
|
||||
@@ -137,27 +145,30 @@ function twentyseventeen_setup() {
|
||||
),
|
||||
),
|
||||
|
||||
// Create the custom image attachments used as post thumbnails for pages.
|
||||
'attachments' => array(
|
||||
'image-espresso' => array(
|
||||
'post_title' => _x( 'Espresso', 'Theme starter content' ),
|
||||
'file' => 'assets/images/espresso.jpg',
|
||||
'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),
|
||||
'file' => 'assets/images/espresso.jpg', // URL relative to the template directory.
|
||||
),
|
||||
'image-sandwich' => array(
|
||||
'post_title' => _x( 'Sandwich', 'Theme starter content' ),
|
||||
'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ),
|
||||
'file' => 'assets/images/sandwich.jpg',
|
||||
),
|
||||
'image-coffee' => array(
|
||||
'post_title' => _x( 'Coffee', 'Theme starter content' ),
|
||||
'post_title' => _x( 'Coffee', 'Theme starter content', 'twentyseventeen' ),
|
||||
'file' => 'assets/images/coffee.jpg',
|
||||
),
|
||||
),
|
||||
|
||||
// Default to a static front page and assign the front and posts pages.
|
||||
'options' => array(
|
||||
'show_on_front' => 'page',
|
||||
'page_on_front' => '{{home}}',
|
||||
'page_for_posts' => '{{blog}}',
|
||||
),
|
||||
|
||||
// Set the front page section theme mods to the IDs of the core-registered pages.
|
||||
'theme_mods' => array(
|
||||
'panel_1' => '{{homepage-section}}',
|
||||
'panel_2' => '{{about}}',
|
||||
@@ -165,16 +176,20 @@ function twentyseventeen_setup() {
|
||||
'panel_4' => '{{contact}}',
|
||||
),
|
||||
|
||||
// Set up nav menus for each of the two areas registered in the theme.
|
||||
'nav_menus' => array(
|
||||
// Assign a menu to the "top" location.
|
||||
'top' => array(
|
||||
'name' => __( 'Top Menu', 'twentyseventeen' ),
|
||||
'items' => array(
|
||||
'page_home',
|
||||
'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
|
||||
'page_about',
|
||||
'page_blog',
|
||||
'page_contact',
|
||||
),
|
||||
),
|
||||
|
||||
// Assign a menu to the "social" location.
|
||||
'social' => array(
|
||||
'name' => __( 'Social Links Menu', 'twentyseventeen' ),
|
||||
'items' => array(
|
||||
@@ -186,7 +201,18 @@ function twentyseventeen_setup() {
|
||||
),
|
||||
),
|
||||
),
|
||||
) );
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters Twenty Seventeen array of starter content.
|
||||
*
|
||||
* @since Twenty Seventeen 1.1
|
||||
*
|
||||
* @param array $starter_content Array of starter content.
|
||||
*/
|
||||
$starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content );
|
||||
|
||||
add_theme_support( 'starter-content', $starter_content );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'twentyseventeen_setup' );
|
||||
|
||||
@@ -199,10 +225,23 @@ add_action( 'after_setup_theme', 'twentyseventeen_setup' );
|
||||
*/
|
||||
function twentyseventeen_content_width() {
|
||||
|
||||
$content_width = 700;
|
||||
$content_width = $GLOBALS['content_width'];
|
||||
|
||||
if ( twentyseventeen_is_frontpage() ) {
|
||||
$content_width = 1120;
|
||||
// Get layout.
|
||||
$page_layout = get_theme_mod( 'page_layout' );
|
||||
|
||||
// Check if layout is one column.
|
||||
if ( 'one-column' === $page_layout ) {
|
||||
if ( twentyseventeen_is_frontpage() ) {
|
||||
$content_width = 644;
|
||||
} elseif ( is_page() ) {
|
||||
$content_width = 740;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if is single post and there is no sidebar.
|
||||
if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) {
|
||||
$content_width = 740;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +253,7 @@ function twentyseventeen_content_width() {
|
||||
*/
|
||||
$GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'twentyseventeen_content_width', 0 );
|
||||
add_action( 'template_redirect', 'twentyseventeen_content_width', 0 );
|
||||
|
||||
/**
|
||||
* Register custom fonts.
|
||||
|
||||
@@ -443,8 +443,11 @@ body.colors-custom,
|
||||
.colors-custom .next.page-numbers:focus,
|
||||
.colors-custom .next.page-numbers:hover,
|
||||
.colors-custom.has-header-image .site-title,
|
||||
.colors-custom.has-header-video .site-title,
|
||||
.colors-custom.has-header-image .site-title a,
|
||||
.colors-custom.has-header-image .site-description {
|
||||
.colors-custom.has-header-video .site-title a,
|
||||
.colors-custom.has-header-image .site-description,
|
||||
.colors-custom.has-header-video .site-description {
|
||||
color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
|
||||
}
|
||||
|
||||
@@ -557,5 +560,15 @@ body.colors-custom,
|
||||
}
|
||||
}';
|
||||
|
||||
return $css;
|
||||
|
||||
/**
|
||||
* Filters Twenty Seventeen custom colors CSS.
|
||||
*
|
||||
* @since Twenty Seventeen 1.0
|
||||
*
|
||||
* @param $css string Base theme colors CSS.
|
||||
* @param $hue int The user's selected color hue.
|
||||
* @param $saturation string Filtered theme color saturation level.
|
||||
*/
|
||||
return apply_filters( 'twentyseventeen_custom_colors_css', $css, $hue, $saturation );
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ function twentyseventeen_header_style() {
|
||||
|
||||
// If we get this far, we have custom styles. Let's do this.
|
||||
?>
|
||||
<style type="text/css">
|
||||
<style id="twentyseventeen-custom-header-styles" type="text/css">
|
||||
<?php
|
||||
// Has the text been hidden?
|
||||
if ( 'blank' === $header_text_color ) :
|
||||
@@ -84,9 +84,23 @@ function twentyseventeen_header_style() {
|
||||
else :
|
||||
?>
|
||||
.site-title a,
|
||||
body.has-header-image .site-title a,
|
||||
.colors-dark .site-title a,
|
||||
.colors-custom .site-title a,
|
||||
body.has-header-image .site-title a,
|
||||
body.has-header-video .site-title a,
|
||||
body.has-header-image.colors-dark .site-title a,
|
||||
body.has-header-video.colors-dark .site-title a,
|
||||
body.has-header-image.colors-custom .site-title a,
|
||||
body.has-header-video.colors-custom .site-title a,
|
||||
.site-description,
|
||||
body.has-header-image .site-description {
|
||||
.colors-dark .site-description,
|
||||
.colors-custom .site-description,
|
||||
body.has-header-image .site-description,
|
||||
body.has-header-video .site-description,
|
||||
body.has-header-image.colors-dark .site-description,
|
||||
body.has-header-video.colors-dark .site-description,
|
||||
body.has-header-image.colors-custom .site-description,
|
||||
body.has-header-video.colors-custom .site-description {
|
||||
color: #<?php echo esc_attr( $header_text_color ); ?>;
|
||||
}
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -35,7 +35,7 @@ function twentyseventeen_body_classes( $classes ) {
|
||||
}
|
||||
|
||||
// Add a class if there is a custom header.
|
||||
if ( has_header_image() || has_header_video() && is_front_page() ) {
|
||||
if ( has_header_image() ) {
|
||||
$classes[] = 'has-header-image';
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ Theme Name: Twenty Seventeen
|
||||
Theme URI: https://wordpress.org/themes/twentyseventeen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
|
||||
Version: 1.0
|
||||
Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.
|
||||
Version: 1.1
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: twentyseventeen
|
||||
@@ -868,6 +868,7 @@ html[lang="th"] h4,
|
||||
html[lang="th"] h5,
|
||||
html[lang="th"] h6 {
|
||||
line-height: 1.65;
|
||||
font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
html[lang="th"] body,
|
||||
@@ -876,6 +877,7 @@ html[lang="th"] input,
|
||||
html[lang="th"] select,
|
||||
html[lang="th"] textarea {
|
||||
line-height: 1.8;
|
||||
font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Remove letter-spacing for all non-latin alphabets */
|
||||
@@ -933,6 +935,7 @@ input[type="datetime-local"],
|
||||
input[type="color"],
|
||||
textarea {
|
||||
color: #666;
|
||||
background: #fff;
|
||||
background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0));
|
||||
border: 1px solid #bbb;
|
||||
-webkit-border-radius: 3px;
|
||||
@@ -1580,7 +1583,9 @@ body {
|
||||
}
|
||||
|
||||
body.has-header-image .site-title,
|
||||
body.has-header-image .site-title a {
|
||||
body.has-header-video .site-title,
|
||||
body.has-header-image .site-title a,
|
||||
body.has-header-video .site-title a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -1591,7 +1596,8 @@ body.has-header-image .site-title a {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
body.has-header-image .site-description {
|
||||
body.has-header-image .site-description,
|
||||
body.has-header-video .site-description {
|
||||
color: #fff;
|
||||
opacity: 0.8;
|
||||
}
|
||||
@@ -1609,7 +1615,8 @@ body.has-header-image .site-description {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
body.home.title-tagline-hidden.has-header-image .custom-logo-link img {
|
||||
body.home.title-tagline-hidden.has-header-image .custom-logo-link img,
|
||||
body.home.title-tagline-hidden.has-header-video .custom-logo-link img {
|
||||
max-height: 200px;
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -1629,14 +1636,16 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
}
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header {
|
||||
.has-header-video.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header,
|
||||
.has-header-video.home.blog .custom-header {
|
||||
display: table;
|
||||
height: 300px;
|
||||
height: 75vh;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.custom-header-image {
|
||||
.custom-header-media {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: hidden;
|
||||
@@ -1646,7 +1655,7 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.custom-header-image:before {
|
||||
.custom-header-media:before {
|
||||
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+75 */
|
||||
background: -moz-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* FF3.6-15 */
|
||||
background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* Chrome10-25,Safari5.1-6 */
|
||||
@@ -1662,9 +1671,9 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.has-header-image .custom-header-image img,
|
||||
.has-header-image .custom-header-image video,
|
||||
.has-header-image .custom-header-image iframe {
|
||||
.has-header-image .custom-header-media img,
|
||||
.has-header-video .custom-header-media video,
|
||||
.has-header-video .custom-header-media iframe {
|
||||
position: fixed;
|
||||
height: auto;
|
||||
left: 50%;
|
||||
@@ -1674,6 +1683,7 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
min-width: 100vw; /* vw prevents 1px gap on left that 100% has */
|
||||
width: auto;
|
||||
top: 50%;
|
||||
padding-bottom: 1px; /* Prevent header from extending beyond the footer */
|
||||
-ms-transform: translateX(-50%) translateY(-50%);
|
||||
-moz-transform: translateX(-50%) translateY(-50%);
|
||||
-webkit-transform: translateX(-50%) translateY(-50%);
|
||||
@@ -1706,7 +1716,7 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
top: 62px;
|
||||
}
|
||||
|
||||
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image img {
|
||||
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
top: auto;
|
||||
@@ -1716,14 +1726,35 @@ body:not(.title-tagline-hidden) .site-branding-text {
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
/* For browsers that support 'object-fit' */
|
||||
@supports ( object-fit: cover ) {
|
||||
.has-header-image .custom-header-media img,
|
||||
.has-header-video .custom-header-media video,
|
||||
.has-header-video .custom-header-media iframe,
|
||||
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
|
||||
height: 100%;
|
||||
left: 0;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
top: 0;
|
||||
-ms-transform: none;
|
||||
-moz-transform: none;
|
||||
-webkit-transform: none;
|
||||
transform: none;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hides div in Customizer preview when header images or videos change. */
|
||||
|
||||
body:not(.has-header-image) .custom-header-image {
|
||||
body:not(.has-header-image):not(.has-header-video) .custom-header-media {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .site-branding,
|
||||
.has-header-image.home.blog .site-branding {
|
||||
.has-header-video.twentyseventeen-front-page .site-branding,
|
||||
.has-header-image.home.blog .site-branding,
|
||||
.has-header-video.home.blog .site-branding {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: bottom;
|
||||
@@ -2237,6 +2268,10 @@ body:not(.twentyseventeen-front-page) .entry-header {
|
||||
margin: 0 0 1.5em;
|
||||
}
|
||||
|
||||
.page:not(.home) #content {
|
||||
padding-bottom: 1.5em;
|
||||
}
|
||||
|
||||
/* 404 page */
|
||||
|
||||
.error404 .page-content {
|
||||
@@ -2938,7 +2973,7 @@ object {
|
||||
box-shadow: none;
|
||||
background: none;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.gallery-item a img {
|
||||
@@ -3269,7 +3304,9 @@ object {
|
||||
}
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .site-branding,
|
||||
.has-header-image.home.blog .site-branding {
|
||||
.has-header-video.twentyseventeen-front-page .site-branding,
|
||||
.has-header-image.home.blog .site-branding,
|
||||
.has-header-video.home.blog .site-branding {
|
||||
bottom: 0;
|
||||
display: block;
|
||||
left: 0;
|
||||
@@ -3280,23 +3317,28 @@ object {
|
||||
}
|
||||
|
||||
.has-header-image.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header {
|
||||
.has-header-video.twentyseventeen-front-page .custom-header,
|
||||
.has-header-image.home.blog .custom-header,
|
||||
.has-header-video.home.blog .custom-header {
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.custom-header-image {
|
||||
.custom-header-media {
|
||||
height: 165px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-image,
|
||||
.home.blog.has-header-image .custom-header-image {
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-media,
|
||||
.twentyseventeen-front-page.has-header-video .custom-header-media,
|
||||
.home.blog.has-header-image .custom-header-media,
|
||||
.home.blog.has-header-video .custom-header-media {
|
||||
height: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image {
|
||||
.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media,
|
||||
.has-header-video:not(.twentyseventeen-front-page):not(.home) .custom-header-media {
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
left: 0;
|
||||
@@ -3310,11 +3352,13 @@ object {
|
||||
}
|
||||
|
||||
.custom-logo-link img,
|
||||
body.home.title-tagline-hidden.has-header-image .custom-logo-link img {
|
||||
body.home.title-tagline-hidden.has-header-image .custom-logo-link img,
|
||||
body.home.title-tagline-hidden.has-header-video .custom-logo-link img {
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.title-tagline-hidden.home.has-header-image .custom-logo-link img {
|
||||
.title-tagline-hidden.home.has-header-image .custom-logo-link img,
|
||||
.title-tagline-hidden.home.has-header-video .custom-logo-link img {
|
||||
max-height: 200px;
|
||||
}
|
||||
|
||||
@@ -3576,25 +3620,33 @@ object {
|
||||
/* Front Page */
|
||||
|
||||
.twentyseventeen-front-page.has-header-image .site-branding,
|
||||
.home.blog.has-header-image .site-branding {
|
||||
.twentyseventeen-front-page.has-header-video .site-branding,
|
||||
.home.blog.has-header-image .site-branding,
|
||||
.home.blog.has-header-video .site-branding {
|
||||
margin-bottom: 70px;
|
||||
}
|
||||
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-image,
|
||||
.home.blog.has-header-image .custom-header-image {
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-media,
|
||||
.twentyseventeen-front-page.has-header-video .custom-header-media,
|
||||
.home.blog.has-header-image .custom-header-media,
|
||||
.home.blog.has-header-video .custom-header-media {
|
||||
height: 1200px;
|
||||
height: 100vh;
|
||||
max-height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-image:before,
|
||||
.home.blog.has-header-image .custom-header-image:before {
|
||||
.twentyseventeen-front-page.has-header-image .custom-header-media:before,
|
||||
.twentyseventeen-front-page.has-header-video .custom-header-media:before,
|
||||
.home.blog.has-header-image .custom-header-media:before,
|
||||
.home.blog.has-header-video .custom-header-media:before {
|
||||
height: 33%;
|
||||
}
|
||||
|
||||
.admin-bar.twentyseventeen-front-page.has-header-image .custom-header-image,
|
||||
.admin-bar.home.blog.has-header-image .custom-header-image {
|
||||
.admin-bar.twentyseventeen-front-page.has-header-image .custom-header-media,
|
||||
.admin-bar.twentyseventeen-front-page.has-header-video .custom-header-media,
|
||||
.admin-bar.home.blog.has-header-image .custom-header-media,
|
||||
.admin-bar.home.blog.has-header-video .custom-header-media {
|
||||
height: calc(100vh - 32px);
|
||||
}
|
||||
|
||||
@@ -3655,7 +3707,7 @@ object {
|
||||
/* Posts */
|
||||
|
||||
.site-content {
|
||||
padding: 6.5em 0 0;
|
||||
padding: 5.5em 0 0;
|
||||
}
|
||||
|
||||
.single-post .entry-title,
|
||||
@@ -3816,6 +3868,10 @@ object {
|
||||
margin-bottom: 4em;
|
||||
}
|
||||
|
||||
.page:not(.home) #content {
|
||||
padding-bottom: 3.25em;
|
||||
}
|
||||
|
||||
/* 404 page */
|
||||
|
||||
.error404 .page-content {
|
||||
@@ -4104,12 +4160,14 @@ object {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.custom-header-image {
|
||||
.custom-header-media {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.twentyseventeen-front-page.has-header-image .site-branding,
|
||||
.home.blog.has-header-image .site-branding {
|
||||
.twentyseventeen-front-page.has-header-video .site-branding,
|
||||
.home.blog.has-header-image .site-branding,
|
||||
.home.blog.has-header-video .site-branding {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -4148,7 +4206,9 @@ object {
|
||||
a,
|
||||
.site-title a,
|
||||
.twentyseventeen-front-page.has-header-image .site-title,
|
||||
.twentyseventeen-front-page.has-header-image .site-title a {
|
||||
.twentyseventeen-front-page.has-header-video .site-title,
|
||||
.twentyseventeen-front-page.has-header-image .site-title a,
|
||||
.twentyseventeen-front-page.has-header-video .site-title a {
|
||||
color: #222 !important; /* Make sure color schemes don't affect to print */
|
||||
}
|
||||
|
||||
@@ -4157,6 +4217,7 @@ object {
|
||||
blockquote,
|
||||
.site-description,
|
||||
.twentyseventeen-front-page.has-header-image .site-description,
|
||||
.twentyseventeen-front-page.has-header-video .site-description,
|
||||
.entry-meta,
|
||||
.entry-meta a {
|
||||
color: #777 !important; /* Make sure color schemes don't affect to print */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Displays header image
|
||||
* Displays header media
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Seventeen
|
||||
@@ -11,7 +11,7 @@
|
||||
?>
|
||||
<div class="custom-header">
|
||||
|
||||
<div class="custom-header-image">
|
||||
<div class="custom-header-media">
|
||||
<?php the_custom_header_markup(); ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div><!-- .site-branding-text -->
|
||||
|
||||
<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && ! has_nav_menu( 'top' ) ) : ?>
|
||||
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll Down', 'twentyseventeen' ); ?></span></a>
|
||||
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!-- .wrap -->
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
) ); ?>
|
||||
|
||||
<?php if ( ( twentyseventeen_is_frontpage() || ( is_home() && is_front_page() ) ) && has_custom_header() ) : ?>
|
||||
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll Down', 'twentyseventeen' ); ?></span></a>
|
||||
<a href="#content" class="menu-scroll-down"><?php echo twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ); ?><span class="screen-reader-text"><?php _e( 'Scroll down to content', 'twentyseventeen' ); ?></span></a>
|
||||
<?php endif; ?>
|
||||
</nav><!-- #site-navigation -->
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Thirteen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.6
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Stable tag: 2.0
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 2.1
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-header, custom-menu, editor-style, featured-images, footer-widgets, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready
|
||||
@@ -47,6 +47,11 @@ Source: http://www.genericons.com
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.1 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
https://codex.wordpress.org/Twenty_Thirteen_Theme_Changelog#Version_2.1
|
||||
|
||||
= 2.0 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentythirteen/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
|
||||
Version: 2.0
|
||||
Version: 2.1
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-header, custom-menu, editor-style, featured-images, footer-widgets, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== Twenty Twelve ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 3.5
|
||||
Tested up to: WordPress 4.7-trunk
|
||||
Stable tag: 2.1
|
||||
Tested up to: WordPress 4.8-trunk
|
||||
Stable tag: 2.2
|
||||
License: GPLv2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
@@ -43,6 +43,11 @@ Source: https://github.com/aFarkas/html5shiv
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.2 =
|
||||
* Released: December 6, 2016
|
||||
|
||||
https://codex.wordpress.org/Twenty_Twelve_Theme_Changelog#Version_2.2
|
||||
|
||||
= 2.1 =
|
||||
* Released: August 15, 2016
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentytwelve/
|
||||
Author: the WordPress team
|
||||
Author URI: https://wordpress.org/
|
||||
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
|
||||
Version: 2.1
|
||||
Version: 2.2
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Tags: blog, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
|
||||
|
||||
@@ -427,7 +427,7 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'edit_term':
|
||||
case 'delete_term':
|
||||
case 'assign_term':
|
||||
$term_id = $args[0];
|
||||
$term_id = (int) $args[0];
|
||||
$term = get_term( $term_id );
|
||||
if ( ! $term || is_wp_error( $term ) ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
|
||||
18
wp-includes/class-feed.php
Normal file
18
wp-includes/class-feed.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Feed API
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Feed
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '4.7.0', 'fetch_feed()' );
|
||||
|
||||
if ( ! class_exists( 'SimplePie', false ) ) {
|
||||
require_once( ABSPATH . WPINC . '/class-simplepie.php' );
|
||||
}
|
||||
|
||||
require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );
|
||||
@@ -31,7 +31,7 @@ class PHPMailer
|
||||
* The PHPMailer Version number.
|
||||
* @var string
|
||||
*/
|
||||
public $Version = '5.2.14';
|
||||
public $Version = '5.2.22';
|
||||
|
||||
/**
|
||||
* Email priority.
|
||||
@@ -201,6 +201,9 @@ class PHPMailer
|
||||
/**
|
||||
* An ID to be used in the Message-ID header.
|
||||
* If empty, a unique id will be generated.
|
||||
* You can set your own, but it must be in the format "<id@domain>",
|
||||
* as defined in RFC5322 section 3.6.4 or it will be ignored.
|
||||
* @see https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||
* @var string
|
||||
*/
|
||||
public $MessageID = '';
|
||||
@@ -285,7 +288,7 @@ class PHPMailer
|
||||
|
||||
/**
|
||||
* SMTP auth type.
|
||||
* Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
|
||||
* Options are CRAM-MD5, LOGIN, PLAIN, attempted in that order if not specified
|
||||
* @var string
|
||||
*/
|
||||
public $AuthType = '';
|
||||
@@ -352,6 +355,7 @@ class PHPMailer
|
||||
/**
|
||||
* Whether to split multiple to addresses into multiple messages
|
||||
* or send them all in one message.
|
||||
* Only supported in `mail` and `sendmail` transports, not in SMTP.
|
||||
* @var boolean
|
||||
*/
|
||||
public $SingleTo = false;
|
||||
@@ -394,7 +398,7 @@ class PHPMailer
|
||||
|
||||
/**
|
||||
* DKIM Identity.
|
||||
* Usually the email address used as the source of the email
|
||||
* Usually the email address used as the source of the email.
|
||||
* @var string
|
||||
*/
|
||||
public $DKIM_identity = '';
|
||||
@@ -419,6 +423,13 @@ class PHPMailer
|
||||
*/
|
||||
public $DKIM_private = '';
|
||||
|
||||
/**
|
||||
* DKIM private key string.
|
||||
* If set, takes precedence over `$DKIM_private`.
|
||||
* @var string
|
||||
*/
|
||||
public $DKIM_private_string = '';
|
||||
|
||||
/**
|
||||
* Callback Action function name.
|
||||
*
|
||||
@@ -446,6 +457,15 @@ class PHPMailer
|
||||
*/
|
||||
public $XMailer = '';
|
||||
|
||||
/**
|
||||
* Which validator to use by default when validating email addresses.
|
||||
* May be a callable to inject your own validator, but there are several built-in validators.
|
||||
* @see PHPMailer::validateAddress()
|
||||
* @var string|callable
|
||||
* @static
|
||||
*/
|
||||
public static $validator = 'auto';
|
||||
|
||||
/**
|
||||
* An instance of the SMTP sender class.
|
||||
* @var SMTP
|
||||
@@ -634,9 +654,11 @@ class PHPMailer
|
||||
* Constructor.
|
||||
* @param boolean $exceptions Should we throw external exceptions?
|
||||
*/
|
||||
public function __construct($exceptions = false)
|
||||
public function __construct($exceptions = null)
|
||||
{
|
||||
$this->exceptions = (boolean)$exceptions;
|
||||
if ($exceptions !== null) {
|
||||
$this->exceptions = (boolean)$exceptions;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -645,9 +667,7 @@ class PHPMailer
|
||||
public function __destruct()
|
||||
{
|
||||
//Close any open SMTP connection nicely
|
||||
if ($this->Mailer == 'smtp') {
|
||||
$this->smtpClose();
|
||||
}
|
||||
$this->smtpClose();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -671,14 +691,16 @@ class PHPMailer
|
||||
} else {
|
||||
$subject = $this->encodeHeader($this->secureHeader($subject));
|
||||
}
|
||||
if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
|
||||
|
||||
//Can't use additional_parameters in safe_mode, calling mail() with null params breaks
|
||||
//@link http://php.net/manual/en/function.mail.php
|
||||
if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
|
||||
$result = @mail($to, $subject, $body, $header);
|
||||
} else {
|
||||
$result = @mail($to, $subject, $body, $header, $params);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Output debugging info via user-defined method.
|
||||
* Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
|
||||
@@ -713,7 +735,7 @@ class PHPMailer
|
||||
case 'echo':
|
||||
default:
|
||||
//Normalize line breaks
|
||||
$str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
|
||||
$str = preg_replace('/\r\n?/ms', "\n", $str);
|
||||
echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
|
||||
"\n",
|
||||
"\n \t ",
|
||||
@@ -850,7 +872,7 @@ class PHPMailer
|
||||
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
||||
if (($pos = strrpos($address, '@')) === false) {
|
||||
// At-sign is misssing.
|
||||
$error_message = $this->lang('invalid_address') . $address;
|
||||
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
|
||||
$this->setError($error_message);
|
||||
$this->edebug($error_message);
|
||||
if ($this->exceptions) {
|
||||
@@ -900,7 +922,7 @@ class PHPMailer
|
||||
return false;
|
||||
}
|
||||
if (!$this->validateAddress($address)) {
|
||||
$error_message = $this->lang('invalid_address') . $address;
|
||||
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address";
|
||||
$this->setError($error_message);
|
||||
$this->edebug($error_message);
|
||||
if ($this->exceptions) {
|
||||
@@ -923,6 +945,61 @@ class PHPMailer
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and validate a string containing one or more RFC822-style comma-separated email addresses
|
||||
* of the form "display name <address>" into an array of name/address pairs.
|
||||
* Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
|
||||
* Note that quotes in the name part are removed.
|
||||
* @param string $addrstr The address list string
|
||||
* @param bool $useimap Whether to use the IMAP extension to parse the list
|
||||
* @return array
|
||||
* @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
|
||||
*/
|
||||
public function parseAddresses($addrstr, $useimap = true)
|
||||
{
|
||||
$addresses = array();
|
||||
if ($useimap and function_exists('imap_rfc822_parse_adrlist')) {
|
||||
//Use this built-in parser if it's available
|
||||
$list = imap_rfc822_parse_adrlist($addrstr, '');
|
||||
foreach ($list as $address) {
|
||||
if ($address->host != '.SYNTAX-ERROR.') {
|
||||
if ($this->validateAddress($address->mailbox . '@' . $address->host)) {
|
||||
$addresses[] = array(
|
||||
'name' => (property_exists($address, 'personal') ? $address->personal : ''),
|
||||
'address' => $address->mailbox . '@' . $address->host
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//Use this simpler parser
|
||||
$list = explode(',', $addrstr);
|
||||
foreach ($list as $address) {
|
||||
$address = trim($address);
|
||||
//Is there a separate name part?
|
||||
if (strpos($address, '<') === false) {
|
||||
//No separate name, just use the whole thing
|
||||
if ($this->validateAddress($address)) {
|
||||
$addresses[] = array(
|
||||
'name' => '',
|
||||
'address' => $address
|
||||
);
|
||||
}
|
||||
} else {
|
||||
list($name, $email) = explode('<', $address);
|
||||
$email = trim(str_replace('>', '', $email));
|
||||
if ($this->validateAddress($email)) {
|
||||
$addresses[] = array(
|
||||
'name' => trim(str_replace(array('"', "'"), '', $name)),
|
||||
'address' => $email
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $addresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the From and FromName properties.
|
||||
* @param string $address
|
||||
@@ -939,7 +1016,7 @@ class PHPMailer
|
||||
if (($pos = strrpos($address, '@')) === false or
|
||||
(!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and
|
||||
!$this->validateAddress($address)) {
|
||||
$error_message = $this->lang('invalid_address') . $address;
|
||||
$error_message = $this->lang('invalid_address') . " (setFrom) $address";
|
||||
$this->setError($error_message);
|
||||
$this->edebug($error_message);
|
||||
if ($this->exceptions) {
|
||||
@@ -972,19 +1049,30 @@ class PHPMailer
|
||||
/**
|
||||
* Check that a string looks like an email address.
|
||||
* @param string $address The email address to check
|
||||
* @param string $patternselect A selector for the validation pattern to use :
|
||||
* @param string|callable $patternselect A selector for the validation pattern to use :
|
||||
* * `auto` Pick best pattern automatically;
|
||||
* * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
|
||||
* * `pcre` Use old PCRE implementation;
|
||||
* * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
|
||||
* * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
|
||||
* * `noregex` Don't use a regex: super fast, really dumb.
|
||||
* Alternatively you may pass in a callable to inject your own validator, for example:
|
||||
* PHPMailer::validateAddress('user@example.com', function($address) {
|
||||
* return (strpos($address, '@') !== false);
|
||||
* });
|
||||
* You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
|
||||
* @return boolean
|
||||
* @static
|
||||
* @access public
|
||||
*/
|
||||
public static function validateAddress($address, $patternselect = 'auto')
|
||||
public static function validateAddress($address, $patternselect = null)
|
||||
{
|
||||
if (is_null($patternselect)) {
|
||||
$patternselect = self::$validator;
|
||||
}
|
||||
if (is_callable($patternselect)) {
|
||||
return call_user_func($patternselect, $address);
|
||||
}
|
||||
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
|
||||
if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
|
||||
return false;
|
||||
@@ -1161,7 +1249,7 @@ class PHPMailer
|
||||
}
|
||||
$this->$address_kind = $this->punyencodeAddress($this->$address_kind);
|
||||
if (!$this->validateAddress($this->$address_kind)) {
|
||||
$error_message = $this->lang('invalid_address') . $this->$address_kind;
|
||||
$error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind;
|
||||
$this->setError($error_message);
|
||||
$this->edebug($error_message);
|
||||
if ($this->exceptions) {
|
||||
@@ -1172,7 +1260,7 @@ class PHPMailer
|
||||
}
|
||||
|
||||
// Set whether the message is multipart/alternative
|
||||
if (!empty($this->AltBody)) {
|
||||
if ($this->alternativeExists()) {
|
||||
$this->ContentType = 'multipart/alternative';
|
||||
}
|
||||
|
||||
@@ -1206,9 +1294,11 @@ class PHPMailer
|
||||
|
||||
// Sign with DKIM if enabled
|
||||
if (!empty($this->DKIM_domain)
|
||||
&& !empty($this->DKIM_private)
|
||||
&& !empty($this->DKIM_selector)
|
||||
&& file_exists($this->DKIM_private)) {
|
||||
&& (!empty($this->DKIM_private_string)
|
||||
|| (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
|
||||
)
|
||||
) {
|
||||
$header_dkim = $this->DKIM_Add(
|
||||
$this->MIMEHeader . $this->mailHeader,
|
||||
$this->encodeHeader($this->secureHeader($this->Subject)),
|
||||
@@ -1274,19 +1364,24 @@ class PHPMailer
|
||||
*/
|
||||
protected function sendmailSend($header, $body)
|
||||
{
|
||||
if ($this->Sender != '') {
|
||||
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
||||
if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
|
||||
if ($this->Mailer == 'qmail') {
|
||||
$sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
|
||||
$sendmailFmt = '%s -f%s';
|
||||
} else {
|
||||
$sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
|
||||
$sendmailFmt = '%s -oi -f%s -t';
|
||||
}
|
||||
} else {
|
||||
if ($this->Mailer == 'qmail') {
|
||||
$sendmail = sprintf('%s', escapeshellcmd($this->Sendmail));
|
||||
$sendmailFmt = '%s';
|
||||
} else {
|
||||
$sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail));
|
||||
$sendmailFmt = '%s -oi -t';
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: If possible, this should be changed to escapeshellarg. Needs thorough testing.
|
||||
$sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
|
||||
|
||||
if ($this->SingleTo) {
|
||||
foreach ($this->SingleToArray as $toAddr) {
|
||||
if (!@$mail = popen($sendmail, 'w')) {
|
||||
@@ -1332,6 +1427,40 @@ class PHPMailer
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
|
||||
*
|
||||
* Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
|
||||
* @param string $string The string to be validated
|
||||
* @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report
|
||||
* @access protected
|
||||
* @return boolean
|
||||
*/
|
||||
protected static function isShellSafe($string)
|
||||
{
|
||||
// Future-proof
|
||||
if (escapeshellcmd($string) !== $string
|
||||
or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$length = strlen($string);
|
||||
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$c = $string[$i];
|
||||
|
||||
// All other characters have a special meaning in at least one common shell, including = and +.
|
||||
// Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
|
||||
// Note that this does permit non-Latin alphanumeric characters based on the current locale.
|
||||
if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mail using the PHP mail() function.
|
||||
* @param string $header The message headers
|
||||
@@ -1349,17 +1478,20 @@ class PHPMailer
|
||||
}
|
||||
$to = implode(', ', $toArr);
|
||||
|
||||
if (empty($this->Sender)) {
|
||||
$params = ' ';
|
||||
} else {
|
||||
$params = sprintf('-f%s', $this->Sender);
|
||||
$params = null;
|
||||
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
||||
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
|
||||
// CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
|
||||
if (self::isShellSafe($this->Sender)) {
|
||||
$params = sprintf('-f%s', $this->Sender);
|
||||
}
|
||||
}
|
||||
if ($this->Sender != '' and !ini_get('safe_mode')) {
|
||||
if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
|
||||
$old_from = ini_get('sendmail_from');
|
||||
ini_set('sendmail_from', $this->Sender);
|
||||
}
|
||||
$result = false;
|
||||
if ($this->SingleTo && count($toArr) > 1) {
|
||||
if ($this->SingleTo and count($toArr) > 1) {
|
||||
foreach ($toArr as $toAddr) {
|
||||
$result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
|
||||
$this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
|
||||
@@ -1409,10 +1541,10 @@ class PHPMailer
|
||||
if (!$this->smtpConnect($this->SMTPOptions)) {
|
||||
throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
|
||||
}
|
||||
if ('' == $this->Sender) {
|
||||
$smtp_from = $this->From;
|
||||
} else {
|
||||
if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
|
||||
$smtp_from = $this->Sender;
|
||||
} else {
|
||||
$smtp_from = $this->From;
|
||||
}
|
||||
if (!$this->smtp->mail($smtp_from)) {
|
||||
$this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
|
||||
@@ -1466,12 +1598,17 @@ class PHPMailer
|
||||
* @throws phpmailerException
|
||||
* @return boolean
|
||||
*/
|
||||
public function smtpConnect($options = array())
|
||||
public function smtpConnect($options = null)
|
||||
{
|
||||
if (is_null($this->smtp)) {
|
||||
$this->smtp = $this->getSMTPInstance();
|
||||
}
|
||||
|
||||
//If no options are provided, use whatever is set in the instance
|
||||
if (is_null($options)) {
|
||||
$options = $this->SMTPOptions;
|
||||
}
|
||||
|
||||
// Already connected?
|
||||
if ($this->smtp->connected()) {
|
||||
return true;
|
||||
@@ -1541,7 +1678,7 @@ class PHPMailer
|
||||
if (!$this->smtp->startTLS()) {
|
||||
throw new phpmailerException($this->lang('connect_host'));
|
||||
}
|
||||
// We must resend HELO after tls negotiation
|
||||
// We must resend EHLO after TLS negotiation
|
||||
$this->smtp->hello($hello);
|
||||
}
|
||||
if ($this->SMTPAuth) {
|
||||
@@ -1580,7 +1717,7 @@ class PHPMailer
|
||||
*/
|
||||
public function smtpClose()
|
||||
{
|
||||
if ($this->smtp !== null) {
|
||||
if (is_a($this->smtp, 'SMTP')) {
|
||||
if ($this->smtp->connected()) {
|
||||
$this->smtp->quit();
|
||||
$this->smtp->close();
|
||||
@@ -1599,6 +1736,19 @@ class PHPMailer
|
||||
*/
|
||||
public function setLanguage($langcode = 'en', $lang_path = '')
|
||||
{
|
||||
// Backwards compatibility for renamed language codes
|
||||
$renamed_langcodes = array(
|
||||
'br' => 'pt_br',
|
||||
'cz' => 'cs',
|
||||
'dk' => 'da',
|
||||
'no' => 'nb',
|
||||
'se' => 'sv',
|
||||
);
|
||||
|
||||
if (isset($renamed_langcodes[$langcode])) {
|
||||
$langcode = $renamed_langcodes[$langcode];
|
||||
}
|
||||
|
||||
// Define full set of translatable strings in English
|
||||
$PHPMAILER_LANG = array(
|
||||
'authenticate' => 'SMTP Error: Could not authenticate.',
|
||||
@@ -1625,6 +1775,10 @@ class PHPMailer
|
||||
// Calculate an absolute path so it can work if CWD is not here
|
||||
$lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
|
||||
}
|
||||
//Validate $langcode
|
||||
if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
|
||||
$langcode = 'en';
|
||||
}
|
||||
$foundlang = true;
|
||||
$lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
|
||||
// There is no English translation file
|
||||
@@ -1918,7 +2072,9 @@ class PHPMailer
|
||||
$result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
|
||||
}
|
||||
|
||||
if ($this->MessageID != '') {
|
||||
// Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
|
||||
// https://tools.ietf.org/html/rfc5322#section-3.6.4
|
||||
if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
|
||||
$this->lastMessageID = $this->MessageID;
|
||||
} else {
|
||||
$this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname());
|
||||
@@ -2020,7 +2176,15 @@ class PHPMailer
|
||||
*/
|
||||
public function getSentMIMEMessage()
|
||||
{
|
||||
return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
|
||||
return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create unique ID
|
||||
* @return string
|
||||
*/
|
||||
protected function generateId() {
|
||||
return md5(uniqid(time()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2034,7 +2198,7 @@ class PHPMailer
|
||||
{
|
||||
$body = '';
|
||||
//Create unique IDs and preset boundaries
|
||||
$this->uniqueid = md5(uniqid(time()));
|
||||
$this->uniqueid = $this->generateId();
|
||||
$this->boundary[1] = 'b1_' . $this->uniqueid;
|
||||
$this->boundary[2] = 'b2_' . $this->uniqueid;
|
||||
$this->boundary[3] = 'b3_' . $this->uniqueid;
|
||||
@@ -2050,11 +2214,12 @@ class PHPMailer
|
||||
//Can we do a 7-bit downgrade?
|
||||
if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
|
||||
$bodyEncoding = '7bit';
|
||||
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
||||
$bodyCharSet = 'us-ascii';
|
||||
}
|
||||
//If lines are too long, change to quoted-printable transfer encoding
|
||||
if (self::hasLineLongerThanMax($this->Body)) {
|
||||
$this->Encoding = 'quoted-printable';
|
||||
//If lines are too long, and we're not already using an encoding that will shorten them,
|
||||
//change to quoted-printable transfer encoding for the body part only
|
||||
if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
|
||||
$bodyEncoding = 'quoted-printable';
|
||||
}
|
||||
|
||||
@@ -2063,10 +2228,12 @@ class PHPMailer
|
||||
//Can we do a 7-bit downgrade?
|
||||
if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
|
||||
$altBodyEncoding = '7bit';
|
||||
//All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
|
||||
$altBodyCharSet = 'us-ascii';
|
||||
}
|
||||
//If lines are too long, change to quoted-printable transfer encoding
|
||||
if (self::hasLineLongerThanMax($this->AltBody)) {
|
||||
//If lines are too long, and we're not already using an encoding that will shorten them,
|
||||
//change to quoted-printable transfer encoding for the alt body part only
|
||||
if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
|
||||
$altBodyEncoding = 'quoted-printable';
|
||||
}
|
||||
//Use this as a preamble in all multipart message types
|
||||
@@ -2169,8 +2336,10 @@ class PHPMailer
|
||||
$body .= $this->attachAll('attachment', $this->boundary[1]);
|
||||
break;
|
||||
default:
|
||||
// catch case 'plain' and case ''
|
||||
$body .= $this->encodeString($this->Body, $bodyEncoding);
|
||||
// Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
|
||||
//Reset the `Encoding` property in case we changed it for line length reasons
|
||||
$this->Encoding = $bodyEncoding;
|
||||
$body .= $this->encodeString($this->Body, $this->Encoding);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2276,8 +2445,7 @@ class PHPMailer
|
||||
|
||||
/**
|
||||
* Set the message type.
|
||||
* PHPMailer only supports some preset message types,
|
||||
* not arbitrary MIME structures.
|
||||
* PHPMailer only supports some preset message types, not arbitrary MIME structures.
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
@@ -2295,6 +2463,7 @@ class PHPMailer
|
||||
}
|
||||
$this->message_type = implode('_', $type);
|
||||
if ($this->message_type == '') {
|
||||
//The 'plain' message_type refers to the message having a single body element, not that it is plain-text
|
||||
$this->message_type = 'plain';
|
||||
}
|
||||
}
|
||||
@@ -2324,6 +2493,7 @@ class PHPMailer
|
||||
|
||||
/**
|
||||
* Add an attachment from a path on the filesystem.
|
||||
* Never use a user-supplied path to a file!
|
||||
* Returns false if the file could not be found or read.
|
||||
* @param string $path Path to the attachment.
|
||||
* @param string $name Overrides the attachment name.
|
||||
@@ -2849,6 +3019,7 @@ class PHPMailer
|
||||
* displayed inline with the message, not just attached for download.
|
||||
* This is used in HTML messages that embed the images
|
||||
* the HTML refers to using the $cid value.
|
||||
* Never use a user-supplied path to a file!
|
||||
* @param string $path Path to the attachment.
|
||||
* @param string $cid Content ID of the attachment; Use this to reference
|
||||
* the content when using an embedded image in HTML.
|
||||
@@ -3209,21 +3380,29 @@ class PHPMailer
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a message from an HTML string.
|
||||
* Automatically makes modifications for inline images and backgrounds
|
||||
* and creates a plain-text version by converting the HTML.
|
||||
* Overwrites any existing values in $this->Body and $this->AltBody
|
||||
* Create a message body from an HTML string.
|
||||
* Automatically inlines images and creates a plain-text version by converting the HTML,
|
||||
* overwriting any existing values in Body and AltBody.
|
||||
* Do not source $message content from user input!
|
||||
* $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty
|
||||
* will look for an image file in $basedir/images/a.png and convert it to inline.
|
||||
* If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email)
|
||||
* If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
|
||||
* @access public
|
||||
* @param string $message HTML message string
|
||||
* @param string $basedir baseline directory for path
|
||||
* @param string $basedir Absolute path to a base directory to prepend to relative paths to images
|
||||
* @param boolean|callable $advanced Whether to use the internal HTML to text converter
|
||||
* or your own custom converter @see PHPMailer::html2text()
|
||||
* @return string $message
|
||||
* @return string $message The transformed message Body
|
||||
*/
|
||||
public function msgHTML($message, $basedir = '', $advanced = false)
|
||||
{
|
||||
preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
|
||||
if (array_key_exists(2, $images)) {
|
||||
if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
|
||||
// Ensure $basedir has a trailing /
|
||||
$basedir .= '/';
|
||||
}
|
||||
foreach ($images[2] as $imgindex => $url) {
|
||||
// Convert data URIs into embedded images
|
||||
if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
|
||||
@@ -3241,18 +3420,24 @@ class PHPMailer
|
||||
$message
|
||||
);
|
||||
}
|
||||
} elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
|
||||
// Do not change urls for absolute images (thanks to corvuscorax)
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
// Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
|
||||
!empty($basedir)
|
||||
// Ignore URLs containing parent dir traversal (..)
|
||||
&& (strpos($url, '..') === false)
|
||||
// Do not change urls that are already inline images
|
||||
&& substr($url, 0, 4) !== 'cid:'
|
||||
// Do not change absolute URLs, including anonymous protocol
|
||||
&& !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)
|
||||
) {
|
||||
$filename = basename($url);
|
||||
$directory = dirname($url);
|
||||
if ($directory == '.') {
|
||||
$directory = '';
|
||||
}
|
||||
$cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
|
||||
if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
|
||||
$basedir .= '/';
|
||||
}
|
||||
if (strlen($directory) > 1 && substr($directory, -1) != '/') {
|
||||
$directory .= '/';
|
||||
}
|
||||
@@ -3277,7 +3462,7 @@ class PHPMailer
|
||||
// Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
|
||||
$this->Body = $this->normalizeBreaks($message);
|
||||
$this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
|
||||
if (empty($this->AltBody)) {
|
||||
if (!$this->alternativeExists()) {
|
||||
$this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
|
||||
self::CRLF . self::CRLF;
|
||||
}
|
||||
@@ -3288,7 +3473,7 @@ class PHPMailer
|
||||
* Convert an HTML string into plain text.
|
||||
* This is used by msgHTML().
|
||||
* Note - older versions of this function used a bundled advanced converter
|
||||
* which was been removed for license reasons in #232
|
||||
* which was been removed for license reasons in #232.
|
||||
* Example usage:
|
||||
* <code>
|
||||
* // Use default conversion
|
||||
@@ -3588,7 +3773,7 @@ class PHPMailer
|
||||
* @access public
|
||||
* @param string $signHeader
|
||||
* @throws phpmailerException
|
||||
* @return string
|
||||
* @return string The DKIM signature value
|
||||
*/
|
||||
public function DKIM_Sign($signHeader)
|
||||
{
|
||||
@@ -3598,15 +3783,35 @@ class PHPMailer
|
||||
}
|
||||
return '';
|
||||
}
|
||||
$privKeyStr = file_get_contents($this->DKIM_private);
|
||||
if ($this->DKIM_passphrase != '') {
|
||||
$privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
|
||||
if ('' != $this->DKIM_passphrase) {
|
||||
$privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
|
||||
} else {
|
||||
$privKey = $privKeyStr;
|
||||
$privKey = openssl_pkey_get_private($privKeyStr);
|
||||
}
|
||||
if (openssl_sign($signHeader, $signature, $privKey)) {
|
||||
return base64_encode($signature);
|
||||
//Workaround for missing digest algorithms in old PHP & OpenSSL versions
|
||||
//@link http://stackoverflow.com/a/11117338/333340
|
||||
if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
|
||||
in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
|
||||
if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
|
||||
openssl_pkey_free($privKey);
|
||||
return base64_encode($signature);
|
||||
}
|
||||
} else {
|
||||
$pinfo = openssl_pkey_get_details($privKey);
|
||||
$hash = hash('sha256', $signHeader);
|
||||
//'Magic' constant for SHA256 from RFC3447
|
||||
//@link https://tools.ietf.org/html/rfc3447#page-43
|
||||
$t = '3031300d060960864801650304020105000420' . $hash;
|
||||
$pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
|
||||
$eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
|
||||
|
||||
if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
|
||||
openssl_pkey_free($privKey);
|
||||
return base64_encode($signature);
|
||||
}
|
||||
}
|
||||
openssl_pkey_free($privKey);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -3623,7 +3828,7 @@ class PHPMailer
|
||||
foreach ($lines as $key => $line) {
|
||||
list($heading, $value) = explode(':', $line, 2);
|
||||
$heading = strtolower($heading);
|
||||
$value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces
|
||||
$value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
|
||||
$lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
|
||||
}
|
||||
$signHeader = implode("\r\n", $lines);
|
||||
@@ -3661,7 +3866,7 @@ class PHPMailer
|
||||
*/
|
||||
public function DKIM_Add($headers_line, $subject, $body)
|
||||
{
|
||||
$DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
|
||||
$DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
|
||||
$DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
|
||||
$DKIMquery = 'dns/txt'; // Query method
|
||||
$DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
|
||||
@@ -3669,6 +3874,7 @@ class PHPMailer
|
||||
$headers = explode($this->LE, $headers_line);
|
||||
$from_header = '';
|
||||
$to_header = '';
|
||||
$date_header = '';
|
||||
$current = '';
|
||||
foreach ($headers as $header) {
|
||||
if (strpos($header, 'From:') === 0) {
|
||||
@@ -3677,6 +3883,9 @@ class PHPMailer
|
||||
} elseif (strpos($header, 'To:') === 0) {
|
||||
$to_header = $header;
|
||||
$current = 'to_header';
|
||||
} elseif (strpos($header, 'Date:') === 0) {
|
||||
$date_header = $header;
|
||||
$current = 'date_header';
|
||||
} else {
|
||||
if (!empty($$current) && strpos($header, ' =?') === 0) {
|
||||
$$current .= $header;
|
||||
@@ -3687,6 +3896,7 @@ class PHPMailer
|
||||
}
|
||||
$from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
|
||||
$to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
|
||||
$date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
|
||||
$subject = str_replace(
|
||||
'|',
|
||||
'=7C',
|
||||
@@ -3694,7 +3904,7 @@ class PHPMailer
|
||||
); // Copied header fields (dkim-quoted-printable)
|
||||
$body = $this->DKIM_BodyC($body);
|
||||
$DKIMlen = strlen($body); // Length of body
|
||||
$DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body
|
||||
$DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
|
||||
if ('' == $this->DKIM_identity) {
|
||||
$ident = '';
|
||||
} else {
|
||||
@@ -3707,16 +3917,18 @@ class PHPMailer
|
||||
$this->DKIM_selector .
|
||||
";\r\n" .
|
||||
"\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
|
||||
"\th=From:To:Subject;\r\n" .
|
||||
"\th=From:To:Date:Subject;\r\n" .
|
||||
"\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
|
||||
"\tz=$from\r\n" .
|
||||
"\t|$to\r\n" .
|
||||
"\t|$date\r\n" .
|
||||
"\t|$subject;\r\n" .
|
||||
"\tbh=" . $DKIMb64 . ";\r\n" .
|
||||
"\tb=";
|
||||
$toSign = $this->DKIM_HeaderC(
|
||||
$from_header . "\r\n" .
|
||||
$to_header . "\r\n" .
|
||||
$date_header . "\r\n" .
|
||||
$subject_header . "\r\n" .
|
||||
$dkimhdrs
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ class SMTP
|
||||
* The PHPMailer SMTP version number.
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '5.2.14';
|
||||
const VERSION = '5.2.22';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@@ -81,7 +81,7 @@ class SMTP
|
||||
* @deprecated Use the `VERSION` constant instead
|
||||
* @see SMTP::VERSION
|
||||
*/
|
||||
public $Version = '5.2.14';
|
||||
public $Version = '5.2.22';
|
||||
|
||||
/**
|
||||
* SMTP server port number.
|
||||
@@ -150,6 +150,17 @@ class SMTP
|
||||
*/
|
||||
public $Timelimit = 300;
|
||||
|
||||
/**
|
||||
* @var array patterns to extract smtp transaction id from smtp reply
|
||||
* Only first capture group will be use, use non-capturing group to deal with it
|
||||
* Extend this class to override this property to fulfil your needs.
|
||||
*/
|
||||
protected $smtp_transaction_id_patterns = array(
|
||||
'exim' => '/[0-9]{3} OK id=(.*)/',
|
||||
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
|
||||
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
|
||||
);
|
||||
|
||||
/**
|
||||
* The socket for the server connection.
|
||||
* @var resource
|
||||
@@ -206,7 +217,7 @@ class SMTP
|
||||
}
|
||||
//Avoid clash with built-in function names
|
||||
if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
|
||||
call_user_func($this->Debugoutput, $str, $this->do_debug);
|
||||
call_user_func($this->Debugoutput, $str, $level);
|
||||
return;
|
||||
}
|
||||
switch ($this->Debugoutput) {
|
||||
@@ -272,8 +283,8 @@ class SMTP
|
||||
$errstr = '';
|
||||
if ($streamok) {
|
||||
$socket_context = stream_context_create($options);
|
||||
//Suppress errors; connection failures are handled at a higher level
|
||||
$this->smtp_conn = @stream_socket_client(
|
||||
set_error_handler(array($this, 'errorHandler'));
|
||||
$this->smtp_conn = stream_socket_client(
|
||||
$host . ":" . $port,
|
||||
$errno,
|
||||
$errstr,
|
||||
@@ -281,12 +292,14 @@ class SMTP
|
||||
STREAM_CLIENT_CONNECT,
|
||||
$socket_context
|
||||
);
|
||||
restore_error_handler();
|
||||
} else {
|
||||
//Fall back to fsockopen which should work in more places, but is missing some features
|
||||
$this->edebug(
|
||||
"Connection: stream_socket_client not available, falling back to fsockopen",
|
||||
self::DEBUG_CONNECTION
|
||||
);
|
||||
set_error_handler(array($this, 'errorHandler'));
|
||||
$this->smtp_conn = fsockopen(
|
||||
$host,
|
||||
$port,
|
||||
@@ -294,6 +307,7 @@ class SMTP
|
||||
$errstr,
|
||||
$timeout
|
||||
);
|
||||
restore_error_handler();
|
||||
}
|
||||
// Verify we connected properly
|
||||
if (!is_resource($this->smtp_conn)) {
|
||||
@@ -336,11 +350,22 @@ class SMTP
|
||||
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Allow the best TLS version(s) we can
|
||||
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
|
||||
|
||||
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
|
||||
//so add them back in manually if we can
|
||||
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
|
||||
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
|
||||
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
|
||||
}
|
||||
|
||||
// Begin encrypted connection
|
||||
if (!stream_socket_enable_crypto(
|
||||
$this->smtp_conn,
|
||||
true,
|
||||
STREAM_CRYPTO_METHOD_TLS_CLIENT
|
||||
$crypto_method
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
@@ -353,7 +378,7 @@ class SMTP
|
||||
* @see hello()
|
||||
* @param string $username The user name
|
||||
* @param string $password The password
|
||||
* @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2)
|
||||
* @param string $authtype The auth type (PLAIN, LOGIN, CRAM-MD5)
|
||||
* @param string $realm The auth realm for NTLM
|
||||
* @param string $workstation The auth workstation for NTLM
|
||||
* @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth)
|
||||
@@ -389,7 +414,7 @@ class SMTP
|
||||
);
|
||||
|
||||
if (empty($authtype)) {
|
||||
foreach (array('LOGIN', 'CRAM-MD5', 'PLAIN') as $method) {
|
||||
foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN') as $method) {
|
||||
if (in_array($method, $this->server_caps['AUTH'])) {
|
||||
$authtype = $method;
|
||||
break;
|
||||
@@ -673,7 +698,7 @@ class SMTP
|
||||
protected function parseHelloFields($type)
|
||||
{
|
||||
$this->server_caps = array();
|
||||
$lines = explode("\n", $this->last_reply);
|
||||
$lines = explode("\n", $this->helo_rply);
|
||||
|
||||
foreach ($lines as $n => $s) {
|
||||
//First 4 chars contain response code followed by - or space
|
||||
@@ -1115,4 +1140,47 @@ class SMTP
|
||||
{
|
||||
return $this->Timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports an error number and string.
|
||||
* @param integer $errno The error number returned by PHP.
|
||||
* @param string $errmsg The error message returned by PHP.
|
||||
*/
|
||||
protected function errorHandler($errno, $errmsg)
|
||||
{
|
||||
$notice = 'Connection: Failed to connect to server.';
|
||||
$this->setError(
|
||||
$notice,
|
||||
$errno,
|
||||
$errmsg
|
||||
);
|
||||
$this->edebug(
|
||||
$notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
|
||||
self::DEBUG_CONNECTION
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the ID of the last smtp transaction based on a list of patterns provided
|
||||
* in SMTP::$smtp_transaction_id_patterns.
|
||||
* If no reply has been received yet, it will return null.
|
||||
* If no pattern has been matched, it will return false.
|
||||
* @return bool|null|string
|
||||
*/
|
||||
public function getLastTransactionID()
|
||||
{
|
||||
$reply = $this->getLastReply();
|
||||
|
||||
if (empty($reply)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
|
||||
if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
|
||||
return $matches[1];
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,12 +191,11 @@ final class WP_Comment {
|
||||
public static function get_instance( $id ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! is_numeric( $id ) || $id != floor( $id ) || ! $id ) {
|
||||
$comment_id = (int) $id;
|
||||
if ( ! $comment_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$comment_id = (int) $id;
|
||||
|
||||
$_comment = wp_cache_get( $comment_id, 'comment' );
|
||||
|
||||
if ( ! $_comment ) {
|
||||
|
||||
@@ -794,11 +794,12 @@ final class WP_Customize_Manager {
|
||||
'post_type' => 'customize_changeset',
|
||||
'post_status' => get_post_stati(),
|
||||
'name' => $uuid,
|
||||
'number' => 1,
|
||||
'posts_per_page' => 1,
|
||||
'no_found_rows' => true,
|
||||
'cache_results' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_term_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'lazy_load_term_meta' => false,
|
||||
) );
|
||||
if ( ! empty( $changeset_post_query->posts ) ) {
|
||||
// Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed.
|
||||
@@ -971,63 +972,75 @@ final class WP_Customize_Manager {
|
||||
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, $changeset_data['nav_menus_created_posts']['value'] );
|
||||
}
|
||||
|
||||
// Make an index of all the posts needed and what their slugs are.
|
||||
$needed_posts = array();
|
||||
$attachments = $this->prepare_starter_content_attachments( $attachments );
|
||||
foreach ( $attachments as $attachment ) {
|
||||
$key = 'attachment:' . $attachment['post_name'];
|
||||
$needed_posts[ $key ] = true;
|
||||
}
|
||||
foreach ( array_keys( $posts ) as $post_symbol ) {
|
||||
if ( empty( $posts[ $post_symbol ]['post_name'] ) && empty( $posts[ $post_symbol ]['post_title'] ) ) {
|
||||
unset( $posts[ $post_symbol ] );
|
||||
continue;
|
||||
}
|
||||
if ( empty( $posts[ $post_symbol ]['post_name'] ) ) {
|
||||
$posts[ $post_symbol ]['post_name'] = sanitize_title( $posts[ $post_symbol ]['post_title'] );
|
||||
}
|
||||
if ( empty( $posts[ $post_symbol ]['post_type'] ) ) {
|
||||
$posts[ $post_symbol ]['post_type'] = 'post';
|
||||
}
|
||||
$needed_posts[ $posts[ $post_symbol ]['post_type'] . ':' . $posts[ $post_symbol ]['post_name'] ] = true;
|
||||
}
|
||||
$all_post_slugs = array_merge(
|
||||
wp_list_pluck( $attachments, 'post_name' ),
|
||||
wp_list_pluck( $posts, 'post_name' )
|
||||
);
|
||||
|
||||
// Re-use auto-draft starter content posts referenced in the current customized state.
|
||||
$existing_starter_content_posts = array();
|
||||
if ( ! empty( $starter_content_auto_draft_post_ids ) ) {
|
||||
$existing_posts_query = new WP_Query( array(
|
||||
'post__in' => $starter_content_auto_draft_post_ids,
|
||||
'post_status' => 'auto-draft',
|
||||
'post_type' => 'any',
|
||||
'number' => -1,
|
||||
'posts_per_page' => -1,
|
||||
) );
|
||||
foreach ( $existing_posts_query->posts as $existing_post ) {
|
||||
$existing_starter_content_posts[ $existing_post->post_type . ':' . $existing_post->post_name ] = $existing_post;
|
||||
$post_name = $existing_post->post_name;
|
||||
if ( empty( $post_name ) ) {
|
||||
$post_name = get_post_meta( $existing_post->ID, '_customize_draft_post_name', true );
|
||||
}
|
||||
$existing_starter_content_posts[ $existing_post->post_type . ':' . $post_name ] = $existing_post;
|
||||
}
|
||||
}
|
||||
|
||||
// Re-use non-auto-draft posts.
|
||||
if ( ! empty( $all_post_slugs ) ) {
|
||||
$existing_posts_query = new WP_Query( array(
|
||||
'post_name__in' => $all_post_slugs,
|
||||
'post_status' => array_diff( get_post_stati(), array( 'auto-draft' ) ),
|
||||
'post_type' => 'any',
|
||||
'posts_per_page' => -1,
|
||||
) );
|
||||
foreach ( $existing_posts_query->posts as $existing_post ) {
|
||||
$key = $existing_post->post_type . ':' . $existing_post->post_name;
|
||||
if ( isset( $needed_posts[ $key ] ) && ! isset( $existing_starter_content_posts[ $key ] ) ) {
|
||||
$existing_starter_content_posts[ $key ] = $existing_post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Attachments are technically posts but handled differently.
|
||||
if ( ! empty( $attachments ) ) {
|
||||
// Such is The WordPress Way.
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
||||
|
||||
$attachment_ids = array();
|
||||
|
||||
foreach ( $attachments as $symbol => $attachment ) {
|
||||
|
||||
// A file is required and URLs to files are not currently allowed.
|
||||
if ( empty( $attachment['file'] ) || preg_match( '#^https?://$#', $attachment['file'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_array = array();
|
||||
$file_path = null;
|
||||
if ( file_exists( $attachment['file'] ) ) {
|
||||
$file_path = $attachment['file']; // Could be absolute path to file in plugin.
|
||||
} elseif ( is_child_theme() && file_exists( get_stylesheet_directory() . '/' . $attachment['file'] ) ) {
|
||||
$file_path = get_stylesheet_directory() . '/' . $attachment['file'];
|
||||
} elseif ( file_exists( get_template_directory() . '/' . $attachment['file'] ) ) {
|
||||
$file_path = get_template_directory() . '/' . $attachment['file'];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
$file_array['name'] = basename( $attachment['file'] );
|
||||
|
||||
// Skip file types that are not recognized.
|
||||
$checked_filetype = wp_check_filetype( $file_array['name'] );
|
||||
if ( empty( $checked_filetype['type'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure post_name is set since not automatically derived from post_title for new auto-draft posts.
|
||||
if ( empty( $attachment['post_name'] ) ) {
|
||||
if ( ! empty( $attachment['post_title'] ) ) {
|
||||
$attachment['post_name'] = sanitize_title( $attachment['post_title'] );
|
||||
} else {
|
||||
$attachment['post_name'] = sanitize_title( preg_replace( '/\.\w+$/', '', $file_array['name'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$file_array = array(
|
||||
'name' => $attachment['file_name'],
|
||||
);
|
||||
$file_path = $attachment['file_path'];
|
||||
$attachment_id = null;
|
||||
$attached_file = null;
|
||||
if ( isset( $existing_starter_content_posts[ 'attachment:' . $attachment['post_name'] ] ) ) {
|
||||
@@ -1059,7 +1072,7 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
|
||||
$attachment_post_data = array_merge(
|
||||
wp_array_slice_assoc( $attachment, array( 'post_title', 'post_content', 'post_excerpt', 'post_name' ) ),
|
||||
wp_array_slice_assoc( $attachment, array( 'post_title', 'post_content', 'post_excerpt' ) ),
|
||||
array(
|
||||
'post_status' => 'auto-draft', // So attachment will be garbage collected in a week if changeset is never published.
|
||||
)
|
||||
@@ -1077,17 +1090,18 @@ final class WP_Customize_Manager {
|
||||
continue;
|
||||
}
|
||||
update_post_meta( $attachment_id, '_starter_content_theme', $this->get_stylesheet() );
|
||||
update_post_meta( $attachment_id, '_customize_draft_post_name', $attachment['post_name'] );
|
||||
}
|
||||
|
||||
$attachment_ids[ $symbol ] = $attachment_id;
|
||||
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, array_values( $attachment_ids ) );
|
||||
}
|
||||
$starter_content_auto_draft_post_ids = array_merge( $starter_content_auto_draft_post_ids, array_values( $attachment_ids ) );
|
||||
}
|
||||
|
||||
// Posts & pages.
|
||||
if ( ! empty( $posts ) ) {
|
||||
foreach ( array_keys( $posts ) as $post_symbol ) {
|
||||
if ( empty( $posts[ $post_symbol ]['post_type'] ) ) {
|
||||
if ( empty( $posts[ $post_symbol ]['post_type'] ) || empty( $posts[ $post_symbol ]['post_name'] ) ) {
|
||||
continue;
|
||||
}
|
||||
$post_type = $posts[ $post_symbol ]['post_type'];
|
||||
@@ -1209,8 +1223,14 @@ final class WP_Customize_Manager {
|
||||
|
||||
// Options.
|
||||
foreach ( $options as $name => $value ) {
|
||||
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) && isset( $posts[ $matches['symbol'] ] ) ) {
|
||||
$value = $posts[ $matches['symbol'] ]['ID'];
|
||||
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
|
||||
if ( isset( $posts[ $matches['symbol'] ] ) ) {
|
||||
$value = $posts[ $matches['symbol'] ]['ID'];
|
||||
} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
|
||||
$value = $attachment_ids[ $matches['symbol'] ];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {
|
||||
@@ -1221,8 +1241,31 @@ final class WP_Customize_Manager {
|
||||
|
||||
// Theme mods.
|
||||
foreach ( $theme_mods as $name => $value ) {
|
||||
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) && isset( $posts[ $matches['symbol'] ] ) ) {
|
||||
$value = $posts[ $matches['symbol'] ]['ID'];
|
||||
if ( preg_match( '/^{{(?P<symbol>.+)}}$/', $value, $matches ) ) {
|
||||
if ( isset( $posts[ $matches['symbol'] ] ) ) {
|
||||
$value = $posts[ $matches['symbol'] ]['ID'];
|
||||
} elseif ( isset( $attachment_ids[ $matches['symbol'] ] ) ) {
|
||||
$value = $attachment_ids[ $matches['symbol'] ];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle header image as special case since setting has a legacy format.
|
||||
if ( 'header_image' === $name ) {
|
||||
$name = 'header_image_data';
|
||||
$metadata = wp_get_attachment_metadata( $value );
|
||||
if ( empty( $metadata ) ) {
|
||||
continue;
|
||||
}
|
||||
$value = array(
|
||||
'attachment_id' => $value,
|
||||
'url' => wp_get_attachment_url( $value ),
|
||||
'height' => $metadata['height'],
|
||||
'width' => $metadata['width'],
|
||||
);
|
||||
} elseif ( 'background_image' === $name ) {
|
||||
$value = wp_get_attachment_url( $value );
|
||||
}
|
||||
|
||||
if ( empty( $changeset_data[ $name ] ) || ! empty( $changeset_data[ $name ]['starter_content'] ) ) {
|
||||
@@ -1240,6 +1283,69 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare starter content attachments.
|
||||
*
|
||||
* Ensure that the attachments are valid and that they have slugs and file name/path.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
*
|
||||
* @param array $attachments Attachments.
|
||||
* @return array Prepared attachments.
|
||||
*/
|
||||
protected function prepare_starter_content_attachments( $attachments ) {
|
||||
$prepared_attachments = array();
|
||||
if ( empty( $attachments ) ) {
|
||||
return $prepared_attachments;
|
||||
}
|
||||
|
||||
// Such is The WordPress Way.
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
||||
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
||||
|
||||
foreach ( $attachments as $symbol => $attachment ) {
|
||||
|
||||
// A file is required and URLs to files are not currently allowed.
|
||||
if ( empty( $attachment['file'] ) || preg_match( '#^https?://$#', $attachment['file'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$file_path = null;
|
||||
if ( file_exists( $attachment['file'] ) ) {
|
||||
$file_path = $attachment['file']; // Could be absolute path to file in plugin.
|
||||
} elseif ( is_child_theme() && file_exists( get_stylesheet_directory() . '/' . $attachment['file'] ) ) {
|
||||
$file_path = get_stylesheet_directory() . '/' . $attachment['file'];
|
||||
} elseif ( file_exists( get_template_directory() . '/' . $attachment['file'] ) ) {
|
||||
$file_path = get_template_directory() . '/' . $attachment['file'];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
$file_name = basename( $attachment['file'] );
|
||||
|
||||
// Skip file types that are not recognized.
|
||||
$checked_filetype = wp_check_filetype( $file_name );
|
||||
if ( empty( $checked_filetype['type'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ensure post_name is set since not automatically derived from post_title for new auto-draft posts.
|
||||
if ( empty( $attachment['post_name'] ) ) {
|
||||
if ( ! empty( $attachment['post_title'] ) ) {
|
||||
$attachment['post_name'] = sanitize_title( $attachment['post_title'] );
|
||||
} else {
|
||||
$attachment['post_name'] = sanitize_title( preg_replace( '/\.\w+$/', '', $file_name ) );
|
||||
}
|
||||
}
|
||||
|
||||
$attachment['file_name'] = $file_name;
|
||||
$attachment['file_path'] = $file_path;
|
||||
$prepared_attachments[ $symbol ] = $attachment;
|
||||
}
|
||||
return $prepared_attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save starter content changeset.
|
||||
*
|
||||
@@ -1671,6 +1777,17 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
$allowed_hosts[] = $host;
|
||||
}
|
||||
|
||||
$switched_locale = switch_to_locale( get_user_locale() );
|
||||
$l10n = array(
|
||||
'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
|
||||
'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
|
||||
'formUnpreviewable' => __( 'This form is not live-previewable.' ),
|
||||
);
|
||||
if ( $switched_locale ) {
|
||||
restore_previous_locale();
|
||||
}
|
||||
|
||||
$settings = array(
|
||||
'changeset' => array(
|
||||
'uuid' => $this->_changeset_uuid,
|
||||
@@ -1695,11 +1812,7 @@ final class WP_Customize_Manager {
|
||||
'activeControls' => array(),
|
||||
'settingValidities' => $exported_setting_validities,
|
||||
'nonce' => current_user_can( 'customize' ) ? $this->get_nonces() : array(),
|
||||
'l10n' => array(
|
||||
'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
|
||||
'linkUnpreviewable' => __( 'This link is not live-previewable.' ),
|
||||
'formUnpreviewable' => __( 'This form is not live-previewable.' ),
|
||||
),
|
||||
'l10n' => $l10n,
|
||||
'_dirty' => array_keys( $post_values ),
|
||||
);
|
||||
|
||||
@@ -1961,10 +2074,6 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
|
||||
$changeset_post_id = $this->changeset_post_id();
|
||||
if ( $changeset_post_id && in_array( get_post_status( $changeset_post_id ), array( 'publish', 'trash' ) ) ) {
|
||||
wp_send_json_error( 'changeset_already_published' );
|
||||
}
|
||||
|
||||
if ( empty( $changeset_post_id ) ) {
|
||||
if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->create_posts ) ) {
|
||||
wp_send_json_error( 'cannot_create_changeset_post' );
|
||||
@@ -1999,13 +2108,8 @@ final class WP_Customize_Manager {
|
||||
wp_send_json_error( 'bad_customize_changeset_status', 400 );
|
||||
}
|
||||
$is_publish = ( 'publish' === $changeset_status || 'future' === $changeset_status );
|
||||
if ( $is_publish ) {
|
||||
if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ) ) {
|
||||
wp_send_json_error( 'changeset_publish_unauthorized', 403 );
|
||||
}
|
||||
if ( false === has_action( 'transition_post_status', '_wp_customize_publish_changeset' ) ) {
|
||||
wp_send_json_error( 'missing_publish_callback', 500 );
|
||||
}
|
||||
if ( $is_publish && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->publish_posts ) ) {
|
||||
wp_send_json_error( 'changeset_publish_unauthorized', 403 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2034,20 +2138,6 @@ final class WP_Customize_Manager {
|
||||
}
|
||||
$changeset_date_gmt = gmdate( 'Y-m-d H:i:s', $timestamp );
|
||||
}
|
||||
$now = gmdate( 'Y-m-d H:i:59' );
|
||||
|
||||
$is_future_dated = ( mysql2date( 'U', $changeset_date_gmt, false ) > mysql2date( 'U', $now, false ) );
|
||||
if ( ! $is_future_dated ) {
|
||||
wp_send_json_error( 'not_future_date', 400 ); // Only future dates are allowed.
|
||||
}
|
||||
|
||||
if ( ! $this->is_theme_active() && ( 'future' === $changeset_status || $is_future_dated ) ) {
|
||||
wp_send_json_error( 'cannot_schedule_theme_switches', 400 ); // This should be allowed in the future, when theme is a regular setting.
|
||||
}
|
||||
$will_remain_auto_draft = ( ! $changeset_status && ( ! $changeset_post_id || 'auto-draft' === get_post_status( $changeset_post_id ) ) );
|
||||
if ( $changeset_date && $will_remain_auto_draft ) {
|
||||
wp_send_json_error( 'cannot_supply_date_for_auto_draft_changeset', 400 );
|
||||
}
|
||||
}
|
||||
|
||||
$r = $this->save_changeset_post( array(
|
||||
@@ -2057,7 +2147,15 @@ final class WP_Customize_Manager {
|
||||
'data' => $input_changeset_data,
|
||||
) );
|
||||
if ( is_wp_error( $r ) ) {
|
||||
$response = $r->get_error_data();
|
||||
$response = array(
|
||||
'message' => $r->get_error_message(),
|
||||
'code' => $r->get_error_code(),
|
||||
);
|
||||
if ( is_array( $r->get_error_data() ) ) {
|
||||
$response = array_merge( $response, $r->get_error_data() );
|
||||
} else {
|
||||
$response['data'] = $r->get_error_data();
|
||||
}
|
||||
} else {
|
||||
$response = $r;
|
||||
|
||||
@@ -2132,9 +2230,43 @@ final class WP_Customize_Manager {
|
||||
$changeset_post_id = $this->changeset_post_id();
|
||||
$existing_changeset_data = array();
|
||||
if ( $changeset_post_id ) {
|
||||
$existing_status = get_post_status( $changeset_post_id );
|
||||
if ( 'publish' === $existing_status || 'trash' === $existing_status ) {
|
||||
return new WP_Error( 'changeset_already_published' );
|
||||
}
|
||||
|
||||
$existing_changeset_data = $this->get_changeset_post_data( $changeset_post_id );
|
||||
}
|
||||
|
||||
// Fail if attempting to publish but publish hook is missing.
|
||||
if ( 'publish' === $args['status'] && false === has_action( 'transition_post_status', '_wp_customize_publish_changeset' ) ) {
|
||||
return new WP_Error( 'missing_publish_callback' );
|
||||
}
|
||||
|
||||
// Validate date.
|
||||
$now = gmdate( 'Y-m-d H:i:59' );
|
||||
if ( $args['date_gmt'] ) {
|
||||
$is_future_dated = ( mysql2date( 'U', $args['date_gmt'], false ) > mysql2date( 'U', $now, false ) );
|
||||
if ( ! $is_future_dated ) {
|
||||
return new WP_Error( 'not_future_date' ); // Only future dates are allowed.
|
||||
}
|
||||
|
||||
if ( ! $this->is_theme_active() && ( 'future' === $args['status'] || $is_future_dated ) ) {
|
||||
return new WP_Error( 'cannot_schedule_theme_switches' ); // This should be allowed in the future, when theme is a regular setting.
|
||||
}
|
||||
$will_remain_auto_draft = ( ! $args['status'] && ( ! $changeset_post_id || 'auto-draft' === get_post_status( $changeset_post_id ) ) );
|
||||
if ( $will_remain_auto_draft ) {
|
||||
return new WP_Error( 'cannot_supply_date_for_auto_draft_changeset' );
|
||||
}
|
||||
} elseif ( $changeset_post_id && 'future' === $args['status'] ) {
|
||||
|
||||
// Fail if the new status is future but the existing post's date is not in the future.
|
||||
$changeset_post = get_post( $changeset_post_id );
|
||||
if ( mysql2date( 'U', $changeset_post->post_date_gmt, false ) <= mysql2date( 'U', $now, false ) ) {
|
||||
return new WP_Error( 'not_future_date' );
|
||||
}
|
||||
}
|
||||
|
||||
// The request was made via wp.customize.previewer.save().
|
||||
$update_transactionally = (bool) $args['status'];
|
||||
$allow_revision = (bool) $args['status'];
|
||||
@@ -2347,7 +2479,12 @@ final class WP_Customize_Manager {
|
||||
if ( $args['status'] ) {
|
||||
$post_array['post_status'] = $args['status'];
|
||||
}
|
||||
if ( $args['date_gmt'] ) {
|
||||
|
||||
// Reset post date to now if we are publishing, otherwise pass post_date_gmt and translate for post_date.
|
||||
if ( 'publish' === $args['status'] ) {
|
||||
$post_array['post_date_gmt'] = '0000-00-00 00:00:00';
|
||||
$post_array['post_date'] = '0000-00-00 00:00:00';
|
||||
} elseif ( $args['date_gmt'] ) {
|
||||
$post_array['post_date_gmt'] = $args['date_gmt'];
|
||||
$post_array['post_date'] = get_date_from_gmt( $args['date_gmt'] );
|
||||
}
|
||||
@@ -3760,7 +3897,7 @@ final class WP_Customize_Manager {
|
||||
$this->add_setting( 'external_header_video', array(
|
||||
'theme_supports' => array( 'custom-header', 'video' ),
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'sanitize_callback' => array( $this, '_sanitize_external_header_video' ),
|
||||
'validate_callback' => array( $this, '_validate_external_header_video' ),
|
||||
) );
|
||||
|
||||
@@ -3988,7 +4125,7 @@ final class WP_Customize_Manager {
|
||||
'description_hidden' => true,
|
||||
'description' => sprintf( '%s<br /><a href="%s" class="external-link" target="_blank">%s<span class="screen-reader-text">%s</span></a>',
|
||||
__( 'CSS allows you to customize the appearance and layout of your site with code. Separate CSS is saved for each of your themes. In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.' ),
|
||||
esc_url( __( 'https://codex.wordpress.org/Know_Your_Sources#CSS' ) ),
|
||||
esc_url( __( 'https://codex.wordpress.org/CSS' ) ),
|
||||
__( 'Learn more about CSS' ),
|
||||
__( '(link opens in a new window)' )
|
||||
),
|
||||
@@ -4004,6 +4141,9 @@ final class WP_Customize_Manager {
|
||||
'type' => 'textarea',
|
||||
'section' => 'custom_css',
|
||||
'settings' => array( 'default' => $custom_css_setting->id ),
|
||||
'input_attrs' => array(
|
||||
'class' => 'code', // Ensures contents displayed as LTR instead of RTL.
|
||||
),
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -4179,6 +4319,18 @@ final class WP_Customize_Manager {
|
||||
return $validity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for sanitizing the external_header_video value.
|
||||
*
|
||||
* @since 4.7.1
|
||||
*
|
||||
* @param string $value URL.
|
||||
* @return string Sanitized URL.
|
||||
*/
|
||||
public function _sanitize_external_header_video( $value ) {
|
||||
return esc_url_raw( trim( $value ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for rendering the custom logo, used in the custom_logo partial.
|
||||
*
|
||||
|
||||
@@ -531,10 +531,7 @@ final class WP_Customize_Nav_Menus {
|
||||
*/
|
||||
public function customize_register() {
|
||||
|
||||
/*
|
||||
* Preview settings for nav menus early so that the sections and controls will be added properly.
|
||||
* See https://github.com/xwp/wp-customize-snapshots/blob/962586659688a5b1fd9ae93618b7ce2d4e7a421c/php/class-customize-snapshot-manager.php#L506-L543
|
||||
*/
|
||||
// Preview settings for nav menus early so that the sections and controls will be added properly.
|
||||
$nav_menus_setting_ids = array();
|
||||
foreach ( array_keys( $this->manager->unsanitized_post_values() ) as $setting_id ) {
|
||||
if ( preg_match( '/^(nav_menu_locations|nav_menu|nav_menu_item)\[/', $setting_id ) ) {
|
||||
@@ -542,10 +539,12 @@ final class WP_Customize_Nav_Menus {
|
||||
}
|
||||
}
|
||||
$this->manager->add_dynamic_settings( $nav_menus_setting_ids );
|
||||
foreach ( $nav_menus_setting_ids as $setting_id ) {
|
||||
$setting = $this->manager->get_setting( $setting_id );
|
||||
if ( $setting ) {
|
||||
$setting->preview();
|
||||
if ( ! $this->manager->doing_ajax( 'customize_save' ) ) {
|
||||
foreach ( $nav_menus_setting_ids as $setting_id ) {
|
||||
$setting = $this->manager->get_setting( $setting_id );
|
||||
if ( $setting ) {
|
||||
$setting->preview();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -803,6 +802,11 @@ final class WP_Customize_Nav_Menus {
|
||||
if ( empty( $postarr['post_name'] ) ) {
|
||||
$postarr['post_name'] = sanitize_title( $postarr['post_title'] );
|
||||
}
|
||||
if ( ! isset( $postarr['meta_input'] ) ) {
|
||||
$postarr['meta_input'] = array();
|
||||
}
|
||||
$postarr['meta_input']['_customize_draft_post_name'] = $postarr['post_name'];
|
||||
unset( $postarr['post_name'] );
|
||||
|
||||
add_filter( 'wp_insert_post_empty_content', '__return_false', 1000 );
|
||||
$r = wp_insert_post( wp_slash( $postarr ), true );
|
||||
@@ -1192,9 +1196,19 @@ final class WP_Customize_Nav_Menus {
|
||||
if ( ! empty( $post_ids ) ) {
|
||||
foreach ( $post_ids as $post_id ) {
|
||||
$target_status = 'attachment' === get_post_type( $post_id ) ? 'inherit' : 'publish';
|
||||
$args = array(
|
||||
'ID' => $post_id,
|
||||
'post_status' => $target_status,
|
||||
);
|
||||
$post_name = get_post_meta( $post_id, '_customize_draft_post_name', true );
|
||||
if ( $post_name ) {
|
||||
$args['post_name'] = $post_name;
|
||||
}
|
||||
|
||||
// Note that wp_publish_post() cannot be used because unique slugs need to be assigned.
|
||||
wp_update_post( array( 'ID' => $post_id, 'post_status' => $target_status ) );
|
||||
wp_update_post( wp_slash( $args ) );
|
||||
|
||||
delete_post_meta( $post_id, '_customize_draft_post_name' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1123,15 +1123,21 @@ final class WP_Customize_Widgets {
|
||||
public function export_preview_data() {
|
||||
global $wp_registered_sidebars, $wp_registered_widgets;
|
||||
|
||||
$switched_locale = switch_to_locale( get_user_locale() );
|
||||
$l10n = array(
|
||||
'widgetTooltip' => __( 'Shift-click to edit this widget.' ),
|
||||
);
|
||||
if ( $switched_locale ) {
|
||||
restore_previous_locale();
|
||||
}
|
||||
|
||||
// Prepare Customizer settings to pass to JavaScript.
|
||||
$settings = array(
|
||||
'renderedSidebars' => array_fill_keys( array_unique( $this->rendered_sidebars ), true ),
|
||||
'renderedWidgets' => array_fill_keys( array_keys( $this->rendered_widgets ), true ),
|
||||
'registeredSidebars' => array_values( $wp_registered_sidebars ),
|
||||
'registeredWidgets' => $wp_registered_widgets,
|
||||
'l10n' => array(
|
||||
'widgetTooltip' => __( 'Shift-click to edit this widget.' ),
|
||||
),
|
||||
'l10n' => $l10n,
|
||||
'selectiveRefreshableWidgets' => $this->get_selective_refreshable_widgets(),
|
||||
);
|
||||
foreach ( $settings['registeredWidgets'] as &$registered_widget ) {
|
||||
|
||||
@@ -681,8 +681,10 @@ final class _WP_Editors {
|
||||
$body_class .= ' post-format-standard';
|
||||
}
|
||||
|
||||
if ( $page_template = get_page_template_slug( $post ) ) {
|
||||
$page_template = str_replace( '.', '-', basename( $page_template, '.php' ) );
|
||||
$page_template = get_page_template_slug( $post );
|
||||
|
||||
if ( $page_template !== false ) {
|
||||
$page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );
|
||||
$body_class .= ' page-template-' . sanitize_html_class( $page_template );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,6 +351,22 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
||||
$this->nesting_level--;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current priority level of the currently running iteration of the hook.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @return int|false If the hook is running, return the current priority level. If it isn't running, return false.
|
||||
*/
|
||||
public function current_priority() {
|
||||
if ( false === current( $this->iterations ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return current( current( $this->iterations ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes filters set up before WordPress has initialized to WP_Hook objects.
|
||||
*
|
||||
|
||||
@@ -146,10 +146,10 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
||||
|
||||
try {
|
||||
$this->image = new Imagick();
|
||||
$file_parts = pathinfo( $this->file );
|
||||
$file_extension = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
|
||||
$filename = $this->file;
|
||||
|
||||
if ( 'pdf' == strtolower( $file_parts['extension'] ) ) {
|
||||
if ( 'pdf' == $file_extension ) {
|
||||
$filename = $this->pdf_setup();
|
||||
}
|
||||
|
||||
|
||||
@@ -210,12 +210,11 @@ final class WP_Post {
|
||||
public static function get_instance( $post_id ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! is_numeric( $post_id ) || $post_id != floor( $post_id ) || ! $post_id ) {
|
||||
$post_id = (int) $post_id;
|
||||
if ( ! $post_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$post_id = (int) $post_id;
|
||||
|
||||
$_post = wp_cache_get( $post_id, 'posts' );
|
||||
|
||||
if ( ! $_post ) {
|
||||
|
||||
@@ -2255,12 +2255,12 @@ class WP_Query {
|
||||
if ( empty( $in_search_post_types ) ) {
|
||||
$where .= ' AND 1=0 ';
|
||||
} else {
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", $in_search_post_types ) . "')";
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')";
|
||||
}
|
||||
} elseif ( !empty( $post_type ) && is_array( $post_type ) ) {
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", $post_type) . "')";
|
||||
$where .= " AND {$wpdb->posts}.post_type IN ('" . join("', '", esc_sql( $post_type ) ) . "')";
|
||||
} elseif ( ! empty( $post_type ) ) {
|
||||
$where .= " AND {$wpdb->posts}.post_type = '$post_type'";
|
||||
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type );
|
||||
$post_type_object = get_post_type_object ( $post_type );
|
||||
} elseif ( $this->is_attachment ) {
|
||||
$where .= " AND {$wpdb->posts}.post_type = 'attachment'";
|
||||
|
||||
@@ -125,12 +125,11 @@ final class WP_Term {
|
||||
public static function get_instance( $term_id, $taxonomy = null ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! is_numeric( $term_id ) || $term_id != floor( $term_id ) || ! $term_id ) {
|
||||
$term_id = (int) $term_id;
|
||||
if ( ! $term_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$term_id = (int) $term_id;
|
||||
|
||||
$_term = wp_cache_get( $term_id, 'terms' );
|
||||
|
||||
// If there isn't a cached version, hit the database.
|
||||
|
||||
@@ -721,8 +721,9 @@ final class WP_Theme implements ArrayAccess {
|
||||
private function markup_header( $header, $value, $translate ) {
|
||||
switch ( $header ) {
|
||||
case 'Name' :
|
||||
if ( empty( $value ) )
|
||||
$value = $this->get_stylesheet();
|
||||
if ( empty( $value ) ) {
|
||||
$value = esc_html( $this->get_stylesheet() );
|
||||
}
|
||||
break;
|
||||
case 'Description' :
|
||||
$value = wptexturize( $value );
|
||||
|
||||
@@ -1003,12 +1003,6 @@ function get_page_of_comment( $comment_ID, $args = array() ) {
|
||||
if ( $args['max_depth'] > 1 && 0 != $comment->comment_parent )
|
||||
return get_page_of_comment( $comment->comment_parent, $args );
|
||||
|
||||
if ( 'desc' === get_option( 'comment_order' ) ) {
|
||||
$compare = 'after';
|
||||
} else {
|
||||
$compare = 'before';
|
||||
}
|
||||
|
||||
$comment_args = array(
|
||||
'type' => $args['type'],
|
||||
'post_id' => $comment->comment_post_ID,
|
||||
@@ -1019,7 +1013,7 @@ function get_page_of_comment( $comment_ID, $args = array() ) {
|
||||
'date_query' => array(
|
||||
array(
|
||||
'column' => "$wpdb->comments.comment_date_gmt",
|
||||
$compare => $comment->comment_date_gmt,
|
||||
'before' => $comment->comment_date_gmt,
|
||||
)
|
||||
),
|
||||
);
|
||||
@@ -2186,8 +2180,6 @@ function wp_update_comment($commentarr) {
|
||||
|
||||
$comment_ID = $data['comment_ID'];
|
||||
$comment_post_ID = $data['comment_post_ID'];
|
||||
$keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );
|
||||
$data = wp_array_slice_assoc( $data, $keys );
|
||||
|
||||
/**
|
||||
* Filters the comment data immediately before it is updated in the database.
|
||||
@@ -2202,6 +2194,9 @@ function wp_update_comment($commentarr) {
|
||||
*/
|
||||
$data = apply_filters( 'wp_update_comment_data', $data, $comment, $commentarr );
|
||||
|
||||
$keys = array( 'comment_post_ID', 'comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt', 'comment_type', 'comment_parent', 'user_id', 'comment_agent', 'comment_author_IP' );
|
||||
$data = wp_array_slice_assoc( $data, $keys );
|
||||
|
||||
$rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) );
|
||||
|
||||
clean_comment_cache( $comment_ID );
|
||||
@@ -3059,7 +3054,7 @@ function wp_handle_comment_submission( $comment_data ) {
|
||||
}
|
||||
} else {
|
||||
if ( get_option( 'comment_registration' ) ) {
|
||||
return new WP_Error( 'not_logged_in', __( 'Sorry, you must be logged in to post a comment.' ), 403 );
|
||||
return new WP_Error( 'not_logged_in', __( 'Sorry, you must be logged in to comment.' ), 403 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -252,14 +252,6 @@ body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut bu
|
||||
}
|
||||
|
||||
@media screen and (max-width:320px) {
|
||||
body.customize-partial-edit-shortcuts-shown .site-title {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
body.customize-partial-edit-shortcuts-shown .widget-area .widget {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.widget .customize-partial-edit-shortcut button,
|
||||
.customize-partial-edit-shortcut button {
|
||||
right: -30px;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -252,14 +252,6 @@ body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut bu
|
||||
}
|
||||
|
||||
@media screen and (max-width:320px) {
|
||||
body.customize-partial-edit-shortcuts-shown .site-title {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
body.customize-partial-edit-shortcuts-shown .widget-area .widget {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.widget .customize-partial-edit-shortcut button,
|
||||
.customize-partial-edit-shortcut button {
|
||||
left: -30px;
|
||||
|
||||
2
wp-includes/css/customize-preview.min.css
vendored
2
wp-includes/css/customize-preview.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -858,6 +858,11 @@ div.mce-menu .mce-menu-item-sep,
|
||||
border-right-color: #23282d;
|
||||
}
|
||||
|
||||
div.mce-notification {
|
||||
right: 10% !important;
|
||||
left: 10%;
|
||||
}
|
||||
|
||||
.mce-notification button.mce-close {
|
||||
left: 6px;
|
||||
top: 3px;
|
||||
|
||||
2
wp-includes/css/editor-rtl.min.css
vendored
2
wp-includes/css/editor-rtl.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -858,6 +858,11 @@ div.mce-menu .mce-menu-item-sep,
|
||||
border-left-color: #23282d;
|
||||
}
|
||||
|
||||
div.mce-notification {
|
||||
left: 10% !important;
|
||||
right: 10%;
|
||||
}
|
||||
|
||||
.mce-notification button.mce-close {
|
||||
right: 6px;
|
||||
top: 3px;
|
||||
|
||||
2
wp-includes/css/editor.min.css
vendored
2
wp-includes/css/editor.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -191,13 +191,7 @@ final class WP_Customize_Custom_CSS_Setting extends WP_Customize_Setting {
|
||||
$imbalanced = true;
|
||||
}
|
||||
|
||||
// Ensure single quotes are equal.
|
||||
if ( ! $this->validate_equal_characters( '\'', $css ) ) {
|
||||
$validity->add( 'unequal_single_quotes', __( 'Your single quotes <code>\'</code> are uneven. Make sure there is a closing <code>\'</code> for every opening <code>\'</code>.' ) );
|
||||
$imbalanced = true;
|
||||
}
|
||||
|
||||
// Ensure single quotes are equal.
|
||||
// Ensure double quotes are equal.
|
||||
if ( ! $this->validate_equal_characters( '"', $css ) ) {
|
||||
$validity->add( 'unequal_double_quotes', __( 'Your double quotes <code>"</code> are uneven. Make sure there is a closing <code>"</code> for every opening <code>"</code>.' ) );
|
||||
$imbalanced = true;
|
||||
|
||||
@@ -29,6 +29,15 @@ final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting {
|
||||
public function update( $value ) {
|
||||
global $custom_image_header;
|
||||
|
||||
// If _custom_header_background_just_in_time() fails to initialize $custom_image_header when not is_admin().
|
||||
if ( empty( $custom_image_header ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/custom-header.php' );
|
||||
$args = get_theme_support( 'custom-header' );
|
||||
$admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
|
||||
$admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
|
||||
$custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
|
||||
}
|
||||
|
||||
// If the value doesn't exist (removed or random),
|
||||
// use the header_image value.
|
||||
if ( ! $value )
|
||||
|
||||
@@ -233,6 +233,9 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
||||
} else {
|
||||
$value = $post_value;
|
||||
}
|
||||
if ( ! empty( $value ) && empty( $value['original_title'] ) ) {
|
||||
$value['original_title'] = $this->get_original_title( (object) $value );
|
||||
}
|
||||
} elseif ( isset( $this->value ) ) {
|
||||
$value = $this->value;
|
||||
} else {
|
||||
@@ -260,6 +263,10 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
||||
$value = $this->value;
|
||||
}
|
||||
|
||||
if ( ! empty( $value ) && empty( $value['type_label'] ) ) {
|
||||
$value['type_label'] = $this->get_type_label( (object) $value );
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
@@ -273,11 +280,8 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
||||
* @return string The original title.
|
||||
*/
|
||||
protected function get_original_title( $item ) {
|
||||
if ( empty( $item->object_id ) ) {
|
||||
return '';
|
||||
}
|
||||
$original_title = '';
|
||||
if ( 'post_type' === $item->type ) {
|
||||
if ( 'post_type' === $item->type && ! empty( $item->object_id ) ) {
|
||||
$original_object = get_post( $item->object_id );
|
||||
if ( $original_object ) {
|
||||
/** This filter is documented in wp-includes/post-template.php */
|
||||
@@ -288,16 +292,53 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
||||
$original_title = sprintf( __( '#%d (no title)' ), $original_object->ID );
|
||||
}
|
||||
}
|
||||
} elseif ( 'taxonomy' === $item->type ) {
|
||||
} elseif ( 'taxonomy' === $item->type && ! empty( $item->object_id ) ) {
|
||||
$original_term_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
|
||||
if ( ! is_wp_error( $original_term_title ) ) {
|
||||
$original_title = $original_term_title;
|
||||
}
|
||||
} elseif ( 'post_type_archive' === $item->type ) {
|
||||
$original_object = get_post_type_object( $item->object );
|
||||
if ( $original_object ) {
|
||||
$original_title = $original_object->labels->archives;
|
||||
}
|
||||
}
|
||||
$original_title = html_entity_decode( $original_title, ENT_QUOTES, get_bloginfo( 'charset' ) );
|
||||
return $original_title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type label.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access protected
|
||||
*
|
||||
* @param object $item Nav menu item.
|
||||
* @returns string The type label.
|
||||
*/
|
||||
protected function get_type_label( $item ) {
|
||||
if ( 'post_type' === $item->type ) {
|
||||
$object = get_post_type_object( $item->object );
|
||||
if ( $object ) {
|
||||
$type_label = $object->labels->singular_name;
|
||||
} else {
|
||||
$type_label = $item->object;
|
||||
}
|
||||
} elseif ( 'taxonomy' === $item->type ) {
|
||||
$object = get_taxonomy( $item->object );
|
||||
if ( $object ) {
|
||||
$type_label = $object->labels->singular_name;
|
||||
} else {
|
||||
$type_label = $item->object;
|
||||
}
|
||||
} elseif ( 'post_type_archive' === $item->type ) {
|
||||
$type_label = __( 'Post Type Archive' );
|
||||
} else {
|
||||
$type_label = __( 'Custom Link' );
|
||||
}
|
||||
return $type_label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the value is fully populated with the necessary properties.
|
||||
*
|
||||
@@ -584,34 +625,19 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
||||
}
|
||||
|
||||
if ( ! isset( $post->type_label ) ) {
|
||||
if ( 'post_type' === $post->type ) {
|
||||
$object = get_post_type_object( $post->object );
|
||||
if ( $object ) {
|
||||
$post->type_label = $object->labels->singular_name;
|
||||
} else {
|
||||
$post->type_label = $post->object;
|
||||
}
|
||||
} elseif ( 'taxonomy' === $post->type ) {
|
||||
$object = get_taxonomy( $post->object );
|
||||
if ( $object ) {
|
||||
$post->type_label = $object->labels->singular_name;
|
||||
} else {
|
||||
$post->type_label = $post->object;
|
||||
}
|
||||
} else {
|
||||
$post->type_label = __( 'Custom Link' );
|
||||
}
|
||||
$post->type_label = $this->get_type_label( $post );
|
||||
}
|
||||
|
||||
// Ensure nav menu item URL is set according to linked object.
|
||||
if ( ! empty( $post->object_id ) ) {
|
||||
if ( 'post_type' === $post->type ) {
|
||||
$post->url = get_permalink( $post->object_id );
|
||||
} elseif ( 'post_type_archive' === $post->type && ! empty( $post->object ) ) {
|
||||
$post->url = get_post_type_archive_link( $post->object );
|
||||
} elseif ( 'taxonomy' == $post->type && ! empty( $post->object ) ) {
|
||||
$post->url = get_term_link( (int) $post->object, $post->object );
|
||||
}
|
||||
if ( 'post_type' === $post->type && ! empty( $post->object_id ) ) {
|
||||
$post->url = get_permalink( $post->object_id );
|
||||
} elseif ( 'taxonomy' === $post->type && ! empty( $post->object ) && ! empty( $post->object_id ) ) {
|
||||
$post->url = get_term_link( (int) $post->object_id, $post->object );
|
||||
} elseif ( 'post_type_archive' === $post->type && ! empty( $post->object ) ) {
|
||||
$post->url = get_post_type_archive_link( $post->object );
|
||||
}
|
||||
if ( is_wp_error( $post->url ) ) {
|
||||
$post->url = '';
|
||||
}
|
||||
|
||||
/** This filter is documented in wp-includes/nav-menu.php */
|
||||
|
||||
@@ -179,18 +179,24 @@ final class WP_Customize_Selective_Refresh {
|
||||
}
|
||||
}
|
||||
|
||||
$switched_locale = switch_to_locale( get_user_locale() );
|
||||
$l10n = array(
|
||||
'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
|
||||
'clickEditMenu' => __( 'Click to edit this menu.' ),
|
||||
'clickEditWidget' => __( 'Click to edit this widget.' ),
|
||||
'clickEditTitle' => __( 'Click to edit the site title.' ),
|
||||
'clickEditMisc' => __( 'Click to edit this element.' ),
|
||||
/* translators: %s: document.write() */
|
||||
'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ),
|
||||
);
|
||||
if ( $switched_locale ) {
|
||||
restore_previous_locale();
|
||||
}
|
||||
|
||||
$exports = array(
|
||||
'partials' => $partials,
|
||||
'renderQueryVar' => self::RENDER_QUERY_VAR,
|
||||
'l10n' => array(
|
||||
'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
|
||||
'clickEditMenu' => __( 'Click to edit this menu.' ),
|
||||
'clickEditWidget' => __( 'Click to edit this widget.' ),
|
||||
'clickEditTitle' => __( 'Click to edit the site title.' ),
|
||||
'clickEditMisc' => __( 'Click to edit this element.' ),
|
||||
/* translators: %s: document.write() */
|
||||
'badDocumentWrite' => sprintf( __( '%s is forbidden' ), 'document.write()' ),
|
||||
),
|
||||
'l10n' => $l10n,
|
||||
);
|
||||
|
||||
// Export data to JS.
|
||||
|
||||
@@ -252,7 +252,7 @@ add_action( 'wp_head', 'wp_print_head_scripts', 9 );
|
||||
add_action( 'wp_head', 'wp_generator' );
|
||||
add_action( 'wp_head', 'rel_canonical' );
|
||||
add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
|
||||
add_action( 'wp_head', 'wp_custom_css_cb', 11 );
|
||||
add_action( 'wp_head', 'wp_custom_css_cb', 101 );
|
||||
add_action( 'wp_head', 'wp_site_icon', 99 );
|
||||
add_action( 'wp_footer', 'wp_print_footer_scripts', 20 );
|
||||
add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );
|
||||
|
||||
@@ -44,7 +44,7 @@ do_action( 'rss_tag_pre', 'rss2' );
|
||||
<description><?php bloginfo_rss("description") ?></description>
|
||||
<lastBuildDate><?php
|
||||
$date = get_lastpostmodified( 'GMT' );
|
||||
echo $date ? mysql2date( 'D, d M Y H:i:s +0000', $date ) : date( 'D, d M Y H:i:s +0000' );
|
||||
echo $date ? mysql2date( 'D, d M Y H:i:s +0000', $date, false ) : date( 'D, d M Y H:i:s +0000' );
|
||||
?></lastBuildDate>
|
||||
<language><?php bloginfo_rss( 'language' ); ?></language>
|
||||
<sy:updatePeriod><?php
|
||||
|
||||
@@ -702,7 +702,6 @@ function fetch_feed( $url ) {
|
||||
do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
|
||||
$feed->init();
|
||||
$feed->set_output_encoding( get_option( 'blog_charset' ) );
|
||||
$feed->handle_content_type();
|
||||
|
||||
if ( $feed->error() )
|
||||
return new WP_Error( 'simplepie-error', $feed->error() );
|
||||
|
||||
@@ -2254,7 +2254,7 @@ function wp_check_filetype( $filename, $mimes = null ) {
|
||||
* If it's determined that the extension does not match the file's real type,
|
||||
* then the "proper_filename" value will be set with a proper filename and extension.
|
||||
*
|
||||
* Currently this function only supports validating images known to getimagesize().
|
||||
* Currently this function only supports renaming images validated via wp_get_image_mime().
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
@@ -2278,14 +2278,15 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return compact( 'ext', 'type', 'proper_filename' );
|
||||
}
|
||||
|
||||
// We're able to validate images using GD
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) && function_exists('getimagesize') ) {
|
||||
// Validate image types.
|
||||
if ( $type && 0 === strpos( $type, 'image/' ) ) {
|
||||
|
||||
// Attempt to figure out what type of image it actually is
|
||||
$imgstats = @getimagesize( $file );
|
||||
$real_mime = wp_get_image_mime( $file );
|
||||
|
||||
// If getimagesize() knows what kind of image it really is and if the real MIME doesn't match the claimed MIME
|
||||
if ( !empty($imgstats['mime']) && $imgstats['mime'] != $type ) {
|
||||
if ( ! $real_mime ) {
|
||||
$type = $ext = false;
|
||||
} elseif ( $real_mime != $type ) {
|
||||
/**
|
||||
* Filters the list mapping image mime types to their respective extensions.
|
||||
*
|
||||
@@ -2302,10 +2303,10 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
) );
|
||||
|
||||
// Replace whatever is after the last period in the filename with the correct extension
|
||||
if ( ! empty( $mime_to_ext[ $imgstats['mime'] ] ) ) {
|
||||
if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {
|
||||
$filename_parts = explode( '.', $filename );
|
||||
array_pop( $filename_parts );
|
||||
$filename_parts[] = $mime_to_ext[ $imgstats['mime'] ];
|
||||
$filename_parts[] = $mime_to_ext[ $real_mime ];
|
||||
$new_filename = implode( '.', $filename_parts );
|
||||
|
||||
if ( $new_filename != $filename ) {
|
||||
@@ -2315,8 +2316,20 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
$wp_filetype = wp_check_filetype( $new_filename, $mimes );
|
||||
$ext = $wp_filetype['ext'];
|
||||
$type = $wp_filetype['type'];
|
||||
} else {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
} elseif ( function_exists( 'finfo_file' ) ) {
|
||||
// Use finfo_file if available to validate non-image files.
|
||||
$finfo = finfo_open( FILEINFO_MIME_TYPE );
|
||||
$real_mime = finfo_file( $finfo, $file );
|
||||
finfo_close( $finfo );
|
||||
|
||||
// If the extension does not match the file's real type, return false.
|
||||
if ( $real_mime !== $type ) {
|
||||
$type = $ext = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2334,6 +2347,38 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
|
||||
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the real mime type of an image file.
|
||||
*
|
||||
* This depends on exif_imagetype() or getimagesize() to determine real mime types.
|
||||
*
|
||||
* @since 4.7.1
|
||||
*
|
||||
* @param string $file Full path to the file.
|
||||
* @return string|false The actual mime type or false if the type cannot be determined.
|
||||
*/
|
||||
function wp_get_image_mime( $file ) {
|
||||
/*
|
||||
* Use exif_imagetype() to check the mimetype if available or fall back to
|
||||
* getimagesize() if exif isn't avaialbe. If either function throws an Exception
|
||||
* we assume the file could not be validated.
|
||||
*/
|
||||
try {
|
||||
if ( is_callable( 'exif_imagetype' ) ) {
|
||||
$mime = image_type_to_mime_type( exif_imagetype( $file ) );
|
||||
} elseif ( function_exists( 'getimagesize' ) ) {
|
||||
$imagesize = getimagesize( $file );
|
||||
$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
|
||||
} else {
|
||||
$mime = false;
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
$mime = false;
|
||||
}
|
||||
|
||||
return $mime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve list of mime types and file extensions.
|
||||
*
|
||||
|
||||
@@ -15,7 +15,19 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
|
||||
* Initialize nav menus preview.
|
||||
*/
|
||||
self.init = function() {
|
||||
var self = this;
|
||||
var self = this, synced = false;
|
||||
|
||||
/*
|
||||
* Keep track of whether we synced to determine whether or not bindSettingListener
|
||||
* should also initially fire the listener. This initial firing needs to wait until
|
||||
* after all of the settings have been synced from the pane in order to prevent
|
||||
* an infinite selective fallback-refresh. Note that this sync handler will be
|
||||
* added after the sync handler in customize-preview.js, so it will be triggered
|
||||
* after all of the settings are added.
|
||||
*/
|
||||
api.preview.bind( 'sync', function() {
|
||||
synced = true;
|
||||
} );
|
||||
|
||||
if ( api.selectiveRefresh ) {
|
||||
// Listen for changes to settings related to nav menus.
|
||||
@@ -32,7 +44,7 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
|
||||
* this can trigger an infinite fallback refresh when the nav menu item lacks any valid items.
|
||||
*/
|
||||
if ( setting.get() && ! setting.get()._invalid ) {
|
||||
self.bindSettingListener( setting, { fire: true } );
|
||||
self.bindSettingListener( setting, { fire: synced } );
|
||||
}
|
||||
} );
|
||||
api.bind( 'remove', function( setting ) {
|
||||
@@ -407,7 +419,7 @@ wp.customize.navMenusPreview = wp.customize.MenusCustomizerPreview = ( function(
|
||||
return;
|
||||
}
|
||||
|
||||
navMenuItemParts = $( this ).attr( 'class' ).match( /(?:^|\s)menu-item-(\d+)(?:\s|$)/ );
|
||||
navMenuItemParts = $( this ).attr( 'class' ).match( /(?:^|\s)menu-item-(-?\d+)(?:\s|$)/ );
|
||||
if ( navMenuItemParts ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation(); // Make sure a sub-nav menu item will get focused instead of parent items.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -49,14 +49,14 @@
|
||||
history.replaceState = ( function( nativeReplaceState ) {
|
||||
return function historyReplaceState( data, title, url ) {
|
||||
currentHistoryState = data;
|
||||
return nativeReplaceState.call( history, data, title, injectUrlWithState( url ) );
|
||||
return nativeReplaceState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url );
|
||||
};
|
||||
} )( history.replaceState );
|
||||
|
||||
history.pushState = ( function( nativePushState ) {
|
||||
return function historyPushState( data, title, url ) {
|
||||
currentHistoryState = data;
|
||||
return nativePushState.call( history, data, title, injectUrlWithState( url ) );
|
||||
return nativePushState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url );
|
||||
};
|
||||
} )( history.pushState );
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
*/
|
||||
handleLinkClick: function( event ) {
|
||||
var preview = this, link, isInternalJumpLink;
|
||||
link = $( event.target );
|
||||
link = $( event.target ).closest( 'a' );
|
||||
|
||||
// No-op if the anchor is not a link.
|
||||
if ( _.isUndefined( link.attr( 'href' ) ) ) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user