[Developers] Developer Features
-
1. Filtering Strings
Rate my Post allows you to override strings in rating widget with a filter. For example, if you have multiple custom post types and you want the strings to be tailored to each custom post type you can utilize the rmp_custom_strings filter. See example below:
/*FILTER EXAMPLE the array has the following keys: rateTitle, rateSubtitle, rateResult, rateResult2, cookieNotice, noRating, afterVote, star1, star2 ,star3 ,star4 ,star5, socialTitle, socialSubtitle, feedbackTitle, feedbackSubtitle, feedbackText, feedbackNotice, feedbackButton, feedbackAlert, submitButtonText */ function modify_rmp_strings( $stringsArray ) { if ( is_singular( 'recipe' ) ) { //modify only if it is custom post type of recipe $stringsArray['rateTitle'] = 'How delicious was this recipe?'; $stringsArray['rateSubtitle'] = 'Click on a star to rate this recipe!'; $stringsArray['afterVote'] = 'Thank you for rating this recipe'; $stringsArray['socialTitle'] = 'As you found this recipe useful...'; $stringsArray['feedbackTitle'] = 'How come you did not like this recipe?'; $stringsArray['feedbackSubtitle'] = 'Can we improve this recipe?'; $stringsArray['feedbackText'] = 'Give us some tips...'; } return $stringsArray; } add_filter( 'rmp_custom_strings', 'modify_rmp_strings' );
The snippet above will change the strings in rating widget only in the recipe custom post type. In similar manner you can override the strings for specific posts, pages etc.
2. FontAwesome
The plugin utilizes FontAwesome for icons (stars, thumbs, social media icons etc.). If you want to further improve the performance of the plugin you can load only the necessary css and fonts instead of the full FontAwesome library. To generate CSS and fonts you can use IcoMoon. Alternatively, you can download Rate my Post – Fast Load Icons plugin here: https://github.com/blaz-blazer/rate-my-post-fast-load-icons
Remember to enable “Do not load FontAwesome” feature after enabling the Rate my Post – Fast Load Icons plugin.
Credit for this feature goes to @douglasferraz89.
More developer features will be available in the future ??
- The topic ‘[Developers] Developer Features’ is closed to new replies.