Skip to content

Instantly share code, notes, and snippets.

@wprs
wprs / wprs_cta_rating_html.php
Created October 16, 2017 15:20
Replace WPRS CTA static rating results with an interactive vote rating stars https://wprichsnippets.com/addons/call-to-action/
<?php //* do not include php tag
add_filter( 'wprs_cta_rating_html', 'wprs_cta_do_rating_html_override_64738746836' );
/**
* Override rating results in CTA box
*
* Replace static rating results with an interactive vote rating stars
*
* @require CTA add-on version 1.9.3 and up
* @return array
@wprs
wprs / wprs-organization-aggregate-override.php
Created September 22, 2017 04:24
Filter Organization > Aggregate Reviews type template output https://wprichsnippets.com
<?php //* Do NOT include the opening php tag shown above. Copy the code shown below.
/*
Filter WPRichSnippets plugn Review Box Template output for the WordPress Rich Snippets plugin.
This function provide a custom view for the Organization > aggregate type
For review type: Aggrgate
https://wprichsnippets.com
*/
function my_template_organization_aggregate_override_7183716() {
@wprs
wprs / wprs_do_override_text_readers_rating.php
Last active September 22, 2017 04:20
Override "Readers Rating" text in WPRichSnippets plugin https://wprichsnippets.com
<?php //* Do NOT include the opening php tag shown above. Copy the code shown below.
add_filter('wprs_text_readers_rating','wprs_do_override_text_readers_rating_567345');
/*
* override "Readers Rating" text in WPRichSnippets plugin
*/
function wprs_do_override_text_readers_rating_567345( $old_value ) {
$new_value = 'You New Text'; // add your new value here
@wprs
wprs / wprs-box-shortcode.php
Created July 25, 2016 17:26
Execute shortcode in Theme template or functions.php file https://wprichsnippets.com/addons/box-shortcode/
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Execute shortcode in Theme template or functions.php file,
//* for WPRichSnipopets Shortcode Box add-on
if ( shortcode_exists( 'wprs-box' ) ) {
// The [wprs-box] short code exists.
echo do_shortcode('[wprs-box]');
}
@wprs
wprs / wprs-widget-legacy.php
Created July 17, 2016 08:45
The older light version of Rich Snippets Entries Widget for WPRichSnippets plugin https://wprichsnippets.com/doc/legacy-widget/
<?php
/*
Plugin Name: WPRS Widget Legacy
Plugin URI: https://wprichsnippets.com/
Description: The WPRichSnippets plugin Widget legacy plugin.
Version: 1.0
Author: Hesham Zebida
Author URI: http://zebida.com
@author WPRichSnippets
@wprs
wprs / wprs_add_toc.php
Last active June 26, 2016 08:45
Use shortcode to display Table Of Content Plus on WPRichSnippets enabled posts https://wprichsnippets.com/doc/table-content-plus/
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_filter('wprs_box', 'wprs_add_toc_4321');
/*
Use shortcode to display Table Of Content
This is a simple fix for Table Of Content Plus Plugin
*/
function wprs_add_toc_4321($box) {
@wprs
wprs / wprs-remove-dates.php
Created May 31, 2016 17:42
Remove plublished and modified dates from WPRichSnippets Box template https://wprichsnippets.com/
add_filter('wprs_template', 'wprs_dates_remove_12345', 99);
/*
Remove plublished and modified dates from WPRichSnippets Box template
*/
function wprs_dates_remove_12345( $template ) {
$template['date_published'] = '';
$template['date_modified'] = '';
$template['datePublished'] = '';
$template['dateModified'] = '';
@wprs
wprs / wprs_get_teplate_array.php
Last active May 31, 2016 18:08
Print an array of WPRichSnippets plugin Template Elements https://wprichsnippets.com/doc/shortcodes/
/*
Print an array of WPRS Template Elements
*/
function wprs_display_element_array_4321() {
global $post;
if (!wprs_is_enabled($post->ID)) return;
$template = wprs_template($post->ID);
echo '<pre>';
print_r($template);
echo '<pre>';
@wprs
wprs / wprs_ranking_table_summary.php
Last active August 29, 2015 14:25
Override Summary value in WPRichSnippets Ranking Table add-on https://wprichsnippets.com/addons/ranking-table/
<?php
add_filter('wprs_ranking_table_summary', 'my_custom_ranking_table_summary');
/**
* Override Summary field value in WPRichSnippets Ranking Table add-on
* Author: Hesham Zebida
* URL: https://wprichsnippets.com/addons/ranking-table/
*
* Here is 3 ways to do it.
* By default, this function returns raw Pros field value