<?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>code example Archives - WP Software License for WooCommerce</title>
	<atom:link href="https://wpsoftwarelicense.com/tag/code-example/feed/" rel="self" type="application/rss+xml" />
	<link>https://wpsoftwarelicense.com/tag/code-example/</link>
	<description>An easy and secure way to manage product licensing for WooCommerce</description>
	<lastBuildDate>Fri, 07 Dec 2018 07:47:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Add additional licence details on Products archive page</title>
		<link>https://wpsoftwarelicense.com/add-additional-licence-details-products-archive-page/</link>
					<comments>https://wpsoftwarelicense.com/add-additional-licence-details-products-archive-page/#respond</comments>
		
		<dc:creator><![CDATA[woocommerce-sl]]></dc:creator>
		<pubDate>Fri, 07 Dec 2018 07:39:13 +0000</pubDate>
				<category><![CDATA[News]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[code example]]></category>
		<guid isPermaLink="false">https://woosoftwarelicense.com/?p=1001</guid>

					<description><![CDATA[<p>For an easier Product management, additional details within admin dashboard on Products archive might come in handy. This is easy to achieve through the default WordPress filter manage_product_posts_custom_column This reduce the maintenance time and let the administrator to focus on important aspects of the site. The next code example add the licensed product version nwxt [&#8230;]</p>
<p>The post <a href="https://wpsoftwarelicense.com/add-additional-licence-details-products-archive-page/">Add additional licence details on Products archive page</a> appeared first on <a href="https://wpsoftwarelicense.com">WP Software License for WooCommerce</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>For an easier Product management, additional details within admin dashboard on Products archive might come in handy. This is easy to achieve through the default WordPress filter <strong>manage_product_posts_custom_column</strong> This reduce the maintenance time and let the administrator to focus on important aspects of the site.<span id="more-1001"></span></p>
<p>The next code example add the licensed <a href="https://wpsoftwarelicense.com/documentation/create-a-licensed-product/">product version</a> nwxt to the Product name within the archive interface:</p>
<pre class="brush: php; title: ; notranslate">
    add_filter( 'manage_product_posts_custom_column', 'admin_product_title_version', 99, 2 );
    function admin_product_title_version( $column, $postid ) 
        {
            if ( 'name' === $column ) 
                {
                    $product = wc_get_product( $postid );
                    if ( 'yes' === $product-&gt;get_meta('_sl_enabled') ) 
                        {
                            printf(
                                '
&lt;strong&gt;v %s&lt;/strong&gt;',
                                $product-&gt;get_meta('_sl_new_version')
                            );
                        }
                }
        }
</pre>
<p>The above code can be included within theme functions.php, within a custom plugin or mu-plugins folder. The expected results appear like this:</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1004" src="https://wpsoftwarelicense.com/wp-content/uploads/2018/12/woosoftwarelicence-products-additional-version.jpg" alt="" width="890" height="449" srcset="https://wpsoftwarelicense.com/wp-content/uploads/2018/12/woosoftwarelicence-products-additional-version.jpg 890w, https://wpsoftwarelicense.com/wp-content/uploads/2018/12/woosoftwarelicence-products-additional-version-600x303.jpg 600w, https://wpsoftwarelicense.com/wp-content/uploads/2018/12/woosoftwarelicence-products-additional-version-300x151.jpg 300w, https://wpsoftwarelicense.com/wp-content/uploads/2018/12/woosoftwarelicence-products-additional-version-768x387.jpg 768w" sizes="(max-width: 890px) 100vw, 890px" /></p>
<p>Other licensing fields can be used too, as follow:</p>
<ul>
<li>_sl_software_title</li>
<li>_sl_software_unique_title</li>
<li>_sl_plugin_url</li>
<li>_sl_product_expire_units</li>
<li>_sl_product_expire_time</li>
<li>_sl_version_required</li>
<li>_sl_tested_up_to</li>
<li>_sl_last_updated</li>
<li>_sl_update_nottice</li>
</ul>
<p>The post <a href="https://wpsoftwarelicense.com/add-additional-licence-details-products-archive-page/">Add additional licence details on Products archive page</a> appeared first on <a href="https://wpsoftwarelicense.com">WP Software License for WooCommerce</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://wpsoftwarelicense.com/add-additional-licence-details-products-archive-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
