Plugin Hooks

Plugin Hooks are provided at certain places, allowing you to easily customize parts of the plugin without having to change the source code directly. More information on how to use these hooks can be found in the official WordPress documentation.

On this page you can find a list of all the hooks that are currently available. If the hook you’re looking for is not in here, just contact us and we’ll probably add it in the next update.

 

wpurp_assets_css

  1. Array $assets – Assets to enqueue

This hook can be used to alter the CSS assets to enqueue.

 

wpurp_assets_js

  1. Array $assets – Assets to enqueue

This hook can be used to alter the JS assets to enqueue.

 

wpurp_assets_js_dependencies

  1. Array $assets – Dependencies

This hook can be used to alter the JS dependencies for the minified JS asset.

 

wpurp_register_post_type

  1. Array $args – Arguments used to register the recipe post type

This hook can be used to modify the arguments used when registering the recipe post type.

 

wpurp_register_taxonomy

  1. Array $args – Arguments used to register the taxonomy
  2. String $taxonomy – Name of the taxonomy

This hook can be used to modify the arguments used when registering the recipe taxonomies (ingredient, course, cuisine and any custom tags you defined).

 

wpurp_register_menu_post_type

  1. Array $args – Arguments used to register the menu post type

This hook can be used to modify the arguments used when registering the menu post type for User Menus.

 

wpurp_output_recipe

  1. String $template – HTML Code generated by the template
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the HTML code outputted for a certain recipe on the recipe page or when using the [ultimate-recipe] shortcode.

 

wpurp_output_recipe_excerpt

  1. String $excerpt – Excerpt to be outputted
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the recipe excerpt on the archive pages.

 

wpurp_output_recipe_print

  1. String $template – HTML Code generated by the template
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the HTML code outputted for a certain recipe on the recipe print page.

 

wpurp_output_recipe_print_user_menus

  1. String $template – HTML Code generated by the template
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the HTML code outputted for a certain recipe on the recipe print entire user menu page.

 

wpurp_user_menus_delete_button_redirect

  1. String $url – URL the user is redirected to

This hook can be used to change to page a user is redirected to after deleting a User Menu.

 

wpurp_user_menus_save_button_redirect

  1. String $url – URL the user is redirected to

This hook can be used to change to page a user is redirected to after saving a User Menu.

 

wpurp_index

  1. String $html – HTML Code generated for displaying the index

This hook can be used to modify the HTML code outputted for the Recipe Index shortcode.

 

wpurp_index_header

  1. String $html – HTML Code generated for displaying the header
  2. String $header – Header to display

This hook can be used to modify the HTML code outputted for the headers in the Recipe Index shortcode.

 

wpurp_index_recipe

  1. String $html – HTML Code generated for displaying the recipe
  2. WPURP_Recipe $recipe – Recipe to display

This hook can be used to modify the HTML code outputted for the recipes in the Recipe Index shortcode.

 

wpurp_user_submissions_form

  1. String $form – HTML Code generated for displaying the form
  2. WPURP_Recipe $recipe – Newly created recipe for the user submissions form

This hook can be used to modify the HTML code outputted for the User Submissions form.

 

wpurp_meal_planner

  1. String $output – HTML Code generated for displaying the Meal Planner
  2. Array $options – Shortcode options

This hook can be used to modify the HTML code outputted for the Meal Planner.

 

wpurp_meal_planner_shortcode

  1. String $output – HTML Code generated for displaying the saved Meal Plan
  2. Array $options – Shortcode options

This hook can be used to modify the HTML code outputted for the saved Meal Plan.

 

wpurp_user_menus_form

  1. String $form – HTML Code generated for displaying the form
  2. Object $menu – Newly created menu for the user menus form

This hook can be used to modify the HTML code outputted for the User Menus form.

 

wpurp_user_menus_by_item

  1. String $item – HTML Code generated for displaying the list item
  2. Object $menu – Menu that’s being displayed

This hook can be used to modify the HTML code outputted by the [ultimate-recipe-user-menus-by] shortcode.

 

wpurp_user_submissions_current_user_edit_item

  1. String $item – HTML Code generated for displaying the list item
  2. Object $recipe – Recipe that’s being displayed

This hook can be used to modify the HTML code outputted by the [ultimate-recipe-submissions-current-user-edit] shortcode.

 

wpurp_favorite_recipes_item

  1. String $item – HTML Code generated for displaying the list item
  2. Object $recipe – Recipe that’s being displayed

This hook can be used to modify the HTML code outputted by the [ultimate-recipe-favorites] shortcode.

 

wpurp_output_recipe_grid

  1. String $template – HTML Code generated by the template
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the HTML code outputted for a certain recipe in the Recipe Grid.

 

wpurp_recipe_grid_recipe_ids

  1. Array $recipe_ids – Array of recipe IDs to be displayed in the grid
  2. String $name – Name of the Recipe Grid

This hook can be used to modify the recipes shown in a specific Recipe Grid.

 

wpurp_recipe_grid_filter_terms

  1. Array – Array of arrays containing all the terms for each taxonomy

This hook can be used to modify the terms that are available in the Recipe Grid dropdown selections.

 

wpurp_output_recipe_block_*template_block_type*

  1. String $template – HTML Code generated by the template
  2. WPURP_Recipe $recipe – Recipe that is being outputted
  3. WPURP_Template_Block $block – Block that is being outputted

This hook can be used to modify the HTML code outputted for a specific template block. Possible values for *template_block_type* can be found in the /core/addons/custom-templates/templates/ folder (the $type parameter of the different classes).

 

wpurp_output_recipe_block_recipe-tags_terms

  1. Array $terms – List of terms that will be outputted in the Recipe Tags block
  2. WPURP_Recipe $recipe – Recipe that is being outputted

This hook can be used to modify the terms being outputted in the Recipe Tags Template Block.

 

wpurp_recipe_field_ingredients

  1. Array $ingredients – List of all the recipe ingredients
  2. WPURP_Recipe $recipe – The actual recipe

This hook can be used to modify the ingredients for a recipe.

 

wpurp_recipe_field_instructions

  1. Array $instructions – List of all the recipe instructions
  2. WPURP_Recipe $recipe – The actual recipe

This hook can be used to modify the instructions for a recipe.

 

wpurp_recipe_list_widget_recipe

  1. String $output – HTML output for this recipe in the widget
  2. WPURP_Recipe $recipe – The actual recipe

This hook can be used to modify the HTML output for each recipe in the Recipe List Widget.

 

wpurp_search_widget_dropdown_args

  1. Array $args – The dropdown arguments
  2. Array $taxonomy – The taxonomy we’re generating the dropdown for

This hook can be used to modify the dropdown arguments in the Recipe Search Widget.

 

wpurp_query_posts

  1. Array/String $post_type – Post type to be set for the WP Query
  2. Object $query – The WP Query that is being modified

To have our recipes behaving like posts we change the WP Query post_type in certain cases. This hook can be used to alter this functionality.

 

wpurp_query_posts_loop_check

  1. Boolean $ignore_query – Whether or not we should ignore this query
  2. Object $query – The WP Query that is being modified

Even when recipes are not acting as posts we need to change the WP Query post_type in certain cases. This hook can be used to alter this functionality.

 

wpurp_recipe_content_loop_check

  1. Boolean $ignore_query – Whether or not we should ignore this query
  2. Object $query – The WP Query that is being modified

This hook can be used to alter the check when deciding whether or not to output the recipe.

 

wpurp_check_for_shortcode

  1. Boolean $shortcode_present – Is the shortcode present on this page/post?
  2. Array/String $shortcodes – The shortcode or shortcodes that we’re checking (true if one matches)

Before including certain assets (CSS and JS files) we check if the shortcode that needs these are present. This hook can be used to alter this check.