<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joshua David Nelson</title>
	<atom:link href="https://joshuadnelson.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://joshuadnelson.com/</link>
	<description>Bullshit Free WordPress Development</description>
	<lastBuildDate>Wed, 05 Apr 2017 17:28:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
		<item>
		<title>Using Font Awesome Icons for WooCommerce Grid / List Toggle</title>
		<link>https://joshuadnelson.com/using-font-awesome-icons-woocommerce-grid-list-toggle/</link>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Tue, 14 Feb 2017 17:30:14 +0000</pubDate>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[woocommerce]]></category>
		<guid isPermaLink="false">https://joshuadnelson.com/?p=2215</guid>

					<description><![CDATA[<p>While working on an eCommerce project the design called for using Font Awesome icons for the Grid/List Toggle button. If you aren&#8217;t familiar with James Koster&#8216;s plugin, it&#8217;s great &#8211; I highly recommend it. What I needed was a way to modify the basic toggle button output. The output wasn&#8217;t initially filterable, so I submitted [&#8230;]</p>
<p>The post <a href="https://joshuadnelson.com/using-font-awesome-icons-woocommerce-grid-list-toggle/">Using Font Awesome Icons for WooCommerce Grid / List Toggle</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>While working on an eCommerce project the design called for using <a href="http://fontawesome.io/">Font Awesome</a> <a href="http://fontawesome.io/icons/">icons</a> for the <a href="https://wordpress.org/plugins/woocommerce-grid-list-toggle/">Grid/List Toggle</a> button. If you aren&#8217;t familiar with <a href="https://github.com/jameskoster/">James Koster</a>&#8216;s <a href="https://github.com/jameskoster/woocommerce-grid-list-toggle">plugin</a>, it&#8217;s great &#8211; I highly recommend it.</p>
<p>What I needed was a way to modify the basic <a href="https://github.com/jameskoster/woocommerce-grid-list-toggle/blob/master/woocommerce-grid-list-toggle.php#L106">toggle button output</a>. The output wasn&#8217;t initially filterable, so I submitted <a href="https://github.com/jameskoster/woocommerce-grid-list-toggle/pull/13">a pull request</a> that was merged into the plugin as of version 1.1.0. It adds filters for all the output stings, see <a href="https://gist.github.com/joshuadavidnelson/7c5ac2a270ad8d010aadc06d5a1887a5">these examples</a>.</p>
<p>This update is great for a lot of purposes, but we&#8217;ll focus on my mission to start: using Font Awesome Icons!</p>
<h3>How It&#8217;s Done</h3>
<p>To replace the existing <a href="https://developer.wordpress.org/resource/dashicons/#admin-media">Dashicons</a> with <a href="http://fontawesome.io/icons/">FontAwesome icons</a>, we&#8217;ll use the <code>gridlist_toggle_button_output</code> filter. This filter passes three arguments: <code>$ouptut</code>, <code>$grid_view</code>, and <code>$list_view</code>. The <code>$output</code> argument is the output string we&#8217;ll be modifying, of course.</p>
<p>The <code>$grid_view</code> and <code>$list_view</code> arguments provide us the <em>translated</em> outputs for the &#8220;Grid View&#8221; and &#8220;List View&#8221; strings. These are important: if you&#8217;re using icons as the <code>title</code> attribute of the link, which might be used for your theme&#8217;s styling, or if you want to output an internationalized string for your buttons. If you want to drop these strings, or completely replace any outputted text (and <a href="https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/">provide translations</a>), you can drop the two &#8220;view&#8221; arguments. Otherwise, we can use them in a similar fashion without worrying about translating them.</p>
<p>This snippet modifies the original output string, replacing the Dashicons with Font Awesome icons and flipping the icon order:</p>
<a href="https://gist.github.com/7c5ac2a270ad8d010aadc06d5a1887a5" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>Hope you find this useful, feel free to share your customization ideas via <a href="https://gist.github.com/">gist</a> or questions in the comments. Big thanks to <a href="https://jameskoster.co.uk/">James Koster</a> for the <a href="https://github.com/jameskoster/woocommerce-grid-list-toggle">Grid / List plugin</a>.</p>
<p>*Also, if you&#8217;re loving the Font Awesome icons, check out <a href="https://www.kickstarter.com/projects/232193852/font-awesome-5">their new version</a> and consider <a href="https://font-awesome-5.backerkit.com/hosted_preorders">buying a license</a>.</p>
<p>The post <a href="https://joshuadnelson.com/using-font-awesome-icons-woocommerce-grid-list-toggle/">Using Font Awesome Icons for WooCommerce Grid / List Toggle</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Disable Blog: WordPress Gone Blog-less</title>
		<link>https://joshuadnelson.com/disable-blog/</link>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Sun, 31 Jul 2016 18:30:46 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[disable blog]]></category>
		<guid isPermaLink="false">https://joshuadnelson.com/?p=2119</guid>

					<description><![CDATA[<p>Disable blog is a simple plugin used to create a website free of blog features. It seamlessly creates a static, page-based WordPress site.</p>
<p>The post <a href="https://joshuadnelson.com/disable-blog/">Disable Blog: WordPress Gone Blog-less</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A year-and-a-half ago I released a plugin called <a href="https://wordpress.org/plugins/disable-blog/" data-cke-saved-href="https://wordpress.org/plugins/disable-blog/">Disable Blog</a>.</p>
<p>Guess what it does: disables the blog on WordPress sites. (clever title, right?)</p>
<h4>“Isn’t WordPress supposed to be a blog?”</h4>
<p>WordPress has grown from a <a href="https://wordpress.org/about/" data-cke-saved-href="https://wordpress.org/about/">blog platform</a> to a content management system. More recently it has progressed into an <a href="http://v2.wp-api.org/" data-cke-saved-href="http://v2.wp-api.org/">application framework</a>/<a href="https://tommcfarlin.com/wordpress-framework/">foundation</a>.</p>
<p>No doubt, WordPress blog functionality is inherent to its core. And so it should be! Blogging is a useful device for much of the web. But the flip side, where it’s not utilized at all, exists on plenty of sites, too.</p>
<p>I have <a href="https://joshuadnelson.com/#portfolio" data-cke-saved-href="https://joshuadnelson.com/#portfolio">clients</a> that only want WordPress for a static website, they don’t want or need a blog. I’ve experienced confusion around unwanted blog features at least <a href="https://en.wiktionary.org/wiki/eleventy" data-cke-saved-href="https://en.wiktionary.org/wiki/eleventy">eleventy-one</a> times. I wanted to provide a better experience for my clients.</p>
<p>Okay, okay, okay – I’ll admit it: there’s an element of OCD involved for me here.</p>
<p>There are plugins to disable <a href="https://wordpress.org/plugins/disable-feeds/" data-cke-saved-href="https://wordpress.org/plugins/disable-feeds/">feeds</a>, <a href="https://wordpress.org/plugins/disable-comments/" data-cke-saved-href="https://wordpress.org/plugins/disable-comments/">disable comments</a>, <a href="https://wordpress.org/plugins/disable-xml-rpc/" data-cke-saved-href="https://wordpress.org/plugins/disable-xml-rpc/">disable XML_RPC</a>, and even one that will <a href="https://wordpress.org/plugins/postless/" data-cke-saved-href="https://wordpress.org/plugins/postless/">hide your admin ‘post’ pages</a>. But none were quite the solution I wanted.</p>
<h4>Just hide everything!</h4>
<p>I wanted a plugin to disable blog functionality across the board. From the obvious items like the “Post” admin menu to the “invisible” things like feed links.</p>
<p>It couldn’t sacrifice anything shared by blog and non-blog things alike. It needed to be flexible enough for custom post types and taxonomies. (A lot of my work revolves around custom content management).</p>
<p>For instance, posts <em>and </em>pages can have comments. It had to obscure any comments attached to posts, but still keep comments available for pages. Not to mention the near-infinite possibilities with custom post types that use the built-in categories/tags, comments, feeds, et cetera.</p>
<p>Other considerations, too: What if the site’s reading settings were set to blog and not to a static page? How do you deal with redirects and queries? What about author pages?</p>
<p>As you can see, it turned into a (fun) challenge.</p>
<h4>The plugin.</h4>
<p>My goal with this plugin is to make it seamless and I think it covers all the major bases:</p>
<ul>
<li>Disables the blog by hiding, redirecting, and/or completely turning off blog-related functionality. See the <a href="https://github.com/joshuadavidnelson/disable-blog#description" data-cke-saved-href="https://github.com/joshuadavidnelson/disable-blog#description">full list here</a>.</li>
<li>Simple path to a blog-free website, without any changes to your database/content. Deactivate it to go back to blogging.</li>
<li>Custom post types and taxonomies support.</li>
<li>Works on Multisite!</li>
<li>There are a ton of filters to allow developers to tweak it further. (Documentation coming soon)</li>
</ul>
<p>I am always finding little ways to improve a (see the <a href="https://github.com/joshuadavidnelson/disable-blog/issues/8" data-cke-saved-href="https://github.com/joshuadavidnelson/disable-blog/issues/8">To-Do list</a>).</p>
<p>I just pushed out the newest release this last week. See the full <a href="https://github.com/joshuadavidnelson/disable-blog/blob/master/CHANGELOG.md" data-cke-saved-href="https://github.com/joshuadavidnelson/disable-blog/blob/master/CHANGELOG.md">changelog</a>, if you’re interested.</p>
<p>View the plugin on <a href="https://github.com/joshuadavidnelson/disable-blog" data-cke-saved-href="https://github.com/joshuadavidnelson/disable-blog">Github</a> and on <a href="https://wordpress.org/plugins/disable-blog/" data-cke-saved-href="https://wordpress.org/plugins/disable-blog/">WordPress.org</a></p>
<p><strong>Please direct any issues to the <a href="https://wordpress.org/support/plugin/disable-blog" data-cke-saved-href="https://wordpress.org/support/plugin/disable-blog">Support Forums</a>, not the comments below.</strong></p>
<p>To comment/contribute, reach out on <a href="https://github.com/joshuadavidnelson/disable-blog/issues" data-cke-saved-href="https://github.com/joshuadavidnelson/disable-blog/issues">Github</a> or <a href="https://joshuadnelson.com/#contact" data-cke-saved-href="https://joshuadnelson.com/#contact">contact me</a> on this site.</p>
<p>Like the plugin? Please consider leaving <a href="https://wordpress.org/support/view/plugin-reviews/disable-blog#postform" data-cke-saved-href="https://wordpress.org/support/view/plugin-reviews/disable-blog#postform">a positive review</a>.</p>
<p><em>Featured Image credit: <a href="https://unsplash.com/search/laptop?photo=tAKXap853rY" data-cke-saved-href="https://unsplash.com/search/laptop?photo=tAKXap853rY">Photo by Alejandro Escamilla on Unsplash.</a></em></p>
<p>The post <a href="https://joshuadnelson.com/disable-blog/">Disable Blog: WordPress Gone Blog-less</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Category (Taxonomy) Dropdown Filtered By Post Type</title>
		<link>https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/</link>
					<comments>https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/#comments</comments>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Sat, 20 Feb 2016 05:56:16 +0000</pubDate>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[custom post type]]></category>
		<guid isPermaLink="false">https://joshuadnelson.com/?p=2038</guid>

					<description><![CDATA[<p>Filter the wp_categories_dropdown function by a specific post type.</p>
<p>The post <a href="https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/">Category (Taxonomy) Dropdown Filtered By Post Type</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignright wp-image-2050 size-medium" src="https://joshuadnelson.com/wp/../files/uploads/2016/02/Screen-Shot-2016-02-19-at-9.20.28-PM-300x90.png" alt="Screen Shot 2016-02-19 at 9.20.28 PM" width="300" height="90" srcset="https://joshuadnelson.com/content/uploads/2016/02/Screen-Shot-2016-02-19-at-9.20.28-PM-300x90.png 300w, https://joshuadnelson.com/content/uploads/2016/02/Screen-Shot-2016-02-19-at-9.20.28-PM.png 368w" sizes="(max-width: 300px) 100vw, 300px" />While working on a large custom content management solution for a client I was building templates for multiple post types all sharing a common taxonomy. Most of these templates needed a dropdown to filter the results by the common taxonomy, in this case a taxonomy named &#8220;department.&#8221;</p>
<p>Should be fairly straight-forward, right? WordPress <em>does</em> offer a great function for creating taxonomy dropdowns called <code><a href="https://codex.wordpress.org/Function_Reference/wp_dropdown_categories">wp_dropdown_categories</a></code>, which works with custom taxonomies as well as categories.</p>
<p>However, it will return all taxonomies with <em>any</em> posts. If you have multiple post types, you could very easily get a list of taxonomies with posts, but not the post type you want for the template &#8211; as was my issue.</p>
<p>Luckily, we can filter the SQL query used in the <a href="https://developer.wordpress.org/reference/functions/get_terms/"><code>get_terms</code></a> function, which is called by <code>wp_dropdown_cateogies</code>.</p>
<a href="https://gist.github.com/4e82bbd506b776534a6f" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>The above utilizes the <a href="https://developer.wordpress.org/reference/functions/get_terms/#source-code"><code>term_clauses</code> filter</a>, and hunts for the <code>post_type</code> argument. The beauty of this is that we&#8217;re extending the functionality of the <code>get_terms</code> function directly.</p>
<p>This means we can use <code>wp_dropdown_categories</code> and simply pass our new <code>post_type</code> argument. Furthermore, the fallback here is the built-in function, which is a double bonus. I love the extend-ability of WordPress!</p>
<p>Here&#8217;s the basic usage, now that we have the filter above:</p>
<a href="https://gist.github.com/4e82bbd506b776534a6f" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>That said, I <a href="https://gist.github.com/joshuadavidnelson/4e82bbd506b776534a6f#file-get-custom-taxonomy-dropdown-php">built a custom function</a> to wrap the <code>wp_dropdown_categories</code>, so I could grab the current query var and add a wrapper element.</p>
<p>Here are some useful resources if you&#8217;re going down this rabbit hole:</p>
<ul>
<li><a href="https://developer.wordpress.org/reference/functions/get_terms/">get_terms</a></li>
<li><a href="https://codex.wordpress.org/Function_Reference/wp_dropdown_categories">wp_dropdown_categories</a></li>
<li><a href="http://scotty-t.com/2012/01/30/understanding-mysql-in-wordpress/">Understanding MySQL in WordPress</a></li>
<li><a href="http://wordpress.stackexchange.com/questions/207655/restrict-taxonomy-dropdown-to-post-type">Stack Exchange: Restrict taxonomy dropdown to post type</a></li>
</ul>
<p>The post <a href="https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/">Category (Taxonomy) Dropdown Filtered By Post Type</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Weather in WordPress with Dark Sky</title>
		<link>https://joshuadnelson.com/weather-in-wordpress-with-forecast-io/</link>
					<comments>https://joshuadnelson.com/weather-in-wordpress-with-forecast-io/#comments</comments>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Mon, 01 Feb 2016 07:47:21 +0000</pubDate>
				<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<guid isPermaLink="false">https://joshuadnelson.com/?p=1984</guid>

					<description><![CDATA[<p>Extend your WordPress website with access to weather data from Forecast.io with this helper class.</p>
<p>The post <a href="https://joshuadnelson.com/weather-in-wordpress-with-forecast-io/">Weather in WordPress with Dark Sky</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://github.com/joshuadavidnelson/wp-darksky" rel="attachment wp-att-1999"><img decoding="async" class="alignright size-full wp-image-1999" src="https://joshuadnelson.com/wp/../files/uploads/2016/02/weather-tile-1.png" alt="weather-tile" width="302" height="129" srcset="https://joshuadnelson.com/content/uploads/2016/02/weather-tile-1.png 302w, https://joshuadnelson.com/content/uploads/2016/02/weather-tile-1-300x128.png 300w" sizes="(max-width: 302px) 100vw, 302px" /></a><em><strong>Update 1-4-17:</strong> Forecast.io is now called Dark Sky. Classes, names, and such have been updated in this post and the various gists/repo.</em></p>
<p>A recent project called for a &#8220;current weather&#8221; tile on the homepage. A quick look through the available weather APIs out there lead me to <strike>Forecast.io</strike> <a href="http://darksky.net">DarkSky.net</a>, which is pretty slick. There are more than a few <a href="https://darksky.net/dev/docs/libraries">PHP approaches already put together</a>. I took <a href="https://github.com/guhelski">Guilherm Uhelski&#8217;s</a> <a href="https://github.com/guhelski/forecast-php">PHP helper class</a> and <a href="https://github.com/joshuadavidnelson/wp-darksky">expanded it for WordPress</a>.</p>
<p>The purpose of this helper class is to: perform the API call, process and return the JSON response, and store that response for quick reuse. Check out <a href="https://github.com/joshuadavidnelson/wp-darksky">here</a>. Feel free to drop it into a custom plugin for use on your site or your projects.</p>
<p>WP-DarkSky uses the <a href="https://codex.wordpress.org/HTTP_API#Helper_Functions">WordPress HTTP API helper functions</a> (as well as <a href="https://codex.wordpress.org/Transients_API">transients</a>). If you&#8217;re not familiar with external HTTP calls or WordPress&#8217; helper functions, check out this great <a href="http://code.tutsplus.com/series/a-look-at-the-wordpress-http-api--wp-33794">series of walkthroughs</a> by <a href="https://tommcfarlin.com/">Tom McFarlin</a>. Here&#8217;s a good <a href="https://css-tricks.com/the-deal-with-wordpress-transients/">walk-through on transients</a>. With a good understanding of the HTTP API and transients, this class will be pretty straight-forward.</p>
<p>Next up, sign up for a <a href="https://darksky.net/dev/register">free account and API key from DarkSky.net</a>, you&#8217;ll need that in order to use this helper class.</p>
<p>Okay, now that we&#8217;ve got the basics out of the way, let&#8217;s use it!<br />
<span id="more-1984"></span></p>
<h4>Using It</h4>
<p>Here&#8217;s a quick example on using this class. At the bare minimum you need an API key, a Latitude, and a Longitude.</p>
<a href="https://gist.github.com/d6fa0c17faf3f0ea0192" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>Then, it&#8217;s a simple matter of calling the elements you need out of the response. Using the <a href="http://php.net/manual/en/language.oop5.overloading.php#object.get">magic <code>__get()</code> method</a>, all of the response data is available to call.</p>
<p>Familiarize yourself with the <a href="https://gist.github.com/joshuadavidnelson/b27ff69e9a99c1500a89">typical response</a>, and the <a href="https://darksky.net/dev/docs">Dark Sky API</a>. From there you can take the response data and build some cool things.</p>
<p>In my case, I wanted today&#8217;s minimum and maximum temperatures. Here&#8217;s a basic version of the function I use in my template:</p>
<a href="https://gist.github.com/d6fa0c17faf3f0ea0192" target="_blank"><em>View this code snippet on GitHub.</em></a>
<h4>How it Works</h4>
<p>Using the great HTTP API functions in WordPress, the helper class grabs the API response. It&#8217;s then stored in a transient (by default, but this can be overridden &#8211; see below), allowing us to store the response for quick recall later. This is important from a page load standpoint, of course, but also critical with services like Dark Sky, which provides 1,000 free calls per day.</p>
<p>It makes sense to grab the forecast once for a set period of time, rather than at every page load. If the latter is true, you could end up with quite a lot of calls to the API and quickly reach your free limit.</p>
<p>For my purposes I only needed the daily forecast, so a 6-hour cache is sufficient (it could be set to 24, but 6 hours allows for 4 API calls a day and accounts for potential changes in the forecast). If you needed, for instance, the current weather, then you could easily reduce the transient time to 5 minutes and still keep your calls below the 1,000/day limit.</p>
<p>Need a fresh of the API call? Just use the <code>get_response</code> function with the first parameter set to true clear the cache and get a fresh API response:</p>
<a href="https://gist.github.com/d6fa0c17faf3f0ea0192" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>You can modify the other cache settings in the initial arguments or by setting the specific parameter, as shown below:</p>
<a href="https://gist.github.com/d6fa0c17faf3f0ea0192" target="_blank"><em>View this code snippet on GitHub.</em></a>
<h4>Bonus: Weather Icons</h4>
<p><a href="https://gist.github.com/joshuadavidnelson/12e9915ad81d62a6991c" rel="attachment wp-att-1999"><img decoding="async" class="alignright size-full wp-image-1999" src="https://joshuadnelson.com/wp/../files/uploads/2016/02/weather-tile-1.png" alt="weather-tile" width="302" height="129" srcset="https://joshuadnelson.com/content/uploads/2016/02/weather-tile-1.png 302w, https://joshuadnelson.com/content/uploads/2016/02/weather-tile-1-300x128.png 300w" sizes="(max-width: 302px) 100vw, 302px" /></a>You might notice that the image shown above (and here) include an icon, yet my example code above doesn&#8217;t? <a href="https://www.youtube.com/watch?v=6nSKkwzwdW4">Oh myyy</a>, you&#8217;re observant!</p>
<p>On my project I built <a href="https://gist.github.com/joshuadavidnelson/12e9915ad81d62a6991c#file-wp-darksky-weather-icon-forecast-php">another helper class</a> to extend the original DarkSky\Forecast class and add some awesome <a href="https://erikflowers.github.io/weather-icons/">Weather Icons</a> (by <a href="https://github.com/erikflowers">Eric Flowers</a>).</p>
<p>Drop <a href="https://gist.github.com/joshuadavidnelson/12e9915ad81d62a6991c#file-wp-darksky-weather-icon-forecast-php">this extra class</a> into the same plugin as the class above to build some awesome weather outputs. To take the temperature example above and expand it, here it is with a weather icon:</p>
<a href="https://gist.github.com/12e9915ad81d62a6991c" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>Note that this doesn&#8217;t enqueue the Weather Icons stylesheet. You&#8217;ll have to do that in your <code>functions.php</code> file. Refer to the Weather Icons Documentation and the <a href="https://developer.wordpress.org/reference/functions/wp_enqueue_style/"><code>wp_enqueue_style</code></a> function.</p>
<p><em>Featured Image: <a href="https://500px.com/photo/63121651/fingers-of-heaven-by-robert-postma">Fingers of Heaven by Robert Postma on 500px.com</a>, under <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons License</a>.</em></p>
<p>The post <a href="https://joshuadnelson.com/weather-in-wordpress-with-forecast-io/">Weather in WordPress with Dark Sky</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://joshuadnelson.com/weather-in-wordpress-with-forecast-io/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Fixing Your Deprecated Widget Constructors in WordPress 4.3</title>
		<link>https://joshuadnelson.com/fixing-your-deprecated-widget-constructors-in-wordpress-4-3/</link>
					<comments>https://joshuadnelson.com/fixing-your-deprecated-widget-constructors-in-wordpress-4-3/#comments</comments>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Wed, 19 Aug 2015 16:42:58 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://joshuadnelson.com/?p=1852</guid>

					<description><![CDATA[<p>A quick update to your code can fix these depreciated widget constructors for WordPress 4.3.</p>
<p>The post <a href="https://joshuadnelson.com/fixing-your-deprecated-widget-constructors-in-wordpress-4-3/">Fixing Your Deprecated Widget Constructors in WordPress 4.3</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As of WordPress 4.3 older versions of constructor functions are deprecated. Typically these are common in widgets, where you&#8217;re extending the parent WP_Widget class. I&#8217;ve recently updated a few of my older versions in my plugins and on client site&#8217;s, here&#8217;s the basics.</p>
<p>Older, now depreciated code (truncated to the first 20 lines):</p>
<a href="https://gist.github.com/4107f33c28d68507ecfb" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>Harder, better, faster, stronger: <a href="https://www.youtube.com/watch?v=lLYD_-A_X5E" target="_blank">*</a></p>
<a href="https://gist.github.com/4107f33c28d68507ecfb" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>It breaks down to being an older PHP method &#8211; naming the constructor function the same as the class and/or calling the parent constructor via the class name. Newer versions of PHP allow us to call parent classes via <a href="http://php.net/manual/en/keyword.parent.php"><code>parent::</code></a> and utilize the <a href="http://php.net/manual/en/language.oop5.decon.php"><code>__construct()</code></a> function, which is now the preferred method for WordPress.</p>
<p>For more information, check out the <a href="https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/">WP Core Blog post</a> on the subject and the <a href="http://codex.wordpress.org/Widgets_API">Widgets API Documentation</a>.</p>
<p>The post <a href="https://joshuadnelson.com/fixing-your-deprecated-widget-constructors-in-wordpress-4-3/">Fixing Your Deprecated Widget Constructors in WordPress 4.3</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://joshuadnelson.com/fixing-your-deprecated-widget-constructors-in-wordpress-4-3/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Programmatically Add Images to Media Library</title>
		<link>https://joshuadnelson.com/programmatically-add-images-to-media-library/</link>
					<comments>https://joshuadnelson.com/programmatically-add-images-to-media-library/#comments</comments>
		
		<dc:creator><![CDATA[Joshua Nelson]]></dc:creator>
		<pubDate>Wed, 03 Jun 2015 18:00:42 +0000</pubDate>
				<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[media library]]></category>
		<guid isPermaLink="false">http://joshuadnelson.com/?p=1695</guid>

					<description><![CDATA[<p>Use this little function to add images to Programmatically Add Images to Media Library in WordPress.</p>
<p>The post <a href="https://joshuadnelson.com/programmatically-add-images-to-media-library/">Programmatically Add Images to Media Library</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I built <a href="https://github.com/joshuadavidnelson/gravity-forms-user-populate">a plugin for a client</a> that utilized a front-end <a href="http://go.jdn.im/gravity-forms">Gravity Form</a> submission to create media file entries and link them to posts. Part of the plugin was the ability to take a file uploaded to the server (in this case, by Gravity Forms) and use that url to create a media entry, so it appears within the media library. Below is the code to add an image to the media library programmatically:</p>
<a href="https://gist.github.com/164a0a0744f0693d5746" target="_blank"><em>View this code snippet on GitHub.</em></a>
<p>I mentioned this code in a previous post, where I outlined how to <a href="http://joshuadnelson.com/connect-gravity-forms-file-upload-to-acf-gallery-field/">link Gravity Forms with ACF Gallery fields</a>.</p>
<p><em><b>Updated 3-29-17:</b> Updated the function to a class and utilized a <a href="https://gist.github.com/hissy">better method for creating the file</a>.</em></p>
<p><em>Featured image via <a href="https://www.flickr.com/creativecommons/">Flickr CC</a>, by <a href="https://www.flickr.com/photos/118118485@N05/16468895996">Michael D Beckwith</a></em></p>
<p>The post <a href="https://joshuadnelson.com/programmatically-add-images-to-media-library/">Programmatically Add Images to Media Library</a> appeared first on <a href="https://joshuadnelson.com">Joshua David Nelson</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://joshuadnelson.com/programmatically-add-images-to-media-library/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
