Yasr Filters and Actions

ACTIONS

File: lib/yasr-ajax-functions.php

This is called before save the Overall Rating
do_action('yasr_action_on_overall_rating', $post_id, $rating);

This add new tabs in the Yasr Shortcode Creator
do_action( 'yasr_add_tabs_on_tinypopupform');

Add content for Yasr Shortcode Creator
do_action( 'yasr_add_content_on_tinypopupform')

Called before saving the visitor vote
do_action('yasr_action_on_visitor_vote', $post_id, $rating);

File: lib/yasr-functions.php

Run after default css are loaded
do_action( 'yasr_add_front_script_css' );

Run after yasr-front.js is loaded
do_action('yasr_add_front_script_js');

For admin side: run before yasr-admin.css is loaded
do_action('yasr_add_admin_scripts_begin');

For admin side: run after yasr-admin.css is loaded
do_action('yasr_add_admin_scripts_end' );

File: yasr-settings-functions.php

Add settings field in Aspect & Style page
do_action('yasr_style_options_add_settings_field', $style_options);

File: yasr-settings-page.php

Add new tab in the Yasr Settings
do_action( 'yasr_add_settings_tab', $active_tab )

Add content here for new page, the callback function must begin with
if ($active_tab == ‘YOURNEWPAGE’) {
do_action( 'yasr_settings_check_active_tab', $active_tab );

File: yasr-metabox-top-right.php

Add content at the bottom of the top right metabox used in the edit screen
do_action( 'yasr_add_content_bottom_topright_metabox', $post_id );

FILTERS

File: lib/yasr-functions.php

Use this filter to use your own rich snippets
$filtered_schema = apply_filters( 'yasr_filter_schema_jsonld', $review_choosen );

Filter the store ip address
yasr_filter_ip

File: yasr-settings-functions.php
Add content to the array $style_options used in the Aspect & Styles tab
apply_filters('yasr_filter_style_options', $style_options);

What do you think about this?
[Total: 4 Average: 5]

2 thoughts on “Yasr Filters and Actions

  • Another plugin on my site prohibits the use of shortcodes at the location where I want to show the YASR rating. Is there an action I can use to get the same result as the [yasr_overall_rating] shortcode?

    • No sorry.
      If you need to disable shortcodes just in few pages, I use this code for this website, (added in the child theme)

      add_filter('the_content', 'yasr_website_remove_shortcode');

      function yasr_website_remove_shortcode ($content) {

      $exluded_ids = array(258, 13, 25);

      $post_id = get_the_ID();

      if (in_array($post_id, $exluded_ids)) {

      remove_all_shortcodes();

      }

      return $content;

      }

Leave a Reply

Your email address will not be published. Required fields are marked *