Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14247ee430 | ||
|
|
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 |
@@ -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">
|
||||
@@ -63,135 +48,182 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<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;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1319,7 +1319,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
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
@@ -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>
|
||||
|
||||
|
||||
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';
|
||||
@@ -1160,6 +1160,8 @@ function wp_edit_attachments_query_vars( $q = false ) {
|
||||
* @since 4.7.0
|
||||
* @access private
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
* @param array $clauses An array including WHERE, GROUP BY, JOIN, ORDER BY,
|
||||
* DISTINCT, fields (SELECT), and LIMITS clauses.
|
||||
* @return array The modified clauses.
|
||||
|
||||
@@ -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 );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
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 );
|
||||
}
|
||||
@@ -2771,9 +2796,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
@@ -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
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
=== Twenty Seventeen ===
|
||||
Contributors: the WordPress team
|
||||
Requires at least: WordPress 4.7
|
||||
Requires at least: WordPress 4.8-trunk
|
||||
Tested up to: WordPress 4.7
|
||||
Version: 1.0
|
||||
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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -139,15 +139,15 @@ function twentyseventeen_setup() {
|
||||
|
||||
'attachments' => array(
|
||||
'image-espresso' => array(
|
||||
'post_title' => _x( 'Espresso', 'Theme starter content' ),
|
||||
'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),
|
||||
'file' => 'assets/images/espresso.jpg',
|
||||
),
|
||||
'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',
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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,7 +3,7 @@ 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.
|
||||
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.0
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
@@ -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' );
|
||||
@@ -794,7 +794,7 @@ 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,
|
||||
@@ -971,63 +971,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 +1071,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 +1089,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 +1222,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 +1240,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 +1282,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.
|
||||
*
|
||||
@@ -1961,10 +2066,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 +2100,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 +2130,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 +2139,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 +2222,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 +2471,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'] );
|
||||
}
|
||||
@@ -3988,7 +4117,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 +4133,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.
|
||||
),
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
@@ -803,6 +803,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 +1197,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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -3059,7 +3059,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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
10
wp-includes/locale.php
Normal file
10
wp-includes/locale.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Locale API
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage i18n
|
||||
* @since 1.2.0
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '4.7.0' );
|
||||
@@ -3139,7 +3139,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
||||
if ( current_user_can( 'delete_post', $attachment->ID ) )
|
||||
$response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
|
||||
|
||||
if ( $meta && ! empty( $meta['sizes'] ) ) {
|
||||
if ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) {
|
||||
$sizes = array();
|
||||
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
|
||||
@@ -421,7 +421,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
|
||||
$notoptions = wp_cache_get( 'notoptions', 'options' );
|
||||
if ( !is_array( $notoptions ) || !isset( $notoptions[$option] ) )
|
||||
/** This filter is documented in wp-includes/option.php */
|
||||
if ( apply_filters( 'default_option_' . $option, false, $option ) !== get_option( $option ) )
|
||||
if ( apply_filters( 'default_option_' . $option, false, $option, false ) !== get_option( $option ) )
|
||||
return false;
|
||||
|
||||
$serialized_value = maybe_serialize( $value );
|
||||
@@ -1737,27 +1737,31 @@ function register_initial_settings() {
|
||||
'description' => __( 'Site tagline.' ),
|
||||
) );
|
||||
|
||||
register_setting( 'general', 'siteurl', array(
|
||||
'show_in_rest' => array(
|
||||
'name' => 'url',
|
||||
'schema' => array(
|
||||
'format' => 'uri',
|
||||
if ( ! is_multisite() ) {
|
||||
register_setting( 'general', 'siteurl', array(
|
||||
'show_in_rest' => array(
|
||||
'name' => 'url',
|
||||
'schema' => array(
|
||||
'format' => 'uri',
|
||||
),
|
||||
),
|
||||
),
|
||||
'type' => 'string',
|
||||
'description' => __( 'Site URL.' ),
|
||||
) );
|
||||
'type' => 'string',
|
||||
'description' => __( 'Site URL.' ),
|
||||
) );
|
||||
}
|
||||
|
||||
register_setting( 'general', 'admin_email', array(
|
||||
'show_in_rest' => array(
|
||||
'name' => 'email',
|
||||
'schema' => array(
|
||||
'format' => 'email',
|
||||
if ( ! is_multisite() ) {
|
||||
register_setting( 'general', 'admin_email', array(
|
||||
'show_in_rest' => array(
|
||||
'name' => 'email',
|
||||
'schema' => array(
|
||||
'format' => 'email',
|
||||
),
|
||||
),
|
||||
),
|
||||
'type' => 'string',
|
||||
'description' => __( 'This address is used for admin purposes. If you change this we will send you an email at your new address to confirm it. The new address will not become active until confirmed.' ),
|
||||
) );
|
||||
'type' => 'string',
|
||||
'description' => __( 'This address is used for admin purposes, like new user notification.' ),
|
||||
) );
|
||||
}
|
||||
|
||||
register_setting( 'general', 'timezone_string', array(
|
||||
'show_in_rest' => array(
|
||||
|
||||
@@ -985,6 +985,8 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
|
||||
* @since 4.4.0 The `show_ui` argument is now enforced on the post type listing
|
||||
* screen and post editing screen.
|
||||
* @since 4.6.0 Post type object returned is now an instance of WP_Post_Type.
|
||||
* @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'
|
||||
* arguments to register the post type in REST API.
|
||||
*
|
||||
* @global array $wp_post_types List of post types.
|
||||
*
|
||||
@@ -994,76 +996,79 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
|
||||
* @param array|string $args {
|
||||
* Array or string of arguments for registering a post type.
|
||||
*
|
||||
* @type string $label Name of the post type shown in the menu. Usually plural.
|
||||
* Default is value of $labels['name'].
|
||||
* @type array $labels An array of labels for this post type. If not set, post
|
||||
* labels are inherited for non-hierarchical types and page
|
||||
* labels for hierarchical ones. See get_post_type_labels() for a full
|
||||
* list of supported labels.
|
||||
* @type string $description A short descriptive summary of what the post type is.
|
||||
* Default empty.
|
||||
* @type bool $public Whether a post type is intended for use publicly either via
|
||||
* the admin interface or by front-end users. While the default
|
||||
* settings of $exclude_from_search, $publicly_queryable, $show_ui,
|
||||
* and $show_in_nav_menus are inherited from public, each does not
|
||||
* rely on this relationship and controls a very specific intention.
|
||||
* Default false.
|
||||
* @type bool $hierarchical Whether the post type is hierarchical (e.g. page). Default false.
|
||||
* @type bool $exclude_from_search Whether to exclude posts with this post type from front end search
|
||||
* results. Default is the opposite value of $public.
|
||||
* @type bool $publicly_queryable Whether queries can be performed on the front end for the post type
|
||||
* as part of parse_request(). Endpoints would include:
|
||||
* * ?post_type={post_type_key}
|
||||
* * ?{post_type_key}={single_post_slug}
|
||||
* * ?{post_type_query_var}={single_post_slug}
|
||||
* If not set, the default is inherited from $public.
|
||||
* @type bool $show_ui Whether to generate and allow a UI for managing this post type in the
|
||||
* admin. Default is value of $public.
|
||||
* @type bool $show_in_menu Where to show the post type in the admin menu. To work, $show_ui
|
||||
* must be true. If true, the post type is shown in its own top level
|
||||
* menu. If false, no menu is shown. If a string of an existing top
|
||||
* level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post
|
||||
* type will be placed as a sub-menu of that.
|
||||
* Default is value of $show_ui.
|
||||
* @type bool $show_in_nav_menus Makes this post type available for selection in navigation menus.
|
||||
* Default is value $public.
|
||||
* @type bool $show_in_admin_bar Makes this post type available via the admin bar. Default is value
|
||||
* of $show_in_menu.
|
||||
* @type int $menu_position The position in the menu order the post type should appear. To work,
|
||||
* $show_in_menu must be true. Default null (at the bottom).
|
||||
* @type string $menu_icon The url to the icon to be used for this menu. Pass a base64-encoded
|
||||
* SVG using a data URI, which will be colored to match the color scheme
|
||||
* -- this should begin with 'data:image/svg+xml;base64,'. Pass the name
|
||||
* of a Dashicons helper class to use a font icon, e.g.
|
||||
* 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty
|
||||
* so an icon can be added via CSS. Defaults to use the posts icon.
|
||||
* @type string $capability_type The string to use to build the read, edit, and delete capabilities.
|
||||
* May be passed as an array to allow for alternative plurals when using
|
||||
* this argument as a base to construct the capabilities, e.g.
|
||||
* array('story', 'stories'). Default 'post'.
|
||||
* @type array $capabilities Array of capabilities for this post type. $capability_type is used
|
||||
* as a base to construct capabilities by default.
|
||||
* See get_post_type_capabilities().
|
||||
* @type bool $map_meta_cap Whether to use the internal default meta capability handling.
|
||||
* Default false.
|
||||
* @type array $supports Core feature(s) the post type supports. Serves as an alias for calling
|
||||
* add_post_type_support() directly. Core features include 'title',
|
||||
* 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt',
|
||||
* 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'.
|
||||
* Additionally, the 'revisions' feature dictates whether the post type
|
||||
* will store revisions, and the 'comments' feature dictates whether the
|
||||
* comments count will show on the edit screen. Defaults is an array
|
||||
* containing 'title' and 'editor'.
|
||||
* @type callable $register_meta_box_cb Provide a callback function that sets up the meta boxes for the
|
||||
* edit form. Do remove_meta_box() and add_meta_box() calls in the
|
||||
* callback. Default null.
|
||||
* @type array $taxonomies An array of taxonomy identifiers that will be registered for the
|
||||
* post type. Taxonomies can be registered later with register_taxonomy()
|
||||
* or register_taxonomy_for_object_type().
|
||||
* Default empty array.
|
||||
* @type bool|string $has_archive Whether there should be post type archives, or if a string, the
|
||||
* archive slug to use. Will generate the proper rewrite rules if
|
||||
* $rewrite is enabled. Default false.
|
||||
* @type string $label Name of the post type shown in the menu. Usually plural.
|
||||
* Default is value of $labels['name'].
|
||||
* @type array $labels An array of labels for this post type. If not set, post
|
||||
* labels are inherited for non-hierarchical types and page
|
||||
* labels for hierarchical ones. See get_post_type_labels() for a full
|
||||
* list of supported labels.
|
||||
* @type string $description A short descriptive summary of what the post type is.
|
||||
* Default empty.
|
||||
* @type bool $public Whether a post type is intended for use publicly either via
|
||||
* the admin interface or by front-end users. While the default
|
||||
* settings of $exclude_from_search, $publicly_queryable, $show_ui,
|
||||
* and $show_in_nav_menus are inherited from public, each does not
|
||||
* rely on this relationship and controls a very specific intention.
|
||||
* Default false.
|
||||
* @type bool $hierarchical Whether the post type is hierarchical (e.g. page). Default false.
|
||||
* @type bool $exclude_from_search Whether to exclude posts with this post type from front end search
|
||||
* results. Default is the opposite value of $public.
|
||||
* @type bool $publicly_queryable Whether queries can be performed on the front end for the post type
|
||||
* as part of parse_request(). Endpoints would include:
|
||||
* * ?post_type={post_type_key}
|
||||
* * ?{post_type_key}={single_post_slug}
|
||||
* * ?{post_type_query_var}={single_post_slug}
|
||||
* If not set, the default is inherited from $public.
|
||||
* @type bool $show_ui Whether to generate and allow a UI for managing this post type in the
|
||||
* admin. Default is value of $public.
|
||||
* @type bool $show_in_menu Where to show the post type in the admin menu. To work, $show_ui
|
||||
* must be true. If true, the post type is shown in its own top level
|
||||
* menu. If false, no menu is shown. If a string of an existing top
|
||||
* level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post
|
||||
* type will be placed as a sub-menu of that.
|
||||
* Default is value of $show_ui.
|
||||
* @type bool $show_in_nav_menus Makes this post type available for selection in navigation menus.
|
||||
* Default is value $public.
|
||||
* @type bool $show_in_admin_bar Makes this post type available via the admin bar. Default is value
|
||||
* of $show_in_menu.
|
||||
* @type bool $show_in_rest Whether to add the post type route in the REST API 'wp/v2' namespace.
|
||||
* @type string $rest_base To change the base url of REST API route. Default is $post_type.
|
||||
* @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Posts_Controller'.
|
||||
* @type int $menu_position The position in the menu order the post type should appear. To work,
|
||||
* $show_in_menu must be true. Default null (at the bottom).
|
||||
* @type string $menu_icon The url to the icon to be used for this menu. Pass a base64-encoded
|
||||
* SVG using a data URI, which will be colored to match the color scheme
|
||||
* -- this should begin with 'data:image/svg+xml;base64,'. Pass the name
|
||||
* of a Dashicons helper class to use a font icon, e.g.
|
||||
* 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty
|
||||
* so an icon can be added via CSS. Defaults to use the posts icon.
|
||||
* @type string $capability_type The string to use to build the read, edit, and delete capabilities.
|
||||
* May be passed as an array to allow for alternative plurals when using
|
||||
* this argument as a base to construct the capabilities, e.g.
|
||||
* array('story', 'stories'). Default 'post'.
|
||||
* @type array $capabilities Array of capabilities for this post type. $capability_type is used
|
||||
* as a base to construct capabilities by default.
|
||||
* See get_post_type_capabilities().
|
||||
* @type bool $map_meta_cap Whether to use the internal default meta capability handling.
|
||||
* Default false.
|
||||
* @type array $supports Core feature(s) the post type supports. Serves as an alias for calling
|
||||
* add_post_type_support() directly. Core features include 'title',
|
||||
* 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt',
|
||||
* 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'.
|
||||
* Additionally, the 'revisions' feature dictates whether the post type
|
||||
* will store revisions, and the 'comments' feature dictates whether the
|
||||
* comments count will show on the edit screen. Defaults is an array
|
||||
* containing 'title' and 'editor'.
|
||||
* @type callable $register_meta_box_cb Provide a callback function that sets up the meta boxes for the
|
||||
* edit form. Do remove_meta_box() and add_meta_box() calls in the
|
||||
* callback. Default null.
|
||||
* @type array $taxonomies An array of taxonomy identifiers that will be registered for the
|
||||
* post type. Taxonomies can be registered later with register_taxonomy()
|
||||
* or register_taxonomy_for_object_type().
|
||||
* Default empty array.
|
||||
* @type bool|string $has_archive Whether there should be post type archives, or if a string, the
|
||||
* archive slug to use. Will generate the proper rewrite rules if
|
||||
* $rewrite is enabled. Default false.
|
||||
* @type bool|array $rewrite {
|
||||
* Triggers the handling of rewrites for this post type. To prevent rewrite, set to false.
|
||||
* Defaults to true, using $post_type as slug. To specify rewrite rules, an array can be
|
||||
@@ -1079,21 +1084,21 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
|
||||
* inherits from $permalink_epmask. If not specified and permalink_epmask
|
||||
* is not set, defaults to EP_PERMALINK.
|
||||
* }
|
||||
* @type string|bool $query_var Sets the query_var key for this post type. Defaults to $post_type
|
||||
* key. If false, a post type cannot be loaded at
|
||||
* ?{query_var}={post_slug}. If specified as a string, the query
|
||||
* ?{query_var_string}={post_slug} will be valid.
|
||||
* @type bool $can_export Whether to allow this post type to be exported. Default true.
|
||||
* @type bool $delete_with_user Whether to delete posts of this type when deleting a user. If true,
|
||||
* posts of this type belonging to the user will be moved to trash
|
||||
* when then user is deleted. If false, posts of this type belonging
|
||||
* to the user will *not* be trashed or deleted. If not set (the default),
|
||||
* posts are trashed if post_type_supports('author'). Otherwise posts
|
||||
* are not trashed or deleted. Default null.
|
||||
* @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or
|
||||
* "built-in" post_type. Default false.
|
||||
* @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of
|
||||
* this post type. Default 'post.php?post=%d'.
|
||||
* @type string|bool $query_var Sets the query_var key for this post type. Defaults to $post_type
|
||||
* key. If false, a post type cannot be loaded at
|
||||
* ?{query_var}={post_slug}. If specified as a string, the query
|
||||
* ?{query_var_string}={post_slug} will be valid.
|
||||
* @type bool $can_export Whether to allow this post type to be exported. Default true.
|
||||
* @type bool $delete_with_user Whether to delete posts of this type when deleting a user. If true,
|
||||
* posts of this type belonging to the user will be moved to trash
|
||||
* when then user is deleted. If false, posts of this type belonging
|
||||
* to the user will *not* be trashed or deleted. If not set (the default),
|
||||
* posts are trashed if post_type_supports('author'). Otherwise posts
|
||||
* are not trashed or deleted. Default null.
|
||||
* @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or
|
||||
* "built-in" post_type. Default false.
|
||||
* @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of
|
||||
* this post type. Default 'post.php?post=%d'.
|
||||
* }
|
||||
* @return WP_Post_Type|WP_Error The registered post type object, or an error object.
|
||||
*/
|
||||
|
||||
@@ -840,7 +840,7 @@ function rest_sanitize_request_arg( $value, $request, $param ) {
|
||||
}
|
||||
$args = $attributes['args'][ $param ];
|
||||
|
||||
return rest_sanitize_value_from_schema( $value, $args, $param );
|
||||
return rest_sanitize_value_from_schema( $value, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -446,7 +446,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! comments_open( $post->ID ) ) {
|
||||
return new WP_Error( 'rest_comment_closed', __( 'Sorry, comments are closed on this post.' ), array( 'status' => 403 ) );
|
||||
return new WP_Error( 'rest_comment_closed', __( 'Sorry, comments are closed for this item.' ), array( 'status' => 403 ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -508,17 +508,9 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
|
||||
// Honor the discussion setting that requires a name and email address of the comment author.
|
||||
if ( get_option( 'require_name_email' ) ) {
|
||||
if ( ! isset( $prepared_comment['comment_author'] ) && ! isset( $prepared_comment['comment_author_email'] ) ) {
|
||||
if ( empty( $prepared_comment['comment_author'] ) || empty( $prepared_comment['comment_author_email'] ) ) {
|
||||
return new WP_Error( 'rest_comment_author_data_required', __( 'Creating a comment requires valid author name and email values.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
if ( ! isset( $prepared_comment['comment_author'] ) ) {
|
||||
return new WP_Error( 'rest_comment_author_required', __( 'Creating a comment requires a valid author name.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
if ( ! isset( $prepared_comment['comment_author_email'] ) ) {
|
||||
return new WP_Error( 'rest_comment_author_email_required', __( 'Creating a comment requires a valid author email.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $prepared_comment['comment_author_email'] ) ) {
|
||||
@@ -1155,6 +1147,10 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
'type' => 'string',
|
||||
'format' => 'email',
|
||||
'context' => array( 'edit' ),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => array( $this, 'check_comment_author_email' ),
|
||||
'validate_callback' => null, // skip built-in validation of 'email'.
|
||||
),
|
||||
),
|
||||
'author_ip' => array(
|
||||
'description' => __( 'IP address for the object author.' ),
|
||||
@@ -1206,13 +1202,13 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
),
|
||||
),
|
||||
'date' => array(
|
||||
'description' => __( 'The date the object was published.' ),
|
||||
'description' => __( "The date the object was published, in the site's timezone." ),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'date_gmt' => array(
|
||||
'description' => __( 'The date the object was published as GMT.' ),
|
||||
'description' => __( 'The date the object was published, as GMT.' ),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
@@ -1348,7 +1344,7 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
);
|
||||
|
||||
$query_params['offset'] = array(
|
||||
'description' => __( 'Offset the result set by a specific number of comments.' ),
|
||||
'description' => __( 'Offset the result set by a specific number of items.' ),
|
||||
'type' => 'integer',
|
||||
);
|
||||
|
||||
@@ -1581,4 +1577,33 @@ class WP_REST_Comments_Controller extends WP_REST_Controller {
|
||||
|
||||
return current_user_can( 'edit_comment', $comment->comment_ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks a comment author email for validity.
|
||||
*
|
||||
* Accepts either a valid email address or empty string as a valid comment
|
||||
* author email address. Setting the comment author email to an empty
|
||||
* string is allowed when a comment is being updated.
|
||||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @param string $value Author email value submitted.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param string $param The parameter name.
|
||||
* @return WP_Error|string The sanitized email address, if valid,
|
||||
* otherwise an error.
|
||||
*/
|
||||
public function check_comment_author_email( $value, $request, $param ) {
|
||||
$email = (string) $value;
|
||||
if ( empty( $email ) ) {
|
||||
return $email;
|
||||
}
|
||||
|
||||
$check_email = rest_validate_request_arg( $email, $request, $param );
|
||||
if ( is_wp_error( $check_email ) ) {
|
||||
return $check_email;
|
||||
}
|
||||
|
||||
return $email;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,11 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
return new WP_Error( 'rest_no_search_term_defined', __( 'You need to define a search term to order by relevance.' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
// Ensure an include parameter is set in case the orderby is set to 'include'.
|
||||
if ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) {
|
||||
return new WP_Error( 'rest_orderby_include_missing_include', sprintf( __( 'Missing parameter(s): %s' ), 'include' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
// Retrieve the list of registered collection query parameters.
|
||||
$registered = $this->get_collection_params();
|
||||
$args = array();
|
||||
@@ -836,8 +841,17 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
|
||||
$query_args['ignore_sticky_posts'] = true;
|
||||
}
|
||||
|
||||
if ( 'include' === $query_args['orderby'] ) {
|
||||
$query_args['orderby'] = 'post__in';
|
||||
// Map to proper WP_Query orderby param.
|
||||
if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) {
|
||||
$orderby_mappings = array(
|
||||
'id' => 'ID',
|
||||
'include' => 'post__in',
|
||||
'slug' => 'post_name',
|
||||
);
|
||||
|
||||
if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) {
|
||||
$query_args['orderby'] = $orderby_mappings[ $request['orderby'] ];
|
||||
}
|
||||
}
|
||||
|
||||
return $query_args;
|
||||
|
||||
@@ -404,7 +404,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'date' => array(
|
||||
'description' => __( 'The date the object was published.' ),
|
||||
'description' => __( "The date the object was published, in the site's timezone." ),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
@@ -426,7 +426,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'modified' => array(
|
||||
'description' => __( 'The date the object was last modified.' ),
|
||||
'description' => __( "The date the object was last modified, in the site's timezone." ),
|
||||
'type' => 'string',
|
||||
'format' => 'date-time',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
|
||||
@@ -288,7 +288,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a request has access to read the specified term.
|
||||
* Checks if a request has access to read or edit the specified term.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
@@ -301,8 +301,8 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
if ( ! $tax_obj || ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) {
|
||||
return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
if ( 'edit' === $request['context'] && ! current_user_can( 'edit_term', (int) $request['id'] ) ) {
|
||||
return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -349,7 +349,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
$taxonomy_obj = get_taxonomy( $this->taxonomy );
|
||||
if ( ! current_user_can( $taxonomy_obj->cap->manage_terms ) ) {
|
||||
if ( ! current_user_can( $taxonomy_obj->cap->edit_terms ) ) {
|
||||
return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create new terms.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'edit_term', $term->term_id ) ) {
|
||||
return new WP_Error( 'rest_cannot_update', __( 'Sorry, you are not allowed to edit terms.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
return new WP_Error( 'rest_cannot_update', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -92,6 +92,8 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
'reassign' => array(
|
||||
'type' => 'integer',
|
||||
'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
|
||||
'required' => true,
|
||||
'sanitize_callback' => array( $this, 'check_reassign' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -125,6 +127,8 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
'reassign' => array(
|
||||
'type' => 'integer',
|
||||
'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ),
|
||||
'required' => true,
|
||||
'sanitize_callback' => array( $this, 'check_reassign' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -132,6 +136,31 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for a valid value for the reassign parameter when deleting users.
|
||||
*
|
||||
* The value can be an integer, 'false', false, or ''.
|
||||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @param int|bool $value The value passed to the reassign parameter.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param string $param The parameter that is being sanitized.
|
||||
*
|
||||
* @return int|bool|WP_Error
|
||||
*/
|
||||
public function check_reassign( $value, $request, $param ) {
|
||||
if ( is_numeric( $value ) ) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ( empty( $value ) || false === $value || 'false' === $value ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Permissions check for getting all users.
|
||||
*
|
||||
@@ -672,8 +701,13 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
|
||||
*/
|
||||
public function delete_item( $request ) {
|
||||
// We don't support delete requests in multisite.
|
||||
if ( is_multisite() ) {
|
||||
return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 501 ) );
|
||||
}
|
||||
|
||||
$id = (int) $request['id'];
|
||||
$reassign = isset( $request['reassign'] ) ? absint( $request['reassign'] ) : null;
|
||||
$reassign = false === $request['reassign'] ? null : absint( $request['reassign'] );
|
||||
$force = isset( $request['force'] ) ? (bool) $request['force'] : false;
|
||||
|
||||
// We don't support trashing for users.
|
||||
@@ -1027,7 +1061,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* @return WP_Error|string The sanitized username, if valid, otherwise an error.
|
||||
*/
|
||||
public function check_username( $value, $request, $param ) {
|
||||
$username = (string) rest_sanitize_value_from_schema( $value, $request, $param );
|
||||
$username = (string) $value;
|
||||
|
||||
if ( ! validate_username( $username ) ) {
|
||||
return new WP_Error( 'rest_user_invalid_username', __( 'Username contains invalid characters.' ), array( 'status' => 400 ) );
|
||||
@@ -1056,7 +1090,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
* @return WP_Error|string The sanitized password, if valid, otherwise an error.
|
||||
*/
|
||||
public function check_user_password( $value, $request, $param ) {
|
||||
$password = (string) rest_sanitize_value_from_schema( $value, $request, $param );
|
||||
$password = (string) $value;
|
||||
|
||||
if ( empty( $password ) ) {
|
||||
return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array( 'status' => 400 ) );
|
||||
|
||||
@@ -117,15 +117,15 @@ abstract class WP_REST_Meta_Fields {
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param array $meta Array of meta parsed from the request.
|
||||
* @param int $object_id Object ID to fetch meta for.
|
||||
* @return WP_Error|null WP_Error if one occurs, null on success.
|
||||
*/
|
||||
public function update_value( $request, $object_id ) {
|
||||
public function update_value( $meta, $object_id ) {
|
||||
$fields = $this->get_registered_fields();
|
||||
foreach ( $fields as $meta_key => $args ) {
|
||||
$name = $args['name'];
|
||||
if ( ! array_key_exists( $name, $request ) ) {
|
||||
if ( ! array_key_exists( $name, $meta ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ abstract class WP_REST_Meta_Fields {
|
||||
* A null value means reset the field, which is essentially deleting it
|
||||
* from the database and then relying on the default value.
|
||||
*/
|
||||
if ( is_null( $request[ $name ] ) ) {
|
||||
if ( is_null( $meta[ $name ] ) ) {
|
||||
$result = $this->delete_meta_value( $object_id, $meta_key, $name );
|
||||
if ( is_wp_error( $result ) ) {
|
||||
return $result;
|
||||
@@ -141,13 +141,13 @@ abstract class WP_REST_Meta_Fields {
|
||||
continue;
|
||||
}
|
||||
|
||||
$is_valid = rest_validate_value_from_schema( $request[ $name ], $args['schema'], 'meta.' . $name );
|
||||
$is_valid = rest_validate_value_from_schema( $meta[ $name ], $args['schema'], 'meta.' . $name );
|
||||
if ( is_wp_error( $is_valid ) ) {
|
||||
$is_valid->add_data( array( 'status' => 400 ) );
|
||||
return $is_valid;
|
||||
}
|
||||
|
||||
$value = rest_sanitize_value_from_schema( $request[ $name ], $args['schema'] );
|
||||
$value = rest_sanitize_value_from_schema( $meta[ $name ], $args['schema'] );
|
||||
|
||||
if ( $args['single'] ) {
|
||||
$result = $this->update_meta_value( $object_id, $meta_key, $name, $value );
|
||||
@@ -391,6 +391,10 @@ abstract class WP_REST_Meta_Fields {
|
||||
'type' => 'object',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
'properties' => array(),
|
||||
'arg_options' => array(
|
||||
'sanitize_callback' => null,
|
||||
'validate_callback' => array( $this, 'check_meta_is_array' ),
|
||||
),
|
||||
);
|
||||
|
||||
foreach ( $fields as $args ) {
|
||||
@@ -444,4 +448,23 @@ abstract class WP_REST_Meta_Fields {
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the 'meta' value of a request is an associative array.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @access public
|
||||
*
|
||||
* @param mixed $value The meta value submitted in the request.
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param string $param The parameter name.
|
||||
* @return WP_Error|string The meta array, if valid, otherwise an error.
|
||||
*/
|
||||
public function check_meta_is_array( $value, $request, $param ) {
|
||||
if ( ! is_array( $value ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
11
wp-includes/session.php
Normal file
11
wp-includes/session.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Session API
|
||||
*
|
||||
* @since 4.0.0
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '4.7.0' );
|
||||
|
||||
require_once( ABSPATH . WPINC . '/class-wp-session-tokens.php' );
|
||||
require_once( ABSPATH . WPINC . '/class-wp-user-meta-session-tokens.php' );
|
||||
@@ -294,6 +294,8 @@ function is_taxonomy_hierarchical($taxonomy) {
|
||||
* @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.
|
||||
* @since 4.4.0 The `public` argument now controls whether the taxonomy can be queried on the front end.
|
||||
* @since 4.5.0 Introduced `publicly_queryable` argument.
|
||||
* @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'
|
||||
* arguments to register the Taxonomy in REST API.
|
||||
*
|
||||
* @global array $wp_taxonomies Registered taxonomies.
|
||||
*
|
||||
@@ -323,6 +325,9 @@ function is_taxonomy_hierarchical($taxonomy) {
|
||||
* (default true).
|
||||
* @type bool $show_in_nav_menus Makes this taxonomy available for selection in navigation menus. If not
|
||||
* set, the default is inherited from `$public` (default true).
|
||||
* @type bool $show_in_rest Whether to include the taxonomy in the REST API.
|
||||
* @type string $rest_base To change the base url of REST API route. Default is $taxonomy.
|
||||
* @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Terms_Controller'.
|
||||
* @type bool $show_tagcloud Whether to list the taxonomy in the Tag Cloud Widget controls. If not set,
|
||||
* the default is inherited from `$show_ui` (default true).
|
||||
* @type bool $show_in_quick_edit Whether to show the taxonomy in the quick/bulk edit panel. It not set,
|
||||
@@ -824,55 +829,49 @@ function get_term( $term, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
|
||||
* or `$term` was not found.
|
||||
*/
|
||||
function get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filter = 'raw' ) {
|
||||
global $wpdb;
|
||||
|
||||
// 'term_taxonomy_id' lookups don't require taxonomy checks.
|
||||
if ( 'term_taxonomy_id' !== $field && ! taxonomy_exists( $taxonomy ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( 'id' === $field || 'term_id' === $field ) {
|
||||
$tax_clause = $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
|
||||
|
||||
if ( 'slug' == $field ) {
|
||||
$_field = 't.slug';
|
||||
$value = sanitize_title($value);
|
||||
if ( empty($value) )
|
||||
return false;
|
||||
} elseif ( 'name' == $field ) {
|
||||
// Assume already escaped
|
||||
$value = wp_unslash($value);
|
||||
$_field = 't.name';
|
||||
} elseif ( 'term_taxonomy_id' == $field ) {
|
||||
$value = (int) $value;
|
||||
$_field = 'tt.term_taxonomy_id';
|
||||
|
||||
// No `taxonomy` clause when searching by 'term_taxonomy_id'.
|
||||
$tax_clause = '';
|
||||
} else {
|
||||
$term = get_term( (int) $value, $taxonomy, $output, $filter );
|
||||
if ( is_wp_error( $term ) || null === $term ) {
|
||||
if ( is_wp_error( $term ) || is_null( $term ) ) {
|
||||
$term = false;
|
||||
}
|
||||
return $term;
|
||||
}
|
||||
|
||||
$args = array(
|
||||
'get' => 'all',
|
||||
'number' => 1,
|
||||
'taxonomy' => $taxonomy,
|
||||
'update_term_meta_cache' => false,
|
||||
'orderby' => 'none',
|
||||
);
|
||||
|
||||
switch ( $field ) {
|
||||
case 'slug' :
|
||||
$args['slug'] = $value;
|
||||
break;
|
||||
case 'name' :
|
||||
$args['name'] = $value;
|
||||
break;
|
||||
case 'term_taxonomy_id' :
|
||||
$args['term_taxonomy_id'] = $value;
|
||||
unset( $args[ 'taxonomy' ] );
|
||||
break;
|
||||
default :
|
||||
return false;
|
||||
}
|
||||
|
||||
$terms = get_terms( $args );
|
||||
if ( is_wp_error( $terms ) || empty( $terms ) ) {
|
||||
$term = $wpdb->get_row( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE $_field = %s", $value ) . " $tax_clause LIMIT 1" );
|
||||
if ( ! $term )
|
||||
return false;
|
||||
}
|
||||
|
||||
$term = array_shift( $terms );
|
||||
|
||||
// In the case of 'term_taxonomy_id', override the provided `$taxonomy` with whatever we find in the db.
|
||||
if ( 'term_taxonomy_id' === $field ) {
|
||||
$taxonomy = $term->taxonomy;
|
||||
}
|
||||
|
||||
wp_cache_add( $term->term_id, $term, 'terms' );
|
||||
|
||||
return get_term( $term, $taxonomy, $output, $filter );
|
||||
}
|
||||
|
||||
@@ -3020,7 +3019,7 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
|
||||
* function only fetches relationship data that is already in the cache.
|
||||
*
|
||||
* @since 2.3.0
|
||||
* @since 4.6.2 Returns a WP_Error object if get_term() returns an error for
|
||||
* @since 4.7.0 Returns a WP_Error object if get_term() returns an error for
|
||||
* any of the matched terms.
|
||||
*
|
||||
* @param int $id Term object ID.
|
||||
|
||||
@@ -1786,9 +1786,14 @@ function wp_update_custom_css_post( $css, $args = array() ) {
|
||||
$r = wp_update_post( wp_slash( $post_data ), true );
|
||||
} else {
|
||||
$r = wp_insert_post( wp_slash( $post_data ), true );
|
||||
|
||||
// Trigger creation of a revision. This should be removed once #30854 is resolved.
|
||||
if ( ! is_wp_error( $r ) && 0 === count( wp_get_post_revisions( $r ) ) ) {
|
||||
wp_save_post_revision( $r );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $r instanceof WP_Error ) {
|
||||
if ( is_wp_error( $r ) ) {
|
||||
return $r;
|
||||
}
|
||||
return get_post( $r );
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.7-RC1-39355';
|
||||
$wp_version = '4.7';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
@@ -80,8 +80,13 @@ wp_debug_mode();
|
||||
* Default true.
|
||||
*/
|
||||
if ( WP_CACHE && apply_filters( 'enable_loading_advanced_cache_dropin', true ) ) {
|
||||
// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
|
||||
// For an advanced caching plugin to use. Uses a static drop-in because you would only want one.
|
||||
WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' );
|
||||
|
||||
// Re-initialize any hooks added manually by advanced-cache.php
|
||||
if ( $wp_filter ) {
|
||||
$wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter );
|
||||
}
|
||||
}
|
||||
|
||||
// Define WP_LANG_DIR if not set.
|
||||
|
||||
Reference in New Issue
Block a user