define('SIMPLE_LINKS_JS_PATH', SIMPLE_LINKS_DIR . 'assets/js/'); define('SIMPLE_LINKS_CSS_DIR', SIMPLE_LINKS_ASSETS_URL . 'css/'); require dirname(__FILE__) . '/template-tags.php'; require dirname(__FILE__) . '/widgets/SL_links_main.php'; function simple_links_autoload($class) { if (file_exists(SIMPLE_LINKS_DIR . 'classes/' . $class . '.php')) { require SIMPLE_LINKS_DIR . 'classes/' . $class . '.php'; } } spl_autoload_register('simple_links_autoload'); /** @var simple_links $simple_links */ $simple_links = simple_links(); if (is_admin()) { /** @var simple_links_admin $simple_links_admin_func */ $simple_links_admin_func = simple_links_admin(); } function simple_links_load() { Simple_Links_Categories::get_instance(); Simple_Links_WP_Links::init(); add_action('init', array('Simple_Link', 'register_sl_post_type')); if (is_admin()) { Simple_Links_Settings::init(); Simple_Links_Sort::init(); Simple_Links_Visual_Shortcodes::init(); } } add_action('plugins_loaded', 'simple_links_load'); #-- Let know about Pro Version add_action('simple_links_widget_form', 'simple_links_pro_notice');
/** * Load Shortcode Form * * Loads the output of the shortcode form into the modal * * @uses added to the template_redirect hook by self::__construct(); * * @uses called by the mce icon * * @return void */ function loadShortcodeForm() { require_once ABSPATH . '/wp-admin/includes/template.php'; $var = get_query_var('simple_links_shortcode'); if ($var != 'form') { return; } wp_enqueue_style('simple-links-shortcode-css', SIMPLE_LINKS_CSS_DIR . 'simple-links-shortcode.css', array(), SIMPLE_LINKS_VERSION); wp_enqueue_script('mce_popup', includes_url() . 'js/tinymce/tiny_mce_popup.js', array('jquery'), SIMPLE_LINKS_VERSION); wp_enqueue_script('sl-shortcode-form', SIMPLE_LINKS_JS_DIR . 'shortcode-form.js', array('jquery', 'mce_popup'), SIMPLE_LINKS_VERSION); wp_localize_script('sl-shortcode-form', 'Simple_Links_Config', simple_links_admin()->js_config()); include SIMPLE_LINKS_DIR . '/admin-views/shortcode-form.php'; die; }