{"id":33900,"date":"2019-03-01T16:56:34","date_gmt":"2019-03-01T16:56:34","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=33900"},"modified":"2019-05-28T14:11:09","modified_gmt":"2019-05-28T14:11:09","slug":"integrating-premium-add-ons-with-plugins-and-themes","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/integrating-premium-add-ons-with-plugins-and-themes\/","title":{"rendered":"Integrating premium add-ons with plugins and themes"},"content":{"rendered":"<p class=\"h2\">Table of contents<\/p>\n\n<ol><li><a href=\"#intro\">Intro<\/a><\/li><li><a href=\"#integrating-with-premium-plugins\">Integrating with premium plugins<\/a><\/li><li><a href=\"#integrating-with-premium-themes\">Integrating with premium themes<\/a><\/li><\/ol><\/li><\/ol>\n\n\n<h2 class=\"wp-block-heading\" id=\"intro\">Intro<\/h2>\n\n\n\n<p>You can integrate premium add-ons of Shortcodes Ultimate plugin into your premium plugins and themes. Specific instructions for plugins and themes are given below. All integrations are made with TGM Plugin Activation Script. Before the integration of premium add-ons you should buy one license for unlimited number of sites for every plugin or theme. Integration of premium add-ons into free themes and plugins is forbidden.<\/p>\n\n\n\n<p>You can download TGMPA script from&nbsp;<a href=\"http:\/\/tgmpluginactivation.com\/\">official site<\/a>. On&nbsp;<a href=\"http:\/\/tgmpluginactivation.com\/configuration\/\">this page<\/a>&nbsp;you can find information on additional script settings.<\/p>\n\n\n\n<p>If you want to integrate the core plugin into your plugin or theme please read &#8220;Integrating Shortcodes Ultimate core-plugin with plugins and themes&#8221; article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"integrating-with-premium-plugins\">Integrating with premium plugins<\/h2>\n\n\n\n<p>First of all you should download TGMPA script and copy it to directory of your plugin. In this article we assume you&#8217;ve copied script file in the root of your plugin directory (without subfolders). Thus, the full path to script file will look like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/plugins\/your-plugin-name\/class-tgm-plugin-activation.php<\/pre>\n\n\n\n<p>Then you should download and copy zip-archive with the necessary add-on to directory of your plugin. In this article we assume you&#8217;ve already copied zip- archive with add-on to the root of your plugin directory (without subfolders). Thus, the full path to zip-archive will look like:<\/p>\n\n\n\n<p>Use the code below in the code of your plugin:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">require_once plugin_dir_path( __FILE__ ) . 'class-tgm-plugin-activation.php';<br><br>add_action( 'tgmpa_register', 'my_plugin_register_required_plugins' );<br><br>function my_plugin_register_required_plugins() {<br><br>  $plugins = array(<br>    array(<br>      'name'        =&gt; 'Shortcodes Ultimate',<br>      'slug'        =&gt; 'shortcodes-ultimate',<br>      'version'     =&gt; '5.1.0',<br>      'is_callable' =&gt; 'shortcodes_ultimate',<br>    ),<br>    array(<br>      'name'    =&gt; 'Shortcodes Ultimate: Add-on',<br>      'slug'    =&gt; 'shortcodes-ultimate-extra',<br>      'version' =&gt; '1.5.0',<br>      'source'  =&gt; plugin_dir_path( __FILE__ ) . 'shortcodes-ultimate-addon.zip',<br>    ),<br>  );<br><br>  \/\/ http:\/\/tgmpluginactivation.com\/configuration\/#h-plugin-parameters<br>  $config = array( 'id' =&gt; 'my_plugin' );<br><br>  tgmpa( $plugins, $config );<br><br>}<\/pre>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/03\/example-plugin.zip\">example-plugin.zip<\/a><a href=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/03\/example-plugin.zip\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"integrating-with-premium-themes\">Integrating with premium themes<\/h2>\n\n\n\n<p>First of all you should download TGMPA script and copy it to directory of your theme. In this article we assume you&#8217;ve copied script file in the root of your theme directory (without subfolders). Thus, the full path to script file will look like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/themes\/your-theme-name\/class-tgm-plugin-activation.php<\/pre>\n\n\n\n<p>Then you should download and copy zip-archive with the necessary add-on to directory of your theme. In this article we assume you&#8217;ve already copied zip- archive with add-on to the root of your theme directory (without subfolders). Thus, the full path to zip-archive will look like:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/wp-content\/themes\/your-theme-name\/shortcodes-ultimate-addon.zip<\/pre>\n\n\n\n<p>Use the code below in the <em>functions.php<\/em> file of your theme:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">require_once get_stylesheet_directory() . '\/class-tgm-plugin-activation.php';<br><br>add_action( 'tgmpa_register', 'my_theme_register_required_plugins' );<br><br>function my_theme_register_required_plugins() {<br><br>  $plugins = array(<br>    array(<br>      'name'        =&gt; 'Shortcodes Ultimate',<br>      'slug'        =&gt; 'shortcodes-ultimate',<br>      'version'     =&gt; '5.1.0',<br>      'is_callable' =&gt; 'shortcodes_ultimate',<br>    ),<br>    array(<br>      'name'    =&gt; 'Shortcodes Ultimate: Add-on',<br>      \/\/ example slug: 'shortcodes-ultimate-extra'<br>      'slug'    =&gt; 'shortcodes-ultimate-addon-slug',<br>      'version' =&gt; '1.5.0',<br>      'source'  =&gt; get_stylesheet_directory() . '\/shortcodes-ultimate-addon.zip',<br>    ),<br>  );<br><br>  \/\/ http:\/\/tgmpluginactivation.com\/configuration\/#h-plugin-parameters<br>  $config = array( 'id' =&gt; 'my_theme' );<br><br>  tgmpa( $plugins, $config );<br><br>}<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/03\/example-theme.zip\">example-theme.zip<\/a><a href=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2019\/03\/example-theme.zip\" class=\"wp-block-file__button\" download>Download<\/a><\/div>\n","protected":false},"featured_media":0,"template":"","docs_category":[23],"class_list":["post-33900","docs","type-docs","status-publish","hentry","docs_category-customization"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/33900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/docs"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=33900"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=33900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}