| Server IP : 80.74.154.100 / Your IP : 216.73.217.0 Web Server : Apache System : Linux marissa.metanet.ch 4.18.0-553.141.2.lve.el7h.x86_64 #1 SMP Wed Jul 8 17:20:31 UTC 2026 x86_64 User : onlineadmin ( 10487) PHP Version : 8.5.7 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/httpd/vhosts/comeonline.ch/httpdocs/wp-content/plugins/wpsso/html/ |
Upload File : |
<p>The <code>$mod</code> variable is defined early in the load process (in <code>WpssoHead->show_head()</code>, which is hooked to the 'wp_head' action) and is passed to most WPSSO methods and filters.</p>
<pre>
$wpsso =& Wpsso::get_instance();
// In case we prefer using the global $post object.
$use_post = apply_filters( 'wpsso_use_post', in_the_loop() ? true : false );
// Get information about the current webpage.
$mod = $wpsso->page->get_mod( $use_post );
</pre>
<p>The <code>$mod</code> variable name stands for <em>module</em> and defines important reference values for the current WPSSO object type. The WPSSO object type can be a comment, post, term, or user object. An archive does not have an object type since an archive page is a collection of objects. For example, a monthly archive is a collection of posts for that month. In this case, <code>$mod[ 'obj' ]</code> would be false and other properties like <code>$mod[ 'is_archive' ]</code>, <code>$mod[ 'is_date' ]</code>, and <code>$mod[ 'is_month' ]</code> would be true.</p>
<p>The <code>WpssoPage->get_mod()</code> method can be used to determine the current webpage module. If you need to setup a <code>$mod</code> variable for a specific comment, post, term, or user, you can call the <code>get_mod()</code> method from those class objects.</p>
<pre>
$wpsso =& Wpsso::get_instance();
// Get information for comment ID 123.
$mod = $wpsso->comment->get_mod( $comment_id = 123 );
// Get information for post ID 123.
$mod = $wpsso->post->get_mod( $post_id = 123 );
// Get information for term ID 123.
$mod = $wpsso->term->get_mod( $term_id = 123 );
// Get information for user ID 123.
$mod = $wpsso->user->get_mod( $user_id = 123 );
</pre>
<p>Functions to get the <code>$mod</code> array are also available:</p>
<pre>
// Get information about the current webpage (post, term, user, archive page, etc.).
$mod = wpsso_get_page_mod();
// Get information for comment ID 123.
$mod = wpsso_get_comment_mod( $comment_id = 123 );
// Get information for post ID 123.
$mod = wpsso_get_post_mod( $post_id = 123 );
// Get information for term ID 123.
$mod = wpsso_get_term_mod( $term_id = 123 );
// Get information for user ID 123.
$mod = wpsso_get_user_mod( $user_id = 123 );
</pre>
<p>Here is an example <code>$mod</code> array for a post:</p>
<pre>Array (
[id] => 123
[name] => post
[name_transl] => post
[obj] => object WpssoPost
[wp_obj] => object WP_Post
[query_vars] => Array ()
[posts_args] => Array ()
[paged] => false
[paged_total] => 1
[is_404] => false
[is_archive] => false
[is_attachment] => false
[is_comment] => false
[is_date] => false
[is_day] => false
[is_home] => false
[is_home_page] => false
[is_home_posts] => false
[is_month] => false
[is_post] => true
[is_post_type_archive] => false
[is_public] => false
[is_search] => false
[is_term] => false
[is_user] => false
[is_year] => false
[comment_author] => false
[comment_author_name] => false
[comment_author_url] => false
[comment_paged] => false
[comment_parent] => false
[comment_rating] => false
[comment_time] => false
[use_post] => false
[post_slug] => the-post-slug
[post_type] => post
[post_type_label_plural] => Posts
[post_type_label_single] => Post
[post_mime_type] => ''
[post_mime_group] => ''
[post_mime_subgroup] => ''
[post_status] => publish
[post_author] => 123
[post_coauthors] => Array ()
[post_time] => 2013-03-15T22:23:27+00:00
[post_timestamp] => 1363386207
[post_modified_time] => 2021-01-31T00:16:46+00:00
[post_modified_timestamp] => 1612052206
[post_parent] => false
[tax_slug] => ''
[tax_label_plural] => false
[tax_label_single] => false
[user_name] => ''
[wpml_code] => ''
)</pre>
<p>Here is an example <code>$mod</code> array for a WooCommerce product:</p>
<pre>Array (
[id] => 4567
[name] => post
[name_transl] => post
[obj] => object WpssoPost
[wp_obj] => object WP_Post
[query_vars] => Array ()
[posts_args] => Array ()
[paged] => false
[paged_total] => 1
[is_404] => false
[is_archive] => false
[is_attachment] => false
[is_comment] => false
[is_date] => false
[is_day] => false
[is_feed] => false
[is_home] => false
[is_home_page] => false
[is_home_posts] => false
[is_month] => false
[is_post] => true
[is_post_type_archive] => false
[is_public] => true
[is_search] => false
[is_term] => false
[is_user] => false
[is_year] => false
[comment_author] => false
[comment_author_name] => false
[comment_author_url] => false
[comment_paged] => false
[comment_parent] => false
[comment_rating] => false
[comment_time] => false
[use_post] => false
[post_slug] => hoodie
[post_type] => product
[post_type_label_plural] => Products
[post_type_label_single] => Product
[post_mime_type] => ''
[post_mime_group] => false
[post_mime_subgroup] => false
[post_status] => publish
[post_author] => 123
[post_coauthors] => Array ()
[post_time] => 2023-02-16T12:34:11+00:00
[post_timestamp] => 1676550851
[post_modified_time] => 2023-07-04T00:54:41+00:00
[post_modified_timestamp] => 1688432081
[post_parent] => false
[term_tax_id] => false
[tax_slug] => ''
[tax_label_plural] => false
[tax_label_single] => false
[user_name] => ''
[wpml_code] => ''
)</pre>
<p>Here is an example <code>$mod</code> array for a WooCommerce product category term:</p>
<pre>Array (
[id] => 890
[name] => term
[name_transl] => term
[obj] => object WpssoTerm
[wp_obj] => object WP_Term
[query_vars] => Array ()
[posts_args] => Array ()
[paged] => false
[paged_total] => false
[is_404] => false
[is_archive] => true
[is_attachment] => false
[is_comment] => false
[is_date] => false
[is_day] => false
[is_feed] => false
[is_home] => false
[is_home_page] => false
[is_home_posts] => false
[is_month] => false
[is_post] => false
[is_post_type_archive] => false
[is_public] => true
[is_search] => false
[is_term] => true
[is_user] => false
[is_year] => false
[comment_author] => false
[comment_author_name] => false
[comment_author_url] => false
[comment_paged] => false
[comment_parent] => false
[comment_rating] => false
[comment_time] => false
[use_post] => false
[post_slug] => false
[post_type] => false
[post_type_label_plural] => false
[post_type_label_single] => false
[post_mime_type] => false
[post_mime_group] => false
[post_mime_subgroup] => false
[post_status] => false
[post_author] => false
[post_coauthors] => Array ()
[post_time] => false
[post_timestamp] => false
[post_modified_time] => false
[post_modified_timestamp] => false
[post_parent] => false
[term_tax_id] => 761
[tax_slug] => product_cat
[tax_label_plural] => Product categories
[tax_label_single] => Category
[user_name] => ''
[wpml_code] => ''
)</pre>