Exemple #1
0
 public static function shortcode($atts)
 {
     $a = shortcode_atts(array('alias' => false), $atts);
     if (!$a['alias']) {
         return __('You have to insert a valid alias in the shortcode', 'crellyslider');
     } else {
         return CrellySliderFrontend::output($a['alias'], false);
     }
 }
Exemple #2
0
define('CS_PATH', plugin_dir_path(__FILE__));
define('CS_PLUGIN_URL', plugins_url() . '/crelly-slider');
require_once CS_PATH . 'wordpress/common.php';
require_once CS_PATH . 'wordpress/tables.php';
require_once CS_PATH . 'wordpress/frontend.php';
// Create (or remove) 3 tables: the sliders settings, the slides settings and the elements proprieties. We will also store the current version of the plugin
register_activation_hook(__FILE__, array('CrellySliderTables', 'setVersion'));
register_activation_hook(__FILE__, array('CrellySliderTables', 'setTables'));
register_uninstall_hook(__FILE__, array('CrellySliderTables', 'removeVersion'));
register_uninstall_hook(__FILE__, array('CrellySliderTables', 'dropTables'));
// Languages
CrellySliderCommon::loadPluginTextDomain();
// This is a variable that should be included first to prevent backend issues.
if (is_admin()) {
    require_once CS_PATH . 'wordpress/admin.php';
    CrellySliderAdmin::setIsAdminJs();
}
// CSS and Javascript
CrellySliderCommon::setEnqueues();
CrellySliderFrontend::addShortcode();
if (is_admin()) {
    // Tables
    if (CS_VERSION != get_option('cs_version')) {
        CrellySliderTables::setVersion();
        CrellySliderTables::setTables();
    }
    CrellySliderAdmin::setEnqueues();
    CrellySliderAdmin::showSettings();
    // Ajax functions
    require_once CS_PATH . 'wordpress/ajax.php';
}