Advertisement
salmancreation

Unify-toolkit.php

Aug 2nd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Unify Toolkit Plugin
  4. Author: Salman Ahmed
  5. Description: Unify Theme Toolkit Plugin , All Shortcode . Please Active .
  6. Version: 1.0
  7. */
  8.  
  9.  
  10. if(!defined('ABSPATH')){
  11.     exit;
  12. }
  13.  
  14.  
  15. define('UNIFY_ACC_URL', WP_PLUGIN_URL . '/' . plugin_basename( dirname (__FILE__ )) . '/' );
  16. define('UNIFY_ACC_PATH', plugin_dir_path(__FILE__ ) );
  17.  
  18.  
  19. add_filter('widget_text', 'do_shortcode');
  20.  
  21.  
  22. // VC Load
  23. require_once(UNIFY_ACC_PATH . 'vc-addons/vc-load.php');
  24.  
  25. // Theme Shortcode File
  26.  
  27. require_once(UNIFY_ACC_PATH . 'shortcodes/slider-shortcode.php');
  28.  
  29.  
  30. // Shortcode Depends on VC Plugin
  31.  
  32. include_once( ABSPATH . 'wp-admin/includes/plugin.php');
  33.  
  34. if (is_plugin_active('js_composer/js_composer.php' )) {
  35.     require_once(UNIFY_ACC_PATH . 'shortcodes/progress.php');
  36. }
  37.  
  38.  
  39. // test shortcode
  40.  
  41. function unify_shortcode_test($atts , $content = null )
  42. {
  43.     extract(shortcode_atts(
  44.         array(
  45.             'id' => ''
  46.             ),
  47.         $atts
  48.     ));
  49.  
  50.     $imgSrc = wp_get_attachment_image_src($id, 'large' );
  51.  
  52.     return '<img src="'.$imgSrc[0].'" alt="img">';
  53.  
  54. }
  55. add_shortcode('unify_test','unify_shortcode_test');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement