public static
object
|
#
get_instance( )
Get the instance and store the class inside it. This plugin utilises the PHP
singleton design pattern.
Get the instance and store the class inside it. This plugin utilises the PHP
singleton design pattern.
Returns
object self::$instance Instance
Since
1.0
See
edd_reviews();
Uses
EDD_Reviews::setup_globals() Setup the globals needed
EDD_Reviews::load_classes() Loads all the classes
EDD_Reviews::hooks()
Setup hooks and actions
|
public
|
|
public
|
#
__clone( )
Throw error on object clone
Throw error on object clone
The whole idea of the singleton design pattern is that there is a single
object therefore, we don't want the object to be cloned.
Since
1.0
|
public
|
#
__wakeup( )
Disable unserializing of the class
Disable unserializing of the class
Since
1.0
|
public
|
#
__isset( mixed $key )
Magic method for checking if custom variables have been set
Magic method for checking if custom variables have been set
Since
1.0
|
public
|
#
__get( mixed $key )
Magic method for getting variables
Magic method for getting variables
Since
1.0
|
public
|
#
__set( mixed $key, mixed $value )
Magic method for setting variables
Magic method for setting variables
Since
1.0
|
public
|
#
__unset( mixed $key )
Magic method for unsetting variables
Magic method for unsetting variables
Since
1.0
|
public
|
#
__call( string $name = '', array $args = array() )
Magic method to prevent notices and errors from invalid method calls
Magic method to prevent notices and errors from invalid method calls
Parameters
- $name
string $name
- $args
array $args
Since
1.0
|
public static
|
#
reset( )
Reset the instance of the class
Reset the instance of the class
Since
1.0
|
public
|
#
init( )
Function fired on init
This function is called on WordPress 'init'. It's triggered from the
constructor function.
Since
1.0
Uses
|
public
boolean
|
#
load_plugin_textdomain( )
Load Plugin Text Domain
Looks for the plugin translation files in certain directories and loads them
to allow the plugin to be localised
Returns
boolean True on success, false on failure
Since
1.0
Used by
|
public
|
#
activation( )
Activation function fires when the plugin is activated.
Activation function fires when the plugin is activated.
This function is fired when the activation hook is called by WordPress, it
flushes the rewrite rules and disables the plugin if EDD isn't active and throws
an error.
Since
1.0
|
public
|
|
public
|
#
hooks( )
Adds all the hooks/filters
Adds all the hooks/filters
The plugin relies heavily on the use of hooks and filters and modifies
default WordPress behaviour by the use of actions and filters which are provided
by WordPress.
Actions are provided to hook on this function, before the hooks and filters
are added and after they are added. The class object is passed via the
action.
Since
1.0
Used by
|
public
|
|
public
|
#
reviews_form( )
Reviews form
This function is called by the reviews template and overrides the default
comments form by replacing the fields in order for reviews to be placed.
Since
1.0
|
public
object|boolean
|
#
check_author( array $commentdata )
Checks if multiple reviews have been disabled and then verifies if the author
has already posted a review for this download (product). This function queries
the database for any reviews by taking the comment_post_ID and
comment_author_email and if anything is returned, execution of the comment
addition will fail with wp_die().
Checks if multiple reviews have been disabled and then verifies if the author
has already posted a review for this download (product). This function queries
the database for any reviews by taking the comment_post_ID and
comment_author_email and if anything is returned, execution of the comment
addition will fail with wp_die().
Parameters
- $commentdata
array $commentdata All the comment data sent via $_POST
Returns
object|boolean Returns an instance of wp_die() or the comment data
Since
1.2
|
public
array
|
#
check_review_title( array $commentdata )
Checks if a review title has been entered otherwise dies with an error
Checks if a review title has been entered otherwise dies with an error
Parameters
- $commentdata
array $commentdata All the comment data sent via $_POST
Returns
array $commentdata All the comment data sent via $_POST
Since
1.0
|
public
array
|
#
check_rating( array $commentdata )
Checks if a rating has been made otherwise dies with an error
Checks if a rating has been made otherwise dies with an error
Parameters
- $commentdata
array $commentdata All the comment data sent via $_POST
Returns
array $commentdata All the comment data sent via $_POST
Since
1.0
|
public
array
|
#
remove_url( array $fields )
Remove URL field from Comments (Review) Form only on the Download page
Remove URL field from Comments (Review) Form only on the Download page
Parameters
- $fields
array $fields All the comment fields
Returns
array $fields Updated list of comment fields without the URL
Since
1.0
|
public
|
#
save_review_meta( integer $comment_id )
Save the Review Meta Data
Save the Review Meta Data
Parameters
- $comment_id
integer $comment_id Comment ID
Since
1.0
|
public
string
|
#
microdata( string $content )
Microdata
Parameters
- $content
string $content Content of the post
Returns
string $content Content of the post with the microdata
Since
1.0
Uses
|
public
string
|
#
average_rating( boolean $echo = true )
Get Average Rating
Parameters
- $echo
boolean $echo Whether to echo the result or return it
Returns
string $average Returns the average rating
Since
1.0
Used by
|
public
|
#
disable_trackbacks( )
Disable Trackbacks
This function removes the Trackbacks meta box from the Add/Edit Download
screen as it's not the sole purpose of this plugin and if any were to be made,
they wouldn't render correctly as the plugin doesn't provide support for
trackbacks.
Since
1.0
|
public
|
#
change_meta_boxes( )
Edit Meta Boxes
The Comments meta box on the Add/Edit Download screen is renamed here and the
callback function for the comments meta box is also changed.
Since
1.0
|
public
|
|
public
|
|
public
|
#
admin_scripts( )
Load Admin Scripts/Styles
Load Admin Scripts/Styles
Since
1.0
|
public
array
|
#
custom_columns( array $columns )
Shows Review Meta on Comments List Table
Shows Review Meta on Comments List Table
Parameters
- $columns
array $columns All the columns on the list table
Returns
array $columns New columns with Review Title and Rating added
Since
1.0
|
public
|
#
custom_column_data( string $column, integer $comment_ID )
Display Custom Column Data
Display Custom Column Data
Parameters
- $column
string $column Current column
- $comment_ID
integer $comment_ID Comment ID
Since
1.0
|
public
array
|
#
misc_settings( array $settings )
Register Misc Settings
Parameters
- $settings
array $settings Existing registered settings
Returns
array Merged array with new settings added
Since
1.0
|
public
array
|
#
styles_settings( array $settings )
Register Misc Settings
Parameters
- $settings
array $settings Existing registered settings
Returns
array Merged array with new settings added
Since
1.0
|
public
|
#
admin_notices( )
Handles the displaying of any notices in the admin area
Handles the displaying of any notices in the admin area
Since
1.0
|
public
string
|
#
count_reviews( )
Count the number of reviews from the database
Count the number of reviews from the database
Returns
string $count Number of reviews
Since
1.0
Used by
|
public
string
|
#
count_ratings( )
Count the number of ratings from the database
Count the number of ratings from the database
Returns
string $count Number of reviews
Since
1.0
|
public
integer
|
#
get_review_count_by_rating( integer $rating )
Gets the number of the reviews by a rating
Gets the number of the reviews by a rating
Parameters
- $rating
integer $rating Rating (1 - 5)
Returns
integer $number Number of reviews
Since
1.0
Used by
|
public
|
#
reviews_title( integer $average = null )
Build Reviews (comments) title
Build Reviews (comments) title
Parameters
- $average
integer $average Average ratings for reviews
Since
1.0
Uses
|
public
boolean
|
#
reviewer_has_purchased_download( )
Checks if the reviewer has purchased the download
Checks if the reviewer has purchased the download
Returns
boolean Whether reviews has purchased download or not
Since
1.0
|
public
array
|
#
review_classes( array $classes )
Add Classes to the Reviews
Add Classes to the Reviews
Parameters
- $classes
array $classes Comment classes
Returns
array $classes Comment (reviews) classes with 'review' added
Since
1.0
|
public
|
#
review( object $comment, array $args, string $depth )
Template for displaying reviews
Template for displaying reviews
This function just executes the hooks to display the review.
Parameters
- $comment
object $comment
- $args
array $args
- $depth
string $depth
Since
1.0
|
public
|
|
public
|
#
voting_info( )
Display Voting Info
Example output: 2 of 8 people found this review helpful
Since
1.0
Used by
|
public
|
#
maybe_show_review_breakdown( )
Conditional whether or not to display review breakdown
Conditional whether or not to display review breakdown
Since
1.0
Uses
|
public
|
#
review_breakdown( )
Reviews Breakdown
Shows a breakdown of all the reviews and the number of people that given each
rating for each download
Example: 8 people gave a 5 star rating; 10 people have a 2 star rating
Since
1.0
Uses
Used by
|
public
|
|
public
|
#
display_review_counts( )
Displays reviews count for each rating by looping through 1 - 5
Displays reviews count for each rating by looping through 1 - 5
Since
1.0
Uses
Used by
|
public
|
#
process_vote( )
Process Vote from Review
This function is called if a JavaScript isn't enabled
Since
1.0
|
public
boolean
|
#
is_ajax_request( )
Checks whether an AJAX request has been sent
Checks whether an AJAX request has been sent
Returns
boolean Whether or not AJAX $_GET header has been passed
Since
1.0
Used by
|
public
mixed
|
#
process_ajax_vote( )
Process Voting for the Reviews via AJAX
Process Voting for the Reviews via AJAX
Processes the voting button appended to the bottom of each review by adding
or updating the comment meta via AJAX.
Returns
mixed returns if AJAX check fails
Since
1.0
Uses
|
public
|
|
public
|
|
public
|
|
public
|
#
review_meta_box( object $comment )
Render the Review Meta Box
Render the Review Meta Box
Outputs the Review Information meta box on the Edit Comment screen. This meta
box displays the review title and the star rating. It also allows for it to be
edited.
Parameters
- $comment
object $comment Comment information
Since
1.0
|
public
|
#
update_review_meta( integer $comment_id )
Save the Meta Data from the Meta Box on the Edit Comment Screen
Save the Meta Data from the Meta Box on the Edit Comment Screen
Parameters
- $comment_id
integer $comment_id Comment ID
Since
1.0
|
public
array
|
#
register_api_mode( array $modes )
Register API Query Mode
Parameters
- $modes
array $modes Whitelisted query modes
Returns
array $modes Updated list of query modes
Since
1.0
|
public
array
|
#
query_vars( array $vars )
Add 'review_id' Query Var into WordPress Whitelisted Query Vars
Add 'review_id' Query Var into WordPress Whitelisted Query Vars
Parameters
- $vars
array $vars Array of WordPress allowed query vars
Returns
array $vars Updated array of WordPress query vars to allow Reviews to integrate with
the EDD API
Since
1.0
|
public
array
|
#
api_output( array $data, array $query_mode, object $api_object )
Processes the Data Outputted when an API Call for Reviews is Triggered
Processes the Data Outputted when an API Call for Reviews is Triggered
Parameters
- $data
array $data Array to hold the output
- $query_mode
array $query_mode Query mode (i.e. reviews)
- $api_object
object $api_object EDD_API Object
Returns
array $data All the data for when the API call for reviews is fired
Since
1.0
|
public
boolean
|
#
user_can_see_tinymce( )
Is the User Allowed to See TinyMCE?
Is the User Allowed to See TinyMCE?
Returns
boolean Whether the user can see TinyMCE or not
Since
1.0
Used by
|
public
|
#
tinymce_button( )
Add TinyMCE Button
Adds a button to the TinyMCE editor to easily embed reviews into posts and
pages
Since
1.0
Uses
|
public
array
|
#
add_plugin( array $plugin_array )
Register TinyMCE Plugin
Parameters
- $plugin_array
array $plugin_array Array of TinyMCE Plugins
Returns
array $plugin_array Array of TinyMCE Plugins
Since
1.0
|
public
array
|
#
register_button( array $buttons )
Register TinyMCE Button
Parameters
- $buttons
array $buttons Array of TinyMCE Button
Returns
array $buttons Array of TinyMCE Button
Since
1.0
|
public
|
#
process_mce_dialog( )
Process the TinyMCE Modal Dialog
Process the TinyMCE Modal Dialog
Since
1.0
|
public
array
|
#
plugin_links( array $links, mixed $file )
Plugin Action Links
This function adds a link to the plugin action links bar on the Plugins
Administrati on page to for the API documentation and to Easy Digital Downloads
Support Forum.
Parameters
- $links
array $links Plugin Action Links
- $file
Returns
array $links Plugin Action Links
Since
1.0
|
public
|
#
updater( )
Loads the Updater
Instantiates the Software Licensing Plugin Updater and passes the plugin data
to the class.
Since
1.0
|