コード例 #1
0
 /**
  * Output the content of our metabox.
  *
  * @since  0.1.0
  * @access public
  *
  * @param \WP_Post $post Post object.
  * @return void
  */
 public function options_callback(WP_Post $post)
 {
     wp_featherlight()->i18n->load();
     $disable = get_post_meta($post->ID, 'wp_featherlight_disable', true);
     $checked = empty($disable) ? '' : $disable;
     require_once wp_featherlight()->get_dir() . 'admin/templates/metabox-sidebar.php';
 }
コード例 #2
0
<?php

/**
 * Define constants to preserve backwards compatibility with older versions.
 *
 * @package   WPFeatherlight
 * @author    Robert Neu
 * @copyright Copyright (c) 2015, WP Site Care
 * @license   GPL-2.0+
 * @since     0.3.0
 */
// Prevent direct access.
defined('ABSPATH') || exit;
define('WP_FEATHERLIGHT_FILE', wp_featherlight()->get_file());
define('WP_FEATHERLIGHT_VERSION', wp_featherlight()->get_version());
if (!defined('WP_FEATHERLIGHT_DIR')) {
    define('WP_FEATHERLIGHT_DIR', wp_featherlight()->get_dir());
}
if (!defined('WP_FEATHERLIGHT_URL')) {
    define('WP_FEATHERLIGHT_URL', wp_featherlight()->get_url());
}
コード例 #3
0
 public function __construct()
 {
     $this->suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     $this->url = wp_featherlight()->get_url();
     $this->version = wp_featherlight()->get_version();
 }
コード例 #4
0
 *
 * Because we aren't using a singleton pattern for our main plugin class, we
 * need to make sure it's only instantiated once in our helper function.
 * If you need to access methods inside the plugin classes, use this function.
 *
 * Example:
 *
 * <?php wp_featherlight()->scripts; ?>
 *
 * @since  0.1.0
 * @access public
 * @uses   WP_Featherlight
 * @return object WP_Featherlight A single instance of the main plugin class.
 */
function wp_featherlight()
{
    static $plugin;
    if (null === $plugin) {
        $plugin = new WP_Featherlight(array('file' => __FILE__));
    }
    return $plugin;
}
/**
 * Register an activation hook to run all necessary plugin setup procedures.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
register_activation_hook(__FILE__, array(wp_featherlight(), 'activate'));
コード例 #5
0
 * need to make sure it's only instantiated once in our helper function.
 * If you need to access methods inside the plugin classes, use this function.
 *
 * Example:
 *
 * <?php wp_featherlight()->meta; ?>
 *
 * @since  0.1.0
 * @access public
 * @uses   WP_Featherlight
 * @return object WP_Featherlight A single instance of the main plugin class.
 */
function wp_featherlight()
{
    static $plugin;
    if (null === $plugin) {
        $plugin = new WP_Featherlight();
    }
    return $plugin;
}
/**
 * Register an activation hook to run all necessary plugin setup procedures.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
register_activation_hook(WP_FEATHERLIGHT_FILE, array(wp_featherlight(), 'activate'));
// Hook the main plugin class into WordPress to get things running.
add_action('plugins_loaded', array(wp_featherlight(), 'run'));