WP Recipe Maker - Version 1.9.1

Version Description

  • Feature: WP Recipe Maker icon in TinyMCE editor
  • Fix: Ingredients settings page
Download this release

Release Info

Developer BrechtVds
Plugin Icon 128x128 WP Recipe Maker
Version 1.9.1
Comparing to
See all releases

Code changes from version 1.9.0 to 1.9.1

assets/images/icon-20x20.png ADDED
Binary file
assets/js/admin/shortcode-button-tinymce.js ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.wp_recipe_maker', {
3
+ /**
4
+ * Initializes the plugin, this will be executed after the plugin has been created.
5
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
6
+ * of the editor instance to intercept that event.
7
+ *
8
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
9
+ * @param {string} url Absolute URL to where the plugin is located.
10
+ */
11
+ init : function(ed, url) {
12
+ ed.addButton('wp_recipe_maker', {
13
+ title : 'WP Recipe Maker',
14
+ cmd : 'wp_recipe_maker',
15
+ image : url.slice(0, -9) + '/images/icon-20x20.png'
16
+ });
17
+
18
+ ed.addCommand('wp_recipe_maker', function() {
19
+ wprm_admin.open_modal(ed.id);
20
+ });
21
+ },
22
+
23
+ /**
24
+ * Creates control instances based in the incomming name. This method is normally not
25
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
26
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
27
+ * method can be used to create those.
28
+ *
29
+ * @param {String} n Name of the control to create.
30
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
31
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.
32
+ */
33
+ createControl : function(n, cm) {
34
+ return null;
35
+ },
36
+
37
+ /**
38
+ * Returns information about the plugin as a name/value array.
39
+ * The current keys are longname, author, authorurl, infourl and version.
40
+ *
41
+ * @return {Object} Name/value array containing information about the plugin.
42
+ */
43
+ getInfo : function() {
44
+ return {
45
+ longname : 'WP Recipe Maker',
46
+ author : 'Bootstrapped Ventures',
47
+ authorurl : 'http://bootstrapped.ventures',
48
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
49
+ version : "0.1"
50
+ };
51
+ }
52
+ });
53
+
54
+ // Register plugin
55
+ tinymce.PluginManager.add( 'wp_recipe_maker', tinymce.plugins.wp_recipe_maker );
56
+ })();
includes/admin/manage/class-wprm-manage-ingredients.php CHANGED
@@ -53,7 +53,9 @@ class WPRM_Manage_Ingredients {
53
  * @param array $tabs Settings tabs.
54
  */
55
  public static function ingredient_settings_tab( $tabs ) {
56
- $tabs['ingredients'] = __( 'Ingredients', 'wp-recipe-maker-premium' );
 
 
57
  return $tabs;
58
  }
59
 
@@ -64,8 +66,8 @@ class WPRM_Manage_Ingredients {
64
  * @param mixed $sub Sub settings page to display.
65
  */
66
  public static function ingredient_settings_page( $sub ) {
67
- if ( 'ingredients' === $sub ) {
68
- require_once( WPRM_DIR . 'templates/admin/settings/ingredients.php' );
69
  }
70
  }
71
 
53
  * @param array $tabs Settings tabs.
54
  */
55
  public static function ingredient_settings_tab( $tabs ) {
56
+ if ( WPRM_Addons::is_active( 'premium' ) ) {
57
+ $tabs['ingredients'] = __( 'Ingredients', 'wp-recipe-maker-premium' );
58
+ }
59
  return $tabs;
60
  }
61
 
66
  * @param mixed $sub Sub settings page to display.
67
  */
68
  public static function ingredient_settings_page( $sub ) {
69
+ if ( 'ingredients' === $sub && WPRM_Addons::is_active( 'premium' ) ) {
70
+ require_once( WPRMP_DIR . 'templates/admin/settings/ingredients.php' );
71
  }
72
  }
73
 
includes/admin/modal/class-wprm-button.php CHANGED
@@ -26,6 +26,9 @@ class WPRM_Button {
26
  */
27
  public static function init() {
28
  add_action( 'media_buttons', array( __CLASS__, 'add_shortcode_button' ) );
 
 
 
29
  }
30
 
31
  /**
@@ -43,6 +46,28 @@ class WPRM_Button {
43
  echo '<button type="button" class="button wprm-modal-button" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $title ) . '</button>';
44
  }
45
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  WPRM_Button::init();
26
  */
27
  public static function init() {
28
  add_action( 'media_buttons', array( __CLASS__, 'add_shortcode_button' ) );
29
+
30
+ add_filter( 'mce_external_plugins', array( __CLASS__, 'add_button' ) );
31
+ add_filter( 'mce_buttons', array( __CLASS__, 'register_button' ) );
32
  }
33
 
34
  /**
46
  echo '<button type="button" class="button wprm-modal-button" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr( $title ) . '">' . esc_html( $title ) . '</button>';
47
  }
48
  }
49
+
50
+ /**
51
+ * Add the button to the TinyMCE editor.
52
+ *
53
+ * @since 1.9.1
54
+ * @param mixed $plugin_array TinyMCE plugins.
55
+ */
56
+ public static function add_button( $plugin_array ) {
57
+ $plugin_array['wp_recipe_maker'] = WPRM_URL . 'assets/js/admin/shortcode-button-tinymce.js';
58
+ return $plugin_array;
59
+ }
60
+
61
+ /**
62
+ * Register the button for the TinyMCE editor.
63
+ *
64
+ * @since 1.9.1
65
+ * @param mixed $buttons TinyMCE buttons.
66
+ */
67
+ public static function register_button( $buttons ) {
68
+ array_push( $buttons, 'wp_recipe_maker' );
69
+ return $buttons;
70
+ }
71
  }
72
 
73
  WPRM_Button::init();
includes/class-wp-recipe-maker.php CHANGED
@@ -31,7 +31,7 @@ class WP_Recipe_Maker {
31
  * @since 1.0.0
32
  */
33
  private function define_constants() {
34
- define( 'WPRM_VERSION', '1.9.0' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.1.1' );
36
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
37
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
31
  * @since 1.0.0
32
  */
33
  private function define_constants() {
34
+ define( 'WPRM_VERSION', '1.9.1' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.1.1' );
36
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
37
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
readme.txt CHANGED
@@ -80,6 +80,10 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
80
 
81
  == Changelog ==
82
 
 
 
 
 
83
  = 1.9.0 =
84
  * Feature: Manage recipes and ingredients in a central place
85
  * Feature: Edit recipes through the WP Recipe Maker button
@@ -167,7 +171,10 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
167
  * Feature: Clean printing of recipes
168
  * Feature: Fallback recipe when the plugin is disabled
169
 
170
- == Upgrade notice ==
 
 
 
171
 
172
  = 1.9.0 =
173
  Easier recipe management in this new update
80
 
81
  == Changelog ==
82
 
83
+ = 1.9.1 =
84
+ * Feature: WP Recipe Maker icon in TinyMCE editor
85
+ * Fix: Ingredients settings page
86
+
87
  = 1.9.0 =
88
  * Feature: Manage recipes and ingredients in a central place
89
  * Feature: Edit recipes through the WP Recipe Maker button
171
  * Feature: Clean printing of recipes
172
  * Feature: Fallback recipe when the plugin is disabled
173
 
174
+ == Upgrade notice =
175
+
176
+ = 1.9.1 =
177
+ Fix for settings issue introduced in previous update
178
 
179
  = 1.9.0 =
180
  Easier recipe management in this new update
wp-recipe-maker.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
- * Version: 1.9.0
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
+ * Version: 1.9.1
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+