/** * Plugins column install */ function test_envato_market_plugins_column_install() { if (is_multisite()) { $this->markTestSkipped('Cannot properly test envato_market_plugins_column() install if on multisite.'); } $plugins = array('install' => array('envato-market/envato-market.php' => array('id' => 12345, 'name' => 'Envato Market', 'author' => 'Derek Herman', 'version' => '10.0.0', 'description' => '', 'url' => 'http://sample.org/custom/', 'author_url' => 'http://sample.org/', 'thumbnail_url' => 'http://sample.org/thumb.png', 'landscape_url' => 'http://sample.org/landscape.png', 'requires' => '4.2', 'tested' => '4.4', 'number_of_sales' => 25000, 'updated_at' => '', 'rating' => array('rating' => 4.79, 'count' => 4457)))); // Replace private themes reference $ref = new ReflectionProperty('Envato_Market_Items', 'plugins'); $ref->setAccessible(true); $ref->setValue(null, $plugins); ob_start(); envato_market_plugins_column('install'); $contents = ob_get_clean(); $this->assertContains('Install Envato Market', $contents); $ref = new ReflectionProperty('Envato_Market_Items', 'plugins'); $ref->setAccessible(true); $ref->setValue(null, array()); }
<?php /** * Plugins panel partial * * @package Envato_Market * @since 1.0.0 */ $plugins = envato_market()->items()->plugins('purchased'); ?> <div id="plugins" class="two-col panel <?php echo empty($plugins) ? 'hidden' : ''; ?> "> <?php if (!empty($plugins)) { envato_market_plugins_column('active'); envato_market_plugins_column('installed'); envato_market_plugins_column('install'); } ?> </div>