| 1 |
<?php |
| 2 |
|
| 3 |
if(!function_exists('xyz_ihs_plugin_get_version')) |
| 4 |
{ |
| 5 |
function xyz_ihs_plugin_get_version() |
| 6 |
{ |
| 7 |
if ( ! function_exists( 'get_plugins' ) ) |
| 8 |
require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 9 |
$plugin_folder = get_plugins( '/' . plugin_basename( dirname( XYZ_INSERT_HTML_PLUGIN_FILE ) ) ); |
| 10 |
// print_r($plugin_folder); |
| 11 |
return $plugin_folder['insert-html-snippet.php']['Version']; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
if(!function_exists('xyz_trim_deep')) |
| 16 |
{ |
| 17 |
|
| 18 |
function xyz_trim_deep($value) { |
| 19 |
if ( is_array($value) ) { |
| 20 |
$value = array_map('xyz_trim_deep', $value); |
| 21 |
} elseif ( is_object($value) ) { |
| 22 |
$vars = get_object_vars( $value ); |
| 23 |
foreach ($vars as $key=>$data) { |
| 24 |
$value->{$key} = xyz_trim_deep( $data ); |
| 25 |
} |
| 26 |
} else { |
| 27 |
$value = trim($value); |
| 28 |
} |
| 29 |
|
| 30 |
return $value; |
| 31 |
} |
| 32 |
|
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
if(!function_exists('xyz_ihs_links')){ |
| 37 |
function xyz_ihs_links($links, $file) { |
| 38 |
$base = plugin_basename(XYZ_INSERT_HTML_PLUGIN_FILE); |
| 39 |
if ($file == $base) { |
| 40 |
|
| 41 |
$links[] = '<a href="http://xyzscripts.com/support/" class="xyz_support" title="Support"></a>'; |
| 42 |
$links[] = '<a href="http://twitter.com/xyzscripts" class="xyz_twitt" title="Follow us on Twitter"></a>'; |
| 43 |
$links[] = '<a href="https://www.facebook.com/xyzscripts" class="xyz_fbook" title="Like us on Facebook"></a>'; |
| 44 |
$links[] = '<a href="https://plus.google.com/+Xyzscripts/" class="xyz_gplus" title="+1 us on Google+"></a>'; |
| 45 |
$links[] = '<a href="http://www.linkedin.com/company/xyzscripts" class="xyz_linkedin" title="Follow us on LinkedIn"></a>'; |
| 46 |
} |
| 47 |
return $links; |
| 48 |
} |
| 49 |
} |
| 50 |
add_filter( 'plugin_row_meta','xyz_ihs_links',10,2); |
| 51 |
|
| 52 |
?> |