<!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>[7306] sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub: Support Hub: Add Support Hub plugin</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 { white-space: pre-line; 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="http://meta.trac.wordpress.org/changeset/7306">7306</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/7306","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-06-14 12:28:54 +0000 (Thu, 14 Jun 2018)</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'>Support Hub: Add Support Hub plugin
Props atachibana, bravokeyl, carl-alberto, clorith, felipeelia, hideokamoto, hlashbrooke, joyously, justingreerbbi, kenshino, mapk, mariovalney, mirucon, miyauchi, netweb, torounit, webdevmattcrom, zzap
See <a href="http://meta.trac.wordpress.org/ticket/3485">#3485</a>.</pre>
<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesassetscsscodexlanguagescss">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/codex-languages.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesclasshelphubcodexlanguagesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesreadmetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/readme.txt</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsLICENSEtxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/LICENSE.txt</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsREADMEtxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/README.txt</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminclasshelphubcontributorsadminphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/index.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/js/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminjshelphubcontributorsadminjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/js/helphub-contributors-admin.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorshelphubcontributorsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/helphub-contributors.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsincludesclasshelphubcontributorsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsincludesindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/index.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/languages/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorslanguageshelphubcontributorspot">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/languages/helphub-contributors.pot</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorspublicclasshelphubcontributorspublicphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorspublicindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/index.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/sass/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorssrcsasshelphubcontributorspublicscss">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/sass/helphub-contributors-public.scss</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsuninstallphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/uninstall.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcustomrolesclasshelphubcustomrolesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcustomrolesindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/index.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblockshelphubfrontpageblocksphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/helphub-front-page-blocks.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludesclasssupporthelphubfrontpageblockswidgetphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludeswidgetbackendphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludeswidgetfrontendphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetscssadmincss">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/admin.css</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetsjsadminjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/admin.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetsjsgalleryjs">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/gallery.js</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypesposttypephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypestaxonomyphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypeshelphubposttypesphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/helphub-post-types.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesreadmetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/readme.txt</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubreadtimehelphubreadtimephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/helphub-read-time.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubreadtimereadmetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/readme.txt</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteassetscssstylecss">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/style.css</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteincludesclasstableofcontentslitephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteindexphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/index.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/lang/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitelangtableofcontentslitepot">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/lang/table-of-contents-lite.pot</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitereadmetxt">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/readme.txt</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitetableofcontentslitephp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/table-of-contents-lite.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubsupporthelphubphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesassetscsscodexlanguagescss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/codex-languages.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/codex-languages.css (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/codex-languages.css 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,8 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.entry-content .language-links {
+ border: 1px solid #ccc;
+ color: #333;
+ font-size: 90%;
+ line-height: 1.5;
+ padding: 10px;
+ text-align: left;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/assets/css/codex-languages.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesclasshelphubcodexlanguagesphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,251 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: Helphub Codex Languages
+ * Plugin URI: http://www.wordpress.org
+ * Description: Short code to link codex translated articles from HelpHub
+ * Version: 1.0.0
+ * Author: Akira Tachibana
+ * Author URI: http://www.helphubcommunications.com/
+ * Requires at least: 4.0.0
+ * Tested up to: 4.0.0
+ *
+ * Text Domain: helphub
+ * Domain Path: /languages/
+ *
+ * @package HelpHub_Codex_Languages
+ * @category Core
+ * @author Akira Tachibana
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Returns the main instance of HelpHub_Codex_Languages to prevent the need to
+ * use globals.
+ *
+ * @since 1.0.0
+ * @return object HelpHub_Codex_Languages
+ */
+function helphub_codex_languages() {
+ return HelpHub_Codex_Languages::instance();
+} // End HelpHub_Codex_Languages()
+
+add_action( 'plugins_loaded', 'helphub_codex_languages' );
+
+/**
+ * Main HelpHub_Codex_Languages Class
+ *
+ * @class HelpHub_Codex_Languages
+ * @version 1.0.0
+ * @since 1.0.0
+ * @package HelpHub_Codex_Languages
+ * @author Akira Tachibana
+ */
+final class HelpHub_Codex_Languages {
+ /**
+ * HelpHub_Codex_Languages The single instance of HelpHub_Codex_Languages.
+ *
+ * @var object
+ * @access private
+ * @since 1.0.0
+ */
+ private static $_instance = null;
+
+ /**
+ * The token.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $token;
+
+ /**
+ * The version number.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $version;
+
+ /**
+ * The plugin directory URL.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $plugin_url;
+
+ /**
+ * Constructor function.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __construct() {
+ $this->token = 'helphub';
+ $this->plugin_url = plugin_dir_url( __FILE__ );
+ $this->version = '1.0.0';
+
+ register_activation_hook( __FILE__, array( $this, 'install' ) );
+
+ add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
+
+ add_shortcode( 'codex_languages', array( $this, 'codex_languages_func' ) );
+ } // End __construct()
+
+ /**
+ * Short code for Codex Language link.
+ *
+ * Note for pt-br, zh-cn and zh-tw: In short codes, hypen causes many troubles
+ * so it have to be removed.
+ *
+ * @example [languages en="Version 4.6" ja="version 4.6"]
+ * @param string $atts language indicator. Refer Multilingual_Codex.
+ * @access public
+ * @since 1.0.0
+ */
+ public function codex_languages_func( $atts ) {
+ wp_enqueue_style( 'helphub-codex-languages-style', $this->plugin_url . 'assets/css/codex-languages.css', array(), '1.0.0' );
+ $str = '<p class="language-links"><a href="https://codex.wordpress.org/Multilingual_Codex" title="Multilingual Codex" class="mw-redirect">Languages</a>: <strong class="selflink">English</strong>';
+ $lang_table = array(
+ array( 'Arabic', 'العربية', 'ar_codex', 'https://codex.wordpress.org/ar:%1s' ),
+ array( 'Azerbaijani', 'Azərbaycanca', 'azr_codex', 'https://codex.wordpress.org/azr:%1s' ),
+ array( 'Azeri', 'آذری', 'azb_codex', 'https://codex.wordpress.org/azb:%1s' ),
+ array( 'Bulgarian', 'Български', 'bg_codex', 'https://codex.wordpress.org/bg:%1s' ),
+ array( 'Bengali', 'বাংলা', 'bn_codex', 'https://codex.wordpress.org/bn:%1s' ),
+ array( 'Bosnian', 'Bosanski', 'bs_codex', 'https://codex.wordpress.org/bs:%1s' ),
+ array( 'Catalan', 'Catalan', 'ca_codex', 'https://codex.wordpress.org/ca:%1s' ),
+ array( 'Czech', 'Čeština', 'cs_codex', 'https://codex.wordpress.org/cs:%1s' ),
+ array( 'Danish', 'Dansk', 'da_codex', 'https://codex.wordpress.org/da:%1s' ),
+ array( 'German', 'Deutsch', 'de_codex', 'https://codex.wordpress.org/de:%1s' ),
+ array( 'Greek', 'Greek', 'el_codex', 'http://wpgreece.org/%1s' ),
+ array( 'Spanish', 'Español', 'es_codex', 'https://codex.wordpress.org/es:%1s' ),
+ array( 'Finnish', 'suomi', 'fi_codex', 'https://codex.wordpress.org/fi:%1s' ),
+ array( 'French', 'Français', 'fr_codex', 'https://codex.wordpress.org/fr:%1s' ),
+ array( 'Croatian', 'Hrvatski', 'hr_codex', 'https://codex.wordpress.org/hr:%1s' ),
+ array( 'Hebrew', 'עברית', 'he_codex', 'https://codex.wordpress.org/he:%1s' ),
+ array( 'Hindi', 'हिन्दी', 'hi_codex', 'https://codex.wordpress.org/hi:%1s' ),
+ array( 'Hungarian', 'Magyar', 'hu_codex', 'https://codex.wordpress.org/hu%1s' ),
+ array( 'Indonesian', 'Bahasa Indonesia', 'id_codex', 'http://id.wordpress.net/codex/%1s' ),
+ array( 'Italian', 'Italiano', 'it_codex', 'https://codex.wordpress.org/it:%1s' ),
+ array( 'Japanese', '日本語', 'ja_codex', 'http://wpdocs.sourceforge.jp/%1s' ),
+ array( 'Georgian', 'ქართული', 'ka_codex', 'https://codex.wordpress.org/ka:%1s' ),
+ array( 'Khmer', 'ភាសាខ្មែរ', 'km_codex', 'http://khmerwp.com/%1s' ),
+ array( 'Korean', '한국어', 'ko_codex', 'http://wordpress.co.kr/codex/%1s' ),
+ array( 'Lao', 'ລາວ', 'lo_codex', 'http://www.laowordpress.com/%1s' ),
+ array( 'Macedonian', 'Македонски', 'mk_codex', 'https://codex.wordpress.org/mk:%1s' ),
+ array( 'Moldavian', 'Română', 'md_codex', 'https://codex.wordpress.org/md:%1s' ),
+ array( 'Mongolian', 'Mongolian', 'mn_codex', 'https://codex.wordpress.org/mn:%1s' ),
+ array( 'Myanmar', 'myanmar', 'mya_codex', 'http://www.myanmarwp.com/%1s' ),
+ array( 'Dutch', 'Nederlands', 'nl_codex', 'https://codex.wordpress.org/nl:%1s' ),
+ array( 'Persian', 'فارسی', 'fa_codex', 'http://codex.wp-persian.com/%1s' ),
+ array( 'Farsi', 'فارسی', 'fax_codex', 'http://www.isawpi.ir/wiki/%1s' ),
+ array( 'Polish', 'Polski', 'pl_codex', 'https://codex.wordpress.org/pl:%1s' ),
+ array( 'Portuguese_Português', 'Português', 'pt_codex', 'https://codex.wordpress.org/pt:%1s' ),
+ array( 'Brazilian Portuguese', 'Português do Brasil', 'ptbr_codex', 'https://codex.wordpress.org/pt-br:%1s' ),
+ array( 'Romanian', 'Română', 'ro_codex', 'https://codex.wordpress.org/ro:%1s' ),
+ array( 'Russian', 'Русский', 'ru_codex', 'https://codex.wordpress.org/ru:%1s' ),
+ array( 'Serbian', 'Српски', 'sr_codex', 'https://codex.wordpress.org/sr:%1s' ),
+ array( 'Slovak', 'Slovenčina', 'sk_codex', 'https://codex.wordpress.org/sk:%1s' ),
+ array( 'Slovenian', 'Slovenščina', 'sl_codex', 'https://codex.wordpress.org/sl:%1s' ),
+ array( 'Albanian', 'Shqip', 'sq_codex', 'https://codex.wordpress.org/al:%1s' ),
+ array( 'Swedish', 'Svenska', 'sv_codex', 'http://wp-support.se/dokumentation/%1s' ),
+ array( 'Tamil', 'Tamil', 'ta_codex', 'http://codex.wordpress.com/ta:%1s' ),
+ array( 'Telugu', 'తెలుగు', 'te_codex', 'https://codex.wordpress.org/te:%1s' ),
+ array( 'Thai', 'ไทย', 'th_codex', 'http://codex.wordthai.com/%1s' ),
+ array( 'Turkish', 'Türkçe', 'tr_codex', 'https://codex.wordpress.org/tr:%1s' ),
+ array( 'Ukrainian', 'Українська', 'uk_codex', 'https://codex.wordpress.org/uk:%1s' ),
+ array( 'Vietnamese', 'Tiếng Việt', 'vi_codex', 'https://codex.wordpress.org/vi:%1s' ),
+ array( 'Chinese', '中文(简体)', 'zhcn_codex', 'https://codex.wordpress.org/zh-cn:%1s' ),
+ array( 'Chinese (Taiwan)', '中文(繁體)', 'zhtw_codex', 'https://codex.wordpress.org/zh-tw:%1s' ),
+ array( 'Kannada', 'ಕನ್ನಡ', 'kn_codex', 'https://codex.wordpress.org/kn:%1s' ),
+ );
+ $shortcode_params = array();
+ foreach ( $lang_table as $lang ) {
+ $shortcode_params[ $lang[2] ] = null;
+ }
+ $args = shortcode_atts( $shortcode_params, $atts );
+ $i = 0;
+ foreach ( $args as $key => $value ) {
+ if ( null != $value ) {
+ $str .= sprintf( ' • <a class="external text" href="' . $lang_table[ $i ][3] . '">' . $lang_table[ $i ][1] . '</a>', $value );
+ }
+ $i++;
+ }
+ $str .= '</p>';
+ return $str;
+ } // End codex_languages_func()
+
+ /**
+ * Main HelpHub_Codex_Languages Instance
+ *
+ * Ensures only one instance of HelpHub_Codex_Languages is loaded or can be loaded.
+ *
+ * @since 1.0.0
+ * @static
+ * @see HelpHub_Codex_Languages()
+ * @return Main HelpHub_Codex_Languages instance
+ */
+ public static function instance() {
+ if ( is_null( self::$_instance ) ) {
+ self::$_instance = new self();
+ }
+ return self::$_instance;
+ } // End instance()
+
+ /**
+ * Load the localisation file.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function load_plugin_textdomain() {
+ load_plugin_textdomain( 'wporg-forums', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
+ } // End load_plugin_textdomain()
+
+ /**
+ * Cloning is forbidden.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __clone() {
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'wporg-forums' ), '1.0.0' );
+ } // End __clone()
+
+ /**
+ * Unserializing instances of this class is forbidden.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __wakeup() {
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'wporg-forums' ), '1.0.0' );
+ } // End __wakeup()
+
+ /**
+ * Installation. Runs on activation.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function install() {
+ $this->_log_version_number();
+ } // End install()
+
+ /**
+ * Log the plugin version number.
+ *
+ * @access private
+ * @since 1.0.0
+ */
+ private function _log_version_number() {
+ // Log the version number.
+ update_option( $this->token . '-version', $this->version );
+ } // End _log_version_number()
+} // End Class
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/class-helphub-codex-languages.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Silence is golden.
+ * @codingStandardsIgnoreFile
+ */
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcodexlanguagesreadmetxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/readme.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/readme.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-codex-languages/readme.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,102 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+=== Helphub Codex Languages ===
+Contributors: Akira Tachibana
+Donate link:
+Tags: 1.0
+Requires at least: 4.0.0
+Tested up to: 4.0.0
+Stable tag: 1.0.0
+License: GPLv3 or later
+License URI: http://www.gnu.org/licenses/gpl-3.0.html
+
+Short code for links to the codex translated articles from HelpHub
+
+== Description ==
+
+This plugin provides shortcode "codex_languages" to make a links to the codex tranlslated articles.
+It is the same role with the Codex Template:Languages.
+
+The list of supported language, keyword and link are as followings:
+NOTE: pt-br, zh-cn and zh-cw are ptbr_codex, zhcn_codex and zhcw_codex by shortcode restriction.
+
+* Arabic / ar_codex / codex.wordpress.org/ar:<article>
+* Azerbaijani / azr_codex / codex.wordpress.org/azr:<article>
+* Azeri / azb_codex / codex.wordpress.org/azb:<article>
+* Bulgarian / bg_codex / codex.wordpress.org/bg:<article>
+* Bengali / bn_codex / codex.wordpress.org/bn:<article>
+* Bosnian / bs_codex / codex.wordpress.org/bs:<article>
+* Catalan / ca_codex / codex.wordpress.org/ca:<article>
+* Czech / cs_codex / codex.wordpress.org/cs:<article>
+* Danish / da_codex / codex.wordpress.org/da:<article>
+* German / de_codex / codex.wordpress.org/de:<article>
+* Greek / el_codex / wpgreece.org/<article>
+* Spanish / es_codex / codex.wordpress.org/es:<article>
+* Finnish / fi_codex / codex.wordpress.org/fi:<article>
+* French / fr_codex / codex.wordpress.org/fr:<article>
+* Croatian / hr_codex / codex.wordpress.org/hr:<article>
+* Hebrew / he_codex / codex.wordpress.org/he:<article>
+* Hindi / hi_codex / codex.wordpress.org/hi:<article>
+* Hungarian / hu_codex / codex.wordpress.org/hu<article>
+* Indonesian / id_codex / id.wordpress.net/codex/<article>
+* Italian / it_codex / codex.wordpress.org/it:<article>
+* Japanese / ja_codex / wpdocs.sourceforge.jp/<article>
+* Georgian / ka_codex / codex.wordpress.org/ka:<article>
+* Khmer / km_codex / khmerwp.com/<article>
+* Korean / ko_codex / wordpress.co.kr/codex/<article>
+* Lao / lo_codex / www.laowordpress.com/<article>
+* Macedonian / mk_codex / codex.wordpress.org/mk:<article>
+* Moldavian / md_codex / codex.wordpress.org/md:<article>
+* Mongolian / mn_codex / codex.wordpress.org/mn:<article>
+* Myanmar / mya_codex / www.myanmarwp.com/<article>
+* Dutch / nl_codex / codex.wordpress.org/nl:<article>
+* Persian / fa_codex / codex.wp-persian.com/<article>
+* Farsi / fax_codex / www.isawpi.ir/wiki/<article>
+* Polish / pl_codex / codex.wordpress.org/pl:<article>
+* Portuguese_Português / Português / codex.wordpress.org/pt:<article>
+* Brazilian Portuguese / Português do Brasil / ptbr_codex / codex.wordpress.org/pt-br:<article>
+* Romanian / ro_codex / codex.wordpress.org/ro:<article>
+* Russian / ru_codex / codex.wordpress.org/ru:<article>
+* Serbian / sr_codex / codex.wordpress.org/sr:<article>
+* Slovak / sk_codex / codex.wordpress.org/sk:<article>
+* Slovenian / sl_codex / codex.wordpress.org/sl:<article>
+* Albanian / sq_codex / codex.wordpress.org/al:<article>
+* Swedish / sv_codex / wp-support.se/dokumentation/<article>
+* Tamil / ta_codex / codex.wordpress.com/ta:<article>
+* Telugu / te_codex / codex.wordpress.org/te:<article>
+* Thai / th_codex / codex.wordthai.com/<article>
+* Turkish / tr_codex / codex.wordpress.org/tr:<article>
+* Ukrainian / uk_codex / codex.wordpress.org/uk:<article>
+* Vietnamese / vi_codex / codex.wordpress.org/vi:<article>
+* Chinese / , "zhcn_codex / codex.wordpress.org/zh-cn:<article>
+* Chinese (Taiwan) / 中文(繁體) / zhtw_codex / codex.wordpress.org/zh-tw:<article>
+* Kannada / kn_codex / codex.wordpress.org/kn:<article>
+
+== Usage ==
+
+In your post, insert shortcode "codex_languages" with language keyword and article title.
+
+Example:
+ [codex_languages en="Version 4.6" codex_ja="version 4.6"]
+
+== Installation ==
+
+Installing "Helphub Codex Languages" can be done either by searching for "Helphub Codex Languages" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
+
+1. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
+2. Activate the plugin through the 'Plugins' menu in WordPress
+3. Visit the settings screen and configure, as desired.
+
+== Frequently Asked Questions ==
+
+= Why does language keyword have 'codex_' prefix such as 'codex_ja'? =
+Simple keywords such as 'ja' were reserved for the future internatinalized HelpHub site.
+
+= Why are keywords of pt-br, ch-zn and ch-tw are 'ptbr_codex', 'chzn_codex' and 'chtw_codex'? =
+This is because shortcode spec that cannot handle hyphen character well.
+Refer https://codex.wordpress.org/Shortcode_API#Hyphens.
+
+== Upgrade Notice ==
+
+== Changelog ==
+
+= 1.0.0 =
+* Initial release.
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsLICENSEtxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/LICENSE.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/LICENSE.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/LICENSE.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,339 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsREADMEtxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/README.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/README.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/README.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,33 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+=== HelpHub Contributors ===
+Contributors: milana_cap
+Donate link:
+Tags: 1.0
+Requires at least: 4.7
+Tested up to: 4.7
+Stable tag: 1.0
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+WordPress plugin for tracking contributors to wordpress.org Documenation team's HelpHub project.
+
+== Description ==
+
+== Installation ==
+
+1. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
+2. Activate the plugin through the 'Plugins' menu in WordPress
+3. Go to edit-post screen and add wp.org usernames to "Contributors" field in "Publish" meta-box.
+
+== Frequently Asked Questions ==
+
+== Screenshots ==
+
+== Upgrade Notice ==
+
+= 1.0.0 =
+* Initial release.
+
+== Changelog ==
+
+= 1.0.0 =
+* Initial release.
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminclasshelphubcontributorsadminphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,184 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Admin functionality of the plugin.
+ *
+ * @package HelpHub_Contributors
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+/**
+ * HelpHub Contributors Admin Class
+ *
+ * The admin functionality of the plugin.
+ *
+ * @since 1.0.0
+ */
+class Helphub_Contributors_Admin {
+ /**
+ * Unique ID of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $helphub_contributors Unique ID of plugin.
+ */
+ private $helphub_contributors;
+
+ /**
+ * The version of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $version The current version of plugin.
+ */
+ private $version;
+
+ /**
+ * Initialize the class and set its properties.
+ *
+ * @since 1.0.0
+ * @param string $helphub_contributors The name of the plugin.
+ * @param string $version The version of plugin.
+ */
+ public function __construct( $helphub_contributors, $version ) {
+
+ $this->helphub_contributors = $helphub_contributors;
+ $this->version = $version;
+
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
+ add_action( 'post_submitbox_misc_actions', array( $this, 'add_contributors' ) );
+ add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );
+
+ // Show contributors for all post types with edit UI.
+ // Easily hide it with post_type_supports()
+ $post_types = get_post_types( array( 'show_ui' => true ) );
+ if ( ! empty( $post_types ) ) {
+ foreach ( $post_types as $post_type ) {
+ add_post_type_support( $post_type, 'helphub-contributors' );
+ add_action( "manage_edit-{$post_type}_columns", array( $this, 'add_column' ) );
+ add_action( "manage_{$post_type}_posts_custom_column", array( $this, 'show_column' ), 10, 2 );
+ }
+ }
+ }
+
+ /**
+ * Enqueue assets for the admin area.
+ *
+ * @since 1.0.0
+ */
+ public function admin_enqueue_scripts() {
+ // Styles.
+ wp_enqueue_style( 'select2', plugin_dir_url( __FILE__ ) . 'assets/node_modules/select2/dist/css/select2.min.css', array(), '1.0.0' );
+ // Scripts.
+ wp_enqueue_script( 'select2', plugin_dir_url( __FILE__ ) . 'assets/node_modules/select2/dist/js/select2.min.js', array( 'jquery' ), '1.0.0', true );
+ wp_enqueue_script( $this->helphub_contributors, plugin_dir_url( __FILE__ ) . 'js/helphub-contributors-admin.js', array( 'jquery' ), $this->version, false );
+ }
+ /**
+ * Add select field to Publish metabox.
+ * Attached to 'post_submitbox_misc_actions' action hook.
+ */
+ public function add_contributors() {
+ $post = get_post();
+
+ if ( ! $post ) {
+ return;
+ }
+
+ if ( ! post_type_supports( $post->post_type, 'helphub-contributors' ) ) {
+ return;
+ }
+ // Set nonce.
+ wp_nonce_field( 'helphub-contributors-save', 'helphub_contributors_nonce' );
+ // Get existing contributors.
+ $contributors = get_post_meta( $post->ID, 'helphub_contributors' ); ?>
+
+ <div class="misc-pub-section helphub-contributors">
+ <label><?php esc_html_e( 'Contributors', 'wporg-forums' ); ?>
+ <select id="helphub-contributors" class="widefat" multiple name="helphub_contributors[]">
+ <?php foreach ( $contributors[0] as $contributor ) : ?>
+ <option value="<?php echo esc_attr( $contributor ); ?>" selected="selected"><?php echo esc_html( $contributor ); ?></option>
+ <?php endforeach; ?>
+ </select><!-- #helphub-contributors -->
+ </label>
+ <p class="description"><?php esc_html_e( 'Type wp.org username for contributor', 'wporg-forums' ); ?></p>
+ </div><!-- misc-pub-section helphub-contributors -->
+ <?php
+ }
+
+ /**
+ * Save contributors as post meta on save post.
+ * Attached to 'save_post' action hook.
+ *
+ * @param int $post_id Post id
+ * @param WP_Post $post Post object
+ */
+ public function save_post( $post_id, $post ) {
+ // Verify nonce.
+ if ( ! isset( $_POST['helphub_contributors_nonce'] ) || ! wp_verify_nonce( $_POST['helphub_contributors_nonce'], 'helphub-contributors-save' ) ) {
+ return;
+ }
+
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
+ return;
+ }
+
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ return;
+ }
+
+ if ( ! isset( $_POST['helphub_contributors'] ) || empty( $_POST['helphub_contributors'] ) ) {
+ return;
+ }
+
+ $contributors = $_POST['helphub_contributors'];
+
+ update_post_meta( $post_id, 'helphub_contributors', $contributors );
+ }
+
+ /**
+ * Add Contributors column on edit.php screen.
+ * Attached to "manage_edit-{$post_type}_columns" action hook.
+ *
+ * @param array $columns Array of columns
+ */
+ public function add_column( $columns ) {
+ $columns['helphub_contributors'] = esc_html__( 'Contributors', 'wporg-forums' );
+ return $columns;
+ }
+
+ /**
+ * Show Contributors column on edit.php screen.
+ * Attached to "manage_{$post_type}_posts_custom_column" action hook.
+ *
+ * @param string $column Column ID
+ * @param int $post_id Post id
+ */
+ public function show_column( $column, $post_id ) {
+ if ( 'helphub_contributors' !== $column ) {
+ return;
+ }
+
+ $contributors = get_post_meta( $post_id, 'helphub_contributors', true );
+
+ if ( empty( $contributors ) ) {
+ return;
+ }
+
+ if ( is_array( $contributors ) ) :
+ foreach ( $contributors as $contributor ) {
+ $contributor_link = '<a href="https://profiles.wordpress.org/' . esc_html( $contributor ) . '">@' . esc_html( $contributor ) . '</a>';
+
+ if ( end( $contributors ) == $contributor ) {
+ $contributor_link .= esc_html__( '.', 'wporg-forums' );
+ } else {
+ $contributor_link .= esc_html__( ', ', 'wporg-forums' );
+ }
+
+ echo $contributor_link;
+ }
+ endif;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/class-helphub-contributors-admin.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php // Silence is golden
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsadminjshelphubcontributorsadminjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/js/helphub-contributors-admin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/js/helphub-contributors-admin.js (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/admin/js/helphub-contributors-admin.js 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,13 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/*jslint node: true */
+jQuery( document ).ready( function( $ ) {
+ 'use strict';
+
+ // ON DOCUMENT READY
+ $( document ).ready( function() {
+
+ $( '#helphub-contributors' ).select2( {
+ tags: true
+ } );
+
+ } );
+} );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorshelphubcontributorsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/helphub-contributors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/helphub-contributors.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/helphub-contributors.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,37 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: HelpHub Contributors
+ * Plugin URI: https://github.com/zzap/HelpHub-Contributors.git
+ * Description: WordPress plugin for tracking contributors to wordpress.org Documenation team's HelpHub project.
+ * Version: 1.0.0
+ * Author: Milana Cap
+ * Author URI: http://developerka.org/
+ * License: GPL-2.0+
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
+ * Text Domain: helphub-contributors
+ * Domain Path: /languages
+ *
+ * @package HelpHub_Contributors
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+/**
+ * The core plugin class that is used to define internationalization,
+ * admin-specific hooks, and public-facing site hooks.
+ */
+require plugin_dir_path( __FILE__ ) . 'includes/class-helphub-contributors.php';
+
+/**
+ * Returns instance of HelpHub_Contributors.
+ *
+ * @since 1.0.0
+ * @return object HelpHub_Contributors
+ */
+function helphub_contributors() {
+ return HelpHub_Contributors::instance();
+}
+add_action( 'plugins_loaded', 'helphub_contributors' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/helphub-contributors.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsincludesclasshelphubcontributorsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,164 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The main plugin class.
+ *
+ * @package HelpHub_Contributors
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+/**
+ * HelpHub Contributors Class
+ *
+ * Define internationalization, admin and frontend hooks.
+ *
+ * @since 1.0.0
+ */
+class HelpHub_Contributors {
+ /**
+ * The single instance.
+ *
+ * @var object
+ * @access private
+ * @since 1.0.0
+ */
+ private static $_instance;
+
+ /**
+ * Unique ID of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $helphub_contributors Unique ID of plugin.
+ */
+ private $helphub_contributors;
+
+ /**
+ * The version of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $version The current version of plugin.
+ */
+ private $version;
+
+ /**
+ * Define the core functionality of the plugin.
+ *
+ * @since 1.0.0
+ */
+ public function __construct() {
+ $this->helphub_contributors = 'helphub-contributors';
+ $this->version = '1.0.0';
+ add_action( 'init', array( $this, 'set_locale' ) );
+ $this->required_dependencies();
+ $this->admin_hooks();
+ $this->frontend_hooks();
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
+ }
+
+ /**
+ * Define the locale for plugin.
+ *
+ * @since 1.0.0
+ * @access public
+ */
+ public function set_locale() {
+ load_plugin_textdomain( $this->get_helphub_contributors(), false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
+ );
+ }
+
+ /**
+ * Required dependencies for plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ */
+ private function required_dependencies() {
+ /**
+ * The class responsible for defining all actions that occur in the admin area.
+ */
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-helphub-contributors-admin.php';
+ /**
+ * The class responsible for defining all actions that occur in the public-facing
+ * side of the site.
+ */
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-helphub-contributors-public.php';
+ }
+
+ /**
+ * Register admin hooks.
+ *
+ * @since 1.0.0
+ * @access private
+ */
+ private function admin_hooks() {
+ return new HelpHub_Contributors_Admin( $this->get_helphub_contributors(), $this->get_version() );
+ }
+
+ /**
+ * Register frontend hooks.
+ *
+ * @since 1.0.0
+ * @access private
+ */
+ private function frontend_hooks() {
+ return new HelpHub_Contributors_Public( $this->get_helphub_contributors(), $this->get_version() );
+ }
+
+ /**
+ * The unique identifier of the plugin.
+ *
+ * @since 1.0.0
+ * @return string The name of the plugin.
+ */
+ public function get_helphub_contributors() {
+ return $this->helphub_contributors;
+ }
+
+ /**
+ * The version number of the plugin.
+ *
+ * @since 1.0.0
+ * @return string The version number of the plugin.
+ */
+ public function get_version() {
+ return $this->version;
+ }
+
+ /**
+ * Activation of the plugin.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function activate() {
+ $this->update_version();
+ }
+
+ /**
+ * Update version number.
+ *
+ * @access private
+ * @since 1.0.0
+ */
+ private function update_version() {
+ update_option( $this->helphub_contributors . '-version', $this->version );
+ }
+
+ /**
+ * Single class instance
+ *
+ * @return HelpHub_Contributors instance
+ */
+ public static function instance() {
+ if ( ! self::$_instance ) {
+ self::$_instance = new self();
+ }
+
+ return self::$_instance;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/class-helphub-contributors.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsincludesindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php // Silence is golden
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/includes/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php // Silence is golden
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorslanguageshelphubcontributorspot"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/languages/helphub-contributors.pot</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php
===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php (rev 0)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php 2018-06-14 12:28:54 UTC (rev 7306)
</ins><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,192 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Frontend functionality of the plugin.
+ *
+ * @package HelpHub_Contributors
+ */
+
+// If this file is called directly, abort.
+if ( ! defined( 'WPINC' ) ) {
+ die;
+}
+
+/**
+ * HelpHub Contributors Public Class
+ *
+ * The frontend functionality of the plugin.
+ *
+ * @since 1.0.0
+ */
+class HelpHub_Contributors_Public {
+ /**
+ * Unique ID of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $helphub_contributors Unique ID of plugin.
+ */
+ private $helphub_contributors;
+
+ /**
+ * The version of plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $version The current version of plugin.
+ */
+ private $version;
+
+ /**
+ * Initialize the class and set its properties.
+ *
+ * @since 1.0.0
+ * @param string $helphub_contributors The name of the plugin.
+ * @param string $version The version of plugin.
+ */
+ public function __construct( $helphub_contributors, $version ) {
+ $this->helphub_contributors = $helphub_contributors;
+ $this->version = $version;
+ add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) );
+ add_filter( 'the_content', array( $this, 'show_contributors' ) );
+ }
+
+ /**
+ * Enqueue assets for the frontend.
+ *
+ * @since 1.0.0
+ */
+ public function public_enqueue_scripts() {
+ // Styles.
+ wp_enqueue_style( $this->helphub_contributors, plugin_dir_url( __FILE__ ) . 'css/helphub-contributors-public.css', array(), $this->version );
+ }
+
+ /**
+ * Show contributors after post content.
+ * Attached to 'the_content' filter hook.
+ *
+ * @param string $content Post content
+ * @return string Returns post content with appended contributors list
+ */
+ public function show_contributors( $content ) {
+ $contributors_markup = '';
+
+ $meta = get_post_meta( get_the_ID(), 'helphub_contributors' );
+
+ if ( is_array( $meta ) && ! empty( $meta ) ) :
+
+ $contributors = $meta[0];
+
+ if ( is_array( $contributors ) && ! empty( $contributors ) ) :
+
+ $contributors_items = '';
+
+ foreach ( $contributors as $contributor ) :
+ // Get user object.
+ $contributor_object = get_user_by( 'slug', $contributor );
+
+ if ( is_object( $contributor_object ) ) :
+
+ $data = array(
+ 'user_nicename' => $contributor_object->data->user_nicename,
+ 'display_name' => $contributor_object->data->display_name,
+ 'user_email' => $contributor_object->data->user_email,
+ );
+
+ /**
+ * Filters retrived data.
+ *
+ * @since 1.0.0
+ *
+ * @param array $data Array of users data
+ * @param obj $contributor_object WP_User Object
+ */
+ $data = apply_filters( 'helphub_contributors_user_data', $data, $contributor_object );
+
+ $contributor_url = 'https://profiles.wordpress.org/' . $data['user_nicename'];
+ $contributor_gravatar = '<img src="' . esc_url( get_avatar_url( $data['user_email'], array( 'size' => 40 ) ) ) . '" />';
+ $contributor_name = '<span class="name">' . esc_html( $data['display_name'] ) . '</span>';
+ $contributor_username = '<span>@' . esc_html( $data['user_nicename'] ) . '</span>';
+
+ /**
+ * Filters contributor text.
+ *
+ * @since 1.0.0
+ *
+ * @param string $contributor_name Contributor display_name.
+ * @param string $contributor_username Contributor wp.org username.
+ */
+ $contributor_text = apply_filters( 'helphub_contributors_contributor_text', '<p>' . $contributor_name . $contributor_username . '</p>' );
+
+ // Build the link
+ $contributor_link = '<a href="' . esc_url( $contributor_url ) . '">' . $contributor_gravatar . $contributor_text . '</a>';
+
+ /**
+ * Filters contributor link.
+ *
+ * @since 1.0.0
+ *
+ * @param string $contributor_link Contributor link markup.
+ * @param string $contributor_url Contributor wp.org profile URL.
+ * @param string $contributor_gravatar Contributor gravatar markup.
+ * @param string $contributor_text Contributor wp.org display_name and username.
+ */
+ $contributor_link = apply_filters( 'helphub_contributors_contributor_link', $contributor_link, $contributor_url, $contributor_gravatar, $contributor_text );
+
+ $contributor_item = '<div class="contributor">' . $contributor_link . '</div>';
+
+ /**
+ * Filters contributor item.
+ *
+ * @since 1.0.0
+ *
+ * @param string $contributor_item Contributor list item markup.
+ */
+ $contributor_item = apply_filters( 'helphub_contributors_contributor_item', $contributor_item );
+
+ $contributors_items .= $contributor_item;
+
+ else :
+
+ // Display message if no user is found with provided username.
+ $contributors_items .= '<div class="contributor contributor-not-found"><p>' . sprintf( __( '%s is not a valid username.', 'wporg-forums' ), '<strong>' . $contributor . '</strong>' ) . '</p></div>';
+
+ endif; // is_object( $contributor_object )
+
+ endforeach; // $contributors as $contributor
+
+ $contributors_heading = '<h5>' . esc_html__( 'Contributors', 'wporg-forums' ) . '</h5>';
+ $contributors_list = '<div class="contributors-list">' . $contributors_items . '</div>';
+
+ // Build the markup
+ $contributors_markup = '<div class="contributors-list-wrap">' . $contributors_heading . $contributors_list . '</div>';
+
+ /**
+ * Filters contributors markup.
+ *
+ * @since 1.0.0
+ *
+ * @param string $contributors_markup Contributors markup.
+ * @param string $contributors_heading Contributors heading.
+ * @param string $contributors_list Contributors list markup.
+ * @param string $contributors_items Contributors list items markup, without '<ul>'.
+ */
+ $contributors_markup = apply_filters( 'helphub_contributors', $contributors_markup, $contributors_heading, $contributors_list, $contributors_items );
+
+ endif; // is_array( $contributors ) && ! empty( $contributors )
+
+ endif; // is_array( $meta ) && ! empty( $meta )
+
+ $output = $content . $contributors_markup;
+
+ /**
+ * Filters complete output, post content and contributors markup.
+ *
+ * @since 1.0.0
+ *
+ * @param string $output Complete output, post content and contributors markup.
+ * @param string $content Post content, accessed via 'the_content' filter.
+ * @param string $contributors_markup Contributors markup, appened to post content.
+ */
+ return apply_filters( 'helphub_contributors_output', $output, $content, $contributors_markup );
+ }
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorspublicclasshelphubcontributorspublicphp"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/class-helphub-contributors-public.php</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorspublicindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php // Silence is golden
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/public/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorssrcsasshelphubcontributorspublicscss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/sass/helphub-contributors-public.scss</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/sass/helphub-contributors-public.scss (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/src/sass/helphub-contributors-public.scss 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,84 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Styles for frontend part of plugin.
+ */
+.contributors-list {
+
+ &-wrap {
+ display: block;
+ margin: 40px 0;
+
+ h5 {
+ font-size: 22px;
+ font-weight: 400;
+ margin-bottom: 1em;
+ }
+
+ .contributors-list {
+ position: relative;
+ display: block;
+ }
+
+ a {
+ display: block;
+ padding: 15px;
+ }
+
+ p,
+ img {
+ display: inline-block;
+ vertical-align: middle;
+ }
+
+ p {
+ font-size: 13px;
+ line-height: 1.4;
+ }
+
+ img {
+ border-radius: 50%;
+ margin-right: 15px;
+ }
+
+ span {
+ display: block;
+ }
+
+ .name {
+ color: #404040;
+ }
+
+ .contributor-not-found {
+ min-height: 70px;
+
+ p {
+ padding: 15px;
+ display: block;
+ text-align: center;
+ }
+ }
+ }
+
+ > div {
+ display: inline-block;
+ width: 100%;
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
+ border-radius: 3px;
+ margin-bottom: 20px;
+ vertical-align: middle;
+
+ @media (min-width: 690px) {
+ width: 70%;
+ }
+
+ @media (min-width: 768px) {
+ width: 48%;
+ }
+
+ &:nth-child(2n+2) {
+
+ @media (min-width: 768px) {
+ float: right;
+ }
+ }
+ }
+}
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcontributorsuninstallphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/uninstall.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/uninstall.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/uninstall.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,15 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Fired when the plugin is uninstalled.
+ *
+ * @package HelpHub_Contributors
+ */
+
+// If uninstall not called from WordPress, then exit.
+if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
+ exit;
+}
+/**
+ * Delete all plugin data on plugin uninstall
+ */
+delete_post_meta_by_key( 'helphub_contributors' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-contributors/uninstall.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcustomrolesclasshelphubcustomrolesphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,242 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * This adds custom roles for the HelpHub project.
+ * Author: carl-alberto
+ *
+ * @package HelpHub
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Custom Roles class.
+ */
+class HelpHub_Custom_Roles {
+
+
+ /**
+ * The single instance of HelpHub_Custom_Roles.
+ *
+ * @var object
+ * @access private
+ * @since 1.0.0
+ */
+ private static $_instance = null;
+
+ /**
+ * Settings class object
+ *
+ * @var object
+ * @access public
+ * @since 1.0.0
+ */
+ public $settings = null;
+
+ /**
+ * The version number.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $_version;
+
+ /**
+ * The token.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $_token;
+
+ /**
+ * The main plugin file.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $file;
+
+ /**
+ * The main plugin directory.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $dir;
+
+ /**
+ * The plugin assets directory.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $assets_dir;
+
+ /**
+ * The plugin assets URL.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $assets_url;
+
+ /**
+ * Suffix for Javascripts.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $script_suffix;
+
+ /**
+ * Custom roles Constructor.
+ *
+ * @param string $file filename.
+ * @param string $version version.
+ */
+ public function __construct( $file = '', $version = '1.0.0' ) {
+ $this->_version = $version;
+ $this->_token = 'helphub_custom_roles';
+
+ $this->file = $file;
+ $this->dir = dirname( $this->file );
+
+ $this->add_helphub_customrole();
+
+ add_action( 'admin_init', array( $this, 'hh_restrict_admin_pages' ), 0 );
+
+ add_action( 'admin_menu', array( $this, 'hh_hide_thememenu' ), 0 );
+
+ } // End __construct ()
+
+ /**
+ * This will add restriction to the custom rule.
+ */
+ public function hh_restrict_admin_pages() {
+
+ if ( $this->check_ifhelphub_editor() ) {
+ global $pagenow;
+ $restricted_pages = array(
+ 'themes.php',
+ );
+ if ( in_array( $pagenow, $restricted_pages, true ) ) {
+ wp_safe_redirect( admin_url( '/' ) );
+ exit;
+ }
+ }
+ }
+
+ /**
+ * This will hide the themes.php under Appearances if using a custom HelpHub Editor.
+ */
+ public function hh_hide_thememenu() {
+ if ( $this->check_ifhelphub_editor() ) {
+ remove_submenu_page( 'themes.php', 'themes.php' );
+ }
+ }
+
+ /**
+ * Check if a current user's assigned role is a HelpHub Editor.
+ *
+ * @return boolean returns true if a current user's assigned role is a HelpHub Editor.
+ */
+ public function check_ifhelphub_editor() {
+ $user_roles = wp_get_current_user()->roles;
+ if ( in_array( 'helphub_editor', $user_roles, true ) ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Main HelpHub_Custom_Roles Instance
+ *
+ * Ensures only one instance of HelpHub_Custom_Roles is loaded or can be loaded.
+ *
+ * @param string $file Filename of site.
+ * @param string $version Version number.
+ * @since 1.0.0
+ * @static
+ * @see HelpHub_Custom_Roles()
+ * @return Main HelpHub_Custom_Roles instance
+ */
+ public static function instance( $file = '', $version = '1.0.0' ) {
+ if ( is_null( self::$_instance ) ) {
+ self::$_instance = new self( $file, $version );
+ }
+ return self::$_instance;
+ } // End instance ()
+
+ /**
+ * Cloning is forbidden.
+ *
+ * @since 1.0.0
+ */
+ public function __clone() {
+ _doing_it_wrong( __FUNCTION__, esc_html( __( 'Sorry, this is not allowed.', 'wporg-forums' ) ), esc_html( $this->_version ) );
+ } // End __clone ()
+
+ /**
+ * Unserializing instances of this class is forbidden.
+ *
+ * @since 1.0.0
+ */
+ public function __wakeup() {
+ _doing_it_wrong( __FUNCTION__, esc_html( __( 'Sorry, this is not allowed.', 'wporg-forums' ) ), esc_html( $this->_version ) );
+ } // End __wakeup ()
+
+ /**
+ * Log the plugin version number.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ private function _log_version_number() {
+ update_option( $this->_token . '_version', $this->_version );
+ } // End _log_version_number ()
+
+ /**
+ * Adds a HelpHub custom role.
+ */
+ public function add_helphub_customrole() {
+
+ // Load users library.
+ if ( ! function_exists( 'get_editable_roles' ) ) {
+ require_once ABSPATH . 'wp-admin/includes/user.php';
+ }
+ get_editable_roles();
+ $role = 'helphub_editor';
+
+ // Check if the custom role is already added.
+ global $wp_roles;
+ $default_editorroles = $wp_roles->get_role( 'editor' );
+ if ( empty( $GLOBALS['wp_roles']->is_role( $role ) ) ) {
+ $wp_roles->add_role( $role, __( 'HelpHub Editor', 'wporg-forums' ), $default_editorroles->capabilities );
+
+ $wp_roles->add_cap( $role, 'edit_theme_options' );
+ }
+ }
+}
+
+/**
+ * Returns the main instance of HelpHub_Custom_Roles to prevent the need to use globals.
+ *
+ * @since 1.0.0
+ * @return object HelpHub_Custom_Roles
+ */
+function helphub_custom_roles() {
+ $instance = HelpHub_Custom_Roles::instance( __FILE__, '1.0.0' );
+ return $instance;
+}
+
+helphub_custom_roles();
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/class-helphub-custom-roles.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubcustomrolesindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Silence is golden.
+ * @codingStandardsIgnoreFile
+ */
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-customroles/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblockshelphubfrontpageblocksphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/helphub-front-page-blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/helphub-front-page-blocks.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/helphub-front-page-blocks.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,19 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: Helphub Front Page Blocks
+ * Plugin URI: https://www.wordpress.org
+ * Description: Create linkable blocks on the front page of support pages.
+ *
+ * @package HelpHub
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+require_once( dirname( __FILE__ ) . '/includes/class-support-helphub-front-page-blocks-widget.php' );
+
+function helphub_register_front_page_blocks_widget() {
+ register_widget( 'Support_HelpHub_Front_Page_Blocks_Widget' );
+}
+add_action( 'widgets_init', 'helphub_register_front_page_blocks_widget' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/helphub-front-page-blocks.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludesclasssupporthelphubfrontpageblockswidgetphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,62 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Introduce the controller for our widget blocks.
+ *
+ * @package HelpHub
+ */
+
+/**
+ * Class Support_HelpHub_Front_Page_blocks_Widget
+ */
+class Support_HelpHub_Front_Page_Blocks_Widget extends WP_Widget {
+ public function __construct() {
+ $widget_options = array(
+ 'classname' => 'helphub-front-page-block',
+ 'description' => __( 'Add a link block to support pages', 'wporg-forums' ),
+ );
+
+ parent::__construct( 'helphub_front_page_block', __( '(HelpHub) Link block', 'wporg-forums' ), $widget_options );
+ }
+
+ /**
+ * Output the widget on the front end.
+ *
+ * @param array $args The widget arguments, passed on from the themes widget area.
+ * @param array $instance This individual widgets settings.
+ *
+ * @return void
+ */
+ public function widget( $args, $instance ) {
+ include( dirname( __FILE__ ) . '/widget-front-end.php' );
+ }
+
+ /**
+ * Generate the widget settings.
+ *
+ * @param array $instance The widget instance and arguments.
+ *
+ * @return void
+ */
+ public function form( $instance ) {
+ include( dirname( __FILE__ ) . '/widget-back-end.php' );
+ }
+
+ /**
+ * Save the widget settings from the admin.
+ *
+ * @param array $new_instance The old widget instance, for comparison.
+ * @param array $old_instance The new widget instance, to be saved.
+ *
+ * @return array
+ */
+ public function update( $new_instance, $old_instance ) {
+ $save_instance = array();
+
+ $save_instance['icon'] = ( ! empty( $new_instance['icon'] ) ? strip_tags( $new_instance['icon'] ) : '' );
+ $save_instance['title'] = ( ! empty( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : '' );
+ $save_instance['description'] = ( ! empty( $new_instance['description'] ) ? strip_tags( $new_instance['description'] ) : '' );
+ $save_instance['menu'] = ( ! empty( $new_instance['menu'] ) ? strip_tags( $new_instance['menu'] ) : '' );
+
+ return $save_instance;
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/class-support-helphub-front-page-blocks-widget.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludeswidgetbackendphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,49 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Back-end output for the widget.
+ *
+ * @package HelpHub
+ */
+
+?>
+
+<p>
+ <label for="<?php echo esc_attr( $this->get_field_id( 'icon' ) ); ?>">
+ <?php esc_html_e( 'Icon (dashicon name or image URL)', 'wporg-forums' ); ?>
+ </label>
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'icon' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'icon' ) ); ?>" type="text" value="<?php echo ( isset( $instance['icon'] ) && ! empty( $instance['icon'] ) ? esc_attr( $instance['icon'] ) : '' ); ?>">
+</p>
+
+<p>
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
+ <?php esc_html_e( 'Title', 'wporg-forums' ); ?>
+ </label>
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo ( isset( $instance['title'] ) && ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : esc_attr__( 'Title', 'wporg-forums' ) ); ?>">
+</p>
+
+<p>
+ <label for="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>">
+ <?php esc_html_e( 'Description', 'wporg-forums' ); ?>
+ </label>
+ <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'description' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description' ) ); ?>" type="text" value="<?php echo ( isset( $instance['description'] ) && ! empty( $instance['description'] ) ? esc_attr( $instance['description'] ) : esc_attr__( 'Block description', 'wporg-forums' ) ); ?>">
+</p>
+
+<p>
+ <label for="<?php echo esc_attr( $this->get_field_id( 'menu' ) ); ?>">
+ <?php esc_html_e( 'Link menu', 'wporg-forums' ); ?>
+ </label>
+ <select class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'menu' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'menu' ) ); ?>">
+ <?php
+ $nav_menus = wp_get_nav_menus();
+
+ foreach ( $nav_menus as $nav_menu ) {
+ printf(
+ '<option value="%s" %s>%s</option>',
+ esc_attr( $nav_menu->term_id ),
+ ( isset( $instance['menu'] ) && ! empty( $instance['menu'] ) && $nav_menu->term_id === $instance['menu'] ? 'selected="selected"' : '' ),
+ esc_html( $nav_menu->name )
+ );
+ }
+ ?>
+ </select>
+</p>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-back-end.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubfrontpageblocksincludeswidgetfrontendphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,43 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Front-end output for the widget.
+ *
+ * @package HelpHub
+ */
+
+?>
+<?php
+echo $args['before_widget']; // WPCS: XSS OK.
+?>
+
+<div class="info-box">
+ <div class="icon-wrapper">
+ <?php if ( stristr( $instance['icon'], '.' ) ) : ?>
+ <img src="<?php echo esc_url( $instance['icon'] ); ?>" width="108" alt="">
+ <?php else : ?>
+ <span class="dashicons
+ <?php echo esc_attr( $instance['icon'] ); ?>
+ "></span>
+ <?php endif; ?>
+ </div>
+ <h3><?php echo esc_html( $instance['title'] ); ?></h3>
+ <p><?php echo esc_html( $instance['description'] ); ?></p>
+
+ <ul class="meta-list">
+ <?php
+ $menu_items = wp_get_nav_menu_items( $instance['menu'] );
+ foreach ( $menu_items as $menu_item ) {
+ printf(
+ '<li><a href="%s">%s</a></li>',
+ esc_url( $menu_item->url ),
+ esc_html( $menu_item->title )
+ );
+ }
+ ?>
+ </ul>
+
+</div>
+
+
+<?php
+echo $args['after_widget']; // WPCS: XSS OK.
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-front-page-blocks/includes/widget-front-end.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetscssadmincss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/admin.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/admin.css (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/admin.css 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,1194 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.post-type.edit-php table.wp-list-table .column-image {
+ width: 120px;
+ text-align: center;
+}
+
+.post-type.edit-php table.wp-list-table .column-image img {
+ width: 60px;
+ height: auto;
+}
+
+
+/*!
+* jQuery UI CSS Framework 1.12.1
+* http://jqueryui.com
+*
+* Copyright jQuery Foundation and other contributors
+* Released under the MIT license.
+* http://jquery.org/license
+*
+* http://api.jqueryui.com/category/theming/
+*/
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1em;
+}
+
+.ui-widget .ui-widget {
+ font-size: 1em;
+}
+
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1em;
+}
+
+.ui-widget.ui-widget-content {
+ border: 1px solid #c5c5c5;
+}
+
+.ui-widget-content {
+ border: 1px solid #ddd;
+ background: #fff;
+ color: #333;
+}
+
+.ui-widget-content a {
+ color: #333;
+}
+
+.ui-widget-header {
+ border: 1px solid #ddd;
+ background: #e9e9e9;
+ color: #333;
+ font-weight: 700;
+}
+
+.ui-widget-header a {
+ color: #333;
+}
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default,
+.ui-button,
+/* We use html here because we need a greater specificity to make sure
+ disabled works properly when clicked or hovered */
+html .ui-button.ui-state-disabled:hover,
+html .ui-button.ui-state-disabled:active {
+ border: 1px solid #c5c5c5;
+ background: #f6f6f6;
+ font-weight: 400;
+ color: #454545;
+}
+
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited,
+a.ui-button,
+a:link.ui-button,
+a:visited.ui-button,
+.ui-button {
+ color: #454545;
+ text-decoration: none;
+}
+
+.ui-state-hover,
+.ui-widget-content .ui-state-hover,
+.ui-widget-header .ui-state-hover,
+.ui-state-focus,
+.ui-widget-content .ui-state-focus,
+.ui-widget-header .ui-state-focus,
+.ui-button:hover,
+.ui-button:focus {
+ border: 1px solid #ccc;
+ background: #ededed;
+ font-weight: 400;
+ color: #2b2b2b;
+}
+
+.ui-state-hover a,
+.ui-state-hover a:hover,
+.ui-state-hover a:link,
+.ui-state-hover a:visited,
+.ui-state-focus a,
+.ui-state-focus a:hover,
+.ui-state-focus a:link,
+.ui-state-focus a:visited,
+a.ui-button:hover,
+a.ui-button:focus {
+ color: #2b2b2b;
+ text-decoration: none;
+}
+
+.ui-visual-focus {
+ box-shadow: 0 0 3px 1px rgb(94, 158, 214);
+}
+
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active,
+a.ui-button:active,
+.ui-button:active,
+.ui-button.ui-state-active:hover {
+ border: 1px solid #003eff;
+ background: #007fff;
+ font-weight: 400;
+ color: #fff;
+}
+
+.ui-icon-background,
+.ui-state-active .ui-icon-background {
+ border: #003eff;
+ background-color: #fff;
+}
+
+.ui-state-active a,
+.ui-state-active a:link,
+.ui-state-active a:visited {
+ color: #fff;
+ text-decoration: none;
+}
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight,
+.ui-widget-content .ui-state-highlight,
+.ui-widget-header .ui-state-highlight {
+ border: 1px solid #dad55e;
+ background: #fffa90;
+ color: #777620;
+}
+
+.ui-state-checked {
+ border: 1px solid #dad55e;
+ background: #fffa90;
+}
+
+.ui-state-highlight a,
+.ui-widget-content .ui-state-highlight a,
+.ui-widget-header .ui-state-highlight a {
+ color: #777620;
+}
+
+.ui-state-error,
+.ui-widget-content .ui-state-error,
+.ui-widget-header .ui-state-error {
+ border: 1px solid #f1a899;
+ background: #fddfdf;
+ color: #5f3f3f;
+}
+
+.ui-state-error a,
+.ui-widget-content .ui-state-error a,
+.ui-widget-header .ui-state-error a {
+ color: #5f3f3f;
+}
+
+.ui-state-error-text,
+.ui-widget-content .ui-state-error-text,
+.ui-widget-header .ui-state-error-text {
+ color: #5f3f3f;
+}
+
+.ui-priority-primary,
+.ui-widget-content .ui-priority-primary,
+.ui-widget-header .ui-priority-primary {
+ font-weight: 700;
+}
+
+.ui-priority-secondary,
+.ui-widget-content .ui-priority-secondary,
+.ui-widget-header .ui-priority-secondary {
+ opacity: 0.7;
+ filter: alpha(opacity=70); /* support: IE8 */
+ font-weight: 400;
+}
+
+.ui-state-disabled,
+.ui-widget-content .ui-state-disabled,
+.ui-widget-header .ui-state-disabled {
+ opacity: 0.35;
+ filter: alpha(opacity=35); /* support: IE8 */
+ background-image: none;
+}
+
+.ui-state-disabled .ui-icon {
+ filter: alpha(opacity=35); /* support: IE8 - See #6059 */
+}
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon {
+ width: 16px;
+ height: 16px;
+}
+
+/* positioning */
+.ui-icon-blank {
+ background-position: 16px 16px;
+}
+
+.ui-icon-caret-1-n {
+ background-position: 0 px;
+}
+
+.ui-icon-caret-1-ne {
+ background-position: -16px px;
+}
+
+.ui-icon-caret-1-e {
+ background-position: -32px px;
+}
+
+.ui-icon-caret-1-se {
+ background-position: -48px px;
+}
+
+.ui-icon-caret-1-s {
+ background-position: -65px px;
+}
+
+.ui-icon-caret-1-sw {
+ background-position: -80px px;
+}
+
+.ui-icon-caret-1-w {
+ background-position: -96px px;
+}
+
+.ui-icon-caret-1-nw {
+ background-position: -112px px;
+}
+
+.ui-icon-caret-2-n-s {
+ background-position: -128px px;
+}
+
+.ui-icon-caret-2-e-w {
+ background-position: -144px px;
+}
+
+.ui-icon-triangle-1-n {
+ background-position: 0 -16px;
+}
+
+.ui-icon-triangle-1-ne {
+ background-position: -16px -16px;
+}
+
+.ui-icon-triangle-1-e {
+ background-position: -32px -16px;
+}
+
+.ui-icon-triangle-1-se {
+ background-position: -48px -16px;
+}
+
+.ui-icon-triangle-1-s {
+ background-position: -65px -16px;
+}
+
+.ui-icon-triangle-1-sw {
+ background-position: -80px -16px;
+}
+
+.ui-icon-triangle-1-w {
+ background-position: -96px -16px;
+}
+
+.ui-icon-triangle-1-nw {
+ background-position: -112px -16px;
+}
+
+.ui-icon-triangle-2-n-s {
+ background-position: -128px -16px;
+}
+
+.ui-icon-triangle-2-e-w {
+ background-position: -144px -16px;
+}
+
+.ui-icon-arrow-1-n {
+ background-position: 0 -32px;
+}
+
+.ui-icon-arrow-1-ne {
+ background-position: -16px -32px;
+}
+
+.ui-icon-arrow-1-e {
+ background-position: -32px -32px;
+}
+
+.ui-icon-arrow-1-se {
+ background-position: -48px -32px;
+}
+
+.ui-icon-arrow-1-s {
+ background-position: -65px -32px;
+}
+
+.ui-icon-arrow-1-sw {
+ background-position: -80px -32px;
+}
+
+.ui-icon-arrow-1-w {
+ background-position: -96px -32px;
+}
+
+.ui-icon-arrow-1-nw {
+ background-position: -112px -32px;
+}
+
+.ui-icon-arrow-2-n-s {
+ background-position: -128px -32px;
+}
+
+.ui-icon-arrow-2-ne-sw {
+ background-position: -144px -32px;
+}
+
+.ui-icon-arrow-2-e-w {
+ background-position: -160px -32px;
+}
+
+.ui-icon-arrow-2-se-nw {
+ background-position: -176px -32px;
+}
+
+.ui-icon-arrowstop-1-n {
+ background-position: -192px -32px;
+}
+
+.ui-icon-arrowstop-1-e {
+ background-position: -208px -32px;
+}
+
+.ui-icon-arrowstop-1-s {
+ background-position: -224px -32px;
+}
+
+.ui-icon-arrowstop-1-w {
+ background-position: -240px -32px;
+}
+
+.ui-icon-arrowthick-1-n {
+ background-position: 1px -48px;
+}
+
+.ui-icon-arrowthick-1-ne {
+ background-position: -16px -48px;
+}
+
+.ui-icon-arrowthick-1-e {
+ background-position: -32px -48px;
+}
+
+.ui-icon-arrowthick-1-se {
+ background-position: -48px -48px;
+}
+
+.ui-icon-arrowthick-1-s {
+ background-position: -64px -48px;
+}
+
+.ui-icon-arrowthick-1-sw {
+ background-position: -80px -48px;
+}
+
+.ui-icon-arrowthick-1-w {
+ background-position: -96px -48px;
+}
+
+.ui-icon-arrowthick-1-nw {
+ background-position: -112px -48px;
+}
+
+.ui-icon-arrowthick-2-n-s {
+ background-position: -128px -48px;
+}
+
+.ui-icon-arrowthick-2-ne-sw {
+ background-position: -144px -48px;
+}
+
+.ui-icon-arrowthick-2-e-w {
+ background-position: -160px -48px;
+}
+
+.ui-icon-arrowthick-2-se-nw {
+ background-position: -176px -48px;
+}
+
+.ui-icon-arrowthickstop-1-n {
+ background-position: -192px -48px;
+}
+
+.ui-icon-arrowthickstop-1-e {
+ background-position: -208px -48px;
+}
+
+.ui-icon-arrowthickstop-1-s {
+ background-position: -224px -48px;
+}
+
+.ui-icon-arrowthickstop-1-w {
+ background-position: -240px -48px;
+}
+
+.ui-icon-arrowreturnthick-1-w {
+ background-position: 0 -64px;
+}
+
+.ui-icon-arrowreturnthick-1-n {
+ background-position: -16px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-e {
+ background-position: -32px -64px;
+}
+
+.ui-icon-arrowreturnthick-1-s {
+ background-position: -48px -64px;
+}
+
+.ui-icon-arrowreturn-1-w {
+ background-position: -64px -64px;
+}
+
+.ui-icon-arrowreturn-1-n {
+ background-position: -80px -64px;
+}
+
+.ui-icon-arrowreturn-1-e {
+ background-position: -96px -64px;
+}
+
+.ui-icon-arrowreturn-1-s {
+ background-position: -112px -64px;
+}
+
+.ui-icon-arrowrefresh-1-w {
+ background-position: -128px -64px;
+}
+
+.ui-icon-arrowrefresh-1-n {
+ background-position: -144px -64px;
+}
+
+.ui-icon-arrowrefresh-1-e {
+ background-position: -160px -64px;
+}
+
+.ui-icon-arrowrefresh-1-s {
+ background-position: -176px -64px;
+}
+
+.ui-icon-arrow-4 {
+ background-position: 0 -80px;
+}
+
+.ui-icon-arrow-4-diag {
+ background-position: -16px -80px;
+}
+
+.ui-icon-extlink {
+ background-position: -32px -80px;
+}
+
+.ui-icon-newwin {
+ background-position: -48px -80px;
+}
+
+.ui-icon-refresh {
+ background-position: -64px -80px;
+}
+
+.ui-icon-shuffle {
+ background-position: -80px -80px;
+}
+
+.ui-icon-transfer-e-w {
+ background-position: -96px -80px;
+}
+
+.ui-icon-transferthick-e-w {
+ background-position: -112px -80px;
+}
+
+.ui-icon-folder-collapsed {
+ background-position: 0 -96px;
+}
+
+.ui-icon-folder-open {
+ background-position: -16px -96px;
+}
+
+.ui-icon-document {
+ background-position: -32px -96px;
+}
+
+.ui-icon-document-b {
+ background-position: -48px -96px;
+}
+
+.ui-icon-note {
+ background-position: -64px -96px;
+}
+
+.ui-icon-mail-closed {
+ background-position: -80px -96px;
+}
+
+.ui-icon-mail-open {
+ background-position: -96px -96px;
+}
+
+.ui-icon-suitcase {
+ background-position: -112px -96px;
+}
+
+.ui-icon-comment {
+ background-position: -128px -96px;
+}
+
+.ui-icon-person {
+ background-position: -144px -96px;
+}
+
+.ui-icon-print {
+ background-position: -160px -96px;
+}
+
+.ui-icon-trash {
+ background-position: -176px -96px;
+}
+
+.ui-icon-locked {
+ background-position: -192px -96px;
+}
+
+.ui-icon-unlocked {
+ background-position: -208px -96px;
+}
+
+.ui-icon-bookmark {
+ background-position: -224px -96px;
+}
+
+.ui-icon-tag {
+ background-position: -240px -96px;
+}
+
+.ui-icon-home {
+ background-position: 0 -112px;
+}
+
+.ui-icon-flag {
+ background-position: -16px -112px;
+}
+
+.ui-icon-calendar {
+ background-position: -32px -112px;
+}
+
+.ui-icon-cart {
+ background-position: -48px -112px;
+}
+
+.ui-icon-pencil {
+ background-position: -64px -112px;
+}
+
+.ui-icon-clock {
+ background-position: -80px -112px;
+}
+
+.ui-icon-disk {
+ background-position: -96px -112px;
+}
+
+.ui-icon-calculator {
+ background-position: -112px -112px;
+}
+
+.ui-icon-zoomin {
+ background-position: -128px -112px;
+}
+
+.ui-icon-zoomout {
+ background-position: -144px -112px;
+}
+
+.ui-icon-search {
+ background-position: -160px -112px;
+}
+
+.ui-icon-wrench {
+ background-position: -176px -112px;
+}
+
+.ui-icon-gear {
+ background-position: -192px -112px;
+}
+
+.ui-icon-heart {
+ background-position: -208px -112px;
+}
+
+.ui-icon-star {
+ background-position: -224px -112px;
+}
+
+.ui-icon-link {
+ background-position: -240px -112px;
+}
+
+.ui-icon-cancel {
+ background-position: 0 -128px;
+}
+
+.ui-icon-plus {
+ background-position: -16px -128px;
+}
+
+.ui-icon-plusthick {
+ background-position: -32px -128px;
+}
+
+.ui-icon-minus {
+ background-position: -48px -128px;
+}
+
+.ui-icon-minusthick {
+ background-position: -64px -128px;
+}
+
+.ui-icon-close {
+ background-position: -80px -128px;
+}
+
+.ui-icon-closethick {
+ background-position: -96px -128px;
+}
+
+.ui-icon-key {
+ background-position: -112px -128px;
+}
+
+.ui-icon-lightbulb {
+ background-position: -128px -128px;
+}
+
+.ui-icon-scissors {
+ background-position: -144px -128px;
+}
+
+.ui-icon-clipboard {
+ background-position: -160px -128px;
+}
+
+.ui-icon-copy {
+ background-position: -176px -128px;
+}
+
+.ui-icon-contact {
+ background-position: -192px -128px;
+}
+
+.ui-icon-image {
+ background-position: -208px -128px;
+}
+
+.ui-icon-video {
+ background-position: -224px -128px;
+}
+
+.ui-icon-script {
+ background-position: -240px -128px;
+}
+
+.ui-icon-alert {
+ background-position: 0 -144px;
+}
+
+.ui-icon-info {
+ background-position: -16px -144px;
+}
+
+.ui-icon-notice {
+ background-position: -32px -144px;
+}
+
+.ui-icon-help {
+ background-position: -48px -144px;
+}
+
+.ui-icon-check {
+ background-position: -64px -144px;
+}
+
+.ui-icon-bullet {
+ background-position: -80px -144px;
+}
+
+.ui-icon-radio-on {
+ background-position: -96px -144px;
+}
+
+.ui-icon-radio-off {
+ background-position: -112px -144px;
+}
+
+.ui-icon-pin-w {
+ background-position: -128px -144px;
+}
+
+.ui-icon-pin-s {
+ background-position: -144px -144px;
+}
+
+.ui-icon-play {
+ background-position: 0 -160px;
+}
+
+.ui-icon-pause {
+ background-position: -16px -160px;
+}
+
+.ui-icon-seek-next {
+ background-position: -32px -160px;
+}
+
+.ui-icon-seek-prev {
+ background-position: -48px -160px;
+}
+
+.ui-icon-seek-end {
+ background-position: -64px -160px;
+}
+
+.ui-icon-seek-start {
+ background-position: -80px -160px;
+}
+
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first {
+ background-position: -80px -160px;
+}
+
+.ui-icon-stop {
+ background-position: -96px -160px;
+}
+
+.ui-icon-eject {
+ background-position: -112px -160px;
+}
+
+.ui-icon-volume-off {
+ background-position: -128px -160px;
+}
+
+.ui-icon-volume-on {
+ background-position: -144px -160px;
+}
+
+.ui-icon-power {
+ background-position: 0 -176px;
+}
+
+.ui-icon-signal-diag {
+ background-position: -16px -176px;
+}
+
+.ui-icon-signal {
+ background-position: -32px -176px;
+}
+
+.ui-icon-battery-0 {
+ background-position: -48px -176px;
+}
+
+.ui-icon-battery-1 {
+ background-position: -64px -176px;
+}
+
+.ui-icon-battery-2 {
+ background-position: -80px -176px;
+}
+
+.ui-icon-battery-3 {
+ background-position: -96px -176px;
+}
+
+.ui-icon-circle-plus {
+ background-position: 0 -192px;
+}
+
+.ui-icon-circle-minus {
+ background-position: -16px -192px;
+}
+
+.ui-icon-circle-close {
+ background-position: -32px -192px;
+}
+
+.ui-icon-circle-triangle-e {
+ background-position: -48px -192px;
+}
+
+.ui-icon-circle-triangle-s {
+ background-position: -64px -192px;
+}
+
+.ui-icon-circle-triangle-w {
+ background-position: -80px -192px;
+}
+
+.ui-icon-circle-triangle-n {
+ background-position: -96px -192px;
+}
+
+.ui-icon-circle-arrow-e {
+ background-position: -112px -192px;
+}
+
+.ui-icon-circle-arrow-s {
+ background-position: -128px -192px;
+}
+
+.ui-icon-circle-arrow-w {
+ background-position: -144px -192px;
+}
+
+.ui-icon-circle-arrow-n {
+ background-position: -160px -192px;
+}
+
+.ui-icon-circle-zoomin {
+ background-position: -176px -192px;
+}
+
+.ui-icon-circle-zoomout {
+ background-position: -192px -192px;
+}
+
+.ui-icon-circle-check {
+ background-position: -208px -192px;
+}
+
+.ui-icon-circlesmall-plus {
+ background-position: 0 -208px;
+}
+
+.ui-icon-circlesmall-minus {
+ background-position: -16px -208px;
+}
+
+.ui-icon-circlesmall-close {
+ background-position: -32px -208px;
+}
+
+.ui-icon-squaresmall-plus {
+ background-position: -48px -208px;
+}
+
+.ui-icon-squaresmall-minus {
+ background-position: -64px -208px;
+}
+
+.ui-icon-squaresmall-close {
+ background-position: -80px -208px;
+}
+
+.ui-icon-grip-dotted-vertical {
+ background-position: 0 -224px;
+}
+
+.ui-icon-grip-dotted-horizontal {
+ background-position: -16px -224px;
+}
+
+.ui-icon-grip-solid-vertical {
+ background-position: -32px -224px;
+}
+
+.ui-icon-grip-solid-horizontal {
+ background-position: -48px -224px;
+}
+
+.ui-icon-gripsmall-diagonal-se {
+ background-position: -64px -224px;
+}
+
+.ui-icon-grip-diagonal-se {
+ background-position: -80px -224px;
+}
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-left,
+.ui-corner-tl {
+ border-top-left-radius: 3px;
+}
+
+.ui-corner-all,
+.ui-corner-top,
+.ui-corner-right,
+.ui-corner-tr {
+ border-top-right-radius: 3px;
+}
+
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-left,
+.ui-corner-bl {
+ border-bottom-left-radius: 3px;
+}
+
+.ui-corner-all,
+.ui-corner-bottom,
+.ui-corner-right,
+.ui-corner-br {
+ border-bottom-right-radius: 3px;
+}
+
+/* Overlays */
+.ui-widget-overlay {
+ background: #aaa;
+ opacity: 0.3;
+ filter: alpha(opacity=30); /* support: IE8 */
+}
+
+.ui-widget-shadow {
+ -webkit-box-shadow: 0 0 5px #666;
+ box-shadow: 0 0 5px #666;
+}
+
+
+/* Overlays */
+.ui-widget-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.ui-datepicker {
+ width: 17em;
+ padding: 0.2em 0.2em 0;
+ display: none;
+ background-color: #fff;
+}
+
+.ui-datepicker .ui-datepicker-header {
+ position: relative;
+ padding: 0.2em 0;
+}
+
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+ position: absolute;
+ top: 2px;
+ width: 1.8em;
+ height: 1.8em;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+ top: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev {
+ left: 2px;
+}
+
+.ui-datepicker .ui-datepicker-next {
+ right: 2px;
+}
+
+.ui-datepicker .ui-datepicker-prev-hover {
+ left: 1px;
+}
+
+.ui-datepicker .ui-datepicker-next-hover {
+ right: 1px;
+}
+
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+ display: block;
+ position: absolute;
+ left: 50%;
+ margin-left: -8px;
+ top: 50%;
+ margin-top: -8px;
+}
+
+.ui-datepicker .ui-datepicker-title {
+ margin: 0 2.3em;
+ line-height: 1.8;
+ text-align: center;
+}
+
+.ui-datepicker .ui-datepicker-title select {
+ font-size: 1em;
+ margin: 1px 0;
+}
+
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+ width: 45%;
+}
+
+.ui-datepicker table {
+ width: 100%;
+ font-size: 0.9em;
+ border-collapse: collapse;
+ margin: 0 0 0.4em;
+}
+
+.ui-datepicker th {
+ padding: 0.7em 0.3em;
+ text-align: center;
+ font-weight: 700;
+ border: 0;
+}
+
+.ui-datepicker td {
+ border: 0;
+ padding: 1px;
+}
+
+.ui-datepicker td span,
+.ui-datepicker td a {
+ display: block;
+ padding: 0.2em;
+ text-align: right;
+ text-decoration: none;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane {
+ background-image: none;
+ margin: 0.7em 0 0;
+ padding: 0 0.2em;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 0;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button {
+ float: right;
+ margin: 0.5em 0.2em 0.4em;
+ cursor: pointer;
+ padding: 0.2em 0.6em 0.3em;
+ width: auto;
+ overflow: visible;
+}
+
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+ float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+ width: auto;
+}
+
+.ui-datepicker-multi .ui-datepicker-group {
+ float: left;
+}
+
+.ui-datepicker-multi .ui-datepicker-group table {
+ width: 95%;
+ margin: 0 auto 0.4em;
+}
+
+.ui-datepicker-multi-2 .ui-datepicker-group {
+ width: 50%;
+}
+
+.ui-datepicker-multi-3 .ui-datepicker-group {
+ width: 33.3%;
+}
+
+.ui-datepicker-multi-4 .ui-datepicker-group {
+ width: 25%;
+}
+
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+ border-left-width: 0;
+}
+
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+ clear: left;
+}
+
+.ui-datepicker-row-break {
+ clear: both;
+ width: 100%;
+ font-size: 0;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+ direction: rtl;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev {
+ right: 2px;
+ left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next {
+ left: 2px;
+ right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+ right: 1px;
+ left: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+ left: 1px;
+ right: auto;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+ clear: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+ float: left;
+}
+
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
+.ui-datepicker-rtl .ui-datepicker-group {
+ float: right;
+}
+
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+ border-right-width: 0;
+ border-left-width: 1px;
+}
+
+/* Icons */
+.ui-datepicker .ui-icon {
+ display: block;
+ text-indent: -99999px;
+ overflow: hidden;
+ background-repeat: no-repeat;
+ left: 0.5em;
+ top: 0.3em;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/css/admin.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetsjsadminjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/admin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/admin.js (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/admin.js 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,58 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* globals HelphubAdmin */
+jQuery( document ).ready( function( $ ) {
+
+ // Instantiates the variable that holds the media library frame.
+ var GalleryDataFrame;
+
+ // Runs when the image button is clicked.
+ jQuery( '.postbox' ).on( 'click', '.helphub-upload', function( event ) {
+
+ // Store button object.
+ var $button = $( this ),
+ Title,
+ Button,
+ Library;
+
+ // Prevents the default action from occuring.
+ event.preventDefault();
+
+ // If the frame already exists, re-open it.
+ if ( GalleryDataFrame ) {
+ GalleryDataFrame.open();
+ return;
+ }
+
+ Title = $button.data( 'title' ) ? $button.data( 'title' ) : HelphubAdmin.default_title;
+ Button = $button.data( 'button' ) ? $button.data( 'button' ) : HelphubAdmin.default_button;
+ Library = $button.data( 'library' ) ? $button.data( 'library' ) : '';
+
+ // Sets up the media library frame.
+ GalleryDataFrame = wp.media.frames.gallery_data_frame = wp.media({
+ title: Title,
+ button: { text: Button },
+ library: { type: Library }
+ });
+
+ // Runs when an image is selected.
+ GalleryDataFrame.on( 'select', function() {
+
+ // Grabs the attachment selection and creates a JSON representation of the model.
+ var MediaAttachment = GalleryDataFrame.state().get( 'selection' ).first().toJSON();
+
+ // Sends the attachment URL to our custom image input field.
+ $button.prev( 'input.helphub-upload-field' ).val( MediaAttachment.url );
+
+ });
+
+ // Opens the media library frame.
+ GalleryDataFrame.open();
+ });
+
+ if ( $( 'input[type="date"]' ).hasClass( 'helphub-meta-date' ) ) {
+ $( '.helphub-meta-date' ).datepicker({
+ changeMonth: true,
+ changeYear: true,
+ formatDate: 'MM, dd, yy'
+ });
+ } // Bust cache.
+});
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesassetsjsgalleryjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/gallery.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/gallery.js (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/assets/js/gallery.js 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,104 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/* globals HelphubGallery */
+jQuery( document ).ready( function( $ ) {
+
+ // Uploading files
+ var HelphubGalleryFrame;
+ var $GalleryContainer = $( '#helphub_images_container' );
+ var $ImageGalleryIds = $( '#helphub_image_gallery' );
+ var $GalleryImages = $GalleryContainer.find( 'ul.product_images' );
+ var $GalleryUl = $GalleryContainer.find( 'ul li.image' );
+
+ jQuery( '.add_helphub_images' ).on( 'click', 'a', function( event ) {
+
+ var AttachmentIds = $ImageGalleryIds.val();
+
+ event.preventDefault();
+
+ // If the media frame already exists, reopen it.
+ if ( HelphubGalleryFrame ) {
+ HelphubGalleryFrame.open();
+ return;
+ }
+
+ // Create the media frame.
+ HelphubGalleryFrame = wp.media.frames.downloadable_file = wp.media({
+
+ // Set the title of the modal.
+ title: HelphubGallery.gallery_title,
+ button: {
+ text: HelphubGallery.gallery_button
+ },
+ multiple: true
+ });
+
+ // When an image is selected, run a callback.
+ HelphubGalleryFrame.on( 'select', function() {
+
+ var selection = HelphubGalleryFrame.state().get( 'selection' );
+
+ selection.map( function( attachment ) {
+
+ attachment = attachment.toJSON();
+
+ if ( attachment.id ) {
+ AttachmentIds = AttachmentIds ? AttachmentIds + ',' + attachment.id : attachment.id;
+
+ $GalleryImages.append( '<li class="image" data-attachment_id="' + attachment.id + '">' +
+ '<img src="' + attachment.sizes.thumbnail.url + '" />' +
+ '<ul class="actions">' +
+ '<li><a href="#" class="delete" title="' + HelphubGallery.delete_image + '">×</a></li>' +
+ '</ul>' +
+ '</li>' );
+ }
+
+ } );
+
+ $ImageGalleryIds.val( AttachmentIds );
+ });
+
+ // Finally, open the modal.
+ HelphubGalleryFrame.open();
+ });
+
+ // Image ordering
+ $GalleryImages.sortable({
+ items: 'li.image',
+ cursor: 'move',
+ scrollSensitivity: 40,
+ forcePlaceholderSize: true,
+ forceHelperSize: false,
+ helper: 'clone',
+ opacity: 0.65,
+ placeholder: 'helphub-metabox-sortable-placeholder',
+ start: function( event, ui ) {
+ ui.item.css( 'background-color', '#f6f6f6' );
+ },
+ stop: function( event, ui ) {
+ ui.item.removeAttr( 'style' );
+ },
+ update: function() {
+ var AttachmentIds = '';
+ $GalleryContainer.find( 'ul li.image' ).css( 'cursor', 'default' ).each( function() {
+ var AttachmentId = jQuery( this ).attr( 'data-attachment_id' );
+ AttachmentIds = AttachmentIds + AttachmentId + ',';
+ });
+ $ImageGalleryIds.val( AttachmentIds );
+ }
+ });
+
+ // Remove images
+ $GalleryContainer.on( 'click', 'a.delete', function() {
+ var AttachmentIds = '';
+
+ $( this ).closest( 'li.image' ).remove();
+
+ $GalleryUl.css( 'cursor', 'default' ).each( function() {
+ var AttachmentId = jQuery( this ).attr( 'data-attachment_id' );
+ AttachmentIds = AttachmentIds + AttachmentId + ',';
+ });
+
+ $ImageGalleryIds.val( AttachmentIds );
+
+ return false;
+ } );
+} );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypesposttypephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,765 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * This file is part of the Helphub Post Types plugin
+ *
+ * @package WordPress
+ * @author Jon Ang
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Helphub Post Types, Post Type Class
+ *
+ * All functionality pertaining to post types in Helphub Post Types.
+ *
+ * @package WordPress
+ * @subpackage HelpHub_Post_Types
+ * @category Plugin
+ * @author Jon Ang
+ * @since 1.0.0
+ */
+class HelpHub_Post_Types_Post_Type {
+ /**
+ * The post type token.
+ *
+ * @access public
+ * @since 1.0.0
+ * @var string
+ */
+ public $post_type;
+
+ /**
+ * The post type singular label.
+ *
+ * @access public
+ * @since 1.0.0
+ * @var string
+ */
+ public $singular;
+
+ /**
+ * The post type plural label.
+ *
+ * @access public
+ * @since 1.0.0
+ * @var string
+ */
+ public $plural;
+
+ /**
+ * The post type args.
+ *
+ * @access public
+ * @since 1.0.0
+ * @var array
+ */
+ public $args;
+
+ /**
+ * The taxonomies for this post type.
+ *
+ * @access public
+ * @since 1.0.0
+ * @var array
+ */
+ public $taxonomies;
+
+ /**
+ * Constructor function.
+ *
+ * @access public
+ * @since 1.0.0
+ *
+ * @param string $post_type The post type id/handle.
+ * @param string $singular The singular pronunciation of the post type name.
+ * @param string $plural The plural pronunciation of the post type name.
+ * @param array $args The typical arguments allowed to register a post type.
+ * @param array $taxonomies The list of taxonomies that the post type is associated with.
+ */
+ public function __construct( $post_type = 'thing', $singular = '', $plural = '', $args = array(), $taxonomies = array() ) {
+ $this->post_type = $post_type;
+ $this->singular = $singular;
+ $this->plural = $plural;
+ $this->args = $args;
+ $this->taxonomies = $taxonomies;
+
+ add_action( 'init', array( $this, 'register_post_type' ) );
+ add_action( 'init', array( $this, 'register_taxonomy' ) );
+
+ if ( is_admin() ) {
+ global $pagenow;
+
+ add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
+ add_action( 'save_post', array( $this, 'meta_box_save' ), 50 );
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
+ add_filter( 'post_updated_messages', array( $this, 'updated_messages' ) );
+
+ if ( 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && $this->post_type === $_GET['post_type'] ) { // WPCS: input var ok; CSRF ok.
+ add_filter( 'manage_edit-' . $this->post_type . '_columns', array(
+ $this,
+ 'register_custom_column_headings',
+ ), 10, 1 );
+ add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
+ }
+ }
+ add_action( 'admin_init', array( $this, 'add_menu_order' ) );
+ add_action( 'after_setup_theme', array( $this, 'ensure_post_thumbnails_support' ) );
+ } // End __construct()
+
+ /**
+ * Register the post type.
+ *
+ * @access public
+ * @return void
+ */
+ public function register_post_type() {
+
+ if ( post_type_exists( $this->post_type ) ) {
+ return;
+ }
+
+ $labels = array(
+ 'name' => $this->plural,
+ 'singular_name' => $this->singular,
+ 'add_new' => _x( 'Add New', 'add new helphub post', 'wporg-forums' ),
+ /* translators: %s: Post type name. */
+ 'add_new_item' => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'edit_item' => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'new_item' => sprintf( __( 'New %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Plural post type name. */
+ 'all_items' => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
+ /* translators: %s: Post type name. */
+ 'view_item' => sprintf( __( 'View %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Plural post type name. */
+ 'search_items' => sprintf( __( 'Search %a', 'wporg-forums' ), $this->plural ),
+ /* translators: %s: Plural post type name. */
+ 'not_found' => sprintf( __( 'No %s Found', 'wporg-forums' ), $this->plural ),
+ /* translators: %s: Plural post type name. */
+ 'not_found_in_trash' => sprintf( __( 'No %s Found In Trash', 'wporg-forums' ), $this->plural ),
+ 'parent_item_colon' => '',
+ 'menu_name' => $this->plural,
+ );
+
+ $single_slug = apply_filters( 'helphub_single_slug', sanitize_title_with_dashes( $this->singular ) );
+ $archive_slug = apply_filters( 'helphub_archive_slug', sanitize_title_with_dashes( $this->plural ) );
+
+ $defaults = array(
+ 'labels' => $labels,
+ 'public' => true,
+ 'publicly_queryable' => true,
+ 'show_ui' => true,
+ 'show_in_menu' => true,
+ 'query_var' => true,
+ 'rewrite' => array(
+ 'slug' => $single_slug,
+ ),
+ 'capability_type' => 'post',
+ 'has_archive' => $archive_slug,
+ 'hierarchical' => false,
+ 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'revisions' ),
+ 'menu_position' => 5,
+ 'menu_icon' => 'dashicons-smiley',
+ 'show_in_rest' => true,
+ 'rest_base' => $archive_slug,
+ 'rest_controller_class' => 'WP_REST_Posts_Controller',
+ );
+
+ $args = wp_parse_args( $this->args, $defaults );
+
+ register_post_type( $this->post_type, $args );
+ } // End register_post_type()
+
+ /**
+ * Register the post-type taxonomy.
+ *
+ * @access public
+ * @since 1.3.0
+ * @return void
+ */
+ public function register_taxonomy() {
+ foreach ( $this->taxonomies as $taxonomy ) {
+ $taxonomy = new HelpHub_Post_Types_Taxonomy( esc_attr( $this->post_type ), $taxonomy, '', '', array() ); // Leave arguments empty, to use the default arguments.
+ $taxonomy->register();
+ }
+ } // End register_taxonomy()
+
+ /**
+ * Add custom columns for the "manage" screen of this post type.
+ *
+ * @access public
+ *
+ * @param string $column_name The name of the column.
+ * @param int $id The ID.
+ *
+ * @since 1.0.0
+ * @return void
+ */
+ public function register_custom_columns( $column_name, $id ) {
+ switch ( $column_name ) {
+ case 'image':
+ // Displays img tag.
+ echo $this->get_image( $id, 40 );
+ /* @codingStandardsIgnoreLine */
+ break;
+ default:
+ break;
+ }
+ } // End register_custom_columns()
+
+ /**
+ * Add custom column headings for the "manage" screen of this post type.
+ *
+ * @access public
+ *
+ * @param array $defaults The default value.
+ *
+ * @since 1.0.0
+ * @return array $defaults
+ */
+ public function register_custom_column_headings( $defaults ) {
+ $new_columns = array(
+ 'image' => __( 'Image', 'wporg-forums' ),
+ );
+
+ $last_item = array();
+
+ if ( isset( $defaults['date'] ) ) {
+ unset( $defaults['date'] );
+ }
+
+ if ( count( $defaults ) > 2 ) {
+ $last_item = array_slice( $defaults, - 1 );
+
+ array_pop( $defaults );
+ }
+ $defaults = array_merge( $defaults, $new_columns );
+
+ if ( is_array( $last_item ) && 0 < count( $last_item ) ) {
+ foreach ( $last_item as $k => $v ) {
+ $defaults[ $k ] = $v;
+ break;
+ }
+ }
+
+ return $defaults;
+ } // End register_custom_column_headings()
+
+ /**
+ * Update messages for the post type admin.
+ *
+ * @since 1.0.0
+ *
+ * @param array $messages Array of messages for all post types.
+ *
+ * @return array Modified array.
+ */
+ public function updated_messages( $messages ) {
+ global $post, $post_ID; /* @codingStandardsIgnoreLine */
+
+ $permalink = get_permalink( $post_ID ); /* @codingStandardsIgnoreLine */
+
+ $messages[ $this->post_type ] = array(
+ 0 => '',
+ // Unused. Messages start at index 1.
+ /* translators: %1$s: Post link tag. %2$s: Close post link tag. %3$s: Post type name. %4$s: Lowercase post type name. */
+ 1 => sprintf( __( '%3$s updated. %1$sView %4$s%2$s', 'wporg-forums' ), '<a href="' . esc_url( $permalink ) . '">', '</a>', $this->singular, strtolower( $this->singular ) ),
+ 2 => __( 'Custom field updated.', 'wporg-forums' ),
+ 3 => __( 'Custom field deleted.', 'wporg-forums' ),
+ /* translators: %s: Post type name. */
+ 4 => sprintf( __( '%s updated.', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: date and time of the revision */
+ 5 => isset( $_GET['revision'] ) ? sprintf( __( '%1$s restored to revision from %2$s', 'wporg-forums' ), $this->singular, wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
+ // WPCS: CSRF ok; input var ok.
+ /* translators: %1$s Post type name. %2$s: Lowercase post type name. %3$s: Post link tag. %4$s: Close post link tag. */
+ 6 => sprintf( __( '%1$s published. %3$sView %2$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a href="' . esc_url( $permalink ) . '">', '</a>' ),
+ /* translators: %s: Post type name. */
+ 7 => sprintf( __( '%s saved.', 'wporg-forums' ), $this->singular ),
+ /* translators: %1$s: Post type name. %2$s: Lowercase post type name. %3$s: Post link tag. %4$s: Close post link tag. */
+ 8 => sprintf( __( '%1$s submitted. %2$sPreview %3$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
+ /* translators: %1$s: Post type name. %2$s: Lowercase post type name. */
+ 9 => sprintf( __( '%1$s scheduled for: %1$s. %2$sPreview %2$s%3$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<strong>' . date_i18n( __( 'M j, Y @ G:i', 'wporg-forums' ), strtotime( $post->post_date ) ) . '</strong>', '<a target="_blank" href="' . esc_url( $permalink ) . '">', '</a>' ),
+ /* translators: %1$s: Post type name. %2$s: Lowercase post type name. %3$s: Close post link tag. %4$s: Close post link tag. */
+ 10 => sprintf( __( '%1$s draft updated. %3$sPreview %2$s%4$s', 'wporg-forums' ), $this->singular, strtolower( $this->singular ), '<a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', $permalink ) ) . '">', '</a>' ),
+ );
+
+ return $messages;
+ } // End updated_messages()
+
+ /**
+ * Setup the meta box.
+ * You can use separate conditions here to add different meta boxes for different post types
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function meta_box_setup() {
+ if ( 'post' === $this->post_type ) {
+ add_meta_box( $this->post_type . '-display', __( 'Display Settings', 'wporg-forums' ), array(
+ $this,
+ 'meta_box_content',
+ ), $this->post_type, 'normal', 'high' );
+ } elseif ( 'helphub_version' === $this->post_type ) {
+ add_meta_box( $this->post_type . '-version-meta', __( 'Display Settings', 'wporg-forums' ), array(
+ $this,
+ 'meta_box_version_content',
+ ), $this->post_type, 'normal', 'high' );
+ }
+ } // End meta_box_setup()
+
+ /**
+ * The contents of our post meta box.
+ * Duplicate this function for more callbacks
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function meta_box_content() {
+ $field_data = $this->get_custom_fields_post_display_settings();
+ $this->meta_box_content_render( $field_data );
+ }
+
+ /**
+ * The contents of our post meta box.
+ * Duplicate this function for more callbacks
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function meta_box_version_content() {
+ $field_data = $this->get_custom_fields_version_display_settings();
+ $this->meta_box_content_render( $field_data );
+ }
+
+ /**
+ * The rendering of fields in meta boxes
+ *
+ * @access public
+ * @since 1.0.0
+ *
+ * @param array $field_data The field data to populate the rendering function.
+ *
+ * @return void
+ */
+ public function meta_box_content_render( $field_data ) {
+ global $post_id;
+ $fields = get_post_custom( $post_id );
+
+ $html = '';
+
+ $html .= '<input type="hidden" name="helphub_' . $this->post_type . '_noonce" id="helphub_' . $this->post_type . '_noonce" value="' . wp_create_nonce( plugin_basename( dirname( HelpHub_Post_Types()->plugin_path ) ) ) . '" />';
+
+ if ( 0 < count( $field_data ) ) {
+ $html .= '<table class="form-table">' . "\n";
+ $html .= '<tbody>' . "\n";
+
+ foreach ( $field_data as $k => $v ) {
+ $data = $v['default'];
+ if ( isset( $fields[ '_' . $k ] ) && isset( $fields[ '_' . $k ][0] ) ) {
+ $data = $fields[ '_' . $k ][0];
+ }
+
+ switch ( $v['type'] ) {
+ case 'hidden':
+ $field = '<input name="' . esc_attr( $k ) . '" type="hidden" id="' . esc_attr( $k ) . '" value="' . esc_attr( $data ) . '" />';
+ $html .= '<tr valign="top">' . $field . "\n";
+ $html .= '</tr>' . "\n";
+ break;
+ case 'text':
+ case 'url':
+ $field = '<input name="' . esc_attr( $k ) . '" type="text" id="' . esc_attr( $k ) . '" class="regular-text" value="' . esc_attr( $data ) . '" />';
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'textarea':
+ $field = '<textarea name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" class="large-text">' . esc_attr( $data ) . '</textarea>';
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'editor':
+ ob_start();
+ wp_editor( $data, $k, array(
+ 'media_buttons' => false,
+ 'textarea_rows' => 10,
+ ) );
+ $field = ob_get_contents();
+ ob_end_clean();
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'upload':
+ $data_atts = '';
+ if ( isset( $v['media-frame']['title'] ) ) {
+ $data_atts .= sprintf( 'data-title="%s" ', esc_attr( $v['media-frame']['title'] ) );
+ }
+ if ( isset( $v['media-frame']['button'] ) ) {
+ $data_atts .= sprintf( 'data-button="%s" ', esc_attr( $v['media-frame']['button'] ) );
+ }
+ if ( isset( $v['media-frame']['library'] ) ) {
+ $data_atts .= sprintf( 'data-library="%s" ', esc_attr( $v['media-frame']['library'] ) );
+ }
+
+ $field = '<input name="' . esc_attr( $k ) . '" type="file" id="' . esc_attr( $k ) . '" class="regular-text helphub-upload-field" />';
+ $field .= '<button id="' . esc_attr( $k ) . '" class="helphub-upload button" ' . $data_atts . '>' . $v['label'] . '</button>';
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'radio':
+ $field = '';
+ if ( isset( $v['options'] ) && is_array( $v['options'] ) ) {
+ foreach ( $v['options'] as $val => $option ) {
+ $field .= '<p><label for="' . esc_attr( $k . '-' . $val ) . '"><input id="' . esc_attr( $k . '-' . $val ) . '" type="radio" name="' . esc_attr( $k ) . '" value="' . esc_attr( $val ) . '" ' . checked( $val, $data, false ) . ' />' . $option . '</label></p>' . "\n";
+ }
+ }
+ $html .= '<tr valign="top"><th><label>' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'checkbox':
+ $field = '<p><input id="' . esc_attr( $v['name'] ) . '" type="checkbox" name="' . esc_attr( $k ) . '" value="1" ' . checked( 'yes', $data, false ) . ' / ></p>' . "\n";
+ if ( isset( $v['description'] ) ) {
+ $field .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $v['name'] ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'multicheck':
+ $field = '';
+ if ( isset( $v['options'] ) && is_array( $v['options'] ) ) {
+ foreach ( $v['options'] as $val => $option ) {
+ $field .= '<p><label for="' . esc_attr( $k . '-' . $val ) . '"><input id="' . esc_attr( $k . '-' . $val ) . '" type="checkbox" name="' . esc_attr( $k ) . '[]" value="' . esc_attr( $val ) . '" ' . checked( 1, in_array( $val, (array) $data, true ), false ) . ' />' . $option . '</label></p>' . "\n";
+ }
+ }
+ $html .= '<tr valign="top"><th><label>' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'select':
+ $field = '<select name="' . esc_attr( $k ) . '" id="' . esc_attr( $k ) . '" >' . "\n";
+ if ( isset( $v['options'] ) && is_array( $v['options'] ) ) {
+ foreach ( $v['options'] as $val => $option ) {
+ $field .= '<option value="' . esc_attr( $val ) . '" ' . selected( $val, $data, false ) . '>' . $option . '</option>' . "\n";
+ }
+ }
+ $field .= '</select>' . "\n";
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ case 'date':
+ if ( ! intval( $data ) ) {
+ $data = time();
+ }
+ $field = '<input name="' . esc_attr( $k ) . '" type="date" id="' . esc_attr( $k ) . '" class="helphub-meta-date" value="' . esc_attr( date_i18n( 'F d, Y', $data ) ) . '" />';
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ break;
+ default:
+ $field = apply_filters( 'helphub_data_field_type_' . $v['type'], null, $k, $data, $v );
+ if ( $field ) {
+ $html .= '<tr valign="top"><th><label for="' . esc_attr( $k ) . '">' . $v['name'] . '</label></th><td>' . $field . "\n";
+ if ( isset( $v['description'] ) ) {
+ $html .= '<p class="description">' . $v['description'] . '</p>' . "\n";
+ }
+ $html .= '</td></tr>' . "\n";
+ }
+ break;
+ } // End switch().
+ } // End foreach().
+
+ $html .= '</tbody>' . "\n";
+ $html .= '</table>' . "\n";
+ } // End if().
+
+ echo $html;
+ /* @codingStandardsIgnoreLine */
+ } // End meta_box_content()
+
+ /**
+ * Save meta box fields.
+ *
+ * @access public
+ * @since 1.0.0
+ *
+ * @param int $post_id The post ID.
+ *
+ * @return int $post_id
+ */
+ public function meta_box_save( $post_id ) {
+ // Verify.
+ $plugin_basename = plugin_basename( dirname( HelpHub_Post_Types()->plugin_path ) );
+ $nonce_key = 'helphub_' . $this->post_type . '_noonce';
+ /* @codingStandardsIgnoreLine */
+ if ( empty( $_POST[ $nonce_key ] ) || ( get_post_type() != $this->post_type ) || ! wp_verify_nonce( $_POST[ $nonce_key ], $plugin_basename ) ) {
+ return $post_id;
+ }
+
+ if ( isset( $_POST['post_type'] ) && 'page' === $_POST['post_type'] ) {
+ /* @codingStandardsIgnoreLine */
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
+ return $post_id;
+ }
+ } else {
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ return $post_id;
+ }
+ }
+
+ $field_data = $this->get_custom_fields_settings();
+ $fields = array_keys( $field_data );
+
+ foreach ( $fields as $f ) {
+
+ switch ( $field_data[ $f ]['type'] ) {
+ case 'url':
+ ${$f} = isset( $_POST[ $f ] ) ? esc_url( $_POST[ $f ] ) : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ case 'textarea':
+ case 'editor':
+ ${$f} = isset( $_POST[ $f ] ) ? wp_kses_post( trim( $_POST[ $f ] ) ) : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ case 'checkbox':
+ ${$f} = isset( $_POST[ $f ] ) ? 'yes' : 'no';
+ /* @codingStandardsIgnoreLine */
+ break;
+ case 'multicheck':
+ // Ensure checkbox is array and whitelist accepted values against options.
+ ${$f} = isset( $_POST[ $f ] ) && is_array( $field_data[ $f ]['options'] ) ? (array) array_intersect( (array) $_POST[ $f ], array_flip( $field_data[ $f ]['options'] ) ) : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ case 'radio':
+ case 'select':
+ // Whitelist accepted value against options.
+ $values = array();
+ if ( is_array( $field_data[ $f ]['options'] ) ) {
+ $values = array_keys( $field_data[ $f ]['options'] );
+ }
+ ${$f} = isset( $_POST[ $f ] ) && in_array( $_POST[ $f ], $values ) ? $_POST[ $f ] : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ case 'date':
+ ${$f} = isset( $_POST[ $f ] ) ? strtotime( wp_strip_all_tags( $_POST[ $f ] ) ) : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ default:
+ ${$f} = isset( $_POST[ $f ] ) ? strip_tags( trim( $_POST[ $f ] ) ) : '';
+ /* @codingStandardsIgnoreLine */
+ break;
+ }
+
+ // Save it.
+ if ( 'read_time' !== $f ) {
+ update_post_meta( $post_id, '_' . $f, ${$f} );
+ }
+ } // End foreach().
+
+ // Save the project gallery image IDs.
+ if ( isset( $_POST['helphub_image_gallery'] ) ) : /* @codingStandardsIgnoreLine */
+ $attachment_ids = array_filter( explode( ',', sanitize_text_field( $_POST['helphub_image_gallery'] ) ) );
+ /* @codingStandardsIgnoreLine */
+ update_post_meta( $post_id, '_helphub_image_gallery', implode( ',', $attachment_ids ) );
+ endif;
+
+ return $post_id;
+ } // End meta_box_save()
+
+ /**
+ * Customise the "Enter title here" text.
+ *
+ * @access public
+ * @since 1.0.0
+ *
+ * @param string $title The title.
+ *
+ * @return string $title
+ */
+ public function enter_title_here( $title ) {
+ if ( get_post_type() === $this->post_type ) {
+ if ( 'post' === get_post_type() ) {
+ $title = __( 'Enter the article title here', 'wporg-forums' );
+ }
+ }
+
+ return $title;
+ } // End enter_title_here()
+
+ /**
+ * Get the settings for the custom fields.
+ * Use array merge to get a unified fields array
+ * eg. $fields = array_merge( $this->get_custom_fields_post_display_settings(), $this->get_custom_fields_post_advertisement_settings(), $this->get_custom_fields_post_spacer_settings() );
+ *
+ * @access public
+ * @since 1.0.0
+ * @return array
+ */
+ public function get_custom_fields_settings() {
+
+ $fields = array();
+ if ( 'post' === get_post_type() ) {
+ $fields = $this->get_custom_fields_post_display_settings();
+ } elseif ( 'helphub_version' === get_post_type() ) {
+ $fields = $this->get_custom_fields_version_display_settings();
+ }
+
+ return $fields;
+
+ } // End get_custom_fields_settings()
+
+ /**
+ * Get the settings for the post display custom fields.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return array
+ */
+ public function get_custom_fields_post_display_settings() {
+ $fields = array();
+
+ $fields['read_time'] = array(
+ 'name' => __( 'Article Read Time', 'wporg-forums' ),
+ 'description' => __( 'Leave this empty, calculation is automatic', 'wporg-forums' ),
+ 'type' => 'text',
+ 'default' => '',
+ 'section' => 'info',
+ );
+
+ $fields['custom_read_time'] = array(
+ 'name' => __( 'Custom Read Time', 'wporg-forums' ),
+ 'description' => __( 'Only fill up this field if the automated calculation is incorrect', 'wporg-forums' ),
+ 'type' => 'text',
+ 'default' => '',
+ 'section' => 'info',
+ );
+
+ return $fields;
+ }
+
+ /**
+ * Get the settings for the post display custom fields.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return array
+ */
+ public function get_custom_fields_version_display_settings() {
+ $fields = array();
+
+ $fields['version_date'] = array(
+ 'name' => __( 'Date Released', 'wporg-forums' ),
+ 'description' => __( 'Date this WordPress Version was released', 'wporg-forums' ),
+ 'type' => 'date',
+ 'default' => '',
+ 'section' => 'info',
+ );
+
+ $fields['musician_codename'] = array(
+ 'name' => __( 'Musician', 'wporg-forums' ),
+ 'description' => __( 'The Jazz Musician this release was named after', 'wporg-forums' ),
+ 'type' => 'text',
+ 'default' => '',
+ 'section' => 'info',
+ );
+
+ return $fields;
+ }
+
+
+ /**
+ * Get the image for the given ID.
+ *
+ * @param int $id The post ID.
+ * @param mixed $size Image dimension. (default: "thing-thumbnail").
+ *
+ * @since 1.0.0
+ * @return string <img> tag.
+ */
+ protected function get_image( $id, $size = 'thing-thumbnail' ) {
+ $response = '';
+
+ if ( has_post_thumbnail( $id ) ) {
+ // If not a string or an array, and not an integer, default to 150x9999.
+ if ( ( is_int( $size ) || ( 0 < intval( $size ) ) ) && ! is_array( $size ) ) {
+ $size = array( intval( $size ), intval( $size ) );
+ } elseif ( ! is_string( $size ) && ! is_array( $size ) ) {
+ $size = array( 150, 9999 );
+ }
+ $response = get_the_post_thumbnail( intval( $id ), $size );
+ }
+
+ return $response;
+ } // End get_image()
+
+ /**
+ * Run on activation.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function activation() {
+ $this->flush_rewrite_rules();
+ } // End activation()
+
+ /**
+ * Flush the rewrite rules
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ private function flush_rewrite_rules() {
+ $this->register_post_type();
+ flush_rewrite_rules();
+ } // End flush_rewrite_rules()
+
+ /**
+ * Ensure that "post-thumbnails" support is available for those themes that don't register it.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function ensure_post_thumbnails_support() {
+ if ( ! current_theme_supports( 'post-thumbnails' ) ) {
+ add_theme_support( 'post-thumbnails' );
+ }
+ } // End ensure_post_thumbnails_support()
+
+ /**
+ * Add menu order
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function add_menu_order() {
+ add_post_type_support( 'post', 'page-attributes' );
+ } // End ens
+
+} // End Class
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-post-type.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypestaxonomyphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,162 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * This file is part of the Helphub Post Types plugin
+ *
+ * @package WordPress
+ * @author Jon Ang
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+/**
+ * Helphub Post Types Taxonomy Class
+ *
+ * Re-usable class for registering post type taxonomies.
+ *
+ * @package WordPress
+ * @subpackage HelpHub_Post_Types
+ * @category Plugin
+ * @author Jon Ang
+ * @since 1.0.0
+ */
+class HelpHub_Post_Types_Taxonomy {
+ /**
+ * The post type to register the taxonomy for.
+ *
+ * @access private
+ * @since 1.3.0
+ * @var array
+ */
+ private $post_type;
+
+ /**
+ * The key of the taxonomy.
+ *
+ * @access private
+ * @since 1.3.0
+ * @var string
+ */
+ private $token;
+
+ /**
+ * The singular name for the taxonomy.
+ *
+ * @access private
+ * @since 1.3.0
+ * @var string
+ */
+ private $singular;
+
+ /**
+ * The plural name for the taxonomy.
+ *
+ * @access private
+ * @since 1.3.0
+ * @var string
+ */
+ private $plural;
+
+ /**
+ * The arguments to use when registering the taxonomy.
+ *
+ * @access private
+ * @since 1.3.0
+ * @var string
+ */
+ private $args;
+
+ /**
+ * Class constructor.
+ *
+ * @access public
+ * @since 1.3.0
+ * @param array $post_type The post type key.
+ * @param string $token The taxonomy key.
+ * @param string $singular Singular name.
+ * @param string $plural Plural name.
+ * @param array $args Array of argument overrides.
+ */
+ public function __construct( $post_type = array(), $token = 'thing-category', $singular = '', $plural = '', $args = array() ) {
+ $this->post_type = $post_type;
+ $this->token = esc_attr( $token );
+ $this->singular = esc_html( $singular );
+ $this->plural = esc_html( $plural );
+
+ if ( '' === $this->singular ) {
+ $this->singular = __( 'Category', 'wporg-forums' );
+ }
+ if ( '' === $this->plural ) {
+ $this->plural = __( 'Categories', 'wporg-forums' );
+ }
+
+ $this->args = wp_parse_args( $args, $this->_get_default_args() );
+
+ add_action( 'init', array( $this, 'register' ) );
+ } // End __construct()
+
+ /**
+ * Return an array of default arguments.
+ *
+ * @access private
+ * @since 1.3.0
+ * @return array Default arguments.
+ */
+ private function _get_default_args() {
+ return array(
+ 'labels' => $this->_get_default_labels(),
+ 'public' => true,
+ 'hierarchical' => true,
+ 'show_ui' => true,
+ 'show_admin_column' => true,
+ 'query_var' => true,
+ 'show_in_nav_menus' => false,
+ 'show_tagcloud' => false,
+ 'rewrite' => array(
+ 'slug' => str_replace( 'helphub_', '', esc_attr( $this->token ) ),
+ ),
+ );
+ } // End _get_default_args()
+
+ /**
+ * Return an array of default labels.
+ *
+ * @access private
+ * @since 1.3.0
+ * @return array Default labels.
+ */
+ private function _get_default_labels() {
+ return array(
+ 'name' => sprintf( _x( '%s', 'taxonomy general name', 'wporg-forums' ), $this->plural ), /* @codingStandardsIgnoreLine */
+ 'singular_name' => sprintf( _x( '%s', 'taxonomy singular name', 'wporg-forums' ), $this->singular ), /* @codingStandardsIgnoreLine */
+ 'search_items' => sprintf( __( 'Search %s', 'wporg-forums' ), $this->plural ),
+ /* translators: %s: Plural name of the post type. */
+ 'all_items' => sprintf( __( 'All %s', 'wporg-forums' ), $this->plural ),
+ /* translators: %s: Post type name. */
+ 'parent_item' => sprintf( __( 'Parent %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'parent_item_colon' => sprintf( __( 'Parent %s:', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'edit_item' => sprintf( __( 'Edit %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'update_item' => sprintf( __( 'Update %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'add_new_item' => sprintf( __( 'Add New %s', 'wporg-forums' ), $this->singular ),
+ /* translators: %s: Post type name. */
+ 'new_item_name' => sprintf( __( 'New %s Name', 'wporg-forums' ), $this->singular ),
+ 'menu_name' => $this->plural,
+ );
+ } // End _get_default_labels()
+
+ /**
+ * Register the taxonomy.
+ *
+ * @access public
+ * @since 1.3.0
+ * @return void
+ */
+ public function register() {
+ register_taxonomy( esc_attr( $this->token ), (array) $this->post_type, (array) $this->args );
+ } // End register()
+} // End Class
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types-taxonomy.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesclasshelphubposttypesphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,272 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * This file is part of the Helphub Post Types plugin
+ *
+ * @package WordPress
+ */
+
+/**
+ * Main HelpHub_Post_Types Class
+ *
+ * @class HelpHub_Post_Types
+ * @version 1.0.0
+ * @since 1.0.0
+ * @package HelpHub_Post_Types
+ * @author Jon Ang
+ */
+final class HelpHub_Post_Types {
+ /**
+ * HelpHub_Post_Types The single instance of HelpHub_Post_Types.
+ *
+ * @var object
+ * @access private
+ * @since 1.0.0
+ */
+ private static $_instance = null;
+
+ /**
+ * The token.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $token;
+
+ /**
+ * The version number.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $version;
+
+ /**
+ * The plugin directory URL.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $plugin_url;
+
+ /**
+ * The plugin directory path.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $plugin_path;
+
+ /* Admin - Start */
+
+ /**
+ * The admin object.
+ *
+ * @var object
+ * @access public
+ * @since 1.0.0
+ */
+ public $admin;
+
+ /**
+ * The settings object.
+ *
+ * @var object
+ * @access public
+ * @since 1.0.0
+ */
+ public $settings;
+
+ /* Admin - End */
+
+ /* Post Types - Start */
+
+ /**
+ * The post types we're registering.
+ *
+ * @var array
+ * @access public
+ * @since 1.0.0
+ */
+ public $post_types = array();
+
+ /* Post Types - End */
+
+ /* Taxonomies - Start */
+
+ /**
+ * The taxonomies we're registering.
+ *
+ * @var array
+ * @access public
+ * @since 1.0.0
+ */
+ public $taxonomies = array();
+
+ /* Taxonomies - End */
+
+
+ /**
+ * Constructor function.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __construct() {
+ $this->token = 'helphub';
+ $this->plugin_url = plugin_dir_url( __FILE__ );
+ $this->plugin_path = plugin_dir_path( __FILE__ );
+ $this->version = '1.0.0';
+
+ /* Post Types - Start */
+
+ require_once( dirname( __FILE__ ) . '/class-helphub-post-types-post-type.php' );
+ require_once( dirname( __FILE__ ) . '/class-helphub-post-types-taxonomy.php' );
+
+ $this->post_types['post'] = new HelpHub_Post_Types_Post_Type( 'post', __( 'Post', 'wporg-forums' ), __( 'Posts', 'wporg-forums' ), array(
+ 'menu_icon' => 'dashicons-post',
+ ) );
+ $this->post_types['helphub_article'] = new HelpHub_Post_Types_Post_Type( 'helphub_article', __( 'Article', 'wporg-forums' ), __( 'Articles', 'wporg-forums' ), array(
+ 'menu_icon' => 'dashicons-media-document',
+ ) );
+ $this->post_types['helphub_version'] = new HelpHub_Post_Types_Post_Type( 'helphub_version', __( 'WordPress Version', 'wporg-forums' ), __( 'WordPress Versions', 'wporg-forums' ), array(
+ 'menu_icon' => 'dashicons-wordpress',
+ ) );
+
+ /* Post Types - End */
+
+ // Register an example taxonomy. To register more taxonomies, duplicate this line.
+ $this->taxonomies['helphub_category'] = new HelpHub_Post_Types_Taxonomy( array( 'post', 'helphub_article' ), 'category', __( 'Category', 'wporg-forums' ), __( 'Categories', 'wporg-forums' ) );
+ $this->taxonomies['helphub_persona'] = new HelpHub_Post_Types_Taxonomy( array( 'post', 'helphub_article' ), 'helphub_persona', __( 'Persona', 'wporg-forums' ), __( 'Personas', 'wporg-forums' ) );
+ $this->taxonomies['helphub_experience'] = new HelpHub_Post_Types_Taxonomy( array( 'post', 'helphub_article' ), 'helphub_experience', __( 'Experience', 'wporg-forums' ), __( 'Experiences', 'wporg-forums' ) );
+ $this->taxonomies['helphub_major_release'] = new HelpHub_Post_Types_Taxonomy( 'helphub_version', 'helphub_major_release', __( 'Major Release', 'wporg-forums' ), __( 'Major Releases', 'wporg-forums' ) );
+
+ register_activation_hook( __FILE__, array( $this, 'install' ) );
+
+ add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
+ add_action( 'pre_get_posts', array( $this, 'fix_archive_category' ) );
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
+ } // End __construct()
+
+ /**
+ * Main HelpHub_Post_Types Instance
+ *
+ * Ensures only one instance of HelpHub_Post_Types is loaded or can be loaded.
+ *
+ * @since 1.0.0
+ * @static
+ * @see HelpHub_Post_Types()
+ * @return HelpHub_Post_Types instance
+ */
+ public static function instance() {
+
+ if ( is_null( self::$_instance ) ) {
+ self::$_instance = new self();
+ }
+
+ return self::$_instance;
+ } // End instance()
+
+ /**
+ * Load the localisation file.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function load_plugin_textdomain() {
+ load_plugin_textdomain( 'wporg-forums', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
+ } // End load_plugin_textdomain()
+
+ /**
+ * Make sure category archive actually loads
+ *
+ * @access public
+ * @since 1.1.0
+ */
+ public function fix_archive_category( WP_Query $query ) {
+ if ( ! is_admin() && is_category() && $query->is_main_query() ) {
+ $query->set( 'post_type', 'helphub_article' );
+ }
+ } // End fix_archive_category()
+
+ /**
+ * Enqueue post type admin Styles.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function enqueue_admin_styles() {
+ global $pagenow;
+
+ wp_enqueue_style( 'helphub-post-types-admin-style', $this->plugin_url . 'assets/css/admin.css', array(), '1.0.0' );
+
+ if ( ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) ) :
+ if ( array_key_exists( get_post_type(), $this->post_types ) ) :
+ wp_enqueue_script( 'helphub-post-types-admin', $this->plugin_url . 'assets/js/admin.js', array( 'jquery' ), '1.0.1', true );
+ wp_enqueue_script( 'helphub-post-types-gallery', $this->plugin_url . 'assets/js/gallery.js', array( 'jquery' ), '1.0.0', true );
+ wp_enqueue_script( 'jquery-ui-datepicker' );
+ wp_enqueue_style( 'jquery-ui-datepicker' );
+ endif;
+ endif;
+ wp_localize_script( 'helphub-post-types-admin', 'HelphubAdmin',
+ array(
+ 'default_title' => __( 'Upload', 'wporg-forums' ),
+ 'default_button' => __( 'Select this', 'wporg-forums' ),
+ )
+ );
+
+ wp_localize_script( 'helphub-post-types-gallery', 'HelphubGallery',
+ array(
+ 'gallery_title' => __( 'Add Images to Product Gallery', 'wporg-forums' ),
+ 'gallery_button' => __( 'Add to gallery', 'wporg-forums' ),
+ 'delete_image' => __( 'Delete image', 'wporg-forums' ),
+ )
+ );
+
+ } // End enqueue_admin_styles()
+
+ /**
+ * Cloning is forbidden.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __clone() {
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'wporg-forums' ), '1.0.0' );
+ } // End __clone()
+
+ /**
+ * Unserializing instances of this class is forbidden.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function __wakeup() {
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'wporg-forums' ), '1.0.0' );
+ } // End __wakeup()
+
+ /**
+ * Installation. Runs on activation.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ public function install() {
+ $this->_log_version_number();
+ } // End install()
+
+ /**
+ * Log the plugin version number.
+ *
+ * @access private
+ * @since 1.0.0
+ */
+ private function _log_version_number() {
+ // Log the version number.
+ update_option( $this->token . '-version', $this->version );
+ } // End _log_version_number()
+} // End Class
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/class-helphub-post-types.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesclassesindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Silence is golden.
+ * @codingStandardsIgnoreFile
+ */
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/classes/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypeshelphubposttypesphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/helphub-post-types.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/helphub-post-types.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/helphub-post-types.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,36 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: Helphub Post Types
+ * Plugin URI: http://www.wordpress.org
+ * Description: This is what powers Post Types and Taxonomies.
+ * Version: 1.3.0
+ * Author: Jon Ang
+ * Author URI: http://www.helphubcommunications.com/
+ * Requires at least: 4.6.0
+ * Tested up to: 4.0.0
+ *
+ * Text Domain: helphub
+ * Domain Path: /languages/
+ *
+ * @package HelpHub_Post_Types
+ * @category Core
+ * @author Jon Ang
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+require_once( dirname( __FILE__ ) . '/classes/class-helphub-post-types.php' );
+
+/**
+ * Returns the main instance of HelpHub_Post_Types to prevent the need to use globals.
+ *
+ * @since 1.0.0
+ * @return object HelpHub_Post_Types
+ */
+function helphub_post_types() {
+ return HelpHub_Post_Types::instance();
+} // End HelpHub_Post_Types()
+
+add_action( 'plugins_loaded', 'helphub_post_types' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/helphub-post-types.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Silence is golden.
+ * @codingStandardsIgnoreFile
+ */
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubposttypesreadmetxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/readme.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/readme.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-post-types/readme.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,46 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+=== Helphub Post Types ===
+Contributors: Jon Ang
+Donate link:
+Tags: 1.1
+Requires at least: 4.0.0
+Tested up to: 4.0.0
+Stable tag: 1.1.0
+License: GPLv3 or later
+License URI: http://www.gnu.org/licenses/gpl-3.0.html
+
+Hey there! This powers the Frontpage Magazine
+
+== Description ==
+
+Hey there! I create Post Types, custom meta fields, taxonomies and sanitise them.
+
+Looking for a helping hand? Contact Jon
+
+== Usage ==
+
+
+
+== Installation ==
+
+Installing "Helphub Post Types" can be done either by searching for "Helphub Post Types" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
+
+1. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
+2. Activate the plugin through the 'Plugins' menu in WordPress
+3. Visit the settings screen and configure, as desired.
+
+== Frequently Asked Questions ==
+
+
+
+== Upgrade Notice ==
+
+= 1.0.0 =
+* XXXX-XX-XX
+* Initial release. Woo!
+
+== Changelog ==
+
+= 1.1.0 =
+
+= 1.0.0 =
+* Initial release. Woo!
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubreadtimehelphubreadtimephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/helphub-read-time.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/helphub-read-time.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/helphub-read-time.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,194 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: HelpHub Read Time
+ * Description: Adds estimated reading time to a post using a simple formula.
+ * Version: 1.0.3
+ * Author: justingreerbbi
+ * Author URI: https://wordpress.org
+ * License: GPL3
+ * License URI: https://www.gnu.org/licenses/gpl-3.0.html
+ *
+ * @package Helphub Readtime
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ die( 'No script kiddies please!' );
+}
+
+// Adds the read time hook when saving a post.
+add_action( 'save_post', 'hh_calculate_and_update_post_read_time', 10, 3 );
+
+/**
+ * Calculates the read time of a post when created or updated.
+ *
+ * @param int $post_id Post id to calculate read time for.
+ * @param object $post Post object.
+ * @param boolean $update Is this an update or new.
+ *
+ * @return void
+ */
+function hh_calculate_and_update_post_read_time( $post_id, $post, $update ) {
+ global $pagenow;
+
+ // Only those allowed.
+ if ( ! current_user_can( 'edit_posts', $post_id ) ) {
+ return;
+ }
+
+ // Resolve the issues with DOM reader with Quick Draft.
+ // https://github.com/Kenshino/HelpHub/commit/faba446e699893eb95c1eef4cf9f0e38c03a4680.
+ if ( 'post-new.php' === $pagenow ) {
+ return;
+ }
+
+ // Store post content for raw usage.
+ $post_content = $post->post_content;
+ if ( empty( $post_content ) ) {
+ return;
+ }
+
+ // No post revisions.
+ if ( wp_is_post_revision( $post_id ) ) {
+ return;
+ }
+
+ // Get post types that need to have read time applied.
+ $calculate_for_posts = apply_filters( 'read_time_types', array( 'post' ) );
+
+ // If the post type is not found then return.
+ if ( ! in_array( $post->post_type, $calculate_for_posts, true ) ) {
+ return;
+ }
+
+ // Average words per minute integer.
+ $average_word_per_minute = apply_filters( 'read_time_average', 175 );
+
+ // Simple adjustment for pre tags.
+ libxml_use_internal_errors( true );
+ $data = new DOMDocument();
+ $data->loadHTML( $post_content );
+ $xpath = new DomXpath( $data );
+ libxml_use_internal_errors( false );
+
+ $pre_tags = array();
+ $word_count_offset = 0;
+
+ // Offset weight. Offset word count will be timed by this number.
+ $offset_weight = apply_filters( 'read_time_offset_weight', 1 );
+
+ foreach ( $xpath->query( '//pre' ) as $node ) {
+ /* @codingStandardsIgnoreLine */
+ $pre_tags[] = $node->nodeValue;
+ /* @codingStandardsIgnoreLine */
+ $word_count_offset = str_word_count( $node->nodeValue ) + ( $word_count_offset * $offset_weight );
+ }
+
+ // Word count.
+ $word_count = str_word_count( wp_strip_all_tags( $post_content ) ) + $word_count_offset;
+
+ // Calculate basic read time.
+ $readtime = round( $word_count / ( $average_word_per_minute / 60 ) );
+
+ // Grad and count all images.
+ preg_match_all( '/(img|src)\=(\"|\')[^\"\'\>]+/i', $post->post_content, $media );
+
+ // Adjust read time given the number of images.
+ $image_count = count( $media[0] );
+ if ( $image_count ) {
+ $readtime = ( $image_count * 12 - $image_count + $readtime );
+ }
+
+ // Update the post read time.
+ update_post_meta( $post_id, '_read_time', $readtime );
+}
+
+/**
+ * Returns the raw value of post meta "read time" for a given post.
+ *
+ * @access private
+ *
+ * @param int $post_id ID of post to retrieve read time for.
+ *
+ * @return string|int Raw value of read time
+ */
+function hh_get_readtime( $post_id ) {
+
+ if ( 0 === $post_id || ! is_numeric( $post_id ) ) {
+ global $post;
+ $post_id = $post->ID;
+ }
+
+ $custom_read_time = get_post_meta( $post_id, '_custom_read_time', true );
+
+ // Possible issue if the string is empty.
+ if ( $custom_read_time ) {
+ $read_time = $custom_read_time;
+ } else {
+ $read_time = get_post_meta( $post_id, '_read_time', true );
+ }
+
+ return $read_time;
+}
+
+/**
+ * Echo's the reading time for a given post
+ *
+ * @example
+ * <?php hh_the_read_time(); ?>
+ *
+ * @example
+ * <?php hh_the_read_time( $post->ID ); ?>
+ *
+ * @param int $post_id ID of post to retrieve read time for.
+ */
+function hh_the_read_time( $post_id = null ) {
+ $post_id = intval( $post_id );
+ echo esc_html( hh_get_the_read_time( $post_id ) );
+}
+
+/**
+ * Returns the reading time for a given post
+ *
+ * @example
+ * <?php echo hh_get_the_read_time(); ?>
+ *
+ * @example
+ * <?php echo hh_get_the_read_time( $post->ID ); ?>
+ *
+ * @param int $post_id ID of post to retrieve read time for.
+ *
+ * @return string Formated string provided read time text.
+ */
+function hh_get_the_read_time( $post_id = null ) {
+ $hh_reading_time = hh_get_readtime( $post_id );
+
+ // Filter the time before it is converted.
+ $read_time = apply_filters( 'hh_post_read_time', $hh_reading_time, $post_id );
+
+ // Convert reading time to minutes.
+ $reading_time = (int) $read_time < 60 ? '1' : (string) round( $read_time / 60 );
+
+ /* translators: %s: Read time in minutes. */
+ return sprintf( _n( 'Reading Time: %s Minute', 'Reading Time: %s Minutes', $reading_time, 'wporg-forums' ), $reading_time );
+}
+
+/**
+ * Mass calculate the read time of all published posts
+ *
+ * @return void
+ */
+function hh_mass_calculate_readtime() {
+ $qry_args = array(
+ 'post_status' => 'publish',
+ 'post_type' => 'post',
+ 'posts_per_page' => - 1,
+ );
+
+ $query = new WP_Query( $qry_args );
+ while ( $query->have_posts() ) {
+ $query->the_post();
+ hh_calculate_and_update_post_read_time( $query->post->ID, $query->post, false );
+ }
+}
+
+register_activation_hook( __FILE__, 'hh_mass_calculate_readtime' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/helphub-read-time.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinchelphubreadtimereadmetxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/readme.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/readme.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/helphub-read-time/readme.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,59 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+=== Helphub Post Types ===
+Contributors: justingreerbbi
+Requires at least: 4.5
+Tested up to: 4.6-RC1-38210
+Stable tag: 1.0.3
+License: GPLv3 or later
+License URI: http://www.gnu.org/licenses/gpl-3.0.html
+
+Generates a rough read time estimate for a post.
+
+== Description ==
+
+Generates a rough read time estimate for a post.
+
+== Usage ==
+
+Display read time for a single post in the loop.
+`<?php hh_the_read_time(); ?>`
+
+Display the read time for a post outside the loop.
+`<?php hh_the_read_time( $post->ID ); ?>`
+
+Adding Read Time Functionality to other post types can be done using the filter
+`read_time_types`
+
+Adjusting Words Per Minute Average can be filtered using
+`read_time_average`
+
+Pre tag content holds a bit more weight than normal words. The weight of the word count in pre tags is twice than normal (2 x Word Count).
+The weight can be modified by using the filter `read_time_offset_weight` which is set to 1 by default since the offset word count is added to the final word count total.
+Increasing `read_time_offset_weight` will increase the weight of the pre tag word count.
+
+Final Word Count + ( Offset Word Count * Offset Weight )
+
+
+== Installation ==
+
+Installing "Helphub Read Time" can be done either by searching for "Helphub Read Time" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
+
+1. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
+2. Activate the plugin through the 'Plugins' menu in WordPress
+3. Visit the settings screen and configure, as desired.
+
+== Frequently Asked Questions ==
+
+== Upgrade Notice ==
+
+== Changelog ==
+
+= 1.0.0 =
+* Initial release.
+
+= 1.0.1 =
+* Adjusted Read Time "Words Per Minute" for documentation style reading
+* Added Pre tag adjustment to add more weight for words count in pre tags.
+
+= 1.0.3 =
+* Fix for the Quick Draft DOM issues.
+* Read time fix for and integer & null check.
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteassetscssstylecss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/style.css (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/style.css 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,157 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.content-area h1,
+.content-area h2,
+.content-area h3,
+.content-area h4 {
+ margin: 0.4em 0 1.1em 0;
+ font-weight: 400;
+ border-bottom: 0 none;
+ padding: 0;
+}
+
+.entry-content .toc-heading,
+.entry-content h2.toc-heading,
+.entry-content h3.toc-heading,
+.entry-content h4.toc-heading,
+.entry-content h5.toc-heading,
+.entry-content h6.toc-heading {
+ clear: left;
+ float: none !important;
+ text-transform: none;
+ font-weight: 400;
+}
+
+.entry-content h2.toc-heading {
+ font-size: 1.45rem; /* 26px */
+ line-height: 1.5em; /* 39px */
+}
+
+.entry-content h3.toc-heading {
+ font-size: 1.15rem; /* 21px */
+ line-height: 1.475em; /* 31px */
+}
+
+.entry-content h4.toc-heading {
+ font-size: 1rem; /* 18px */
+}
+
+.table-of-contents {
+ float: right;
+ width: 250px;
+ background-color: #fff;
+ box-shadow: 0 0 8px rgba(0,0,0,0.1);
+ border: 1px solid #eee;
+ border-radius: 3px;
+ margin: 0 0 15px 15px;
+ z-index: 1;
+ position: relative;
+ color: #555d66;
+}
+
+@media (min-width: 971px) {
+
+ div.table-of-contents {
+ margin: -15px -30px 15px 15px;
+ }
+}
+
+@media (max-width: 480px) {
+
+ div.table-of-contents {
+ display: none;
+ }
+}
+
+.table-of-contents h2.toc-title {
+ /**
+ * originally font-size is 1.3em defined in wporg-breathe theme,
+ * which is correctly 17px but in HelpHub style this inheritance is wrong
+ * and 1.3em becomes 21px so we'll define font-size and line-height here
+ * until issue is fixed in theme itself.
+ *
+ * Recently edited to use rem values instead of pixels.
+ */
+ margin: 0;
+ padding: 7px 12px;
+ font-size: 0.95rem;
+ font-weight: 400;
+ color: #32373c;
+ text-transform: uppercase;
+ border-bottom: 1px solid #eee;
+}
+
+/**
+ * Same thing with font-size and line-height as above
+ */
+.table-of-contents .items {
+ font-size: 0.8rem;
+ margin: 0;
+ list-style-type: none;
+ padding: 1rem;
+}
+
+.table-of-contents .items li {
+ padding: 4px;
+}
+
+.table-of-contents .items li ul li,
+.table-of-contents .items li ul li ul li {
+ padding-bottom: 0;
+}
+
+/**
+ * Hiding second level table of contents links.
+ * With the second level, things looks too messy and
+ * information in the small area is too overwhelming.
+ */
+.table-of-contents .items li ul {
+ display: none;
+}
+
+/**
+ * This should be inherited from p2-breathe
+ */
+.table-of-contents .items li a,
+.table-of-contents .items li a:visited {
+ text-decoration: none;
+}
+
+.table-of-contents .items li a:hover {
+ color: #0073aa;
+ text-decoration: underline;
+}
+
+/**
+ * This should be inherited from p2-breathe
+ */
+.table-of-contents .items li ul {
+ list-style: disc;
+ margin-left: 16px;
+}
+
+.table-of-contents .items li ul li {
+ list-style: disc;
+}
+
+/* Highlight current heading and adjust scroll position for fixed toolbar */
+.toc-heading:target {
+ border-left: 5px solid #0073aa;
+ padding-left: 5px;
+ margin-left: -10px;
+}
+
+p.toc-jump {
+ position: relative;
+ height: 50px;
+ text-align:right;
+ font-size: 12px;
+}
+
+p.toc-jump:after {
+ content: '';
+ display: table;
+ clear: both;
+}
+
+p.toc-jump {
+ z-index: 1;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/assets/css/style.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteincludesclasstableofcontentslitephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,315 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Table_Of_Contents_Lite Class
+ *
+ * @package WordPress
+ * @author Carl Alberto
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+/**
+ * Helphub Table of Content Class
+ *
+ * Functionalities needed to generate the table of contents.
+ *
+ * @package WordPress
+ * @subpackage HelpHub_Post_Types
+ * @category Plugin
+ * @author Carl Alberto
+ * @since 1.0.0
+ */
+class Table_Of_Contents_Lite {
+
+ /**
+ * The single instance of Table_Of_Contents_Lite.
+ *
+ * @var object
+ * @access private
+ * @since 1.0.0
+ */
+ private static $_instance = null;
+
+ /**
+ * Settings class object
+ *
+ * @var object
+ * @access public
+ * @since 1.0.0
+ */
+ public $settings = null;
+
+ /**
+ * The version number.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $_version;
+
+ /**
+ * The token.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $_token;
+
+ /**
+ * The main plugin file.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $file;
+
+ /**
+ * The main plugin directory.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $dir;
+
+ /**
+ * The plugin assets directory.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $assets_dir;
+
+ /**
+ * The plugin assets URL.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $assets_url;
+
+ /**
+ * Suffix for Javascripts.
+ *
+ * @var string
+ * @access public
+ * @since 1.0.0
+ */
+ public $script_suffix;
+
+ /**
+ * Constructor function.
+ *
+ * @access public
+ *
+ * @param string $file filename of the plugin.
+ * @param string $version version number of plugin.
+ *
+ * @since 1.0.0
+ * @return void
+ */
+ public function __construct( $file = '', $version = '1.0.0' ) {
+ $this->_version = $version;
+ $this->_token = 'table_of_contents_lite';
+
+ // Load plugin environment variables.
+ $this->file = $file;
+ $this->dir = dirname( $this->file );
+ $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
+ $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
+
+ $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+
+ add_action( 'init', array( $this, 'plugin_init' ), 99 );
+
+ register_activation_hook( $this->file, array( $this, 'install' ) );
+
+ add_filter( 'the_content', array( $this, 'add_toc' ) );
+ } // End __construct ()
+
+ /**
+ * Load plugin initialization
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function plugin_init() {
+ $plugin_text_domain = 'table-of-contents-lite';
+ load_plugin_textdomain( $plugin_text_domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
+ }
+ /**
+ * Load style
+ */
+ public function enqueue_scripts() {
+ wp_enqueue_style( 'table-of-contents', TABLE_OF_CONTENTS_URL . 'assets/css/style.css', array(), '1.0' );
+ }
+
+ /**
+ * Main Table_Of_Contents_Lite Instance. This ensures only one instance of Table_Of_Contents_Lite is loaded or can be loaded.
+ *
+ * @since 1.0.0
+ * @static
+ *
+ * @param string $file filename of the plugin.
+ * @param string $version version number of plugin.
+ *
+ * @see Table_Of_Contents_Lite()
+ * @return Main Table_Of_Contents_Lite instance
+ */
+ public static function instance( $file = '', $version = '1.0.0' ) {
+ if ( is_null( self::$_instance ) ) {
+ self::$_instance = new self( $file, $version );
+ }
+
+ return self::$_instance;
+ } // End instance ()
+
+ /**
+ * Cloning is forbidden.
+ *
+ * @since 1.0.0
+ */
+ public function __clone() {
+ _doing_it_wrong( __FUNCTION__, esc_html_e( 'Cheatin’ huh?', 'wporg-forums' ) );
+ } // End __clone ()
+
+ /**
+ * Unserializing instances of this class is forbidden.
+ *
+ * @since 1.0.0
+ */
+ public function __wakeup() {
+ _doing_it_wrong( __FUNCTION__, esc_html_e( 'Cheatin’ huh?', 'wporg-forums' ) );
+ } // End __wakeup ()
+
+ /**
+ * Installation. Runs on activation.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ public function install() {
+ $this->_log_version_number();
+ } // End install ()
+
+ /**
+ * Log the plugin version number.
+ *
+ * @access public
+ * @since 1.0.0
+ * @return void
+ */
+ private function _log_version_number() {
+ update_option( $this->_token . '_version', $this->_version );
+ } // End _log_version_number ()
+
+ /**
+ * Main function that adds the TOC to the regular content of each post.
+ *
+ * @param longtext $content contains the post content.
+ *
+ * @return longtext generatod TOC based from the h tags in the $content plus the $content at the end.
+ */
+ public function add_toc( $content ) {
+
+ $toc = '';
+
+ $items = $this->get_tags_in_content( 'h([1-4])', $content ); // returns the h1-h4 tags inside the_content.
+ if ( count( $items ) < 2 ) {
+ return $content;
+ }
+
+ for ( $i = 1; $i <= 4; $i ++ ) {
+ $content = $this->add_ids_and_jumpto_links( "h$i", $content );
+ }
+
+ if ( $items ) {
+ $contents_header = sprintf( 'h%s', $items[0][2] );
+ $toc .= '<div class="table-of-contents">';
+ $toc .= '<h2 class="toc-title">' . __( 'Topics', 'wporg-forums' ) . '</h2>';
+ $toc .= '<ul class="items">';
+ $last_item = false;
+ foreach ( $items as $item ) {
+ if ( $last_item ) {
+ if ( $last_item < $item[2] ) {
+ $toc .= '<ul>';
+ } elseif ( $last_item > $item[2] ) {
+ $toc .= '</ul></li>';
+ } else {
+ $toc .= '</li>';
+ }
+ }
+ $last_item = $item[2];
+ $toc .= sprintf( '<li><a href="#%1s">%2s</a>', sanitize_title_with_dashes( $item[3] ), $item[3] );
+ }
+ $toc .= '</ul></div>';
+ }
+
+ return $toc . $content;
+ }
+
+ /**
+ * Filters all header tags in the current content.
+ *
+ * @param string $tag header tags to be included, default h1-h4.
+ * @param string $content content to be filtered.
+ *
+ * @return array $matches all filtered header tags.
+ */
+ public function get_tags_in_content( $tag, $content = '' ) {
+ if ( empty( $content ) ) {
+ $content = get_the_content();
+ }
+ preg_match_all( "/(<{$tag}>)(.*)(<\/{$tag}>)/", $content, $matches, PREG_SET_ORDER );
+
+ return $matches;
+ }
+
+ /**
+ * Appends the filtered header tags on the start fo the $content.
+ *
+ * @param string $tag depending on the tag, it will place the TOC link deeper in the ul - li tag.
+ * @param longtext $content content to be filtered.
+ *
+ * @return array $content returns the content with the partial TOC on top.
+ */
+ public function add_ids_and_jumpto_links( $tag, $content ) {
+ $items = $this->get_tags_in_content( $tag, $content );
+ $first = true;
+ $matches = array();
+ $replacements = array();
+
+ foreach ( $items as $item ) {
+ $replacement = '';
+ $matches[] = $item[0];
+ $id = sanitize_title_with_dashes( $item[2] );
+ if ( ! $first ) {
+ $replacement .= '<p class="toc-jump"><a href="#top">' . __( 'Top ↑', 'wporg-forums' ) . '</a></p>';
+ } else {
+ $first = false;
+ }
+ $a11y_text = sprintf( '<span class="screen-reader-text">%s</span>', $item[2] );
+ $hash = __( '<span aria-hidden="true">#</span>', 'wporg-forums' );
+ $anchor = sprintf( '<a href="#%1$s" class="anchor">%2$s %3$s</a>', $id, $hash, $a11y_text );
+ $replacement .= sprintf( '<%1$s class="toc-heading" id="%2$s" tabindex="-1">%3$s %4$s</%1$s>', $tag, $id, $item[2], $anchor );
+ $replacements[] = $replacement;
+ }
+
+ if ( $replacements ) {
+ $content = str_replace( $matches, $replacements, $content );
+ }
+
+ return $content;
+ }
+
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/includes/class-table-of-contents-lite.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentsliteindexphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/index.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/index.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Silence is golden.
+ * @codingStandardsIgnoreFile
+ */
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/index.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitelangtableofcontentslitepot"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/lang/table-of-contents-lite.pot</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/lang/table-of-contents-lite.pot (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/lang/table-of-contents-lite.pot 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,35 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+# Copyright (C) 2017 Table Of Contents For HelpHub
+# This file is distributed under the same license as the Table Of Contents Lite package.
+msgid ""
+msgstr ""
+"Project-Id-Version: Table Of Contents Lite 1.0\n"
+"Report-Msgid-Bugs-To: http://wordpress.org/support\n"
+"POT-Creation-Date: 2014-04-07 11:28:06+00:00\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2017-01-12 10:00+08:00\n"
+"Last-Translator: Carl Alberto<carl@alber2.com>\n"
+
+#. translators: %s: date and time of the revision
+
+#: includes/class-table-of-contents-lite.php:207
+#: includes/class-table-of-contents-lite.php:216
+msgid "Cheatin’ huh?"
+msgstr ""
+
+#. Plugin Name of the plugin/theme
+msgid "Table Of Contents Lite"
+msgstr ""
+
+#. Plugin URI of the plugin/theme
+msgid "https://carl@alber2.com"
+msgstr ""
+
+#. Author of the plugin/theme
+msgid "Carl Alberto"
+msgstr ""
+
+#. Author URI of the plugin/theme
+msgid "https://carl@alber2.com"
+msgstr ""
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitereadmetxt"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/readme.txt</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/readme.txt (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/readme.txt 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,39 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+=== Table Of Contents Lite ===
+Contributors: carl-alberto
+Donate link:
+Tags: wordpress, plugin, table of contents
+Requires at least: 3.9
+Tested up to: 4.5.3
+Stable tag: 1.0
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+Lightweight Table of Content Plugin for the HelpHub Project. Automatically detects h1, h2, h3 tags in your post content and convert it to your table of contents.
+
+== Description ==
+
+Lightweight Table of Content Plugin. Automatically detects h1, h2, h3 tags in your post content and convert it to your table of contents. Derived from the table of contents in the original WordPress handbook. http://meta.svn.wordpress.org/sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/table-of-contents.php
+
+== Installation ==
+
+Installing "Table Of Contents Lite" can be done either by searching for "Table Of Contents Lite" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
+
+1. Download the plugin via WordPress.org
+2. Upload the ZIP file through the 'Plugins > Add New > Upload' screen in your WordPress dashboard
+3. Activate the plugin through the 'Plugins' menu in WordPress
+
+== Screenshots ==
+
+== Frequently Asked Questions ==
+
+== Changelog ==
+
+= 1.0 =
+* 2017-01-08
+* Initial version
+
+== Upgrade Notice ==
+
+= 1.0 =
+* 2017-01-08
+* Initial version
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubinctableofcontentslitetableofcontentslitephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/table-of-contents-lite.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/table-of-contents-lite.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/table-of-contents-lite.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,39 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: Table Of Contents Lite
+ * Version: 1.0
+ * Plugin URI: https://carl.alber2.com
+ * Description: Lightweight Table of Content Plugin. Automatically detects h1, h2, h3 tags in your post content and convert it to your table of contents.
+ * Author: Carl Alberto
+ * Author URI: https://carl.alber2.com
+ * Requires at least: 4.0
+ * Tested up to: 4.5
+ *
+ * Text Domain: table-of-contents-lite
+ * Domain Path: /lang/
+ *
+ * @package WordPress
+ * @author Carl Alberto
+ * @since 1.0.0
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+define( 'TABLE_OF_CONTENTS_URL', plugin_dir_url( __FILE__ ) );
+
+// Load plugin class files.
+require_once( 'includes/class-table-of-contents-lite.php' );
+
+/**
+ * Returns the main instance of Table_Of_Contents_Lite to prevent the need to use globals.
+ *
+ * @since 1.0.0
+ * @return object Table_Of_Contents_Lite
+ */
+function table_of_contents_lite() {
+ $instance = Table_Of_Contents_Lite::instance( __FILE__, '1.0.0' );
+ return $instance;
+}
+
+table_of_contents_lite();
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/inc/table-of-contents-lite/table-of-contents-lite.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupporthelphubsupporthelphubphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php 2018-06-14 12:28:54 UTC (rev 7306)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,24 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: Support HelpHub
+ * Plugin URI: https://wordpress.org/support/
+ * Description: Introduces HelpHub functionality to the WordPress.org support structure.
+ * Version: 1.0
+ * Author: WordPress.org
+ * Author URI: https://wordpress.org/
+ * Text Domain: wporg-forums
+ * License: GPLv2
+ * License URI: http://opensource.org/licenses/gpl-2.0.php
+ *
+ * @package HelpHub
+ */
+
+namespace WordPressdotorg\HelpHub;
+
+require_once( dirname( __FILE__ ) . '/inc/helphub-codex-languages/class-helphub-codex-languages.php' );
+require_once( dirname( __FILE__ ) . '/inc/helphub-contributors/helphub-contributors.php' );
+require_once( dirname( __FILE__ ) . '/inc/helphub-post-types/helphub-post-types.php' );
+require_once( dirname( __FILE__ ) . '/inc/helphub-read-time/helphub-read-time.php' );
+require_once( dirname( __FILE__ ) . '/inc/table-of-contents-lite/table-of-contents-lite.php' );
+require_once( dirname( __FILE__ ) . '/inc/helphub-front-page-blocks/helphub-front-page-blocks.php' );
+require_once( dirname( __FILE__ ) . '/inc/helphub-customroles/class-helphub-custom-roles.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-helphub/support-helphub.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>
</body>
</html>