Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/05/2025 02:27:53 AM (6 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: docs & code formatting improvements.

Props johnjamesjacoby, noruzzaman.

Fixes #3659.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/akismet.php

    r7379 r7380  
    22
    33/**
    4  * Main bbPress Akismet Class
     4 * Main bbPress Akismet Class.
    55 *
    66 * @package bbPress
     
    1313if ( ! class_exists( 'BBP_Akismet' ) ) :
    1414/**
    15  * Loads Akismet extension
     15 * Loads Akismet extension.
    1616 *
    1717 * @since 2.0.0 bbPress (r3277)
     
    3232
    3333    /**
    34      * The main bbPress Akismet loader
     34     * The main bbPress Akismet loader.
    3535     *
    3636     * @since 2.0.0 bbPress (r3277)
     
    4141
    4242    /**
    43      * Setup the admin hooks
     43     * Setup the admin hooks.
    4444     *
    4545     * @since 2.0.0 bbPress (r3277)
     
    9090
    9191    /**
    92      * Converts topic/reply data into Akismet comment checking format
     92     * Converts topic/reply data into Akismet comment checking format.
    9393     *
    9494     * @since 2.0.0 bbPress (r3277)
     
    9696     * @param array $post_data
    9797     *
    98      * @return array Array of post data
     98     * @return array Array of post data.
    9999     */
    100100    public function check_post( $post_data = array() ) {
     
    272272
    273273    /**
    274      * Submit a post for spamming or hamming
     274     * Submit a post for spamming or hamming.
    275275     *
    276276     * @since 2.0.0 bbPress (r3277)
    277277     *
    278      * @param int $post_id
     278     * @param int $post_id Post id.
    279279     *
    280280     * @global string $akismet_api_host
     
    283283     * @global object $current_site
    284284     *
    285      * @return array Array of existing topic terms
     285     * @return array Array of existing topic terms.
    286286     */
    287287    public function submit_post( $post_id = 0 ) {
     
    438438
    439439    /**
    440      * Ping Akismet service and check for spam/ham response
     440     * Ping Akismet service and check for spam/ham response.
    441441     *
    442442     * @since 2.0.0 bbPress (r3277)
    443443     *
    444444     * @param array $post_data
    445      * @param string $check Accepts check|submit
    446      * @param string $spam Accepts spam|ham
     445     * @param string $check Accepts check|submit.
     446     * @param string $spam Accepts spam|ham.
    447447     *
    448448     * @global string $akismet_api_host
    449449     * @global string $akismet_api_port
    450450     *
    451      * @return array Array of post data
     451     * @return array Array of post data.
    452452     */
    453453    private function maybe_spam( $post_data = array(), $check = 'check', $spam = 'spam' ) {
     
    537537
    538538    /**
    539      * Update post meta after a spam check
     539     * Update post meta after a spam check.
    540540     *
    541541     * @since 2.0.0 bbPress (r3308)
    542542     *
    543      * @param int $post_id
     543     * @param int $post_id Post id.
    544544     * @param object $_post
    545545     *
     
    702702
    703703    /**
    704      * Update Akismet history of a Post
     704     * Update Akismet history of a Post.
    705705     *
    706706     * @since 2.0.0 bbPress (r3308)
     
    741741
    742742    /**
    743      * Get the Akismet history of a Post
     743     * Get the Akismet history of a Post.
    744744     *
    745745     * @since 2.0.0 bbPress (r3308)
     
    747747     * @param int $post_id
    748748     *
    749      * @return array Array of Akismet history
     749     * @return array Array of Akismet history.
    750750     */
    751751    public function get_post_history( $post_id = 0 ) {
     
    761761
    762762    /**
    763      * Handle any terms submitted with a post flagged as spam
     763     * Handle any terms submitted with a post flagged as spam.
    764764     *
    765765     * @since 2.0.0 bbPress (r3308)
    766766     *
    767      * @param string $terms Comma-separated list of terms
     767     * @param string $terms Comma-separated list of terms.
    768768     * @param int $topic_id
    769769     * @param int $reply_id
    770770     *
    771      * @return array Array of existing topic terms
     771     * @return array Array of existing topic terms.
    772772     */
    773773    public function filter_post_terms( $terms = '', $topic_id = 0, $reply_id = 0 ) {
     
    790790
    791791    /**
    792      * Submit data to Akismet service with unique bbPress User Agent
     792     * Submit data to Akismet service with unique bbPress User Agent.
    793793     *
    794794     * This code is directly taken from the akismet_http_post() function and
     
    797797     * @since 2.0.0 bbPress (r3466)
    798798     *
    799      * @param string $request The request we are sending
    800      * @param string $host The host to send our request to
    801      * @param string $path The path from the host
    802      * @param string $port The port to use
    803      * @param string $ip Optional Override $host with an IP address
    804      * @return mixed WP_Error on error, array on success, empty on failure
     799     * @param string $request The request we are sending.
     800     * @param string $host The host to send our request to.
     801     * @param string $path The path from the host.
     802     * @param string $port The port to use.
     803     * @param string $ip Optional Override $host with an IP address.
     804     * @return mixed WP_Error on error, array on success, empty on failure.
    805805     */
    806806    private function http_post( $request, $host, $path, $port = 80, $ip = '' ) {
     
    842842     * @since 2.6.7 (bbPress r7194)
    843843     *
    844      * @param string $host_and_path Scheme-less URL
    845      * @param array  $http_args     Array of arguments for wp_remote_post()
     844     * @param string $host_and_path Scheme-less URL.
     845     * @param array  $http_args     Array of arguments for wp_remote_post().
    846846     * @return array
    847847     */
     
    908908
    909909    /**
    910      * Return a user's roles on this site (including super_admin)
     910     * Return a user's roles on this site (including super_admin).
    911911     *
    912912     * @since 2.3.0 bbPress (r4812)
    913913     *
    914      * @param int $user_id
     914     * @param int $user_id User id.
    915915     *
    916916     * @return boolean
     
    943943
    944944    /**
    945      * Add Aksimet History meta-boxes to topics and replies
     945     * Add Aksimet History meta-boxes to topics and replies.
    946946     *
    947947     * @since 2.4.0 bbPress (r5049)
     
    971971
    972972    /**
    973      * Output for Akismet History meta-box
     973     * Output for Akismet History meta-box.
    974974     *
    975975     * @since 2.4.0 bbPress (r5049)
Note: See TracChangeset for help on using the changeset viewer.