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 “tabs” 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

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

Action: new reported content

Hook
peepso_after_login_form

 

Plugin PeepSo Foundation
Since 1.8.2
Status Active
Args
array

Description

Fires after a new report is filed, passes the array used to perform the insert.

Examples

Action: print after login form

Hook
peepso_after_login_form

 

Plugin PeepSo Foundation
Since 1.6.2
Status Active
Args
(none)

Description

Available in Welcome Screen and PeepSo Profile Widget for guest users.

Use it to print additional login/registration HTML – for example buttons for external login/registration handlers like Facebook.

Examples