コード例 #1
0
 * License:      GPL-2.0+
 * License URI:  http://www.gnu.org/licenses/gpl-2.0.txt
 * Domain Path:  /lang
 */
// If this file is called directly, abort.
if (!defined('WPINC')) {
    die;
}
// Load the main plugin class and widget class.
require_once plugin_dir_path(__FILE__) . 'class-floating-social-bar.php';
// Register hooks for activation, deactivation and uninstall instances.
register_activation_hook(__FILE__, array('floating_social_bar', 'activate'));
register_deactivation_hook(__FILE__, array('floating_social_bar', 'deactivate'));
register_uninstall_hook(__FILE__, array('floating_social_bar', 'uninstall'));
// Initialize the plugin.
$floating_social_bar = floating_social_bar::get_instance();
// Generate a template tag for use in template files.
if (!function_exists('floating_social_bar')) {
    /**
     * Floating Social Bar template tag.
     *
     * Allows you to insert a floating social bar anywhere in your template files.
     * The keys currently available are 'facebook', 'twitter', 'google',
     * 'linkedin', and 'pinterest'. The value should be set to true if you want to
     * display that social service in the bar. Services will be output in the order
     * that you specify in the $args array.
     *
     * @package Floating Social Bar
     * @param array $args Args used for the floating social bar.
     * @param bool $return Flag for returning or echoing the slider content.
     */
/**
 * Echo the Floating Social Bar in the right place, just before the entry
 * content (after the header and entry meta) in Genesis child themes.
 *
 * As fsb() is really a function for filtering, it requires a single argument
 * (the content or excerpt), so we fool it by passing in an empty string instead.
 *
 * @since 1.0.0
 */
function mfsbig_add_floating_social_bar()
{
    if (class_exists('floating_social_bar')) {
        echo floating_social_bar::get_instance()->fsb('');
    }
}