コード例 #1
0
 function __construct($plugin_basename)
 {
     self::$instance = $this;
     $this->static_url = self::static_url();
     $this->static_dir = self::static_dir();
     $this->basic_auth = self::basic_auth();
     $this->timeout = self::timeout();
     $this->plugin_basename = $plugin_basename;
     $this->admin_action = admin_url('/admin.php') . '?page=' . self::OPTION_PAGE . '-options';
     $data = get_file_data(dirname(dirname(__FILE__)) . '/plugin.php', array('pluginname' => 'Plugin Name', 'version' => 'Version'));
     $this->plugin_name = isset($data['pluginname']) ? $data['pluginname'] : 'StaticPress';
     $this->plugin_version = isset($data['version']) ? $data['version'] : '';
     add_action('admin_menu', array($this, 'admin_menu'));
     add_filter('plugin_action_links', array($this, 'plugin_setting_links'), 10, 2);
     add_action('admin_head', array($this, 'add_admin_head'), 99);
 }
コード例 #2
0
ファイル: plugin.php プロジェクト: hideokamoto/staticpress
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
if (!class_exists('static_press_admin')) {
    require dirname(__FILE__) . '/includes/class-static_press_admin.php';
}
if (!class_exists('static_press')) {
    require dirname(__FILE__) . '/includes/class-static_press.php';
}
load_plugin_textdomain(static_press_admin::TEXT_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages/');
$staticpress = new static_press(plugin_basename(__FILE__), static_press_admin::static_url(), static_press_admin::static_dir(), static_press_admin::remote_get_option());
add_filter('StaticPress::get_url', array($staticpress, 'replace_url'));
add_filter('StaticPress::static_url', array($staticpress, 'static_url'));
add_filter('StaticPress::put_content', array($staticpress, 'rewrite_generator_tag'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'add_last_modified'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'remove_link_tag'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'replace_relative_URI'), 10, 2);
add_filter('https_local_ssl_verify', '__return_false');
register_activation_hook(__FILE__, array($staticpress, 'activate'));
register_deactivation_hook(__FILE__, array($staticpress, 'deactivate'));
if (is_admin()) {
    new static_press_admin(plugin_basename(__FILE__));
}
コード例 #3
0
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
if (!class_exists('static_press_admin')) {
    require dirname(__FILE__) . '/includes/class-static_press_admin.php';
}
if (!class_exists('static_press')) {
    require dirname(__FILE__) . '/includes/class-static_press.php';
}
load_plugin_textdomain(static_press_admin::TEXT_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/languages/');
$staticpress = new static_press(plugin_basename(__FILE__), static_press_admin::static_url(), static_press_admin::static_dir(), static_press_admin::remote_get_option(), static_press_admin::exclude_folders(), static_press_admin::remove_from_path());
add_filter('StaticPress::get_url', array($staticpress, 'replace_url'));
add_filter('StaticPress::static_url', array($staticpress, 'static_url'));
add_filter('StaticPress::put_content', array($staticpress, 'rewrite_generator_tag'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'add_last_modified'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'remove_link_tag'), 10, 2);
add_filter('StaticPress::put_content', array($staticpress, 'replace_relative_URI'), 10, 2);
register_activation_hook(__FILE__, array($staticpress, 'activate'));
register_deactivation_hook(__FILE__, array($staticpress, 'deactivate'));
if (is_admin()) {
    new static_press_admin(plugin_basename(__FILE__));
}