<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[33198] trunk/src/wp-admin/includes/class-wp-site-icon.php: Improving formatting for various pieces of inline documentation in the new `WP_Site_Icon` class added in 4.3.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/33198">33198</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/33198","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>DrewAPicture</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-07-13 17:50:41 +0000 (Mon, 13 Jul 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Improving formatting for various pieces of inline documentation in the new `WP_Site_Icon` class added in 4.3.
See <a href="https://core.trac.wordpress.org/changeset/32994">[32994]</a>. See <a href="https://core.trac.wordpress.org/ticket/32891">#32891</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpsiteiconphp">trunk/src/wp-admin/includes/class-wp-site-icon.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpsiteiconphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-site-icon.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-icon.php 2015-07-13 17:48:07 UTC (rev 33197)
+++ trunk/src/wp-admin/includes/class-wp-site-icon.php 2015-07-13 17:50:41 UTC (rev 33198)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,7 +1,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Class WP_Site_Icon.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Class for implementing site icon functionality.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The minimum size of the site icon.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $min_size = 512;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,29 +19,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * The size to which to crop the image so that we can display it in the UI nicely.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var int
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $page_crop = 512;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * List of site icon sizes.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $site_icon_sizes = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
</ins><span class="cx" style="display: block; padding: 0 10px"> * Square, medium sized tiles for IE11+.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @link https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * See https://msdn.microsoft.com/library/dn455106(v=vs.85).aspx
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> 270,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /*
</ins><span class="cx" style="display: block; padding: 0 10px"> * App icons up to iPhone 6 Plus.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @link https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * See https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> 180,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,9 +51,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Register our actions and filters.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Registers actions and filters.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct() {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,11 +69,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add a hidden upload page.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adds a hidden upload page.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * There is no need to access it directly.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function admin_menu_upload_site_icon() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = add_submenu_page( null, __( 'Site Icon' ), __( 'Site Icon' ), 'manage_options', 'site-icon', array( $this, 'upload_site_icon_page' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -83,9 +85,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add scripts to admin settings pages.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adds scripts to admin settings pages.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function enqueue_scripts() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_style( 'jcrop' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -93,9 +96,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Load on when the admin is initialized.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Loads the settings when the admin is initialized.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function add_upload_settings() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_section( 'site-icon-upload', false, false, 'site-icon-upload' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,9 +109,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Removes site icon.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Removes the site icon.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function remove_site_icon() {
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'remove-site-icon' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,6 +123,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handle uploading a site icon.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * Uploading a site_icon is a 3 step process
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * 1. Select the file to upload
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,6 +132,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * 3. Confirmation
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function upload_site_icon_page() {
</span><span class="cx" style="display: block; padding: 0 10px"> $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'select_site_icon';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,6 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Displays the site_icon form to upload the image.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function select_page() {
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,9 +169,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Settings field for file upload.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles settings field for file upload.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function upload_field() {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_enqueue_media();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -191,11 +201,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Check if the image needs cropping.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Checks if the image needs cropping.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * If it doesn't need cropping, proceed to set the icon.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function maybe_skip_cropping() {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_REQUEST['action'] ) || 'crop_site_icon' !== $_REQUEST['action'] ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -222,9 +233,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Crop a the image admin view.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles the image crop admin view.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function crop_page() {
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'crop-site-icon' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,9 +326,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Saves a new Site Icon.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles saving a new Site Icon.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function set_site_icon() {
</span><span class="cx" style="display: block; padding: 0 10px"> check_admin_referer( 'set-site-icon' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,9 +337,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = absint( $_REQUEST['attachment_id'] );
</span><span class="cx" style="display: block; padding: 0 10px"> $create_new_attachement = ! empty( $_REQUEST['create-new-attachment'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /*
- * If the current attachment as been set as site icon don't delete it.
- */
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // If the current attachment as been set as site icon don't delete it.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( get_option( 'site_icon' ) == $attachment_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the file path.
</span><span class="cx" style="display: block; padding: 0 10px"> $image_url = get_attached_file( $attachment_id );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -373,9 +384,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Upload the file to be cropped in the second step.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles uploading the file to be cropped in the second step.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function handle_upload() {
</span><span class="cx" style="display: block; padding: 0 10px"> $uploaded_file = $_FILES['site-icon'];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,7 +423,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Create an attachment 'object'.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Creates an attachment 'object'.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,9 +452,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Insert an attachment.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Inserts an attachment.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $object Attachment object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $file File path of the attached image.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -456,7 +469,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Update the metadata of an attachment.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Handles updating the metadata of an attachment.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,12 +493,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add additional sizes to be made when creating the site_icon images.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adds additional sizes to be made when creating the site_icon images.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $sizes
- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $sizes List of additional sizes.
+ * @return array Additional image sizes.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function additional_sizes( $sizes = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $only_crop_sizes = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -524,12 +538,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Add Site Icon sizes to the array of image sizes on demand.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Adds Site Icon sizes to the array of image sizes on demand.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $sizes
- * @return array
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $sizes List of image sizes.
+ * @return array List of intermediate image sizes.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function intermediate_image_sizes( $sizes = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-admin/includes/site-icon.php */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -545,8 +560,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Deletes all additional image sizes, used for site icons.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return bool
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return bool Whether the site icon was successfully deleted.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function delete_site_icon() {
</span><span class="cx" style="display: block; padding: 0 10px"> // We add the filter to make sure that we also delete all the added images.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,6 +577,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Deletes the Site Icon when the image file is deleted.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Attachment ID.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -576,14 +593,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Adds custom image sizes when meta data for an image is requested, that happens to be used as Site Icon.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access public
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param null|array|string $value The value get_metadata() should
- * return - a single metadata value,
- * or an array of values.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param null|array|string $value The value get_metadata() should return a single metadata value, or an
+ * array of values.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param int $post_id Post ID.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $meta_key Meta key.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $single Meta value, or an array of values.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return array|null|string
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return array|null|string The attachment metadata value, array of values, or null.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_post_metadata( $value, $post_id, $meta_key, $single ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $site_icon_id = get_option( 'site_icon' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -596,9 +613,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Get the data required to work with the uploaded image
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Gets the data required to work with the uploaded image
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.3.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @access private
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array containing the collected data
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span></span></pre>
</div>
</div>
</body>
</html>