Filter: Stream Ad – allowed HTML

Hook
peepso_filter_advads_allowed_html

 

Plugin PeepSo Advanced Ads
Since 3.2.0.0
Status Active
Args
array

Description

Used to modify the list of HTML tags allowed in PeepSo Stream Ad type. The argument is an array of strings. There is no validation or cleanup, use only a-z characters (like iframe) and avoid using any special characters like spaces, braces etc.

Examples

Filter: profile navigation order

Hook
peepso_filter_navigation_profile_order

 

Plugin PeepSo Foundation
Since 3.0.0.0
Status Active
Args
array

Description

This filter is used to order the list of links built with peepso_navigation_profile. The argument is an array of strings – the unique keys representing the links.

The “Stream” and “About” tabs cannot be moved – they will always be displayed first. You are not required to specify all keys – omitted keys will fall back to their original sorting. It’s recommended to follow the array_merge() approach displayed below, to make sure other plugins can also use this filter successfully.

If you are using the WooCommerce Product Vendors plugin and wish to move the “Products” tab, you need to use filter priority higher than 10000.

Examples

Filter: enable or disable comment box

Hook
peepso_commentsbox_display

 

Plugin PeepSo Foundation
Since 1.2.0
Status Active
Args
bool
int

Description

Used to influence the decision whether the comment box should be displayed. The first argument is the current state of the enabled/disabled flag, and the second id the ID of the post.

Examples

Filter: media upload title & icon

Hook
peepso_filter_video_action_icon
peepso_filter_video_action_text
peepso_filter_audio_action_icon
peepso_filter_audio_action_text

 

Plugin PeepSo Audio & Video
Since 2.0.0
Status Active
Args
string

Description

When users upload video and audio files, the resulting activity title contains an action text, icon and user-entered title. The action text and icon are customizable with these four filters.

Modify the CSS of the icons to change the icon or hide it completely: peepso_filter_video_action_icon – modifies the CSS class of the video icon peepso_filter_audio_action_icon – modifies the CSS class of the audio icon

Modify the action text or disable it (with an empty string) peepso_filter_video_action_text – modifies the action text on a video post peepso_filter_audio_action_text – modifies the action text on an audio post

Examples

Filter: photo thumbnail sizes

Hook
peepso_filter_photos_thumb_settings

 

Plugin PeepSo Photos
Since 1.10.4
Status Active
Args
array

Description

Used to modify the size (in pixels) of thumbnails generated by PeepSo Photos.

Examples

Filter: profile navigation

Hook
peepso_navigation_profile

 

Plugin PeepSo Foundation
Since 1.8.5
Status Active
Args
array

Description

This filter is used to build a list of  links used in:

  • profile tabs
  • profile widget links
  • mobile profile sub-menu

All tabs are supposed to be the same in every context. It is not possible to sort the tabs – they are appended in the order of the filters firing – you can adjust that by using filter priority.

Each tab is identified by an unique key. By hooking into the filter and modifying the array after everything was processed, it’s also possible to delete or rename tabs to your liking.

Examples

Adding custom tabs

The peepso_navigation_profile filter only works in pair with a dedicated peepso_profile_segment_* action. Please refer to the PeepSo Hello World plugin – it contains example code showing exactly how to add tabs and the subsequent action hook required for rendering.

Deleting and renaming

Deleting a tab should not be treated as a security measure  – the URL related to the tab will still work, so if you are trying to implement access control, it should be done in the rendering action mentioned above.

Profile ownership

You can check ownership (for example to remove a tab if the viewer is not the owner)  by checking if get_current_user_id() is the same as $links['_user_id'].

Sorting

Tabs can be sorted with a final filter peepso_filter_navigation_profile_order.

Screenshot

Elements marked in red are managed by peepso_navigation, yellow marks peepso_navigation_profile. Mobile view on the left, desktop view on the right

peepso_navigation filter

peepso_navigation & peepso_navigation_profile

Filter: community navigation

Hook
peepso_navigation

 

Plugin PeepSo Foundation
Since 1.8.5
Status Active
Args
array

Description

This filter is used to build the

  • desktop toolbar
  • desktop notification area
  • mobile hamburger menu
  • mobile notification area
  • “community links” section of the profile widget

You can append a new key-value pair to the result array. Key must be an unique string identifying your plugin. Value is an array with the following keys:

    • required
      • href – the URL of the link
      • label – the text label
      • icon – CSS class of an icon. Needs to work both as <i> and <span> and is needed for icon-only and the widget
    • optional
      • class – CSS class of the parent element
      • icon-only – whether the link should be just an icon – label is then ignored
      • count – count of notifications

Each link added to the stack is also required to have five TRUE/FALSE flags deciding which area it should render in:

  • primary
  • secondary
  • mobile-primary
  • mobile-secondary
  • widget

See screenshot below for better explaination

Depending on TRUE/FALSE value of each key, the link will be rendered in the given area. Third parties are generally advised not to use the “secondary” positions, because the layout will most likely break.

With this filter it is possible to have different links in the toolbar and the widget, although for consistency a link should always show both in the primaries and the widget – with optional admin switches to disable them.

Examples

Screenshot

Elements marked in red are managed by peepso_navigation, yellow marks peepso_navigation_profile. Mobile view on the left, desktop view on the right

peepso_navigation filter

peepso_navigation & peepso_navigation_profile

Filter: custom cover size

Hook
peepso_filter_cover_sizes_to_delete

 

Plugin PeepSo Foundation
Since 1.11.4
Status Active
Args
array(int)

Description

To use a custom cover size in your theme or plugin, simply pass an integer to PeepSoUser::get_cover($value). Custom sized images are generated on-the-fly and stored in the user’s directory.

If you do use custom cover images by passing an integer to PeepSoUser::get_cover(), you should hook into this filter to make sure your custom sized cover is deleted when the user removes it.

Examples

Let’s say you use a custom sized cover of 666 somewhere in your plugin or theme:

Since PeepSo creates a file on-the-fly if needed, make sure the file is cleaned up when user removes his cover. To do that, you need to add your custom size to the array of integers.

Filter: country list

Hook
peepso_filter_countries

 

Plugin PeepSo Foundation
Since 2.0.0
Status Active
Args
array(string=>string)

Description

PeepSo is using the ISO-3166-1 alpha-2 standard for country codes. If you wish to remove, rename, add items to this list, you can use this filter.

The final country list will be sorted alphabetically.

Examples

Action: profile completeness changed

Hook
peepso_action_profile_completeness_change

 

Plugin PeepSo Foundation
Since 1.8.2
Status Active
Args
array

Description

Fires after user’s profile completeness percentage changes when saving a field.

Fires inside an AJAX call and all output is discarded. You can set transients, send notifications, write to database etc, but you cannot modify the AJAX output.

The argument is an array('before'⇒(int),'after'⇒(int) so you can (for example) make sure to fire your code only when the percentage goes up (or down).

This will NOT take into account admin adding/removing fields until user saves something in their profile. Profile completeness is recalculated ONLY when users modify their profiles.

Examples