예제 #1
0
 /**
  * install_plugin()
  *
  * This method handles all the actions for the plugin initialization.
  *
  * @author Luca Grandicelli <*****@*****.**>
  * @copyright (C) 2011-2014 Luca Grandicelli
  * @package special-recent-posts-free
  * @version 2.0.4
  * @access public
  */
 static function install_plugin()
 {
     // Doing a global database options check.
     SpecialRecentPostsFree::srp_dboptions_check();
 }
예제 #2
0
/**
 * srp_wp_head()
 *
 * This function loads styles & scripts in the WP theme <head>
 *
 * @author Luca Grandicelli <*****@*****.**>
 * @copyright (C) 2011-2014 Luca Grandicelli
 * @package special-recent-posts-free
 * @version 2.0.4
 * @return boolean true
 */
function srp_wp_head()
{
    // First of all, let's do a database check.
    SpecialRecentPostsFree::srp_dboptions_check();
    // Importing global default options array.
    $srp_current_options = get_option('srp_plugin_options');
    // Checking if the SRP built-in stylesheet is enabled.
    if ('yes' != $srp_current_options['srp_disable_theme_css']) {
        // Registering front end stylesheet.
        wp_register_style('srp-layout-stylesheet', SRP_LAYOUT_CSS);
        // Enqueuing stylesheet.
        wp_enqueue_style('srp-layout-stylesheet');
        // Checking if there is some custom CSS code available.
        if (!empty($srp_current_options['srp_custom_css'])) {
            // Outputting custom CSS.
            echo "<style type='text/css'>" . $srp_current_options['srp_custom_css'] . '</style>';
        }
    }
    // Returning true.
    return true;
}
예제 #3
0
 static function install_plugin()
 {
     // Loading text domain for translations.
     load_plugin_textdomain(SRP_TRANSLATION_ID, false, dirname(plugin_basename(__FILE__)) . SRP_LANG_FOLDER);
     // Doing a global database options check.
     SpecialRecentPostsFree::srp_dboptions_check();
 }
예제 #4
0
function srp_front_head()
{
    // Doing a global database options check.
    SpecialRecentPostsFree::srp_dboptions_check();
    // Importing global default options array.
    $srp_current_options = get_option('srp_plugin_options');
    // Checking for SRP Stylesheet enabled.
    if ($srp_current_options["srp_disable_theme_css"] != "yes") {
        // Registering Front End CSS.
        wp_register_style('srp-front-stylesheet', SRP_PLUGIN_URL . SRP_FRONT_CSS);
        // Enqueuing Front End CSS.
        wp_enqueue_style('srp-front-stylesheet');
        // Adding IE7 Fix.
        echo "<!--[if IE 7]>";
        echo "<link rel='stylesheet' id='css-ie-fix' href='" . SRP_PLUGIN_URL . SRP_IEFIX_CSS . "' type='text/css' media='all' /> ";
        echo "<![endif]-->";
    }
}