Skip to main content

Developers

XenForo Class Proxy

As of XPress 1.1.3, all filters, hooks and API endpoints pass through the XenForo class proxy and can hence be extended using XenForo Class Extensions. You can find a full list of classes under:

  • /wp-content/plugins/wp-xpress-plugin/src/XPress/Action/
  • /wp-content/plugins/wp-xpress-plugin/src/XPress/Filter/
  • /wp-content/plugins/wp-xpress-plugin/src/XPress/API/

These class extensions can be used to overwrite and alter these code snippets. Please be aware that certain filters and API endpoints expect their output to remain in the right schema without verification.

Filters

As of XPress 1.1.3, we’ve added a number of 3rd party filters to hook into certain XPress output without hampering with the code directly A full list of filters can be found below:

xpress_registered_hooks

Arguments: $toRegister

A list of Actions, Filters and Shortcodes that will be registered by the XPress extension. Can be used to add extra items to the list or remove them. Certain items are expected to be present at code execution and removing them may break the bridge.

xpress_outwards_facing_ip

Arguments: $outwardsIp

Filters the IP that your server has facing outwards, which is used by XPress to identify API calls as internal calls.

xpress_api_user

Arguments: \WP_User $user

The WordPress user under which XPress executes its API calls. Is expected to be a WordPress administrator.

xpress_thread_reply_count

Arguments: $replyCount, $threadId

The number of replies a XenForo thread has or 0 if no thread exists.

xpress_thread_url

Arguments: $threadUrl, $threadId

The link to a XenForo thread by thread id.

xpress_post_link

Arguments: $commentLink, $comment, $post

The link to a XenForo thread associated with a given WordPress post.

xpress_post_link

Arguments: $commentLink, $comment

The link to a XenForo post associated with a given WordPress comment.

xpress_category_link

Arguments: $categoryLink, $categoryId

The link to a XenForo category associated with a given WordPress category.

xpress_style_property

Arguments: $value, $stylePropertyId

The value of a XenForo style property.

xpress_render_bb_code

Arguments. $finalHtml, $bbCode

The rendered output of BB Code.

xpress_html_to_bb_code

Arguments. $bbCode, $html, $htmlMaxLength

The BB code equivalent for a given HTML input.

xpress_editor_content

Arguments: $bbCodeContent, $htmlContent

The BB code content of a froala editor instance.

xpress_get_xf_user

Arguments: \XF\Entity\User $xfUser, \WP_User $wpUser

The XenForo user for a given WordPress user.

xpress_get_wp_user

Arguments: \WP_User $wpUser, \XF\Entity\User $xfUser

The WordPress user for a given XenForo user.