Site icon Osclass Documentation & Knowledge Base

Filters

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}.

<tr class="<?php echo implode(' ', osc_apply_filter('datatable_user_class', array(), $aRawRows[$key], $row)); ?>">
<tr class="<?php echo implode(' ', osc_apply_filter('datatable_listing_class', array(), $aRawRows[$key], $row)); ?>">
<tr class="<?php echo implode(' ', osc_apply_filter('datatable_alert_class', array(), $aRawRows[$key], $row)); ?>">

TinyMCE image uploader related filters (oc-admin/themes/omega/):

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
search_cond_pattern (Osclass 8.2.0)
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