-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhrecipe.php
executable file
·98 lines (75 loc) · 3.27 KB
/
hrecipe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/*
* Plugin Name: hRecipe
* Plugin URI: http://hrecipe.com/
* Description: Fast and easy recipe formatting for Google Rich Snippet display and better search results click throughs. Leverage your recipe SEO with the hrecipe microformatting! It's easy using hRecipe plugin for WordPress. Visit the plugin home page for tips and techniques on food blogging, SEO and more.
* Version: 0.6.1
* Author: Dave Doolin
* Author URI: http://hrecipe.com/about
*/
/* Copyright 2009-2011 David M. Doolin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
hRecipe is derived from Andrew Scott's hReview plugin, with some
modification of the original code.
*/
/**
* Translation command line: $ xgettext -L PHP --keyword="__" --keyword="_e" --files-from="filelist.txt" -o
lang/hrecipe.pot
*
* Procedure for merging updated translations: TBD
*/
define('HRECIPE_VERSION', "0.6.1");
// Find the full URL to the plugin directory and store it
// @todo define(HRECIPE_PLUGIN_URL) instead of this.
global $hrecipe_plugin_url;
$hrecipe_plugin_url = WP_PLUGIN_URL.'/hrecipe';
include dirname( __FILE__ ).'/models/options_db.php';
if (!class_exists('hrecipe')) {
require_once ('hrecipe.class.php');
}
if (class_exists('hrecipe')) {
$recipe = new hrecipe();
}
if ( isset ($recipe)) {
register_activation_hook( __FILE__ , array ($recipe, 'hrecipe_activate'));
register_deactivation_hook( __FILE__ , array ($recipe, 'hrecipe_deactivate'));
add_filter('plugin_action_links', 'hrecipe_plugin_links', 10, 2);
$recipe->init();
add_action('wp_print_styles', array ($recipe, 'add_hrecipe_stylesheet'));
add_action('init', array ($recipe, 'hrecipe_plugin_init'));
add_action('admin_init', array($recipe, 'register_mysettings'));
add_action('admin_init', array($recipe, 'hrecipe_admin_init'));
add_action('admin_menu', array ($recipe, 'hrecipe_plugin_menu'));
/**
* Adds an action link to the Plugins page
*/
function hrecipe_plugin_links($links, $file) {
static $this_plugin;
if (!$this_plugin) {
$this_plugin = plugin_basename(__FILE__);
}
if ($file == $this_plugin) {
$settings_link = '<a href="options-general.php?page=view/admin/options.php">'.__("Settings", "hrecipe").'</a>';
array_unshift($links, $settings_link);
}
return $links;
}
function media_hrecipe_tb_callback() {
include(dirname( __FILE__ ) . '/view/hrecipe_form_body.php');
}
function hrecipe_tb_callback1() {
wp_iframe('media_hrecipe_tb_callback', array());
}
add_action('media_upload_hrecipe', 'hrecipe_tb_callback1');
}
?>