Beispiel #1
0
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new RFBP_Public();
     }
     return self::$instance;
 }
/**
 * Load the plugin files at `plugins_loaded:10`
 */
function __rfbp_bootstrap()
{
    // Include Global code
    require RFBP_PLUGIN_DIR . 'includes/functions/global.php';
    if (!is_admin()) {
        // frontend requests
        include_once RFBP_PLUGIN_DIR . 'includes/functions/helpers.php';
        include_once RFBP_PLUGIN_DIR . 'includes/functions/template.php';
        require RFBP_PLUGIN_DIR . 'includes/class-public.php';
        $rfbp_public = RFBP_Public::instance();
        $rfbp_public->add_hooks();
    } elseif (!defined('DOING_AJAX') || !DOING_AJAX) {
        // admin requests
        require RFBP_PLUGIN_DIR . 'includes/class-admin.php';
        $admin = new RFBP_Admin();
        $admin->add_hooks();
    }
}
/**
 * Prints a list of Recent Facebook Posts
 *
 * Accepted arguments are the same as the shortcode args
 *
 * - number: 5
 * - likes: true
 * - comments: true
 * - excerpt_length: 140
 * - el: div
 * - origin: shortcode
 * - show_page_link: false
 * - show_link_preview: false
 *
 * @param array $args
 * @return void
 */
function recent_facebook_posts($args = array())
{
    echo RFBP_Public::instance()->output($args);
}