| 1 |
<?php |
| 2 |
//avoid direct calls to this file where wp core files not present |
| 3 |
if (!function_exists ('add_action')) { |
| 4 |
header('Status: 403 Forbidden'); |
| 5 |
header('HTTP/1.1 403 Forbidden'); |
| 6 |
exit(); |
| 7 |
} |
| 8 |
// Pre-2.6 compatibility |
| 9 |
if ( ! defined( 'WP_CONTENT_URL' ) ) |
| 10 |
define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); |
| 11 |
if ( ! defined( 'WP_CONTENT_DIR' ) ) |
| 12 |
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); |
| 13 |
if ( ! defined( 'WP_PLUGIN_URL' ) ) |
| 14 |
define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' ); |
| 15 |
if ( ! defined( 'WP_PLUGIN_DIR' ) ) |
| 16 |
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); |
| 17 |
|
| 18 |
add_action('admin_menu', 'smart_add_menu'); |
| 19 |
//wp_register_script('checkboxToSlider', WP_PLUGIN_URL.'/wp-insert/js/jquery.checkboxToSlider.js', array( 'jquery' )); |
| 20 |
|
| 21 |
function screen_layout_columns($columns, $screen) { |
| 22 |
$columns[$screen] = 2; |
| 23 |
return $columns; |
| 24 |
} |
| 25 |
|
| 26 |
/*add_filter('screen_layout_columns', array(&$this, 'on_screen_layout_columns'), 10, 2); |
| 27 |
//for WordPress 2.8 we have to tell, that we support 2 columns ! |
| 28 |
function on_screen_layout_columns($columns, $screen) { |
| 29 |
if ($screen == $this->pagehook) { |
| 30 |
$columns[$this->pagehook] = 2; |
| 31 |
} |
| 32 |
return $columns; |
| 33 |
}*/ |
| 34 |
|
| 35 |
function wp_insert_get_current_page_details() { |
| 36 |
if(is_home()) return 'HOME'; |
| 37 |
else if(is_archive()) return 'ARCHIVE'; |
| 38 |
else if(is_singular()) { |
| 39 |
global $wp_query; |
| 40 |
return $wp_query->post->ID; |
| 41 |
} |
| 42 |
else return 'NULL'; |
| 43 |
} |
| 44 |
|
| 45 |
function wp_insert_is_in_array($inputString, $inputArray) { |
| 46 |
foreach($inputArray as $arrayElements) |
| 47 |
{ |
| 48 |
if($arrayElements == $inputString) |
| 49 |
{ |
| 50 |
return 'TRUE'; |
| 51 |
} |
| 52 |
} |
| 53 |
return 'FALSE'; |
| 54 |
} |
| 55 |
|
| 56 |
require_once (dirname(__FILE__) . '/widgethook.php'); |
| 57 |
require_once (dirname(__FILE__) . '/contenthook.php'); |
| 58 |
require_once (dirname(__FILE__) . '/ads.php'); |
| 59 |
?> |