A filter is functionality that allows to modify content of particular functions (price format, item title etc.). Function added to filter have 1 input parameter – content that can be modified. Function returns output as modified content.
osc_add_filter('filter_name', 'function_name');
Example for filters might be need to capitalize items title:
osc_add_filter('item_title', function($title) { return ucwords($title); });
List of filters
Keep in mind that not all filters are listed here, we will try to make this list as accurate as possible. List is written in form: {name of filter} / {file where filter is used} / {short description}.
- item_title / item.php – affects the title of the item
- item_description / item.php – affects the description of the item
- item_price_null, item_price_zero, item_price – item price filters
- item_contact_name, item_contact_phone, item_contact_other, item_contact_email / hItem.php – item contact information (Osclass 8.0.2)
- item_post_data, item_edit_data – run right before item data are entered into database (Osclass 8.0.3)
- user_insert_data, user_edit_data, user_update_description – run right before user data (or user description data) are inserted into database (Osclass 8.0.3)
- comment_insert_data – run right before comment is entered into database.
- slug / model / Category.php – could change the slug of the categories (usefull for especial characters as ä, ü, …)
- resource_path / media_processing.php(oc-admin) – affects the resource path
- structured_data_title_filter / structured-data.php – affects the title in structured data
- structured_data_description_filter / structured-data.php – affects the description in structured data
- structured_data_image_filter / structured-data.php – affects the image in structured data
- structured_data_url_filter / structured-data.php – affects the current URL in structured data
- actions_manage_items / items_processing.php – could add more actions on actions list at manage listing. An array of ‘actions’ is passed and an array with the item information.
- more_actions_manage_items / items_processing.php – could add more actions on ‘more actions’ list at manage listing. An array of ‘actions’ is passed and an array with the item information.
- actions_manage_users / items_processing.php – could add more actions on actions list at manage users. An array of ‘actions’ is passed and an array with the user information.
- more_actions_manage_users / items_processing.php – could add more actions on ‘more actions’ list at manage users. An array of ‘actions’ is passed and an array with the user information.
- datatable_user_class / user/index.php – backoffice user list row class
<tr class="<?php echo implode(' ', osc_apply_filter('datatable_user_class', array(), $aRawRows[$key], $row)); ?>">
- datatable_listing_class / item/index.php – backoffice listing list row class
<tr class="<?php echo implode(' ', osc_apply_filter('datatable_listing_class', array(), $aRawRows[$key], $row)); ?>">
- datatable_alert_class / user/alert.php – backoffice alert list row class
<tr class="<?php echo implode(' ', osc_apply_filter('datatable_alert_class', array(), $aRawRows[$key], $row)); ?>">
- meta_generator / oc-load.php – Osclass generator meta tag
- limit_alert_items / controller / user.php – change number of listings returned with each alert. By default, 12 listings is returned (added in Osclass 8.0.2)
- public_items_per_page / controller / user-non-secure.php – change number of per page listings returned on public profile page. (added in Osclass 8.0.2)
- search_list_orders / helpers / hSearch.php – change predefined list (array) of order types/options (added in Osclass 8.0.2). Default options are: Newly listed, Lower price first, Higher price first.
- search_list_columns / model / Search.php – list of allowed columns for sorting (added in Osclass 8.0.2). Default values are i_price, dt_pub_date, dt_expiration.
- search_list_types / model / Search.php – list of allowed sorting types (added in Osclass 8.0.2). Default values are asc, desc.
- ipdata_service_map / osclass / functions.php – array with mapping for geo service (IP data) to retrieve country code and related data for subdomains.
- rtl_lang_codes / helpers / hDefines.php – array of rtl language codes (5-letter long) used to identify if language is on RTL list. Only used when b_rtl is not defined for language.
- subdomain_top_url / helpers / hDefines.php – URL used to navigate to top-level domain. Used when subdomains are activated. Example: https://domain.com/index.php?nored=1
- rewrite_rules_array_init / oc-includes / osclass / classes / Rewrite.php – List of rewrite rules read from DB on initialize. Can be modified, altered or added new rules. Array has structure $key => $value, where $key represent regex and $value represent redirect. See “List of default Osclass rewrite rules” section at bottom of this page.
- rewrite_rules_array_save / oc-includes / osclass / classes / Rewrite.php – List of rewrite rules right before they are saved into database.
- rss_add_item / oc-includes / osclass / classes / RSSFeed.php – Single item added into RSS items. (added in Osclass 8.2.0)
- rss_items / oc-includes / osclass / classes / RSSFeed.php – All RSS items before loop starts. (added in Osclass 8.2.0)
Extract of all known filters from code (Osclass 3.9)
login_admin_title
login_admin_url
login_admin_image
page_templates
admin_favicons
admin_item_title
admin_page_title
admin_item_description
admin_page_description
actions_manage_alerts
more_actions_manage_rules
rules_processing_row
comments_processing_row
actions_manage_items
items_processing_row
items_processing_reported_row
resource_path
media_processing_row
pages_processing_row
more_actions_manage_users
actions_manage_users
users_processing_row
email_legend_words
watermark_font_path
watermark_text_value
watermark_font_size
theme_url
style_url
contact_params
pre_show_item
pre_show_items
item_title
correct_login_url_redirect
email_description
save_latest_searches_pattern
moderator_access
theme
mo_core_path
mo_theme_path
mo_plugin_path
mo_theme_messages_path
mo_core_messages_path
email_alert_validation_title
email_alert_validation_description
email_alert_validation_title_after
email_alert_validation_description_after
alert_email_hourly_title
alert_email_hourly_description
alert_email_hourly_title_after
alert_email_hourly_description_after
alert_email_daily_title
alert_email_daily_description
alert_email_daily_title_after
alert_email_daily_description_after
alert_email_weekly_title
alert_email_weekly_description
alert_email_weekly_title_after
alert_email_weekly_description_after
alert_email_instant_title
alert_email_instant_description
alert_email_instant_title_after
alert_email_instant_description_after
email_comment_validated_title
email_comment_validated_title_after
email_comment_validated_description
email_comment_validated_description_after
email_new_item_non_register_user_title
email_new_item_non_register_user_title_after
email_new_item_non_register_user_description
email_new_item_non_register_user_description_after
email_user_forgot_pass_word_title
email_user_forgot_pass_word_title_after
email_user_forgot_password_description
email_user_forgot_password_description_after
email_user_registration_title
email_user_registration_title_after
email_user_registration_description
email_user_registration_description_after
email_title
email_new_email_title
email_new_email_title_after
email_new_email_description
email_new_email_description_after
email_user_validation_title
email_user_validation_title_after
email_send_friend_title
email_send_friend_title_after
email_send_friend_description
email_send_friend_description_after
email_item_inquiry_title
email_item_inquiry_title_after
email_item_inquiry_description
email_item_inquiry_description_after
email_new_comment_admin_title
email_new_comment_admin_title_after
email_item_validation_title
email_item_validation_title_after
email_item_validation_description
email_item_validation_description_after
email_admin_new_item_title
email_admin_new_item_title_after
email_admin_new_item_description
email_admin_new_item_description_after
email_item_validation_non_register_user_title
email_item_validation_non_register_user_title_after
email_item_validation_non_register_user_description
email_item_validation_non_register_user_description_after
email_admin_user_registration_title
email_admin_user_registration_title_after
email_admin_user_regsitration_description
email_admin_user_regsitration_description_after
email_item_inquiry_title
email_item_inquiry_title_after
email_item_inquiry_description
email_item_inquiry_description_after
email_new_comment_user_title
email_new_comment_user_title_after
email_new_comment_user_description
email_new_comment_user_description_after
email_new_admin_title
email_new_admin_title_after
email_new_admin_description
email_new_admin_description_after
email_warn_expiration_title
email_warn_expiration_title_after
email_warn_expiration_description
email_warn_expiration_description_after
email_after_auto_upgrade_title
email_after_auto_upgrade_title_after
email_after_auto_upgrade_description
email_after_auto_upgrade_description_after
osc_item_edit_meta_textarea_value_filter
meta_title_filter
meta_description_filter
meta_description_filter
current_admin_menu_
base_url
admin_base_url
item_price
flash_message_text
gettext
ngettext
user_menu_filter
item_add_prepare_data
pre_item_add_error
item_edit_prepare_data
pre_item_edit_error
item_prepare_data
upload_image_extension
upload_image_mime
slug
sql_search_conditions
sql_search_fields
sql_search_item_conditions
user_add_flash_error
init_send_mail
mail_from
mail_from_name
pre_send_mail
shutdown_functions
List of default Osclass rewrite rules
[^contact/?$] => index.php?page=contact [^feed/?$] => index.php?page=search&sFeed=rss [^feed/(.+)/?$] => index.php?page=search&sFeed=$1 [^language/(.*?)/?$] => index.php?page=language&locale=$1 [^search$] => index.php?page=search [^search/(.*)$] => index.php?page=search&sParams=$1 [^item/mark/(.*?)/([0-9]+)/?$] => index.php?page=item&action=mark&as=$1&id=$2 [^item/send-friend/([0-9]+)/?$] => index.php?page=item&action=send_friend&id=$1 [^item/contact/([0-9]+)/?$] => index.php?page=item&action=contact&id=$1 [^item/new/?$] => index.php?page=item&action=item_add [^item/new/([0-9]+)/?$] => index.php?page=item&action=item_add&catId=$1 [^item/activate/([0-9]+)/(.*?)/?$] => index.php?page=item&action=activate&id=$1&secret=$2 [^item/deactivate/([0-9]+)/(.*?)/?$] => index.php?page=item&action=deactivate&id=$1&secret=$2 [^item/renew/([0-9]+)/(.*?)/?$] => index.php?page=item&action=renew&id=$1&secret=$2 [^item/edit/([0-9]+)/(.*?)/?$] => index.php?page=item&action=item_edit&id=$1&secret=$2 [^item/delete/([0-9]+)/(.*?)/?$] => index.php?page=item&action=item_delete&id=$1&secret=$2 [^resource/delete/([0-9]+)/([0-9]+)/([0-9A-Za-z]+)/?(.*?)/?$] => index.php?page=item&action=deleteResource&id=$1&item=$2&code=$3&secret=$4 [^([a-z]{2})_([A-Z]{2})/.*/.*_i([0-9]+)\?comments-page=([0-9al]*)$] => index.php?page=item&id=$3&lang=$1_$2&comments-page=$4 [^.*/.*_i([0-9]+)\?comments-page=([0-9al]*)$] => index.php?page=item&id=$1&comments-page=$2 [^([a-z]{2})_([A-Z]{2})/.*/.*_i([0-9]+)$] => index.php?page=item&id=$3&lang=$1_$2 [^.*/.*_i([0-9]+)$] => index.php?page=item&id=$1 [^user/login/?$] => index.php?page=login [^user/dashboard/?$] => index.php?page=user&action=dashboard [^user/logout/?$] => index.php?page=main&action=logout [^user/register/?$] => index.php?page=register&action=register [^user/activate/([0-9]+)/(.*?)/?$] => index.php?page=register&action=validate&id=$1&code=$2 [^alert/confirm/([0-9]+)/([a-zA-Z0-9]+)/(.+)$] => index.php?page=user&action=activate_alert&id=$1&email=$3&secret=$2 [^user/profile/?$] => index.php?page=user&action=profile [^user/profile/([0-9]+)/?$] => index.php?page=user&action=pub_profile&id=$1 [^user/profile/(.+)/?$] => index.php?page=user&action=pub_profile&username=$1 [^user/items/?$] => index.php?page=user&action=items [^user/alerts/?$] => index.php?page=user&action=alerts [^user/recover/?$] => index.php?page=login&action=recover [^user/forgot/([0-9]+)/(.*)/?$] => index.php?page=login&action=forgot&userId=$1&code=$2 [^password/change/?$] => index.php?page=user&action=change_password [^email/change/?$] => index.php?page=user&action=change_email [^username/change/?$] => index.php?page=user&action=change_username [^email/confirm/([0-9]+)/(.*?)/?$] => index.php?page=user&action=change_email_confirm&userId=$1&code=$2 [^([\p{L}\p{N}_\-,]+)-p([0-9]+)/?$] => index.php?page=page&id=$2&slug=$1 [^([a-z]{2})_([A-Z]{2})/([\p{L}\p{N}_\-,]+)-p([0-9]+)/?$] => index.php?page=page&lang=$1_$2&id=$4&slug=$3 [^([a-z]{2})-([A-Z]{2})/([\p{L}\p{N}_\-,]+)-p([0-9]+)/?$] => index.php?page=page&lang=$1_$2&id=$4&slug=$3 [^([a-z]{2})/([\p{L}\p{N}_\-,]+)-p([0-9]+)/?$] => index.php?page=page&lang=$1&id=$3&slug=$2 [^(.+?)\.php(.*)$] => $1.php$2 [^(.+)/([0-9]+)$] => index.php?page=search&iPage=$2 [^(.+)/?$] => index.php?page=search&sCategory=$1 [^(.+)$] => index.php?page=search