Giter VIP home page Giter VIP logo

wordpress-plugin-installer's Introduction

wordpress-plugin-installer

The Connekt Plugin Installer is a class for displaying a list of recommended or related plugins inside of the WordPress admin.

The installer displays a list of plugins that users can easily install and activate from the screen they are currently viewing.

Connekt Plugin Installer Example

This is a perfect tool for plugin and theme developers who want to make it as easy as possible for users to install recommended or related plugins.

To see a live example, install a copy of Ajax Load More and go to the Extensions section.


Getting Started

To get started, you'll simply need to load and initialize the class. The installer provides the required CSS and JS for display and functionality.

Class Loader

First step is to load the class into your plugin or theme. This would typically appear in functions.php or in the _construct of your plugin Class.

include_once('vendor/connekt-plugin-installer/class-connekt-plugin-installer.php');

Display

Next, build an array of plugin slugs and pass the array to the init method for display.

$plugin_array = array(
  array(
    'slug' => 'ajax-load-more',
  ),
  array(
    'slug' => 'velocity',
  ),
  array(
    'slug' => 'instant-images'
  ),
  array(
    'slug' => 'easy-query'
  )
);

if(class_exists('Connekt_Plugin_Installer')){
  Connekt_Plugin_Installer::init($plugin_array);
}

And that's it. Happy coding :)


Notes

  • Plugins must be available on the wordpress.org plugin repository to be installed and activated using this class.
  • Using this class outside of the plugins directory will require modification to the CNKT_INSTALLER_PATH constant for loading assets. You can define this constant in functions.php prior to loading the class. define('CNKT_INSTALLER_PATH', get_template_directory_uri() .'/vendor/connekt-plugin-installer/');

License

The code is available under the GPLv2 license

wordpress-plugin-installer's People

Contributors

dcooney avatar georgejipa avatar miklb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.