Skip to content

Latest commit

 

History

History
593 lines (390 loc) · 20.7 KB

yasr_hooks.md

File metadata and controls

593 lines (390 loc) · 20.7 KB

do_action('yasr_add_admin_scripts_begin')

Source: ../admin/classes/YasrAdmin.php, line 170

Add custom script in one of the page used by YASR, at the beginning

Argument Type Description
$hook string

do_action('yasr_add_admin_scripts_end')

Source: ../admin/classes/YasrAdmin.php, line 187

Add custom script in one of the page used by YASR, at the end

Argument Type Description
$hook string

do_action('yasr_add_tabs_on_tinypopupform')

Source: ../admin/editor/YasrEditorHooks.php, line 218

Use this action to add tabs inside shortcode creator for tinymce


do_action('yasr_add_content_on_tinypopupform')

Source: ../admin/editor/YasrEditorHooks.php, line 234

Use this action to add content inside shortcode creator

Argument Type Description
$n_multi_set int
$multi_set string the multiset name

do_action('yasr_metabox_below_editor_add_tab')

Source: ../admin/editor/YasrMetaboxBelowEditor.php, line 60

Use this hook to add new tabs into the metabox below the editor


do_action('yasr_metabox_below_editor_content')

Source: ../admin/editor/YasrMetaboxBelowEditor.php, line 66


do_action('yasr_add_content_multiset_tab_top')

Source: ../admin/editor/YasrMetaboxBelowEditor.php, line 210

Hook here to add new content at the beginning of the div

Argument Type Description
$post_id int
$set_id int

do_action('yasr_add_content_multiset_tab_pro')

Source: ../admin/editor/YasrMetaboxBelowEditor.php, line 292

Hook here to add new content

Argument Type Description
$post_id int
$set_id int

do_action('yasr_on_save_post')

Source: ../admin/editor/YasrOnSavePost.php, line 61

Hook here to add actions when YASR save data on save_post

Argument Type Description
$post_id int

do_action('yasr_action_on_overall_rating')

Source: ../admin/editor/YasrOnSavePost.php, line 106

Do action before overall rating is saved, works only in classic editor

Argument Type Description
$post_id int
$rating float

do_action('yasr_add_content_bottom_topright_metabox')

Source: ../admin/editor/yasr-metabox-top-right.php, line 121

Hook here to add content at the bottom of the metabox

Argument Type Description
$post_id int

do_action('yasr_add_settings_tab')

Source: ../admin/settings/classes/YasrSettings.php, line 255

Hook here to add new settings tab


do_action('yasr_settings_tab_content')

Source: ../admin/settings/classes/YasrSettings.php, line 330

Hook here to add new settings tab content


apply_filters('yasr_setting_page_footer')

Source: ../admin/settings/classes/YasrSettingsFooter.php, line 135

Filter to customize the footer page on the "Aspect & style" page.

Since this could contain js, this will only allow FALSE as value

Argument Type Description
$style_page_upgrade_pro_js string

apply_filters('yasr_settings_select_ranking')

Source: ../admin/settings/classes/YasrSettingsRankings.php, line 60


do_action('yasr_right_settings_panel_box')

Source: ../admin/settings/classes/YasrSettingsRightColumn.php, line 15


apply_filters('yasr_filter_style_options')

Source: ../admin/settings/classes/YasrSettingsStyle.php, line 37


do_action('yasr_style_options_add_settings_field')

Source: ../admin/settings/classes/YasrSettingsStyle.php, line 48


apply_filters('yasr_sanitize_style_options')

Source: ../admin/settings/classes/YasrSettingsStyle.php, line 462


do_action('yasr_add_stats_tab')

Source: ../admin/settings/classes/YasrStats.php, line 56

Use this hook to add a tab into yasr_stats_page


apply_filters('yasr_export_box_button')

Source: ../admin/settings/classes/YasrStatsExport.php, line 144

Use this hook to customize the button


do_action('yasr_export_box_end')

Source: ../admin/settings/classes/YasrStatsExport.php, line 160

Hook here to do an action at the end of the box


do_action('yasr_migration_page_bottom')

Source: ../admin/settings/yasr-settings-migration.php, line 63


do_action('yasr_stats_tab_content')

Source: ../admin/settings/yasr-stats-page.php, line 54

Hook here to add new stats tab content


apply_filters('yasr_feature_locked')

Source: ../admin/yasr-admin-init.php, line 33


apply_filters('yasr_feature_locked_html_attribute')

Source: ../admin/yasr-admin-init.php, line 40


apply_filters('yasr_feature_locked_text')

Source: ../admin/yasr-admin-init.php, line 56


apply_filters('yasr_rankings_query_ov')

Source: ../includes/classes/YasrDB.php, line 421


apply_filters('yasr_rankings_query_vv')

Source: ../includes/classes/YasrDB.php, line 465


apply_filters('yasr_rankings_query_tu')

Source: ../includes/classes/YasrDB.php, line 515


apply_filters('yasr_rankings_multi_query')

Source: ../includes/classes/YasrDB.php, line 560


apply_filters('yasr_rankings_query_tr')

Source: ../includes/classes/YasrDB.php, line 614


apply_filters('yasr_rankings_multivv_query')

Source: ../includes/classes/YasrDB.php, line 665


apply_filters('yasr_user_rate_history_must_login_text')

Source: ../includes/classes/YasrLastRatingsWidget.php, line 85

Hook here to customize the message "You must login to see this widget." when

the shortcode yasr_user_rate_history is used


apply_filters('yasr_filter_itemtypes')

Source: ../includes/classes/YasrRichSnippetsItemTypes.php, line 91

Use this hook to add (or eventually remove) supported itemTypes

Argument Type Description
$itemTypes array an array containing all the default supported itemTypes

apply_filters('yasr_filter_itemtypes_fields')

Source: ../includes/classes/YasrRichSnippetsItemTypes.php, line 112

Use this hook to add optional fields for an itemType

Here the array member must contain main itemType name

E.g. if you want to add the filed 'price' to 'SoftwareApplication, you need to add

yasr_softwareapplication_price

Argument Type Description
$additionalFields array an array containing all the default supported additional fields

apply_filters('yasr_custom_loader')

Source: ../includes/classes/YasrScriptsLoader.php, line 59


apply_filters('yasr_custom_loader_url')

Source: ../includes/classes/YasrScriptsLoader.php, line 63


do_action('yasr_add_front_script_css')

Source: ../includes/classes/YasrScriptsLoader.php, line 118


do_action('yasr_add_front_script_js')

Source: ../includes/classes/YasrScriptsLoader.php, line 127


apply_filters('yasr_gutenberg_constants')

Source: ../includes/classes/YasrScriptsLoader.php, line 525


apply_filters('yasr_rest_rankings_args')

Source: ../includes/rest/classes/YasrCustomEndpoint.php, line 146


apply_filters('yasr_rest_sanitize')

Source: ../includes/rest/classes/YasrCustomEndpoint.php, line 277


apply_filters('yasr_tr_rankings_atts')

Source: ../includes/shortcodes/classes/YasrNoStarsRankings.php, line 36


apply_filters('yasr_tu_rankings_atts')

Source: ../includes/shortcodes/classes/YasrNoStarsRankings.php, line 63


apply_filters('yasr_tu_rankings_display')

Source: ../includes/shortcodes/classes/YasrNoStarsRankings.php, line 124


apply_filters('yasr_overall_rating_shortcode')

Source: ../includes/shortcodes/classes/YasrOverallRating.php, line 52


apply_filters('yasr_cstm_text_before_overall')

Source: ../includes/shortcodes/classes/YasrOverallRating.php, line 123


apply_filters('yasr_ov_rankings_atts')

Source: ../includes/shortcodes/classes/YasrRankings.php, line 54


apply_filters('yasr_vv_rankings_atts')

Source: ../includes/shortcodes/classes/YasrRankings.php, line 84

Hook here to use shortcode atts.

If not used, will work with no support for atts

Argument Type Description
$this->shortcode_name string Name of shortcode caller
$atts string array

apply_filters('yasr_multi_set_ranking_atts')

Source: ../includes/shortcodes/classes/YasrRankings.php, line 112


apply_filters('yasr_visitor_multi_set_ranking_atts')

Source: ../includes/shortcodes/classes/YasrRankings.php, line 144

Hook here to use shortcode atts.

If not used, shortcode will works only with setId param

Argument Type Description
$this->shortcode_name string Name of shortcode caller
$atts string array

apply_filters('yasr_size_ranking')

Source: ../includes/shortcodes/classes/YasrShortcode.php, line 109


do_action('yasr_enqueue_assets_shortcode')

Source: ../includes/shortcodes/classes/YasrShortcode.php, line 178


do_action('yasr_action_on_visitor_vote')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 93

Hook here to add an action on visitor votes (e.g. empty cache)

Argument Type Description
$array_action_visitor_vote array An array containing post_id and is_singular

apply_filters('yasr_vv_cookie')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 201


apply_filters('yasr_vv_updated_text')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 214


apply_filters('yasr_vv_saved_text')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 217


do_action('yasr_action_on_visitor_multiset_vote')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 328


apply_filters('yasr_mv_cookie')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 433


apply_filters('yasr_mv_saved_text')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 442


apply_filters('yasr_filter_ranking_request')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 625


apply_filters('yasr_add_sources_ranking_request')

Source: ../includes/shortcodes/classes/YasrShortcodesAjax.php, line 676


apply_filters('yasr_mv_cookie')

Source: ../includes/shortcodes/classes/YasrVisitorMultiSet.php, line 113


apply_filters('yasr_must_sign_in')

Source: ../includes/shortcodes/classes/YasrVisitorMultiSet.php, line 167


apply_filters('yasr_vv_ro_shortcode')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 116

Use this filter to customize yasr visitor votes readonly.

Argument Type Description
$shortcode_html string html for the shortcode
$stored_votes array array with average rating data for the post id.
$this->post_id int the post id
$stored_votes YasrDB::visitorVotes() array

apply_filters('yasr_vv_cookie')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 130

Use this filter to customize the visitor votes cookie name

Argument Type Description
string yasr_visitor_votes_cookie is the default name

apply_filters('yasr_cstm_text_already_voted')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 209

Use this filter to customize the text "You have already voted for this article with rating %rating%"

Unless you're using a multi-language site, there is no need to use this hook; you can customize this in

"General Settings" -> "Custom text to display when an user has already rated"


apply_filters('yasr_must_sign_in')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 226

Use this filter to customize the text "you must sign in"

Unless you're using a multi-language site, there is no need to use this hook; you can customize this in

"General Settings" -> "Custom text to display when login is required to vote"


apply_filters('yasr_cstm_text_before_vv')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 261

Use this filter to customize text before visitor rating.

Unless you're using a multi-language site, there is no need to use this hook; you can customize this in

"General Settings" -> "Custom text to display BEFORE Visitor Rating"

Argument Type Description
$number_of_votes int the total number of votes
$average_rating float the average rating
$this->unique_id string the dom ID

apply_filters('yasr_cstm_text_after_vv')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 317

Use this filter to customize text after visitor rating.

Unless you're using a multi-language site, there is no need to use this hook; you can customize this in

"General Settings" -> "Custom text to display AFTER Visitor Rating"

Argument Type Description
$number_of_votes int the total number of votes
$average_rating float the average rating
$this->unique_id string the dom ID

apply_filters('yasr_vv_shortcode')

Source: ../includes/shortcodes/classes/YasrVisitorVotes.php, line 433

Use this filter to customize the yasr_visitor_votes shortcode

Argument Type Description
$shortcode_html string html for the shortcode
$this->post_id int the post id
$this->starSize string () the star size
$this->readonly string is the stars are readonly or not
$this->ajax_nonce_visitor string the WordPress nonce
$this->is_singular string if the current page is_singular or not

apply_filters('yasr_seconds_between_ratings')

Source: ../includes/yasr-includes-defines.php, line 33


apply_filters('yasr_filter_ip')

Source: ../includes/yasr-includes-functions.php, line 156


apply_filters('yasr_auto_insert_disable')

Source: ../public/classes/YasrPublicFilters.php, line 62


apply_filters('yasr_auto_insert_exclude_cpt')

Source: ../public/classes/YasrPublicFilters.php, line 92


apply_filters('yasr_title_vv_widget')

Source: ../public/classes/YasrPublicFilters.php, line 276


apply_filters('yasr_title_overall_widget')

Source: ../public/classes/YasrPublicFilters.php, line 313


apply_filters('yasr_filter_schema_jsonld')

Source: ../public/classes/YasrRichSnippets.php, line 77

Use this hook to write your custom microdata from scratch

Argument Type Description
$item_type_for_post string the itemType selected for the post

apply_filters('yasr_filter_existing_schema')

Source: ../public/classes/YasrRichSnippets.php, line 191


apply_filters('yasr_filter_schema_title')

Source: ../public/classes/YasrRichSnippets.php, line 223


do_action('yasr_display_posts_top')

Source: ../templates/content.php, line 28

hook here to add content at the beginning of yasr_display_posts


do_action('yasr_display_posts_bottom')

Source: ../templates/content.php, line 61

hook here to add content at the end of yasr_display_posts


do_action('yasr_ur_add_custom_form_fields')

Source: ../yasr_pro/public/classes/YasrProCommentForm.php, line 170


apply_filters('yasr_ur_display_custom_fields')

Source: ../yasr_pro/public/classes/YasrProCommentForm.php, line 284


do_action('yasr_ur_save_custom_form_fields')

Source: ../yasr_pro/public/classes/YasrProCommentForm.php, line 496


do_action('yasr_ur_do_content_after_save_commentmeta')

Source: ../yasr_pro/public/classes/YasrProCommentForm.php, line 505


do_action('yasr_fs_loaded')

Source: ../yet-another-stars-rating.php, line 82