The $mod Variable

The $mod variable is defined early in the WPSSO load process, and is passed to most methods and filters.

The $mod variable name stands for module and defines important reference values for the current WPSSO object type.

The WPSSO object type can be a comment, post, taxonomy term, or user. An archive does not have an object type since an archive is a collection of object types (ie. a monthly archive is a collection of posts for that month). In this case, $mod[ 'obj' ] will be false and other properties will return true, like $mod[ 'is_archive' ], $mod[ 'is_date' ], and $mod[ 'is_month' ] for example.

Here is an example $mod array for a post:

An example to retrieve custom post meta:

The 'obj' element can be used to call object methods. Here's an example to get a custom Open Graph description value (if one has been defined):

WPSSO offers several useful functions for it's methods. For example: