Пример #1
0
 Author URI: http://interconnectit.com
*/
// Check that we're using a version of WordPress that this works with.
global $wp_version;
if (version_compare($wp_version, '3.0', 'lt')) {
    return false;
}
// Set up the translation domain.
defined('SPOTS_DOM') || define('SPOTS_DOM', 'spots');
defined('SPOTS_DIR') || define('SPOTS_DIR', dirname(__FILE__));
if (file_exists(SPOTS_DIR . '/lang/' . SPOTS_DOM . '-' . get_locale() . '.mo')) {
    load_textdomain(SPOTS_DOM, SPOTS_DIR . '/lang/' . SPOTS_DOM . '-' . get_locale() . '.mo');
}
if (!class_exists('icit_spots')) {
    require_once 'includes/icit-plugin.php';
    icit_register_plugin('spots', __FILE__, array('page_title' => __('Spots Settings', SPOTS_DOM), 'menu_title' => __('Settings', SPOTS_DOM), 'parent_slug' => 'edit.php?post_type=spot'));
    add_action('plugins_loaded', array('icit_spots', '_init'), 1);
    // This creates the main plugin object and the button object.
    // add settings
    add_action('admin_init', array('icit_spots', 'settings'));
    class icit_spots
    {
        /**
         * @var icit_spots This object
         */
        static $instance_spots = null;
        /**
         * @var icit_spots_mce_button AWWWWWW it's the button
         */
        protected static $instance_mce_button;
        public function __construct()
Пример #2
0
<?php

/*
Plugin Name: Query Editor
Description: Adds some simple options on the reading settings page to customise the main query. You can change the default post type(s), exclude terms from any taxonomy and change the ordering.
Version: 0.4
Author: Robert O'Rourke
Author URI: http://sanchothefat.com
License: GPLv2 or later
*/
// plugin helper
require_once 'inc/icit-plugin.php';
icit_register_plugin('query_editor', __FILE__);
if (!defined('QUERY_EDITOR_BASE')) {
    define('QUERY_EDITOR_BASE', dirname(__FILE__));
}
if (!defined('QUERY_EDITOR_URL')) {
    define('QUERY_EDITOR_URL', plugins_url('', __FILE__));
}
// initialise
add_action('plugins_loaded', array('query_editor', 'instance'));
class query_editor
{
    public $section = __CLASS__;
    public $default_queries = array();
    /**
     * Reusable object instance.
     *
     * @type object
     */
    protected static $instance = null;