diff --git a/.build-excludes b/.build-excludes index b1e9681..fb53173 100644 --- a/.build-excludes +++ b/.build-excludes @@ -7,7 +7,6 @@ build node_modules src/assets tests -vendor/typisttech .build-excludes .editorconfig .gitattributes diff --git a/.editorconfig b/.editorconfig index caa69d4..a98b2d7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,3 +9,7 @@ indent_style = tab [{*.txt,wp-config-sample.php}] end_of_line = crlf + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 55482b6..028c8b3 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -6,30 +6,25 @@ on: - develop jobs: - # Builds the package and creates artifact with dist files build: name: Build runs-on: ubuntu-latest steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - name: Checkout uses: actions/checkout@v2 - - name: Install OS dependencies - run: sudo apt-get install zip -y - - name: Setup variables - id: vars - run: | - echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)" - - name: Cache Composer - uses: actions/cache@v1 + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - path: ${{ steps.vars.outputs.composer-cache-path }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + php-version: '7.4' + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none - name: Install Composer dependencies - run: composer install -o --no-dev --no-progress + uses: "ramsey/composer-install@v2" + with: + composer-options: "--no-dev" + - name: Run Strauss + run: composer run-script prefix-namespaces-prod - name: Create build dir run: mkdir build - name: Copy files @@ -42,48 +37,7 @@ jobs: src: '.' dest: 'build' - name: Upload artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: - name: build + name: ${{ secrets.SLUG }}-dev path: build - - # Creates the dev package artifact from develop branch - pack: - name: Pack - runs-on: ubuntu-latest - needs: build - steps: - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: build - path: ${{ secrets.SLUG }} - - name: Create archive - run: | - zip -rq ${{ secrets.SLUG }}-dev.zip ${{ secrets.SLUG }} - - name: Upload artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ secrets.SLUG }}-dev - path: ${{ secrets.SLUG }}-dev.zip - - # Uploads the develop package to internal repository - upload: - name: Upload to repo - runs-on: ubuntu-latest - needs: pack - steps: - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: ${{ secrets.SLUG }}-dev - path: . - - name: Upload to repo - uses: Pendect/action-rsyncer@v1.1.0 - env: - DEPLOY_KEY: ${{ secrets.PACKAGES_DEPLOY_KEY }} - with: - flags: '-avz' - options: '--recursive ' - src: '.' - dest: '${{ secrets.BRACKETSPACE_REPO_RSYNC_URL }}${{ secrets.SLUG }}/' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15cbc10..7042d34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,6 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - name: Checkout master uses: actions/checkout@v1 with: @@ -33,17 +31,29 @@ jobs: run: git flow init -d - name: Start release run: git flow release start ${{ github.event.inputs.new_version }} - - name: Replace 2.0.0 tags with new version number + - name: Replace Next tags with new version number uses: jacobtomlinson/gha-find-replace@master with: find: "(?i)\\[Next\\]" replace: "${{ github.event.inputs.new_version }}" + - name: Replace stable tag in readme + uses: jacobtomlinson/gha-find-replace@master + with: + find: "Stable tag: [0-9]+.[0-9]+.[0-9]+" + replace: "Stable tag: ${{ github.event.inputs.new_version }}" + include: "readme.txt" - name: Replace version tag in main file uses: jacobtomlinson/gha-find-replace@master with: find: "Version: [0-9]+.[0-9]+.[0-9]+" replace: "Version: ${{ github.event.inputs.new_version }}" include: "${{ secrets.SLUG }}.php" + - name: Replace constant tag in Runtime file + uses: jacobtomlinson/gha-find-replace@master + with: + find: "VERSION = '[0-9]+.[0-9]+.[0-9]+'" + replace: "VERSION = '${{ github.event.inputs.new_version }}'" + include: "src/classes/Runtime.php" - name: Commit version bump run: git commit -am "Version bump" - name: Finish release diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index ed2a774..927b582 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -12,24 +12,20 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - name: Checkout uses: actions/checkout@v2 - - name: Install OS dependencies - run: sudo apt-get install zip -y - - name: Setup variables - id: vars - run: | - echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)" - - name: Cache Composer - uses: actions/cache@v1 + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - path: ${{ steps.vars.outputs.composer-cache-path }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + php-version: '7.4' + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none - name: Install Composer dependencies - run: composer install -o --no-dev --no-progress + uses: "ramsey/composer-install@v2" + with: + composer-options: "--no-dev" + - name: Run Strauss + run: composer run-script prefix-namespaces-prod - name: Create build dir run: mkdir build - name: Copy files @@ -42,7 +38,7 @@ jobs: src: '.' dest: 'build' - name: Upload artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: build path: build @@ -58,7 +54,7 @@ jobs: run: | echo "::set-output name=package-name::${{ secrets.SLUG }}-${GITHUB_REF#refs/tags/}" - name: Download artifact - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: build path: ${{ secrets.SLUG }} @@ -66,54 +62,11 @@ jobs: run: | zip -rq ${{ steps.vars.outputs.package-name }}.zip ${{ secrets.SLUG }} - name: Upload artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: ${{ steps.vars.outputs.package-name }} path: ${{ steps.vars.outputs.package-name }}.zip - # Uploads the stable package to internal repository - upload: - name: Upload to repo - runs-on: ubuntu-latest - needs: pack - steps: - - name: Setup variables - id: vars - run: | - echo "::set-output name=package-name::${{ secrets.SLUG }}-${GITHUB_REF#refs/tags/}" - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: ${{ steps.vars.outputs.package-name }} - path: . - - name: Upload to repo - uses: Pendect/action-rsyncer@v1.1.0 - env: - DEPLOY_KEY: ${{ secrets.PACKAGES_DEPLOY_KEY }} - with: - flags: '-avz' - options: '--recursive ' - src: '.' - dest: '${{ secrets.BRACKETSPACE_REPO_RSYNC_URL }}${{ secrets.SLUG }}/' - - # Deploys the stable tag to WordPress.org repository - wordpress-org-release: - name: Release on WordPress.org - runs-on: ubuntu-latest - needs: build - steps: - - name: Download artifact - uses: actions/download-artifact@v1 - with: - name: build - path: . - - name: Deploy to WordPress repository - uses: 10up/action-wordpress-plugin-deploy@1.4.0 - env: - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SLUG: ${{ secrets.SLUG }} - # Release on GitHub github-release: name: Release on GitHub @@ -127,21 +80,14 @@ jobs: run: | echo "::set-output name=version::${GITHUB_REF#refs/tags/}" echo "::set-output name=package-name::${{ secrets.SLUG }}-${GITHUB_REF#refs/tags/}" - - name: Parse changelog - run: | - START="= ${{ steps.vars.outputs.version }} =" - END="= [0-9]+.[0-9]+.[0-9]+ =|==|\$" - grep -oPz "(?s)${START}.*?\n\K.*?(?=${END})" changelog.txt > release-changelog.txt - truncate -s-2 changelog.txt - name: Download artifact - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: ${{ steps.vars.outputs.package-name }} path: . - name: Release uses: softprops/action-gh-release@v1 with: - body_path: release-changelog.txt files: ${{ steps.vars.outputs.package-name }}.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae2ed34..ab4a64e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,68 +4,59 @@ on: push jobs: phpcs: - name: WordPress Coding Standards + name: PHP Coding Standards runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - - name: Checkout - uses: actions/checkout@v2 - - name: Setup variables - id: vars - run: | - echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)" - - name: Cache Composer - uses: actions/cache@v1 - with: - path: ${{ steps.vars.outputs.composer-cache-path }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --no-progress - - name: Coding Standards - run: composer phpcs - php-lint: - name: PHP Lint + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + - name: Install Composer dependencies + uses: "ramsey/composer-install@v2" + - name: Coding Standards + run: composer phpcs + phpstan: + name: PHPStan runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - - name: Checkout - uses: actions/checkout@v2 - - name: Setup variables - id: vars - run: | - echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)" - - name: Cache Composer - uses: actions/cache@v1 - with: - path: ${{ steps.vars.outputs.composer-cache-path }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --no-progress - - name: Coding Standards - run: composer phpcs - php-compat: - name: PHP Compatibility + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + - name: Install Composer dependencies + uses: "ramsey/composer-install@v2" + - name: Analyze + run: composer phpstan + phplint: + name: PHP Lint runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - - name: Set PHP version - run: sudo update-alternatives --set php /usr/bin/php7.4 - - name: Checkout - uses: actions/checkout@v2 - - name: Setup variables - id: vars - run: | - echo "::set-output name=composer-cache-path::$(composer config cache-files-dir)" - - name: Cache Composer - uses: actions/cache@v1 - with: - path: ${{ steps.vars.outputs.composer-cache-path }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - name: Install dependencies - run: composer install --no-progress - - name: Coding Standards - run: composer phpcompat + - name: Checkout + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + - name: Install Composer dependencies + uses: "ramsey/composer-install@v2" + - name: Lint + run: composer phplint diff --git a/.gitignore b/.gitignore index 5d12c9a..30ba7ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,11 @@ ### Project ### composer.lock +yarn.lock *.log +/dependencies/* +!/dependencies/.gitkeep node_modules/ -/dist +resources/*/dist/ /vendor ### Windows ### diff --git a/.wordpress-org/banner-1544x500.png b/.wordpress-org/banner-1544x500.png deleted file mode 100644 index 15085b4..0000000 Binary files a/.wordpress-org/banner-1544x500.png and /dev/null differ diff --git a/.wordpress-org/banner-772x250.png b/.wordpress-org/banner-772x250.png deleted file mode 100644 index 024ec31..0000000 Binary files a/.wordpress-org/banner-772x250.png and /dev/null differ diff --git a/.wordpress-org/icon-128x128.png b/.wordpress-org/icon-128x128.png deleted file mode 100644 index ef13e89..0000000 Binary files a/.wordpress-org/icon-128x128.png and /dev/null differ diff --git a/.wordpress-org/icon-256x256.png b/.wordpress-org/icon-256x256.png deleted file mode 100644 index e7f19df..0000000 Binary files a/.wordpress-org/icon-256x256.png and /dev/null differ diff --git a/.wordpress-org/icon.svg b/.wordpress-org/icon.svg deleted file mode 100644 index 3c87493..0000000 --- a/.wordpress-org/icon.svg +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - buddypress - - - - - - - - - - - - - - - - - - - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d1094ca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,43 @@ +# How to Contribute + +Thank you for taking the time to contribute to our project. We're thrilled to share our work with you and hope you'll enjoy sharing your work with us! Here's a bunch of useful information for you to start. + +## Gitflow + +We use [Gitflow](https://danielkummer.github.io/git-flow-cheatsheet/) on each of our projects. According to the basic assumptions of this workflow, here are the steps that you need to take when developing a new feature: + +1. Create a new branch from `develop` +2. Work on this branch until your feature is finished +3. Rebase your branch onto current `develop` +4. Create a Pull Request and wait for the Code Review +5. Iterate with all needed changes and fixes +6. Enjoy your branch being merged once accepted + +### Branch names + +Typically, branches are named after the developed feature, i.e. `feature/Name-of-the-Feature` and so we do. + +## Conventional Commits + +We're following the rule of [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +A well-formed git commit description line should always be able to complete the following sentence: +> When applied, this commit should *\* + +## Pull Requests + +When you're done with developing your feature, you should create a [Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) and wait for your code to be reviewed. Once all the changes and fixes will be applied, the PR will be merged into the develop branch. + +### PR size + +Create PRs as small as they can possibly be. Create as much of them as you need. This makes them easier to review and less likely to cause serious merge conflicts. + +## Changelog + +We appreciate it if you keep the changelog for every change. + +Changelog usually lives in `readme.txt` files when it comes to a plugin, or it is in `CHANGELOG.md`. New sections (unreleased changes) can be marked as `3.0.0`. It will be changed to the next version number when a new version is released. + +*** + +And that's it for the basic information you need. Thanks! diff --git a/compat/buddypress-stubs.php b/compat/buddypress-stubs.php new file mode 100644 index 0000000..74855cd --- /dev/null +++ b/compat/buddypress-stubs.php @@ -0,0 +1,73078 @@ +id}-awesome.php" and you could use + * bp_is_active( $this->id, 'awesome' ) to determine if the feature is active. + * @type string $search_query_arg String to be used as the query argument in component search URLs. + * } + */ + public function start($id = '', $name = '', $path = '', $params = array()) + { + } + /** + * Set up component global variables. + * + * @since 1.5.0 + * @since 2.0.0 Adds the `$directory_title` argument to the `$args` parameter. + * @since 9.0.0 Adds the `$block_globals` argument to the `$args` parameter. + * @since 12.0.0 Adds the `$rewrite_ids` argument to the `$args` parameter. + * + * @param array $args { + * All values are optional. + * @type string $slug The component slug. Used to construct certain URLs, such as 'friends' in + * http://example.com/members/joe/friends/. Default: the value of $this->id. + * @type string $root_slug The component root slug. Note that this value is generally unused if the + * component has a root directory (the slug will be overridden by the + * post_name of the directory page). Default: the slug of the directory page + * if one is found, otherwise an empty string. + * @type bool $has_directory Set to true if the component requires an associated WordPress page. + * @type array $rewrite_ids The list of rewrited IDs to use for the component. + * @type string $directory_title The title to use for the directory page. + * @type callable $notification_callback The callable function that formats the component's notifications. + * @type string $search_string The placeholder text for the directory search box. Eg: 'Search Groups...'. + * @type array $global_tables An array of database table names. + * @type array $meta_tables An array of metadata table names. + * @type array $block_globals An array of globalized data for BP Blocks. + * } + */ + public function setup_globals($args = array()) + { + } + /** + * Include required files. + * + * Please note that, by default, this method is fired on the bp_include + * hook, with priority 8. This is necessary so that core components are + * loaded in time to be available to third-party plugins. However, this + * load order means that third-party plugins whose main files are + * loaded at bp_include with priority 10 (as recommended), will not be + * loaded in time for their includes() method to fire automatically. + * + * For this reason, it is recommended that your plugin has its own + * method or function for requiring necessary files. If you must use + * this method, you will have to call it manually in your constructor + * class, ie + * $this->includes(); + * + * Note that when you pass an array value like 'actions' to includes, + * it looks for the following three files (assuming your component is + * called 'my_component'): + * - ./actions + * - ./bp-my_component/actions + * - ./bp-my_component/bp-my_component-actions.php + * + * @since 1.5.0 + * + * @param array $includes An array of file names, or file name chunks, + * to be parsed and then included. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Components should include files here only on specific pages using + * conditionals such as {@link bp_is_current_component()}. Intentionally left + * empty. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up the actions. + * + * @since 1.5.0 + */ + public function setup_actions() + { + } + /** + * Set up the canonical URL stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() + { + } + /** + * Registers nav items globalizing them into `BP_Component::$main_nav` & `BP_Component::$sub_nav` properties. + * + * @since 12.0.0 + * + * @param array $main_nav Optional. Passed directly to bp_core_new_nav_item(). + * See that function for a description. + * @param array $sub_nav Optional. Multidimensional array, each item in + * which is passed to bp_core_new_subnav_item(). See that + * function for a description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.5.0 + * @since 12.0.0 Uses the registered navigations to generate it. + * + * @param array $main_nav Optional. Passed directly to bp_core_new_nav_item(). + * See that function for a description. + * @param array $sub_nav Optional. Multidimensional array, each item in + * which is passed to bp_core_new_subnav_item(). See that + * function for a description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see WP_Admin_Bar::add_menu() for a description of the syntax + * required by each item in the $wp_admin_nav parameter array. + * + * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + * + * @param array $wp_admin_nav An array of nav item arguments. Each item in this parameter + * array is passed to {@link WP_Admin_Bar::add_menu()}. + * See that method for a description of the required syntax for + * each item. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the component title. + * + * @since 1.5.0 + */ + public function setup_title() + { + } + /** + * Setup component-specific cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Register global tables for the component, so that it may use WordPress's database API. + * + * @since 2.0.0 + * + * @param array $tables Table names to register. + */ + public function register_global_tables($tables = array()) + { + } + /** + * Register component metadata tables. + * + * Metadata tables are registered in the $wpdb global, for + * compatibility with the WordPress metadata API. + * + * @since 2.0.0 + * + * @param array $tables Table names to register. + */ + public function register_meta_tables($tables = array()) + { + } + /** + * Set up the component post types. + * + * @since 1.5.0 + */ + public function register_post_types() + { + } + /** + * Set up the component post statuses. + * + * @since 12.0.0 + */ + public function register_post_statuses() + { + } + /** + * Register component-specific taxonomies. + * + * @since 1.5.0 + */ + public function register_taxonomies() + { + } + /** + * Add Component's additional rewrite tags. + * + * @since 1.5.0 + * @since 12.0.0 Adds the `$rewrite_tags` parameter. + * + * @param array $rewrite_tags Array of arguments list used to add WordPress rewrite tags. + * Each argument key needs to match one of `$this->rewrite_ids` keys. + */ + public function add_rewrite_tags($rewrite_tags = array()) + { + } + /** + * Add Component's additional rewrite rules. + * + * @since 1.9.0 + * @since 12.0.0 Adds the `$rewrite_rules` parameter. + * + * @param array $rewrite_rules { + * Array of associative arrays of arguments list used to add WordPress rewrite rules. + * Each associative array needs to include the following keys. + * + * @type string $regex Regular expression to match request against. Required. + * @type string $query The corresponding query vars for this rewrite rule. Required. + * @type int $order The insertion order for the rewrite rule. Required. + * @type string $priority The Priority of the new rule. Accepts 'top' or 'bottom'. Optional. + * Default 'top'. + * } + */ + public function add_rewrite_rules($rewrite_rules = array()) + { + } + /** + * Add Component's permalink structures. + * + * @since 1.9.0 + * @since 12.0.0 Adds the `$permastructs` parameter. + * + * @param array $permastructs { + * Array of associative arrays of arguments list used to register WordPress additional permalink structures. + * Each array enty is keyed with the permalink structure. + * Each associative array needs to include the following keys. + * + * @type string $permastruct The permalink structure. Required. + * @type array $args The permalink structure arguments. Optional. + * } + */ + public function add_permastructs($permastructs = array()) + { + } + /** + * Allow components to parse the main query. + * + * @since 1.9.0 + * + * @param object $query The main WP_Query. + */ + public function parse_query($query) + { + } + /** + * Make sure to avoid querying for regular posts when displaying a BuddyPress page. + * + * @since 12.0.0 + * + * @param null $posts A null value to use the regular WP Query. + * @param WP_Query $query The WP Query object. + * @return null|array Null if not displaying a BuddyPress page. + * An array containing the BuddyPress directory page otherwise. + */ + public function pre_query($posts = \null, $query = \null) + { + } + /** + * Generate any additional rewrite rules. + * + * @since 1.5.0 + */ + public function generate_rewrite_rules() + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * + * @param array $controllers The list of BP REST controllers to load. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Blocks. + * + * @since 6.0.0 + * + * @see `BP_Block->construct()` for a full description of a BP Block arguments. + * + * @param array $blocks The list of BP Blocks to register. + */ + public function blocks_init($blocks = array()) + { + } + /** + * Add component's directory states. + * + * @since 10.0.0 + * @deprecated 12.0.0 + * + * @param string[] $states An array of post display states. + * @return array The component's directory states. + */ + public function admin_directory_states($states = array()) + { + } + } + /** + * Creates our Blogs component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Blogs_Component extends \BP_Component + { + /** + * Start the blogs component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Set up global settings for the blogs component. + * + * The BP_BLOGS_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals($args = array()) + { + } + /** + * Include bp-blogs files. + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.5.0 + * @since 12.0.0 Used to customize the main navigation name. + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up bp-blogs integration with the WordPress admin bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_admin_bar() for a description of arguments. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() + * for description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and . + */ + public function setup_title() + { + } + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Add the Blog Create rewrite tags. + * + * @since 12.0.0 + * + * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for + * description. + */ + public function add_rewrite_tags($rewrite_tags = array()) + { + } + /** + * Add the Registration and Activation rewrite rules. + * + * @since 12.0.0 + * + * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for + * description. + */ + public function add_rewrite_rules($rewrite_rules = array()) + { + } + /** + * Parse the WP_Query and eventually display the component's directory or single item. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. See BP_Component::parse_query() for + * description. + */ + public function parse_query($query) + { + } + /** + * Init the BP REST API. + * + * @since 6.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Blogs Blocks. + * + * @since 9.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * List table class for signups network admin page. + * + * @since 2.0.0 + */ + class BP_Members_MS_List_Table extends \WP_MS_Users_List_Table + { + /** + * Signup counts. + * + * @since 2.0.0 + * + * @var int + */ + public $signup_counts = 0; + /** + * Signup profile fields. + * + * @since 10.0.0 + * + * @var array + */ + public $signup_field_labels = array(); + /** + * Constructor. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 2.0.0 + * + * @global string $usersearch The users search terms. + * @global string $mode The display mode. + */ + public function prepare_items() + { + } + /** + * Display the users screen views + * + * @since 2.5.0 + * + * @global string $role The name of role the users screens is filtered by + */ + public function views() + { + } + /** + * Specific signups columns. + * + * @since 2.0.0 + * + * @return array + */ + public function get_columns() + { + } + /** + * Specific bulk actions for signups. + * + * @since 2.0.0 + */ + public function get_bulk_actions() + { + } + /** + * The text shown when no items are found. + * + * Nice job, clean sheet! + * + * @since 2.0.0 + */ + public function no_items() + { + } + /** + * The columns signups can be reordered with. + * + * @since 2.0.0 + */ + public function get_sortable_columns() + { + } + /** + * Display signups rows. + * + * @since 2.0.0 + */ + public function display_rows() + { + } + /** + * Display a signup row. + * + * @since 2.0.0 + * + * @see WP_List_Table::single_row() for explanation of params. + * + * @param object|null $signup_object Signup user object. + * @param string $style Styles for the row. + */ + public function single_row($signup_object = \null, $style = '') + { + } + /** + * Prevents regular users row actions to be output. + * + * @since 2.4.0 + * + * @param object|null $signup_object Signup being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. + * @return string + */ + protected function handle_row_actions($signup_object = \null, $column_name = '', $primary = '') + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_cb($signup_object = \null) + { + } + /** + * The row actions (delete/activate/email). + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_username($signup_object = \null) + { + } + /** + * Display user name, if any. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_name($signup_object = \null) + { + } + /** + * Display user email. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_email($signup_object = \null) + { + } + /** + * Display registration date. + * + * @since 2.0.0 + * + * @global string $mode The display mode. + * + * @param object|null $signup_object The signup data object. + */ + public function column_registered($signup_object = \null) + { + } + /** + * Display the last time an activation email has been sent. + * + * @since 2.0.0 + * + * @global string $mode The display mode. + * + * @param object|null $signup_object Signup object instance. + */ + public function column_date_sent($signup_object = \null) + { + } + /** + * Display number of time an activation email has been sent. + * + * @since 2.0.0 + * + * @param object|null $signup_object Signup object instance. + */ + public function column_count_sent($signup_object = \null) + { + } + /** + * Allow plugins to add their custom column. + * + * @since 2.1.0 + * + * @param object|null $signup_object The signup data object. + * @param string $column_name The column name. + * @return string + */ + function column_default($signup_object = \null, $column_name = '') + { + } + } + /** + * The main theme compat class for BuddyPress Registration. + * + * This class sets up the necessary theme compatibility actions to safely output + * registration template parts to the_title and the_content areas of a theme. + * + * @since 1.7.0 + */ + class BP_Registration_Theme_Compat + { + /** + * Setup the groups component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() + { + } + /** + * Are we looking at either the registration or activation pages? + * + * @since 1.7.0 + */ + public function is_registration() + { + } + /** Template ***********************************************************/ + /** + * Add template hierarchy to theme compat for registration/activation pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function template_hierarchy($templates) + { + } + /** + * Update the global $post with dummy data. + * + * @since 1.7.0 + */ + public function dummy_post() + { + } + /** + * Filter the_content with either the register or activate templates. + * + * @since 1.7.0 + */ + public function dummy_content() + { + } + } + /** + * The main membership invitations template loop class. + * + * Responsible for loading a group of membership invitations into a loop for display. + * + * @since 8.0.0 + */ + class BP_Members_Invitations_Template + { + /** + * The loop iterator. + * + * @since 8.0.0 + * @var int + */ + public $current_invitation = -1; + /** + * The number of invitations returned by the paged query. + * + * @since 8.0.0 + * @var int + */ + public $current_invitation_count; + /** + * Total number of invitations matching the query. + * + * @since 8.0.0 + * @var int + */ + public $total_invitation_count; + /** + * Array of network invitations located by the query. + * + * @since 8.0.0 + * @var array + */ + public $invitations; + /** + * The invitation object currently being iterated on. + * + * @since 8.0.0 + * @var object + */ + public $invitation; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 8.0.0 + * @var bool + */ + public $in_the_loop; + /** + * The ID of the user to whom the displayed invitations were sent. + * + * @since 8.0.0 + * @var int + */ + public $user_id; + /** + * The ID of the user to whom the displayed invitations belong. + * + * @since 8.0.0 + * @var int + */ + public $inviter_id; + /** + * The page number being requested. + * + * @since 8.0.0 + * @var int + */ + public $pag_page; + /** + * The $_GET argument used in URLs for determining pagination. + * + * @since 8.0.0 + * @var int + */ + public $pag_arg; + /** + * The number of items to display per page of results. + * + * @since 8.0.0 + * @var int + */ + public $pag_num; + /** + * An HTML string containing pagination links. + * + * @since 8.0.0 + * @var string + */ + public $pag_links; + /** + * A string to match against. + * + * @since 8.0.0 + * @var string + */ + public $search_terms; + /** + * A database column to order the results by. + * + * @since 8.0.0 + * @var string + */ + public $order_by; + /** + * The direction to sort the results (ASC or DESC). + * + * @since 8.0.0 + * @var string + */ + public $sort_order; + /** + * Array of variables used in this invitation query. + * + * @since 8.0.0 + * @var array + */ + public $query_vars; + /** + * Constructor method. + * + * @see bp_has_members_invitations() For information on the array format. + * + * @since 8.0.0 + * + * @param array $args { + * An array of arguments. See {@link bp_has_members_invitations()} + * for more details. + * } + */ + public function __construct($args = array()) + { + } + /** + * Whether there are invitations available in the loop. + * + * @since 8.0.0 + * + * @see bp_has_members_invitations() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_invitations() + { + } + /** + * Set up the next invitation and iterate index. + * + * @since 8.0.0 + * + * @return object The next invitation to iterate over. + */ + public function next_invitation() + { + } + /** + * Rewind the blogs and reset blog index. + * + * @since 8.0.0 + */ + public function rewind_invitations() + { + } + /** + * Whether there are invitations left in the loop to iterate over. + * + * This method is used by {@link bp_members_invitations()} as part of the + * while loop that controls iteration inside the invitations loop, eg: + * while ( bp_members_invitations() ) { ... + * + * @since 8.0.0 + * + * @see bp_members_invitations() + * + * @return bool True if there are more invitations to show, + * otherwise false. + */ + public function invitations() + { + } + /** + * Set up the current invitation inside the loop. + * + * Used by {@link bp_the_invitation()} to set up the current + * invitation data while looping, so that template tags used during + * that iteration make reference to the current invitation. + * + * @since 8.0.0 + * + * @see bp_the_invitation() + */ + public function the_invitation() + { + } + } + /** + * List table class for signups admin page. + * + * @since 2.0.0 + */ + class BP_Members_List_Table extends \WP_Users_List_Table + { + /** + * Signup counts. + * + * @since 2.0.0 + * + * @var int + */ + public $signup_counts = 0; + /** + * Signup profile fields. + * + * @since 10.0.0 + * + * @var array + */ + public $signup_field_labels = array(); + /** + * Constructor. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 2.0.0 + * + * @global string $usersearch The users search terms. + */ + public function prepare_items() + { + } + /** + * Display the users screen views + * + * @since 2.5.0 + * + * @global string $role The name of role the users screens is filtered by. + */ + public function views() + { + } + /** + * Get rid of the extra nav. + * + * WP_Users_List_Table will add an extra nav to change user's role. + * As we're dealing with signups, we don't need this. + * + * @since 2.0.0 + * + * @param array $which Current table nav item. + */ + public function extra_tablenav($which) + { + } + /** + * Specific signups columns. + * + * @since 2.0.0 + * + * @return array + */ + public function get_columns() + { + } + /** + * Specific bulk actions for signups. + * + * @since 2.0.0 + */ + public function get_bulk_actions() + { + } + /** + * The text shown when no items are found. + * + * Nice job, clean sheet! + * + * @since 2.0.0 + */ + public function no_items() + { + } + /** + * The columns signups can be reordered with. + * + * @since 2.0.0 + */ + public function get_sortable_columns() + { + } + /** + * Display signups rows. + * + * @since 2.0.0 + */ + public function display_rows() + { + } + /** + * Display a signup row. + * + * @since 2.0.0 + * + * @see WP_List_Table::single_row() for explanation of params. + * + * @param object|null $signup_object Signup user object. + * @param string $style Styles for the row. + * @param string $role Role to be assigned to user. + * @param int $numposts Numper of posts. + */ + public function single_row($signup_object = \null, $style = '', $role = '', $numposts = 0) + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_cb($signup_object = \null) + { + } + /** + * The row actions (delete/activate/email). + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_username($signup_object = \null) + { + } + /** + * Display user name, if any. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_name($signup_object = \null) + { + } + /** + * Display user email. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_email($signup_object = \null) + { + } + /** + * Display registration date. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_registered($signup_object = \null) + { + } + /** + * Display the last time an activation email has been sent. + * + * @since 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_date_sent($signup_object = \null) + { + } + /** + * Display number of times an activation email has been sent. + * + * @since 2.0.0 + * + * @param object|null $signup_object Signup object instance. + */ + public function column_count_sent($signup_object = \null) + { + } + /** + * Allow plugins to add their custom column. + * + * @since 2.1.0 + * + * @param object|null $signup_object The signup data object. + * @param string $column_name The column name. + * @return string + */ + function column_default($signup_object = \null, $column_name = '') + { + } + } + /** + * Members Widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + */ + class BP_Core_Members_Widget + { + /** + * Constructor method. + * + * @since 1.5.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Enqueue scripts. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function enqueue_scripts() + { + } + /** + * Display the Members widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @see WP_Widget::widget() for description of parameters. + * + * @param array $args Widget arguments. + * @param array $instance Widget settings, as saved by the user. + */ + public function widget($args, $instance) + { + } + /** + * Update the Members widget options. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $new_instance The new instance options. + * @param array $old_instance The old instance options. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Output the Members widget options form. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function form($instance) + { + } + /** + * Merge the widget settings into defaults array. + * + * @since 2.3.0 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function parse_settings($instance = array()) + { + } + } + /** + * BuddyPress Members endpoints. + * + * /members/ + * /members/{id} + * + * @since 5.0.0 + */ + class BP_REST_Members_Endpoint extends \WP_REST_Users_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Registers the routes for the objects of the controller. + * + * @since 7.0.0 + * + * @see register_rest_route() + */ + public function register_routes() + { + } + /** + * Retrieve users. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Checks if a given request has access to get all users. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieves a single member. + * + * @since 7.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + */ + public function get_item($request) + { + } + /** + * Checks if a given request has access to read a user. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Checks if a given request has access create members. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Check if a given request has access to update a member. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Check if a given request has access to delete a member. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Checks if a given request has access to delete the current user. + * + * @since 5.0.0 + * @since 0.7.0 Do implement this method. + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. + */ + public function delete_current_item_permissions_check($request) + { + } + /** + * Deletes the current user. + * + * @since 5.0.0 + * @since 0.7.0 Do implement this method. + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + */ + public function delete_current_item($request) + { + } + /** + * Prepares a single user output for response. + * + * @since 5.0.0 + * + * @param WP_User $user User object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($user, $request) + { + } + /** + * Prepares links for the user request. + * + * @since 11.0.0 + * + * @param WP_User $user User object. + * @param array $user_data User data. + * @return array + */ + protected function prepare_links($user, $user_data = array()) + { + } + /** + * Method to facilitate fetching of user data. + * + * This was abstracted to be used in other BuddyPress endpoints. + * + * @since 5.0.0 + * @since 7.0.0 Add the `$request` parameter. + * + * @param WP_User $user User object. + * @param string $context The context of the request. Defaults to 'view'. + * @param WP_REST_Request $request Full details about the request. + * @return array + */ + public function user_data($user, $context, $request) + { + } + /** + * Prepares a single user for creation or update. + * + * @todo Improve sanitization and schema verification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Request object. + * @return stdClass + */ + protected function prepare_item_for_database($request) + { + } + /** + * Get XProfile info from the user. + * + * @since 5.0.0 + * + * @param int $user_id User ID. + * @return array + */ + protected function xprofile_data($user_id) + { + } + /** + * Can user manage (delete/update) a member? + * + * @since 5.0.0 + * + * @param WP_User $user User object. + * @param string $action The action to perform (update or delete). + * @return bool + */ + protected function can_manage_member($user, $action = 'delete') + { + } + /** + * Updates the values of additional fields added to a data object. + * + * This function makes sure updating the field value thanks to the `id` property of + * the created/updated object type is consistent accross BuddyPress components. + * + * @since 5.0.0 + * + * @param WP_User $user The WordPress user object. + * @param WP_REST_Request $request Full details about the request. + * @return bool|WP_Error True on success, WP_Error object if a field cannot be updated. + */ + protected function update_additional_fields_for_object($user, $request) + { + } + /** + * Make sure to retrieve the needed arguments for the endpoint CREATABLE method. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the members schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Member Avatar endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Attachments_Member_Avatar_Endpoint extends \WP_REST_Controller + { + use \BP_REST_Attachments; + /** + * BP_Attachment_Avatar Instance. + * + * @since 5.0.0 + * + * @var BP_Attachment_Avatar + */ + protected $avatar_instance; + /** + * Member object. + * + * @since 5.0.0 + * + * @var WP_User + */ + protected $user; + /** + * Member object type. + * + * @since 5.0.0 + * + * @var string + */ + protected $object = 'user'; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Fetch an existing member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Checks if a given request has access to get a member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Upload a member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to upload a member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Delete an existing member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Checks if a given request has access to delete member avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares avatar data to return as an object. + * + * @since 5.0.0 + * + * @param object $avatar Avatar object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($avatar, $request) + { + } + /** + * Get the member avatar schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for the `get_item`. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_collection_params() + { + } + } + /** + * List table class for Invitations admin page. + * + * @since 8.0.0 + */ + class BP_Members_Invitations_List_Table extends \WP_Users_List_Table + { + /** + * The type of view currently being displayed. + * + * E.g. "All", "Pending", "Sent", "Unsent"... + * + * @since 8.0.0 + * @var string + */ + public $active_filters = array(); + /** + * Invitation counts. + * + * @since 8.0.0 + * @var int + */ + public $total_items = 0; + /** + * Constructor. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 8.0.0 + */ + public function prepare_items() + { + } + /** + * Gets the name of the default primary column. + * + * @since 10.1.0 + * + * @return string Name of the default primary column, in this case, 'invitee_email'. + */ + protected function get_default_primary_column_name() + { + } + /** + * Get the list of views available on this table (e.g. "all", "public"). + * + * @since 8.0.0 + */ + public function views() + { + } + /** + * Get rid of the extra nav. + * + * WP_Users_List_Table will add an extra nav to change user's role. + * As we're dealing with invitations, we don't need this. + * + * @since 8.0.0 + * + * @param array $which Current table nav item. + */ + public function extra_tablenav($which) + { + } + /** + * Specific signups columns. + * + * @since 8.0.0 + * + * @return array + */ + public function get_columns() + { + } + /** + * Specific bulk actions for signups. + * + * @since 8.0.0 + */ + public function get_bulk_actions() + { + } + /** + * The text shown when no items are found. + * + * Nice job, clean sheet! + * + * @since 8.0.0 + */ + public function no_items() + { + } + /** + * The columns invitations can be reordered by. + * + * @since 8.0.0 + */ + public function get_sortable_columns() + { + } + /** + * Display invitation rows. + * + * @since 8.0.0 + */ + public function display_rows() + { + } + /** + * Display an invitation row. + * + * @since 8.0.0 + * + * @see WP_List_Table::single_row() for explanation of params. + * + * @param BP_Invitation $invite BP_Invitation object. + * @param string $style Styles for the row. + * @param string $role Role to be assigned to user. + * @param int $numposts Number of posts. + */ + public function single_row($invite = \null, $style = '', $role = '', $numposts = 0) + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_cb($invite = \null) + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_invitee_email($invite = \null) + { + } + /** + * Display invited user's email address. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_email($invite = \null) + { + } + /** + * The inviter. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_username($invite = \null) + { + } + /** + * Display invitation date. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_inviter_registered_date($invite = \null) + { + } + /** + * Display invitation date. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_invitation_date_modified($invite = \null) + { + } + /** + * Display invitation date. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_invitation_sent($invite = \null) + { + } + /** + * Display invitation acceptance status. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + */ + public function column_invitation_accepted($invite = \null) + { + } + /** + * Allow plugins to add their custom column. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite BP_Invitation object. + * @param string $column_name The column name. + * @return string + */ + function column_default($invite = \null, $column_name = '') + { + } + } + /** + * Defines the BuddyPress Members Component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Members_Component extends \BP_Component + { + /** + * Member types. + * + * @see bp_register_member_type() + * + * @since 2.2.0 + * @var array + */ + public $types = array(); + /** + * Main nav arguments. + * + * @since 2.2.0 + * @var array + */ + public $main_nav = array(); + /** + * Main nav arguments. + * + * @since 2.2.0 + * @var array + */ + public $sub_nav = array(); + /** + * Nav for the members component. + * + * @since 2.2.0 + * @var BP_Core_Nav + */ + public $nav; + /** + * Member admin. + * + * @since 2.0.0 + * @var BP_Members_Admin + */ + public $admin; + /** + * Invitations. + * + * @var stdClass + */ + public $invitations; + /** + * Start the members component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include bp-members files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up the component actions. + * + * @since 12.0.0 + */ + public function setup_actions() + { + } + /** + * Set up additional globals for the component. + * + * @since 10.0.0 + */ + public function setup_additional_globals() + { + } + /** + * Set up bp-members global settings. + * + * The BP_MEMBERS_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @global wpdb $wpdb The WordPress database object. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals($args = array()) + { + } + /** + * Set up canonical stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() + { + } + /** + * Get the Avatar and Cover image subnavs. + * + * @since 6.0.0 + * @deprecated 12.0.0 + * + * @return array The Avatar and Cover image subnavs. + */ + public function get_avatar_cover_image_subnavs() + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up a profile nav in case the xProfile + * component is not active and a front template is + * used. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function setup_profile_nav() + { + } + /** + * Set up the xProfile nav. + * + * @since 6.0.0 + * @deprecated 12.0.0 + */ + public function setup_xprofile_nav() + { + } + /** + * Get the Avatar and Cover image admin navs. + * + * @since 6.0.0 + * + * @param string $admin_bar_menu_id The Admin bar menu ID to attach sub items to. + * @return array The Avatar and Cover image admin navs. + */ + public function get_avatar_cover_image_admin_navs($admin_bar_menu_id = '') + { + } + /** + * Set up the Admin Bar. + * + * @since 6.0.0 + * + * @param array $wp_admin_nav Admin Bar items. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Adds "Profile > Change Avatar" & "Profile > Change Cover Image" subnav item + * under the "Profile" adminbar menu. + * + * @since 6.0.0 + * + * @param array $wp_admin_nav The Profile adminbar nav array. + * @return array + */ + public function setup_xprofile_admin_nav($wp_admin_nav) + { + } + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() + { + } + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Adds the Members directory type, Registration and Activation rewrite tags. + * + * @since 12.0.0 + * + * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for + * description. + */ + public function add_rewrite_tags($rewrite_tags = array()) + { + } + /** + * Adds the Registration and Activation rewrite rules. + * + * @since 12.0.0 + * + * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for + * description. + */ + public function add_rewrite_rules($rewrite_rules = array()) + { + } + /** + * Adds the Registration and Activation permastructs. + * + * @since 12.0.0 + * + * @param array $permastructs Optional. See BP_Component::add_permastructs() for + * description. + */ + public function add_permastructs($permastructs = array()) + { + } + /** + * Parse the WP_Query and eventually display the component's directory or single item. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. See BP_Component::parse_query() for + * description. + */ + public function parse_query($query) + { + } + /** + * Check the parsed query is consistent with Members navigation. + * + * As the members’ component pages need a valid screen function to load the right BP Template, + * we need to make sure the current single item action exists inside the Members navigation and + * that the corresponding screen function is a valid callback. + * + * @since 12.0.0 + */ + public function check_parsed_query() + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * @since 6.0.0 Adds the Member Cover and Signup REST endpoints. + * @since 9.0.0 Moves the `BP_REST_Components_Endpoint` controller in `BP_Core` component. + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Members Blocks. + * + * @since 6.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * Load Members admin area. + * + * @since 2.0.0 + */ + class BP_Members_Admin + { + /** Directory *************************************************************/ + /** + * Path to the BP Members Admin directory. + * + * @var string $admin_dir + */ + public $admin_dir = ''; + /** URLs ******************************************************************/ + /** + * URL to the BP Members Admin directory. + * + * @var string $admin_url + */ + public $admin_url = ''; + /** + * URL to the BP Members Admin CSS directory. + * + * @var string $css_url + */ + public $css_url = ''; + /** + * URL to the BP Members Admin JS directory. + * + * @var string + */ + public $js_url = ''; + /** Other *****************************************************************/ + /** + * Support forum link. + * + * @since 14.0.0 + * @var string + */ + private $bp_forum = ''; + /** + * Redirect. + * + * @since 2.0.0 + * @var string + */ + public $redirect; + /** + * Screen id for edit user's profile page. + * + * @since 2.0.0 + * @var string + */ + public $user_page = ''; + /** + * User capability. + * + * @since 2.0.0 + * @var string + */ + public $capability; + /** + * Show Profile Screen id. + * + * @since 2.0.0 + * @var string + */ + public $user_profile; + /** + * Current user ID. + * + * @since 2.0.0 + * @var int + */ + public $current_user_id; + /** + * User ID being edited. + * + * @since 2.0.0 + * @var int + */ + public $user_id = 0; + /** + * Is a member editing their own profile. + * + * @since 2.0.0 + * @var bool + */ + public $is_self_profile = \false; + /** + * The screen ids to load specific css for. + * + * @since 2.0.0 + * @var array + */ + public $screen_id = array(); + /** + * The stats metabox default position. + * + * @since 2.0.0 + * @var stdClass + */ + public $stats_metabox; + /** + * Edit user's profile args. + * + * @since 2.0.0 + * @var array + */ + public $edit_profile_args; + /** + * Edit user's profile URL. + * + * @since 2.0.0 + * @var string + */ + public $edit_profile_url = ''; + /** + * Edit URL. + * + * @since 2.0.0 + * @var string + */ + public $edit_url = ''; + /** + * Users page. + * + * @since 2.0.0 + * @var string + */ + public $users_page = ''; + /** + * Signups page. + * + * @since 2.0.0 + * @var string + */ + public $signups_page = ''; + /** + * Users URL. + * + * @since 2.0.0 + * @var string + */ + public $users_url; + /** + * Users screen. + * + * @since 2.0.0 + * @var string + */ + public $users_screen; + /** + * Members' Invite Page. + * + * @since 2.0.0 + * @var string + */ + public $members_invites_page = ''; + /** + * Status of BuddyPress network. + * + * @since 2.0.0 + * @var bool + */ + public $subsite_activated; + /** + * Tools menu. + * + * @since 2.0.0 + * @var string + */ + public $tools_parent = 'tools.php'; + /** + * Constructor method. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Set admin-related globals. + * + * @since 2.0.0 + */ + private function setup_globals() + { + } + /** + * Set admin-related actions and filters. + * + * @since 2.0.0 + */ + private function setup_actions() + { + } + /** + * Create registration pages when multisite user registration is turned on. + * + * @since 2.7.0 + * + * @param string $option_name Current option name; value is always 'registration'. + * @param string $value + */ + public function multisite_registration_on($option_name, $value) + { + } + /** + * Create registration pages when single site registration is turned on. + * + * @since 2.7.0 + * + * @param string $old_value + * @param string $value + */ + public function single_site_registration_on($old_value, $value) + { + } + /** + * Setup BP Members Admin. + * + * @since 2.0.0 + * + * @return BP_Members_Admin|null + */ + public static function register_members_admin() + { + } + /** + * Get the user ID. + * + * Look for $_GET['user_id']. If anything else, force the user ID to the + * current user's ID so they aren't left without a user to edit. + * + * @since 2.1.0 + * + * @return int + */ + private function get_user_id() + { + } + /** + * Can the current user edit the one displayed. + * + * Self profile editing / or bp_moderate check. + * This might be replaced by more granular capabilities + * in the future. + * + * @since 2.1.0 + * + * @param int $user_id ID of the user being checked for edit ability. + * + * @return bool + */ + private function member_can_edit($user_id = 0) + { + } + /** + * Get admin notice when saving a user or member profile. + * + * @since 2.1.0 + * + * @return array + */ + private function get_user_notice() + { + } + /** + * Create the /user/ admin Profile submenus for all members. + * + * @since 2.1.0 + */ + public function user_profile_menu() + { + } + /** + * Create the All Users / Profile > Edit Profile and All Users Signups submenus. + * + * @since 2.0.0 + */ + public function admin_menus() + { + } + /** + * Include the Members Invitations tab to the Admin tabs needing specific inline styles. + * + * @since 10.0.0 + * + * @param array $submenu_pages The BP_Admin submenu pages passed by reference. + */ + public function set_submenu_page(&$submenu_pages) + { + } + /** + * Highlight the Users menu if on Edit Profile and check if on the user's admin profile. + * + * @since 2.1.0 + * + * @global string $submenu_file The name of the submenu file. + * @global string $parent_file The name of the parent file. + */ + public function profile_admin_head() + { + } + /** + * Remove the Edit Profile page. + * + * We add these pages in order to integrate with WP's Users panel, but + * we want them to show up as a row action of the WP panel, not as separate + * subnav items under the Users menu. + * + * @since 2.0.0 + */ + public function admin_head() + { + } + /** Community Profile *****************************************************/ + /** + * Add some specific styling to the Edit User and Edit User's Profile page. + * + * @since 2.0.0 + */ + public function enqueue_scripts() + { + } + /** + * Create the Profile navigation in Edit User & Edit Profile pages. + * + * @since 2.0.0 + * + * @param object|null $user User to create profile navigation for. + * @param string $active Which profile to highlight. + * @return string|null + */ + public function profile_nav($user = \null, $active = 'WordPress') + { + } + /** + * Set up the user's profile admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 2.0.0 + * @since 6.0.0 The `delete_avatar` action is now managed into this method. + */ + public function user_admin_load() + { + } + /** + * Display the user's profile. + * + * @since 2.0.0 + */ + public function user_admin() + { + } + /** + * Render the Status metabox for user's profile screen. + * + * Actions are: + * - Update profile fields if xProfile component is active + * - Spam/Unspam user + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_status_metabox($user = \null) + { + } + /** + * Render the fallback metabox in case a user has been marked as a spammer. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_spammer_metabox($user = \null) + { + } + /** + * Render the Stats metabox to moderate inappropriate images. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_stats_metabox($user = \null) + { + } + /** + * Render the Avatar metabox to moderate inappropriate images. + * + * @since 6.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + */ + public function user_admin_avatar_metabox($user = \null) + { + } + /** + * Render the Member Type metabox. + * + * @since 2.2.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_member_type_metabox($user = \null) + { + } + /** + * Process changes from the Member Type metabox. + * + * @since 2.2.0 + */ + public function process_member_type_update() + { + } + /** + * Add a link to Profile in Users listing row actions. + * + * @since 2.0.0 + * + * @param array|string $actions WordPress row actions (edit, delete). + * @param object|null $user The object for the user row. + * @return null|string|array Merged actions. + */ + public function row_actions($actions = '', $user = \null) + { + } + /** + * Add a filter to edit profile url in WP Admin Bar. + * + * @since 2.1.0 + */ + public function add_edit_profile_url_filter() + { + } + /** + * Filter the profile url. + * + * @since 2.1.0 + * + * + * @param string $profile_link Profile Link for admin bar. + * @param string $url Profile URL. + * @param int $user_id User ID. + * @return string + */ + public function filter_adminbar_profile_link($profile_link = '', $url = '', $user_id = 0) + { + } + /** + * Remove the filter to edit profile url in WP Admin Bar. + * + * @since 2.1.0 + */ + public function remove_edit_profile_url_filter() + { + } + /** Signups Management ****************************************************/ + /** + * Display the admin preferences about signups pagination. + * + * @since 2.0.0 + * + * @param int $value Value for signup option. + * @param string $option Value for the option key. + * @param int $new_value Value for the saved option. + * @return int The pagination preferences. + */ + public function signup_screen_options($value = 0, $option = '', $new_value = 0) + { + } + /** + * Make sure no signups will show in users list. + * + * This is needed to handle signups that may have not been activated + * before the 2.0.0 upgrade. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param WP_User_Query|null $query The users query. + * @return WP_User_Query|null The users query without the signups. + */ + public function remove_signups_from_user_query($query = \null) + { + } + /** + * Filter the WP Users List Table views to include 'bp-signups'. + * + * @since 2.0.0 + * + * @global string $role The name of the WP Role. + * + * @param array $views WP List Table views. + * @return array The views with the signup view added. + */ + public function signup_filter_view($views = array()) + { + } + /** + * Load the Signup WP Users List table. + * + * @since 2.0.0 + * + * @param string $class The name of the class to use. + * @param string $required The parent class. + * @return WP_List_Table|null The List table. + */ + public static function get_list_table_class($class = '', $required = '') + { + } + /** + * Set up the signups admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 2.0.0 + * + * @global object $bp_members_signup_list_table + */ + public function signups_admin_load() + { + } + /** + * Display any activation errors. + * + * @since 2.0.0 + */ + public function signups_display_errors() + { + } + /** + * Get admin notice when viewing the sign-up page. + * + * @since 2.1.0 + * + * @return array + */ + private function get_signup_notice() + { + } + /** + * Signups admin page router. + * + * Depending on the context, display + * - the list of signups, + * - or the delete confirmation screen, + * - or the activate confirmation screen, + * - or the "resend" email confirmation screen. + * + * Also prepare the admin notices. + * + * @since 2.0.0 + */ + public function signups_admin() + { + } + /** + * This is the list of the Pending accounts (signups). + * + * @since 2.0.0 + * + * @global string $plugin_page + * @global object $bp_members_signup_list_table + */ + public function signups_admin_index() + { + } + /** + * This is the confirmation screen for actions. + * + * @since 2.0.0 + * + * @param string $action Delete, activate, or resend activation link. + * + * @return null|false + */ + public function signups_admin_manage($action = '') + { + } + /** Users List Management ****************************************************/ + /** + * Display a dropdown to bulk change the member type of selected user(s). + * + * @since 2.7.0 + * + * @param string $which Where this dropdown is displayed - top or bottom. + */ + public function users_table_output_type_change_select($which = 'top') + { + } + /** + * Process bulk member type change submission from the WP admin users list table. + * + * @since 2.7.0 + */ + public function users_table_process_bulk_type_change() + { + } + /** + * Display an admin notice upon member type bulk update. + * + * @since 2.7.0 + */ + public function users_type_change_notice() + { + } + /** + * Add member type column to the WordPress admin users list table. + * + * @since 2.7.0 + * + * @param array $columns Users table columns. + * + * @return array $columns + */ + public function users_table_add_type_column($columns = array()) + { + } + /** + * Return member's type for display in the WP admin users list table. + * + * @since 2.7.0 + * + * @param string $retval + * @param string $column_name + * @param int $user_id + * + * @return string Member type as a link to filter all users. + */ + public function users_table_populate_type_cell($retval = '', $column_name = '', $user_id = 0) + { + } + /** + * Filter WP Admin users list table to include users of the specified type. + * + * @since 2.7.0 + * + * @global string $pagenow The filename of the current screen. + * + * @param WP_Query $query The WordPress Query object. + */ + public function users_table_filter_by_type($query) + { + } + /** + * Formats a signup's xprofile field data for display. + * + * Operates recursively on arrays, which are then imploded with commas. + * + * @since 2.8.0 + * @deprecated 10.0.0 + * + * @param string|array $value Field value. + * @return string + */ + protected function format_xprofile_field_for_display($value) + { + } + /** + * Set up the signups admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 8.0.0 + * + * @global object $bp_members_invitations_list_table + */ + public function members_invitations_admin_load() + { + } + /** + * Get admin notice when viewing the invitations management page. + * + * @since 8.0.0 + * + * @return array + */ + private function get_members_invitations_notice() + { + } + /** + * Member invitations admin page router. + * + * Depending on the context, display + * - the list of invitations, + * - or the delete confirmation screen, + * - or the "resend" email confirmation screen. + * + * Also prepare the admin notices. + * + * @since 8.0.0 + */ + public function invitations_admin() + { + } + /** + * This is the list of invitations. + * + * @since 8.0.0 + * + * @global string $plugin_page + * @global object $bp_members_invitations_list_table + */ + public function invitations_admin_index() + { + } + /** + * This is the confirmation screen for actions. + * + * @since 8.0.0 + * + * @param string $action Delete or resend invitation. + * @return null|false + */ + public function invitations_admin_manage($action = '') + { + } + } + /** + * Member Cover endpoints. + * + * /members/<user_id>/cover + * + * @since 6.0.0 + */ + class BP_REST_Attachments_Member_Cover_Endpoint extends \WP_REST_Controller + { + use \BP_REST_Attachments; + /** + * BP_Attachment_Cover_Image Instance. + * + * @since 6.0.0 + * + * @var BP_Attachment_Cover_Image + */ + protected $attachment_instance; + /** + * Member object. + * + * @since 6.0.0 + * + * @var WP_User + */ + protected $user; + /** + * Member object type. + * + * @since 6.0.0 + * + * @var string + */ + protected $object = 'user'; + /** + * Constructor. + * + * @since 6.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 6.0.0 + */ + public function register_routes() + { + } + /** + * Fetch an existing user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Checks if a given request has access to get a user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Upload a user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to upload a user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Delete an existing user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Checks if a given request has access to delete a user cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares user cover to return as an object. + * + * @since 6.0.0 + * + * @param string $cover_url User cover url. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($cover_url, $request) + { + } + /** + * Get the plugin schema, conforming to JSON Schema. + * + * @since 6.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + } + /** + * Signups Management class. + * + * @package BuddyPress + * @subpackage coreClasses + * @since 2.0.0 + */ + /** + * Class used to handle Signups. + * + * @since 2.0.0 + */ + #[\AllowDynamicProperties] + class BP_Signup + { + /** + * ID of the signup which the object relates to. + * + * @since 2.0.0 + * @var integer + */ + public $id; + /** + * ID of the signup which the object relates to. + * + * @since 2.0.0 + * @var integer + */ + public $signup_id; + /** + * The URL to the full size of the avatar for the user. + * + * @since 2.0.0 + * @var string + */ + public $avatar; + /** + * The username for the user. + * + * @since 2.0.0 + * @var string + */ + public $user_login; + /** + * The email for the user. + * + * @since 2.0.0 + * @var string + */ + public $user_email; + /** + * The full name of the user. + * + * @since 2.0.0 + * @var string + */ + public $user_name; + /** + * Metadata associated with the signup. + * + * @since 2.0.0 + * @var array + */ + public $meta; + /** + * The registered date for the user. + * + * @since 2.0.0 + * @var string + */ + public $registered; + /** + * The activation key for the user. + * + * @since 2.0.0 + * @var string + */ + public $activation_key; + /** + * The activated date for the user. + * + * @since 10.0.0 + * @var string + */ + public $activated; + /** + * Whether the user account is activated or not. + * + * @since 10.0.0 + * @var bool + */ + public $active; + /** + * The date that the last activation email was sent. + * + * @since 10.0.0 + * @var string + */ + public $date_sent; + /** + * Was the last activation email sent in the last 24 hours? + * + * @since 10.0.0 + * @var bool + */ + public $recently_sent; + /** + * The number of activation emails sent to this user. + * + * @since 10.0.0 + * @var int + */ + public $count_sent; + /** + * The domain for the signup. + * + * @since 10.0.0 + * @var string + */ + public $domain; + /** + * The path for the signup. + * + * @since 10.0.0 + * @var string + */ + public $path; + /** + * The title for the signup. + * + * @since 10.0.0 + * @var string + */ + public $title; + /** Public Methods *******************************************************/ + /** + * Class constructor. + * + * @since 2.0.0 + * + * @param integer $signup_id The ID for the signup being queried. + */ + public function __construct($signup_id = 0) + { + } + /** + * Populate the instantiated class with data based on the signup_id provided. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + */ + public function populate() + { + } + /** Static Methods *******************************************************/ + /** + * Fetch signups based on parameters. + * + * @since 2.0.0 + * @since 6.0.0 Added a list of allowed orderby parameters. + * + * @global wpdb $wpdb The WordPress database object. + * + * @param array $args { + * The argument to retrieve desired signups. + * @type int $offset Offset amount. Default 0. + * @type int $number How many to fetch. Pass -1 to fetch all. Default 1. + * @type bool|string $usersearch Whether or not to search for a username. Default false. + * @type string $orderby Order By parameter. Possible values are `signup_id`, `login`, `email`, + * `registered`, `activated`. Default `signup_id`. + * @type string $order Order direction. Default 'DESC'. + * @type bool $include Whether or not to include more specific query params. + * @type string $activation_key Activation key to search for. If specified, all other + * parameters will be ignored. + * @type int|bool $active Pass 0 for inactive signups, 1 for active signups, + * and `false` to ignore. + * @type string $user_login Specific user login to return. + * @type string $fields Which fields to return. Specify 'ids' to fetch a list of signups IDs. + * Default: 'all' (return BP_Signup objects). + * } + * @return array { + * @type array $signups Located signups. (IDs only if `fields` is set to `ids`.) + * @type int $total Total number of signups matching params. + * } + */ + public static function get($args = array()) + { + } + /** + * Add a signup. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param array $args { + * Array of arguments for signup addition. + * @type string $domain New user's domain. + * @type string $path New user's path. + * @type string $title New user's title. + * @type string $user_login New user's user_login. + * @type string $user_email New user's email address. + * @type int|string $registered Time the user registered. + * @type string $activation_key New user's activation key. + * @type string $meta New user's user meta. + * } + * @return int|bool ID of newly created signup on success, false on failure. + */ + public static function add($args = array()) + { + } + /** + * Create a WP user at signup. + * + * Since BP 2.0, non-multisite configurations have stored signups in + * the same way as Multisite configs traditionally have: in the + * wp_signups table. However, because some plugins may be looking + * directly in the wp_users table for non-activated signups, we + * mirror signups there by creating "phantom" users, mimicking WP's + * default behavior. + * + * @since 2.0.0 + * @deprecated 14.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param string $user_login User login string. + * @param string $user_password User password. + * @param string $user_email User email address. + * @param array $usermeta Metadata associated with the signup. + * @return int User id. + */ + public static function add_backcompat($user_login = '', $user_password = '', $user_email = '', $usermeta = array()) + { + } + /** + * Check a user status (from wp_users) on a non-multisite config. + * + * @since 2.0.0 + * + * @param int $user_id ID of the user being checked. + * @return int|bool The status if found, otherwise false. + */ + public static function check_user_status($user_id = 0) + { + } + /** + * Activate a signup. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param string $key Activation key. + * @return bool + */ + public static function validate($key = '') + { + } + /** + * How many inactive signups do we have? + * + * @since 2.0.0 + * + * @return int The number of signups. + */ + public static function count_signups() + { + } + /** + * Update the meta for a signup. + * + * This is the way we use to "trace" the last date an activation + * email was sent and how many times activation was sent. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param array $args { + * Array of arguments for the signup update. + * @type int $signup_id User signup ID. + * @type array $meta Meta to update. + * } + * @return int The signup id. + */ + public static function update($args = array()) + { + } + /** + * Resend an activation email. + * + * @since 2.0.0 + * + * @param array $signup_ids Single ID or list of IDs to resend. + * @return array + */ + public static function resend($signup_ids = array()) + { + } + /** + * Activate a pending account. + * + * @since 2.0.0 + * + * @param array $signup_ids Single ID or list of IDs to activate. + * @return array + */ + public static function activate($signup_ids = array()) + { + } + /** + * Delete a pending account. + * + * @since 2.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param array $signup_ids Single ID or list of IDs to delete. + * @return array + */ + public static function delete($signup_ids = array()) + { + } + } + /** + * The main theme compat class for BuddyPress Members. + * + * This class sets up the necessary theme compatibility actions to safely output + * member template parts to the_title and the_content areas of a theme. + * + * @since 1.7.0 + */ + class BP_Members_Theme_Compat + { + /** + * Set up the members component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() + { + } + /** + * Are we looking at something that needs members theme compatibility? + * + * @since 1.7.0 + */ + public function is_members() + { + } + /** Directory *************************************************************/ + /** + * Add template hierarchy to theme compat for the members directory page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param array $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function directory_template_hierarchy($templates = array()) + { + } + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() + { + } + /** + * Filter the_content with the members index template part. + * + * @since 1.7.0 + */ + public function directory_content() + { + } + /** Single ****************************************************************/ + /** + * Add custom template hierarchy to theme compat for member pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from + * bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function single_template_hierarchy($templates) + { + } + /** + * Update the global $post with the displayed user's data. + * + * @since 1.7.0 + */ + public function single_dummy_post() + { + } + /** + * Filter the_content with the members' single home template part. + * + * @since 1.7.0 + */ + public function single_dummy_content() + { + } + } + /** + * Signup endpoints. + * + * Use /signup + * Use /signup/{id} + * Use /signup/resend + * Use /signup/activate/{activation_key} + * + * @since 6.0.0 + */ + class BP_REST_Signup_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 6.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 6.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve signups. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to signup items. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve single signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to create a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true + */ + public function create_item_permissions_check($request) + { + } + /** + * Delete a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Activate a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function activate_item($request) + { + } + /** + * Check if a given request has access to activate a signup. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function activate_item_permissions_check($request) + { + } + /** + * Resend the activation email. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function signup_resend_activation_email($request) + { + } + /** + * Check if a given request has access to resend the activation email. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function signup_resend_activation_email_permissions_check($request) + { + } + /** + * Prepares signup to return as an object. + * + * @since 6.0.0 + * + * @param BP_Signup $signup Signup object. + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($signup, $request) + { + } + /** + * Prepares links for the signup request. + * + * @param BP_Signup $signup The signup object. + * @return array + */ + protected function prepare_links($signup) + { + } + /** + * Get signup object. + * + * @since 6.0.0 + * + * @param int|string $identifier Signup identifier. + * @return BP_Signup|false + */ + public function get_signup_object($identifier) + { + } + /** + * Check a user password for the REST API. + * + * @since 6.0.0 + * + * @param string $value The password submitted in the request. + * @return string|WP_Error The sanitized password, if valid, otherwise an error. + */ + public function check_user_password($value) + { + } + /** + * Is it possible to signup with a blog? + * + * @since 6.0.0 + * + * @return bool True if blog signup is allowed. False otherwise. + */ + public function is_blog_signup_allowed() + { + } + /** + * Get site's available locales. + * + * @since 6.0.0 + * + * @return array The list of available locales. + */ + public function get_available_languages() + { + } + /** + * Edit the type of the some properties for the CREATABLE & EDITABLE methods. + * + * @since 6.0.0 + * + * @param string $method HTTP method of the request. Default is WP_REST_Server::CREATABLE. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the signup schema, conforming to JSON Schema. + * + * @since 6.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections. + * + * @since 6.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Recently Active Members Widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + */ + class BP_Core_Recently_Active_Widget extends \WP_Widget + { + /** + * Constructor method. + * + * @since 1.5.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Display the Recently Active widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @see WP_Widget::widget() for description of parameters. + * + * @param array $args Widget arguments. + * @param array $instance Widget settings, as saved by the user. + */ + public function widget($args, $instance) + { + } + /** + * Update the Recently Active widget options. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $new_instance The new instance options. + * @param array $old_instance The old instance options. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Output the Recently Active widget options form. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function form($instance) + { + } + /** + * Merge the widget settings into defaults array. + * + * @since 2.3.0 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function parse_settings($instance = array()) + { + } + } + class BP_Members_Invitations_Component extends \BP_Component + { + function __construct() + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 12.0.0 Used to customize the default subnavigation slug. + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.0.0 + * + * @see BP_Component::setup_admin_bar() for a description of arguments. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() + * for description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + } + /** + * BP Invitations class. + * + * Extend it to manage your class's invitations. + * Your extension class, must, at a minimum, provide the + * run_send_action() and run_acceptance_action() methods. + * + * @since 5.0.0 + */ + abstract class BP_Invitation_Manager + { + /** + * The name of the related class. + * + * @since 5.0.0 + * + * @var string + */ + protected $class_name; + /** + * Construct parameters. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Get the invitations table name. + * + * @since 5.0.0 + * + * @return string + */ + public static function get_table_name() + { + } + /** Create ********************************************************************/ + /** + * Add an invitation to a specific user, from a specific user, related to a + * specific class. + * + * @since 5.0.0 + * + * @param array $args { + * Array of arguments describing the invitation. All are optional. + * @type int $user_id ID of the invited user. + * @type int $inviter_id ID of the user who created the invitation. + * @type string $invitee_email Email address of the invited user. + * @type int $item_id ID associated with the invitation and class. + * @type int $secondary_item_id Secondary ID associated with the + * invitation and class. + * @type string $type Type of record this is: 'invite' or 'request'. + * @type string $content Extra information provided by the requester + * or inviter. + * @type string $date_modified Date the invitation was last modified. + * @type int $send_invite Should the invitation also be sent, or is it a + * draft invite? + * } + * @return int|bool ID of the newly created invitation on success, false + * on failure. + */ + public function add_invitation($args = array()) + { + } + /** + * Send an invitation notification. + * + * @since 5.0.0 + * + * @param int $invitation_id ID of invitation to send. + * @param array $args See BP_Invitation::mark_sent(). + * @return bool + */ + public function send_invitation_by_id($invitation_id = 0, $args = array()) + { + } + /** + * Add a request to an item for a specific user, related to a + * specific class. + * + * @since 5.0.0 + * + * @param array $args { + * Array of arguments describing the invitation. All are optional. + * @type int $user_id ID of the invited user. + * @type int $inviter_id ID of the user who created the invitation. + * @type string $class Name of the invitations class. + * @type int $item_id ID associated with the invitation and class. + * @type int $secondary_item_id secondary ID associated with the + * invitation and class. + * @type string $type Type of record this is: 'invite' or 'request'. + * @type string $content Extra information provided by the requester + * or inviter. + * @type string $date_modified Date the invitation was last modified. + * @type int $invite_sent Has the invitation been sent, or is it a + * draft invite? + * } + * @return int|bool ID of the newly created invitation on success, false + * on failure. + */ + public function add_request($args = array()) + { + } + /** + * Send a request notification. + * + * @since 5.0.0 + * + * @param int $request_id ID of request to send. + * @param array $args See BP_Invitation::mark_sent(). + * @return bool + */ + public function send_request_notification_by_id($request_id = 0, $args = array()) + { + } + /** Retrieve ******************************************************************/ + /** + * Get a specific invitation by its ID. + * + * @since 5.0.0 + * + * @param int $id ID of the invitation. + * @return BP_Invitation object + */ + public function get_by_id($id = 0) + { + } + /** + * Get invitations, based on provided filter parameters. + * + * @since 5.0.0 + * + * @param array $args {@see BP_Invitation::get()}. + * @return array Located invitations. + */ + public function get_invitations($args = array()) + { + } + /** + * Get a count of the number of invitations that match provided filter parameters. + * + * @since 8.0.0 + * + * @param array $args {@see BP_Invitation::get_total_count()}. + * @return int Total number of invitations. + */ + public function get_invitations_total_count($args = array()) + { + } + /** + * Get requests, based on provided filter parameters. + * + * @since 5.0.0 + * + * @param array $args {@see BP_Invitation::get()}. + * @return array Located invitations. + */ + public function get_requests($args = array()) + { + } + /** + * Check whether an invitation exists matching the passed arguments. + * + * @since 5.0.0 + * + * @param array $args {@see BP_Invitation::get()}. + * @return int|bool ID of first found invitation or false if none found. + */ + public function invitation_exists($args = array()) + { + } + /** + * Check whether a request exists matching the passed arguments. + * + * @since 5.0.0 + * + * @param array $args {@see BP_Invitation::get()}. + * @return int|bool ID of existing request or false if none found. + */ + public function request_exists($args = array()) + { + } + /** Update ********************************************************************/ + /** + * Accept invitation, based on provided filter parameters. + * + * @since 5.0.0 + * + * @param array $args {BP_Invitation::get()}. + * @return int|bool Number of rows updated on success, false on failure. + */ + public function accept_invitation($args = array()) + { + } + /** + * Accept invitation, based on provided filter parameters. + * + * @since 5.0.0 + * + * @param array $args {BP_Invitation::get()}. + * @return bool Number of rows updated on success, false on failure. + */ + public function accept_request($args = array()) + { + } + /** + * Update invitation, based on provided filter parameters. + * + * @since 5.0.0 + * + * @see BP_Invitation::update() for a description of + * accepted update/where arguments. + * + * @param array $update_args Associative array of fields to update, + * and the values to update them to. Of the format + * array( 'user_id' => 4 ). + * @param array $where_args Associative array of columns/values, to + * determine which invitations should be updated. Formatted as + * array( 'item_id' => 7 ). + * @return int|bool Number of rows updated on success, false on failure. + */ + public function update_invitation($update_args = array(), $where_args = array()) + { + } + /** + * This is where custom actions are added (in child classes) + * to run when an invitation or request needs to be "sent." + * + * @since 5.0.0 + * + * @param BP_Invitation $invitation The invitation to send. + * @return bool + */ + public abstract function run_send_action(\BP_Invitation $invitation); + /** + * Mark invitations as sent that are found by user_id, inviter_id, + * invitee_email, class name, optional item id, + * optional secondary item id. + * + * @since 5.0.0 + * + * @param array $args { + * Associative array of arguments. All arguments but $page and + * $per_page can be treated as filter values for get_where_sql() + * and get_query_clauses(). All items are optional. + * @type int|array $user_id ID of user being queried. Can be an + * array of user IDs. + * @type int|array $inviter_id ID of user who created the + * invitation. Can be an array of user IDs. + * Special cases + * @type string|array $invitee_email Email address of invited users + * being queried. Can be an array of addresses. + * @type string|array $class Name of the class to + * filter by. Can be an array of class names. + * @type int|array $item_id ID of associated item. Can be an array + * of multiple item IDs. + * @type int|array $secondary_item_id ID of secondary associated + * item. Can be an array of multiple IDs. + * } + */ + public function mark_sent($args) + { + } + /** + * This is where custom actions are added (in child classes) + * to run when an invitation or request is accepted. + * + * @since 5.0.0 + * + * @param string $type The type of record being accepted: 'invite' or 'request'. + * @param array $r Associative array of arguments. + * @return bool + */ + public abstract function run_acceptance_action($type, $r); + /** + * Mark invitation as accepted by invitation ID. + * + * @since 5.0.0 + * + * @param int $id ID of the invitation to mark as accepted. + * @param array $args {@see BP_Invitation::mark_accepted()}. + * @return int|bool Number of rows updated on success, false on failure. + */ + public function mark_accepted_by_id($id, $args) + { + } + /** + * Mark invitations as sent that are found by user_id, inviter_id, + * invitee_email, class name, item id, and + * optional secondary item id. + * + * @since 5.0.0 + * + * @param array $args {BP_Invitation::mark_accepted_by_data()}. + * @return int|bool Number of rows updated on success, false on failure. + */ + public function mark_accepted($args) + { + } + /** Delete ********************************************************************/ + /** + * Delete an invitation or invitations by query data. + * + * @since 5.0.0 + * + * @param array $args {BP_Invitation::delete()}. + * @return int|bool Number of rows deleted on success, false on failure. + */ + public function delete($args) + { + } + /** + * Delete a request or requests by query data. + * + * @since 5.0.0 + * + * @param array $args {BP_Invitation::delete()}. + * @return int|bool Number of rows deleted on success, false on failure. + */ + public function delete_requests($args) + { + } + /** + * Delete all invitations by class. + * + * Used when clearing out invitations for an entire class. Possibly used + * when deactivating a component related to a class that created invitations. + * + * @since 5.0.0 + * + * @return int|bool Number of rows deleted on success, false on failure. + */ + public function delete_all() + { + } + /** + * Delete an invitation by id. + * + * @since 8.0.0 + * + * @param int $id ID of the invitation to delete. + * @return int|bool Number of rows deleted on success, false on failure. + */ + public function delete_by_id($id) + { + } + /** + * This is where custom actions are added (in child classes) + * to determine whether an invitation should be allowed. + * + * @since 5.0.0 + * + * @param array $args The parameters that describe the invitation. + * @return bool + */ + public function allow_invitation($args) + { + } + /** + * This is where custom actions are added (in child classes) + * to determine whether a request should be allowed. + * + * @since 5.0.0 + * + * @param array $args The parameters describing the request. + * @return bool + */ + public function allow_request($args) + { + } + } + /** + * Membership invitations class. + * + * An extension of the core Invitations class that adapts the + * core logic to accommodate site membership invitation behavior. + * + * @since 8.0.0 + */ + class BP_Members_Invitation_Manager extends \BP_Invitation_Manager + { + /** + * Construct parameters. + * + * @since 8.0.0 + * + * @param array|string $args. + */ + public function __construct($args = '') + { + } + /** + * This is where custom actions are added to run when notifications of an + * invitation or request need to be generated & sent. + * + * @since 8.0.0 + * + * @param obj BP_Invitation $invitation The invitation to send. + * @return bool + */ + public function run_send_action(\BP_Invitation $invitation) + { + } + /** + * This is where custom actions are added to run when an invitation + * or request is accepted. + * + * @since 8.0.0 + * + * @param string $type Are we accepting an invitation or request? + * @param array $r Parameters that describe the invitation being accepted. + * @return bool + */ + public function run_acceptance_action($type, $r) + { + } + /** + * Should this invitation be created? + * + * @since 8.0.0 + * + * @param array $args Array of arguments. + * @return bool + */ + public function allow_invitation($args) + { + } + /** + * Should this request be created? + * + * @since 8.0.0 + * + * @param array $args. + * @return bool. + */ + public function allow_request($args) + { + } + } + /** + * Who's Online Widget. + * + * @since 1.0.3 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + class BP_Core_Whos_Online_Widget extends \WP_Widget + { + /** + * Constructor method. + * + * @since 1.5.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Display the Who's Online widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @see WP_Widget::widget() for description of parameters. + * + * @param array $args Widget arguments. + * @param array $instance Widget settings, as saved by the user. + */ + public function widget($args, $instance) + { + } + /** + * Update the Who's Online widget options. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $new_instance The new instance options. + * @param array $old_instance The old instance options. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Output the Who's Online widget options form. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function form($instance) + { + } + /** + * Merge the widget settings into defaults array. + * + * @since 2.3.0 + * @deprecated 12.0.0 + * + * @param array $instance Widget instance settings. + */ + public function parse_settings($instance = array()) + { + } + } + /** + * The main member template loop class. + * + * Responsible for loading a group of members into a loop for display. + * + * @since 1.0.0 + */ + class BP_Core_Members_Template + { + /** + * The loop iterator. + * + * @since 1.0.0 + * @var int + */ + public $current_member = -1; + /** + * The number of members returned by the paged query. + * + * @since 1.0.0 + * @var int + */ + public $member_count; + /** + * Array of members located by the query. + * + * @since 1.0.0 + * @var array + */ + public $members; + /** + * The member object currently being iterated on. + * + * @since 1.0.0 + * @var object + */ + public $member; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.0.0 + * @var bool + */ + public $in_the_loop; + /** + * The type of member being requested. Used for ordering results. + * + * @since 2.3.0 + * @var string + */ + public $type; + /** + * The unique string used for pagination queries. + * + * @since 2.2.0 + * @var string + */ + public $pag_arg; + /** + * The page number being requested. + * + * @since 1.0.0 + * @var string + */ + public $pag_page; + /** + * The number of items being requested per page. + * + * @since 1.0.0 + * @var string + */ + public $pag_num; + /** + * An HTML string containing pagination links. + * + * @since 1.0.0 + * @var string + */ + public $pag_links; + /** + * The total number of members matching the query parameters. + * + * @since 1.0.0 + * @var int + */ + public $total_member_count; + /** + * Constructor method. + * + * @since 1.5.0 + * @since 7.0.0 Added `$xprofile_query` parameter. Added `$user_ids` parameter. + * @since 10.0.0 Added `$date_query` parameter. + * + * @see BP_User_Query for an in-depth description of parameters. + * + * @param array ...$args { + * Array of arguments. Supports all arguments of BP_User_Query. Additional + * arguments, or those with different defaults, are described below. + * + * @type int $page_number Page of results. Accepted for legacy reasons. Use 'page' instead. + * @type int $max Max number of results to return. + * @type string $page_arg Optional. The string used as a query parameter in pagination links. + * } + */ + public function __construct(...$args) + { + } + /** + * Whether there are members available in the loop. + * + * @since 1.0.0 + * + * @see bp_has_members() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_members() + { + } + /** + * Set up the next member and iterate index. + * + * @since 1.0.0 + * + * @return object The next member to iterate over. + */ + public function next_member() + { + } + /** + * Rewind the members and reset member index. + * + * @since 1.0.0 + */ + public function rewind_members() + { + } + /** + * Whether there are members left in the loop to iterate over. + * + * This method is used by {@link bp_members()} as part of the while loop + * that controls iteration inside the members loop, eg: + * while ( bp_members() ) { ... + * + * @since 1.2.0 + * + * @see bp_members() + * + * @return bool True if there are more members to show, otherwise false. + */ + public function members() + { + } + /** + * Set up the current member inside the loop. + * + * Used by {@link bp_the_member()} to set up the current member data + * while looping, so that template tags used during that iteration make + * reference to the current member. + * + * @since 1.0.0 + * + * @see bp_the_member() + */ + public function the_member() + { + } + } + /** + * BuddyPress Friendship object. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_Friends_Friendship + { + /** + * ID of the friendship. + * + * @since 1.0.0 + * @var int + */ + public $id; + /** + * User ID of the friendship initiator. + * + * @since 1.0.0 + * @var int + */ + public $initiator_user_id; + /** + * User ID of the 'friend' - the one invited to the friendship. + * + * @since 1.0.0 + * @var int + */ + public $friend_user_id; + /** + * Has the friendship been confirmed/accepted? + * + * @since 1.0.0 + * @var int + */ + public $is_confirmed; + /** + * Is this a "limited" friendship? + * + * Not currently used by BuddyPress. + * + * @since 1.0.0 + * @var int + */ + public $is_limited; + /** + * Date the friendship was created. + * + * @since 1.0.0 + * @var string + */ + public $date_created; + /** + * Is this a request? + * + * Not currently used in BuddyPress. + * + * @since 1.0.0 + * @var bool + */ + public $is_request; + /** + * Should additional friend details be queried? + * + * @since 1.0.0 + * @var bool + */ + public $populate_friend_details; + /** + * Details about the friend. + * + * @since 1.0.0 + * @var BP_Core_User + */ + public $friend; + /** + * Constructor method. + * + * @since 1.5.0 + * @since 10.0.0 Updated to add deprecated notice for `$is_request`. + * + * @param int|null $id Optional. The ID of an existing friendship. + * @param bool $is_request Deprecated. + * @param bool $populate_friend_details Optional. True if friend details should be queried. + */ + public function __construct($id = \null, $is_request = \false, $populate_friend_details = \true) + { + } + /** + * Set up data about the current friendship. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** + * Save the current friendship to the database. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Delete the current friendship from the database. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool|int + */ + public function delete() + { + } + /** Static Methods ********************************************************/ + /** + * Get the friendships for a given user. + * + * @since 2.6.0 + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param array $args { + * Optional. Filter parameters. + * @type int $id ID of specific friendship to retrieve. + * @type int $initiator_user_id ID of friendship initiator. + * @type int $friend_user_id ID of specific friendship to retrieve. + * @type int $is_confirmed Whether the friendship has been accepted. + * @type int $is_limited Whether the friendship is limited. + * @type string $order_by Column name to order by. + * @type string $sort_order Optional. ASC or DESC. Default: 'DESC'. + * } + * @param string $operator Optional. Operator to use in `wp_list_filter()`. + * + * @return array $friendships Array of friendship objects. + */ + public static function get_friendships($user_id, $args = array(), $operator = 'AND') + { + } + /** + * Get all friendship IDs for a user. + * + * @since 2.7.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user. + * @return array + */ + public static function get_friendship_ids_for_user($user_id) + { + } + /** + * Get the IDs of a given user's friends. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param bool $friend_requests_only Optional. Whether to fetch + * unaccepted requests only. Default: false. + * @param bool $assoc_arr Optional. True to receive an array of arrays + * keyed as 'user_id' => $user_id; false to get a one-dimensional + * array of user IDs. Default: false. + * @return array $fids IDs of friends for provided user. + */ + public static function get_friend_user_ids($user_id, $friend_requests_only = \false, $assoc_arr = \false) + { + } + /** + * Get the ID of the friendship object, if any, between a pair of users. + * + * @since 1.0.0 + * + * @param int $user_id The ID of the first user. + * @param int $friend_id The ID of the second user. + * @return int|null The ID of the friendship object if found, otherwise null. + */ + public static function get_friendship_id($user_id, $friend_id) + { + } + /** + * Get a list of IDs of users who have requested friendship of a given user. + * + * @since 1.2.0 + * + * @param int $user_id The ID of the user who has received the + * friendship requests. + * @return array|bool An array of user IDs or false if none are found. + */ + public static function get_friendship_request_user_ids($user_id) + { + } + /** + * Get a total friend count for a given user. + * + * @since 1.0.0 + * + * @param int $user_id Optional. ID of the user whose friendships you + * are counting. Default: displayed user (if any), otherwise + * logged-in user. + * @return int Friend count for the user. + */ + public static function total_friend_count($user_id = 0) + { + } + /** + * Search the friends of a user by a search string. + * + * @todo Optimize this function. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $filter The search string, matched against xprofile + * fields (if available), or usermeta 'nickname' field. + * @param int $user_id ID of the user whose friends are being searched. + * @param int|null $limit Optional. Max number of friends to return. + * @param int|null $page Optional. The page of results to return. Default: + * null (no pagination - return all results). + * @return array|bool On success, an array: { + * @type array $friends IDs of friends returned by the query. + * @type int $count Total number of friends (disregarding + * pagination) who match the search. + * }. Returns false on failure. + */ + public static function search_friends($filter, $user_id, $limit = \null, $page = \null) + { + } + /** + * Check friendship status between two users. + * + * Note that 'pending' means that $initiator_userid has sent a friend + * request to $possible_friend_userid that has not yet been approved, + * while 'awaiting_response' is the other way around ($possible_friend_userid + * sent the initial request). + * + * @since 1.0.0 + * + * @param int $initiator_userid The ID of the user who is the initiator + * of the potential friendship/request. + * @param int $possible_friend_userid The ID of the user who is the + * recipient of the potential friendship/request. + * @return string|false $value The friendship status, from among 'not_friends', + * 'is_friend', 'pending', and 'awaiting_response'. + */ + public static function check_is_friend($initiator_userid, $possible_friend_userid) + { + } + /** + * Find uncached friendships between a user and one or more other users and cache them. + * + * @since 3.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the primary user for whom we want + * to check friendships statuses. + * @param int|array|string $possible_friend_ids The IDs of the one or more users + * to check friendship status with primary user. + */ + public static function update_bp_friends_cache($user_id, $possible_friend_ids) + { + } + /** + * Get the last active date of many users at once. + * + * @todo Why is this in the Friends component? + * + * @since 1.0.0 + * + * @param array $user_ids IDs of users whose last_active meta is + * being queried. + * @return array $retval Array of last_active values + user_ids. + */ + public static function get_bulk_last_active($user_ids) + { + } + /** + * Mark a friendship as accepted. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $friendship_id ID of the friendship to be accepted. + * @return int Number of database rows updated. + */ + public static function accept($friendship_id) + { + } + /** + * Remove a friendship or a friendship request INITIATED BY the logged-in user. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $friendship_id ID of the friendship to be withdrawn. + * @return int Number of database rows deleted. + */ + public static function withdraw($friendship_id) + { + } + /** + * Remove a friendship or a friendship request MADE OF the logged-in user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $friendship_id ID of the friendship to be rejected. + * @return int Number of database rows deleted. + */ + public static function reject($friendship_id) + { + } + /** + * Search users. + * + * @todo Why does this exist, and why is it in bp-friends? + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $filter String to search by. + * @param int $user_id A user ID param that is unused. + * @param int|null $limit Optional. Max number of records to return. + * @param int|null $page Optional. Number of the page to return. Default: + * false (no pagination - return all results). + * @return array $filtered_ids IDs of users who match the query. + */ + public static function search_users($filter, $user_id, $limit = \null, $page = \null) + { + } + /** + * Get a count of users who match a search term. + * + * @todo Why does this exist, and why is it in bp-friends? + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $filter Search term. + * @return int Count of users matching the search term. + */ + public static function search_users_count($filter) + { + } + /** + * Sort a list of user IDs by their display names. + * + * @todo Why does this exist, and why is it in bp-friends? + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $user_ids Array of user IDs. + * @return array|bool User IDs, sorted by the associated display names. + * False if XProfile component is not active. + */ + public static function sort_by_name($user_ids) + { + } + /** + * Get a list of random friend IDs. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param int $total_friends Optional. Number of random friends to get. + * Default: 5. + * @return array|false An array of random friend user IDs on success; + * false if none are found. + */ + public static function get_random_friends($user_id, $total_friends = 5) + { + } + /** + * Get a count of a user's friends who can be invited to a given group. + * + * Users can invite any of their friends except: + * + * - users who are already in the group + * - users who have a pending invite to the group + * - users who have been banned from the group + * + * @todo Need to do a group component check before using group functions. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friends are being counted. + * @param int $group_id ID of the group friends are being invited to. + * @return bool|int False if group component is not active, and friend count. + */ + public static function get_invitable_friend_count($user_id, $group_id) + { + } + /** + * Get friendship objects by ID (or an array of IDs). + * + * @since 2.7.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int|string|array $friendship_ids Single friendship ID or comma-separated/array list of friendship IDs. + * @return array + */ + public static function get_friendships_by_id($friendship_ids) + { + } + /** + * Get the friend user IDs for a given friendship. + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the friendship. + * @return null|stdClass + */ + public static function get_user_ids_for_friendship($friendship_id) + { + } + /** + * Delete all friendships and friend notifications related to a user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user being expunged. + */ + public static function delete_all_for_user($user_id) + { + } + } + /** + * The User Friends widget class. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + class BP_Core_Friends_Widget + { + /** + * Class constructor. + * + * @since 1.9.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Enqueue scripts. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function enqueue_scripts() + { + } + /** + * Display the widget. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array $args Widget arguments. + * @param array $instance The widget settings, as saved by the user. + */ + public function widget($args, $instance) + { + } + /** + * Process a widget save. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @param array $new_instance The parameters saved by the user. + * @param array $old_instance The parameters as previously saved to the database. + * @return array $instance The processed settings to save. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Render the widget edit form. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @param array $instance The saved widget settings. + */ + public function form($instance) + { + } + } + /** + * Friendship endpoints. + * + * /friends/ + * /friends/{id} + * + * @since 6.0.0 + */ + class BP_REST_Friends_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 6.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 6.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve friendships. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to friendship items. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve single friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get a friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create a new friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Check if a given request has access to create a friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update, accept, friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Reject/withdraw/remove friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a friendship. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares friendship data to return as an object. + * + * @since 6.0.0 + * + * @param BP_Friends_Friendship $friendship Friendship object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($friendship, $request) + { + } + /** + * Prepare links for the request. + * + * @since 6.0.0 + * + * @param BP_Friends_Friendship $friendship Friendship object. + * @return array + */ + protected function prepare_links($friendship) + { + } + /** + * Get friendship object. + * + * @since 6.0.0 + * + * @param int $friendship_id Friendship ID. + * @return BP_Friends_Friendship + */ + public function get_friendship_object($friendship_id) + { + } + /** + * Edit some arguments for the endpoint's methods. + * + * @since 6.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the friends schema, conforming to JSON Schema. + * + * @since 6.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for friends collections. + * + * @since 6.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Defines the BuddyPress Friends Component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Friends_Component extends \BP_Component + { + /** + * Start the friends component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include bp-friends files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up bp-friends global settings. + * + * The BP_FRIENDS_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.5.0 + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up bp-friends integration with the WordPress admin bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_admin_bar() for a description of arguments. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() + * for description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() + { + } + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Init the BP REST API. + * + * @since 6.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Friends Blocks. + * + * @since 9.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } +} +namespace Buddypress\CLI\Command { + /** + * Base component class. + * + * @since 1.0 + */ + abstract class BuddyPressCommand extends \WP_CLI\CommandWithDBObject + { + /** + * Default dependency check for a BuddyPress CLI command. + * + * @since 2.0 + */ + public static function check_dependencies() + { + } + /** + * Get Formatter object based on supplied parameters. + * + * @since 2.0 + * + * @param array $assoc_args Parameters passed to command. Determines formatting. + * @return \WP_CLI\Formatter + */ + protected function get_formatter(&$assoc_args) + { + } + /** + * Get a random user id. + * + * @global wpdb $wpdb WordPress database abstraction object. + * + * @since 1.1 + * + * @return int + */ + protected function get_random_user_id() + { + } + /** + * Get an activity ID. + * + * @since 2.0 + * + * @param int $activity_id Activity ID. + * @param bool $activity_object Return BP_Activity_Activity object. + * @return int|BP_Activity_Activity + */ + protected function get_activity_id_from_identifier($activity_id, $activity_object = false) + { + } + /** + * Get a group ID from its identifier (ID or slug). + * + * @since 1.5.0 + * + * @param int|string $group_id Group ID or slug. + * @return int|bool + */ + protected function get_group_id_from_identifier($group_id) + { + } + /** + * Verify a user ID by the passed identifier. + * + * @since 1.2.0 + * + * @param mixed $identifier User ID, email, or login. + * @return WP_User + */ + protected function get_user_id_from_identifier($identifier) + { + } + /** + * Generate random text + * + * @since 1.1 + * + * @return string + */ + protected function generate_random_text() + { + } + /** + * Get field from an ID. + * + * @since 1.5.0 + * + * @param int|string $field_id Field ID or Field name. + * @return int Field ID. + */ + protected function get_field_id($field_id) + { + } + /** + * String sanitization. + * + * @since 1.5.0 + * + * @param string $type String to sanitize. + * @return string Sanitized string. + */ + protected function sanitize_string($type) + { + } + /** + * Pull up a random active component. + * + * @since 1.1 + * + * @return string + */ + protected function get_random_component() + { + } + /** + * Get a list of activity components and actions. + * + * @since 1.1 + * + * @return array + */ + protected function get_components_and_actions() + { + } + /** + * Generate callback. + * + * @param string $message Message to display. + * @param array $assoc_args Command arguments. + * @param callable $callback Callback to execute. + */ + protected function generate_callback($message, $assoc_args, $callback) + { + } + } + /** + * Manage BuddyPress Emails. + * + * ## EXAMPLES + * + * # Create email post + * $ wp bp email create --type=new-event --type-description="Send an email when a new event is created" --subject="[{{{site.name}}}] A new event was created" --content="<a href='{{{some.custom-token-url}}}'></a>A new event</a> was created" --plain-text-content="A new event was created" + * Success: Email post created for type "new-event". + * + * # Create email post with content from given file + * $ wp bp email create ./email-content.txt --type=new-event --type-description="Send an email when a new event is created" --subject="[{{{site.name}}}] A new event was created" --plain-text-content="A new event was created" + * Success: Email post created for type "new-event". + * + * @since 1.6.0 + */ + class Email extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Create a new email post connected to an email type. + * + * ## OPTIONS + * + * --type=<type> + * : Email type for the email (should be unique identifier, sanitized like a post slug). + * + * --type-description=<type-description> + * : Email type description. + * + * --subject=<subject> + * : Email subject line. Email tokens allowed. View https://codex.buddypress.org/emails/email-tokens/ for more info. + * + * [--content=<content>] + * : Email content. Email tokens allowed. View https://codex.buddypress.org/emails/email-tokens/ for more info. + * + * [--plain-text-content=<plain-text-content>] + * : Plain-text email content. Email tokens allowed. View https://codex.buddypress.org/emails/email-tokens/ for more info. + * + * [<file>] + * : Read content from <file>. If this value is present, the + * `--content` argument will be ignored. + * + * Passing `-` as the filename will cause post content to + * be read from STDIN. + * + * [--edit] + * : Immediately open system's editor to write or edit email content. + * + * If content is read from a file, from STDIN, or from the `--content` + * argument, that text will be loaded into the editor. + * + * ## EXAMPLES + * + * # Create email post + * $ wp bp email create --type=new-event --type-description="Send an email when a new event is created" --subject="[{{{site.name}}}] A new event was created" --content="<a href='{{{some.custom-token-url}}}'></a>A new event</a> was created" --plain-text-content="A new event was created" + * Success: Email post created for type "new-event". + * + * # Create email post with content from given file + * $ wp bp email create ./email-content.txt --type=new-event --type-description="Send an email when a new event is created" --subject="[{{{site.name}}}] A new event was created" --plain-text-content="A new event was created" + * Success: Email post created for type "new-event". + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Get details for a post connected to an email type. + * + * ## OPTIONS + * + * <type> + * : The email type to fetch the post details for. + * + * [--field=<field>] + * : Instead of returning the whole post, returns the value of a single field. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - json + * - yaml + * --- + * + * ## EXAMPLE + * + * # Output the post ID for the 'activity-at-message' email type + * $ wp bp email get-post activity-at-message --fields=ID + * + * @alias get-post + * @alias see + */ + public function get_post($args, $assoc_args) + { + } + /** + * Reinstall BuddyPress default emails. + * + * ## OPTIONS + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLE + * + * # Reinstall BuddyPress default emails. + * $ wp bp email reinstall --yes + * Success: Emails have been successfully reinstalled. + */ + public function reinstall($args, $assoc_args) + { + } + /** + * Helper method to use the '--edit' flag. + * + * Copied from Post_Command::_edit(). + * + * @param string $content Post content. + * @param string $title Post title. + * @return mixed + */ + protected function edit_email($content, $title) + { + } + } + /** + * Manage BuddyPress Tools. + * + * ## EXAMPLES + * + * # Repair the friend count. + * $ wp bp tool repair friend-count + * Success: Counting the number of friends for each user. Complete! + * + * # Display BuddyPress version. + * $ wp bp tool version + * BuddyPress: 6.0.0 + * + * # Activate the signup tool. + * $ wp bp tool signup 1 + * Success: Signup tool updated. + * + * @since 1.5.0 + */ + class Tool extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Repair. + * + * ## OPTIONS + * + * <type> + * : Name of the repair tool. + * --- + * options: + * - friend-count + * - group-count + * - blog-records + * - count-members + * --- + * + * ## EXAMPLES + * + * # Repair the friend count. + * $ wp bp tool repair friend-count + * Success: Counting the number of friends for each user. Complete! + * + * @alias fix + */ + public function repair($args) + { + } + /** + * Display BuddyPress version currently installed. + * + * ## EXAMPLE + * + * # Display BuddyPress version. + * $ wp bp tool version + * BuddyPress: 6.0.0 + */ + public function version() + { + } + /** + * (De)Activate the signup feature. + * + * <status> + * : Status of the feature. + * + * ## EXAMPLES + * + * # Activate the signup tool. + * $ wp bp tool signup 1 + * Success: Signup tool updated. + * + * # Deactivate the signup tool. + * $ wp bp tool signup 0 + * Success: Signup tool updated. + */ + public function signup($args) + { + } + } + /** + * Adds, updates, deletes, and lists activity custom fields. + * + * ## EXAMPLES + * + * # Set activity meta + * $ wp bp activity meta set 123 description "Mary is a activity user." + * Success: Updated custom field 'description'. + * + * # Get activity meta + * $ wp bp activity meta get 123 description + * Mary is a Activity user. + * + * # Update activity meta + * $ wp bp activity meta update 123 description "Mary is an awesome activity user." + * Success: Updated custom field 'description'. + * + * # Delete activity meta + * $ wp bp activity meta delete 123 description + * Success: Deleted custom field. + * + * @since 2.0.0 + */ + class Activity_Meta extends \WP_CLI\CommandWithMeta + { + /** + * Type of the meta. + * + * @var string + */ + protected $meta_type = 'activity'; + /** + * Wrapper method for add_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Metadata key to use. + * @param mixed $meta_value Metadata value. Must be serializable if + * non-scalar. + * @param bool $unique Optional, default is false. Whether the + * specified metadata key should be unique for the + * object. If true, and the object already has a + * value for the specified metadata key, no change + * will be made. + * + * @return int|false The meta ID on success, false on failure. + */ + protected function add_metadata($object_id, $meta_key, $meta_value, $unique = false) + { + } + /** + * Wrapper method for update_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Metadata key to use. + * @param mixed $meta_value Metadata value. Must be serializable if + * non-scalar. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise, update all entries. + * + * @return int|bool Meta ID if the key didn't exist, true on successful + * update, false on failure. + */ + protected function update_metadata($object_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Wrapper method for get_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Optional. Metadata key. If not specified, + * retrieve all metadata for the specified object. + * @param bool $single Optional, default is false. If true, return only + * the first value of the specified meta_key. This + * parameter has no effect if meta_key is not + * specified. + * + * @return mixed Single metadata value, or array of values. + */ + protected function get_metadata($object_id, $meta_key = '', $single = true) + { + } + /** + * Wrapper method for delete_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object metadata is for + * @param string $meta_key Metadata key + * @param mixed $meta_value Optional. Metadata value. Must be serializable + * if non-scalar. If specified, only delete + * metadata entries with this value. Otherwise, + * delete all entries with the specified meta_key. + * Pass `null, `false`, or an empty string to skip + * this check. For backward compatibility, it is + * not possible to pass an empty string to delete + * those entries with an empty string for a value. + * + * @return bool True on successful delete, false on failure. + */ + protected function delete_metadata($object_id, $meta_key, $meta_value = '') + { + } + /** + * Check that the activity ID exists. + * + * @param int $object_id Object ID. + * @return int + */ + protected function check_object_id($object_id) + { + } + } + /** + * Manage BuddyPress activity favorites. + * + * ## EXAMPLES + * + * # Add an activity item as a favorite for a user. + * $ wp bp activity favorite add 100 500 + * Success: Activity item added as a favorite for the user. + * + * # Add an activity item as a favorite for a user using user_login. + * $ wp bp activity favorite create 100 user_test + * Success: Activity item added as a favorite for the user. + * + * @since 1.5.0 + */ + class Activity_Favorite extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'user_id', 'component', 'type', 'action', 'item_id', 'primary_link', 'secondary_item_id', 'date_recorded', 'hide_sitewide', 'is_spam']; + /** + * Add an activity item as a favorite for a user. + * + * ## OPTIONS + * + * <activity-id> + * : ID of the activity. + * + * <user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Add an activity item as a favorite. + * $ wp bp activity favorite add 100 500 + * Success: Activity item added as a favorite for the user. + * + * # Add an activity item as a favorite using a user_login identifier. + * $ wp bp activity favorite create 100 user_test + * Success: Activity item added as a favorite for the user. + * + * @alias add + */ + public function create($args) + { + } + /** + * Remove an activity item as a favorite for a user. + * + * ## OPTIONS + * + * <activity-id> + * : ID of the activity. + * + * <user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Remove an activity item as a favorite for a user. + * $ wp bp activity favorite remove 100 500 + * Success: Activity item removed as a favorite for the user. + * + * # Remove an activity item as a favorite for a user. + * $ wp bp activity favorite delete 100 user_test --yes + * Success: Activity item removed as a favorite for the user. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Get a user's favorite activity items. + * + * ## OPTIONS + * + * <user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--<field>=<value>] + * : One or more parameters to pass to \BP_Activity_Activity::get() + * + * [--count=<number>] + * : How many activity favorites to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLE + * + * # Get a user's favorite activity items. + * $ wp bp activity favorite list 315 + * + * @subcommand list + * @alias user-items + */ + public function list_($args, $assoc_args) + { + } + } + /** + * Manage BuddyPress Groups. + * + * ## EXAMPLES + * + * # Create a public group. + * $ wp bp group create --name="Totally Cool Group" + * Success: Group (ID 5465) created: http://example.com/groups/totally-cool-group/ + * + * # Create a private group. + * $ wp bp group create --name="Another Cool Group" --description="Cool Group" --creator-id=54 --status=private + * Success: Group (ID 6454)6 created: http://example.com/groups/another-cool-group/ + * + * @since 1.5.0 + */ + class Group extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'name', 'slug', 'status', 'date_created']; + /** + * Group ID Object Key + * + * @var string + */ + protected $obj_id_key = 'group_id'; + /** + * Group Object Type + * + * @var string + */ + protected $obj_type = 'group'; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Create a group. + * + * ## OPTIONS + * + * --name=<name> + * : Name of the group. + * + * [--slug=<slug>] + * : URL-safe slug for the group. If not provided, one will be generated automatically. + * + * [--description=<description>] + * : Group description. + * + * [--creator-id=<creator-id>] + * : ID of the group creator. + * --- + * default: 1 + * --- + * + * [--slug=<slug>] + * : URL-safe slug for the group. + * + * [--status=<status>] + * : Group status. + * --- + * default: public + * options: + * - public + * - private + * - hidden + * --- + * + * [--enable-forum=<enable-forum>] + * : Whether to enable legacy bbPress forums. + * + * [--date-created=<date-created>] + * : GMT timestamp, in Y-m-d h:i:s format. + * + * [--silent] + * : Whether to silent the group creation. + * + * [--porcelain] + * : Return only the new group id. + * + * ## EXAMPLES + * + * # Create a public group. + * $ wp bp group create --name="Totally Cool Group" + * Success: Successfully created new group (ID 5465) + * + * # Create a private group. + * $ wp bp group create --name="Another Cool Group" --description="Cool Group" --creator-id=54 --status=private + * Success: Successfully created new group (ID 6454) + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Generate random groups. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many groups to generate. + * --- + * default: 100 + * --- + * + * [--status=<status>] + * : The status of the generated groups. + * --- + * default: mixed + * options: + * - public + * - private + * - hidden + * - mixed + * --- + * + * [--creator-id=<creator-id>] + * : ID of the group creator. + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 50 random groups. + * $ wp bp group generate --count=50 + * Generating groups 100% [======================] 0:00 / 0:00 + * + * # Generate 5 groups with mixed status. + * $ wp bp group generate --count=5 --status=mixed + * Generating groups 100% [======================] 0:00 / 0:00 + * + * # Generate 10 hidden groups with a specific creator. + * $ wp bp group generate --count=10 --status=hidden --creator-id=30 + * Generating groups 100% [======================] 0:00 / 0:00 + * + * # Generate 5 random groups and output only the IDs. + * $ wp bp group generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Get a group. + * + * ## OPTIONS + * + * <group-id> + * : Identifier for the group. Can be a numeric ID or the group slug. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get group by ID. + * $ wp bp group get 500 + * + * # Get group by group slug. + * $ wp bp group get group-slug + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete a group. + * + * ## OPTIONS + * + * <group-id>... + * : ID or IDs of group(s) to delete. Can be a numeric ID or the group slug. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a group. + * $ wp bp group delete 500 --yes + * Success: Deleted group 500. + * + * # Delete a group and its metadata. + * $ wp bp group delete group-slug --yes + * Success: Deleted group group-slug. + * + * # Delete multiple groups. + * $ wp bp group delete 55654 54564 --yes + * Success: Deleted group 55654. + * Success: Deleted group 54564. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Update a group. + * + * ## OPTIONS + * + * <group-id>... + * : Identifier(s) for the group(s). Can be a numeric ID or the group slug. + * + * [--<field>=<value>] + * : One or more fields to update. See groups_create_group() + * + * ## EXAMPLES + * + * # Update a group. + * $ wp bp group update 35 --description="What a cool group!" --name="Group of Cool People" + * Success: Group updated. + */ + public function update($args, $assoc_args) + { + } + /** + * Get a list of groups. + * + * ## OPTIONS + * + * [--<field>=<value>] + * : One or more parameters to pass. See groups_get_groups() + * + * [--fields=<fields>] + * : Fields to display. + * + * [--user-id=<user>] + * : Limit results to groups of which a specific user is a member. Accepts either a user_login or a numeric ID. + * + * [--orderby=<orderby>] + * : Sort order for results. + * --- + * default: name + * options: + * - name + * - date_created + * - last_activity + * - total_member_count + * + * [--count=<number>] + * : Number of group to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - ids + * - count + * - csv + * - json + * - yaml + * --- + * + * ## AVAILABLE FIELDS + * + * These fields will be displayed by default for each group: + * + * * id + * * name + * * slug + * * status + * * date_created + * + * ## EXAMPLES + * + * # List groups and get the count. + * $ wp bp group list --format=count + * 100 + * + * # List groups and get the IDs. + * $ wp bp group list --format=ids + * 70 71 72 73 74 + * + * # List groups. + * $ wp bp group list + * +----+------------+---------+---------+---------------------+ + * | id | name | slug | status | date_created | + * +----+------------+---------+---------+---------------------+ + * | 1 | Group - #0 | group-0 | hidden | 2022-07-04 02:12:02 | + * | 2 | Group - #1 | group-1 | hidden | 2022-07-04 02:12:02 | + * | 4 | Group - #3 | group-3 | private | 2022-07-04 02:12:02 | + * | 5 | Group - #4 | group-4 | private | 2022-07-04 02:12:02 | + * | 3 | Group – #2 | group-2 | public | 2022-07-04 02:12:02 | + * +----+------------+---------+---------+---------------------+ + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Gets a randon group status. + * + * @since 1.5.0 + * + * @param string $status Group status. + * @return string + */ + protected function random_group_status($status) + { + } + } + /** + * Manage BuddyPress Sitewide Notices. + * + * ## EXAMPLES + * + * # Get a sitewide notice. + * $ wp bp notice get 500 + * +-----------+---------------------+ + * | Field | Value | + * +-----------+---------------------+ + * | id | 4 | + * | subject | Important message | + * | message | Let's talk! | + * | date_sent | 2023-01-11 12:47:00 | + * | is_active | 1 | + * +-----------+---------------------+ + * + * # Get a sitewide notice in JSON format. + * $ wp bp notice get 56 --format=json + * {"id":4,"subject":"Important message","message":"Let's talk!","date_sent":"2023-01-11 12:47:00","is_active":1} + * + * $ wp bp notice delete 55654 54564 --yes + * Success: Deleted notice 55654. + * Success: Deleted notice 54564. + */ + class Sitewide_Notice extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'subject', 'message', 'is_active', 'date_sent']; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Create a sitewide notice. + * + * ## OPTIONS + * + * --subject=<subject> + * : Notice subject text. + * + * --message=<message> + * : Notice message text. + * + * [--silent] + * : Whether to silent the notice creation. + * + * [--porcelain] + * : Output the new notice id only. + * + * ## EXAMPLES + * + * # Create a sitewide notice. + * $ wp bp notice create --subject=Hello --message=Folks! + * Success: Successfully created new sitewide notice. (ID #5464) + * + * # Create a sitewide notice and return its ID. + * $ wp bp notice create --subject=Hello --message=Folks! --porcelain + * 36565 + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Get specific sitewide notice. + * + * ## OPTIONS + * + * <notice-id> + * : Identifier for the notice. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get a sitewide notice. + * $ wp bp notice get 500 + * +-----------+---------------------+ + * | Field | Value | + * +-----------+---------------------+ + * | id | 4 | + * | subject | Important message | + * | message | Let's talk! | + * | date_sent | 2023-01-11 12:47:00 | + * | is_active | 1 | + * +-----------+---------------------+ + * + * # Get a sitewide notice in JSON format. + * $ wp bp notice get 56 --format=json + * {"id":4,"subject":"Important message","message":"Let's talk!","date_sent":"2023-01-11 12:47:00","is_active":1} + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete sitewide notice(s). + * + * ## OPTIONS + * + * <notice-id>... + * : ID or IDs of sitewide notices to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a sitewide notice. + * $ wp bp notice delete 520 --yes + * Success: Sitewide notice deleted 520. + * + * # Delete multiple sitewide notices. + * $ wp bp notice delete 55654 54564 --yes + * Success: Sitewide notice deleted 55654. + * Success: Sitewide notice deleted 54564. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Activate a sitewide notice. + * + * ## OPTIONS + * + * <notice-id> + * : Identifier for the notice. + * + * ## EXAMPLE + * + * $ wp bp notice activate 123 + * Success: Sitewide notice activated. + */ + public function activate($args) + { + } + /** + * Deactivate a sitewide notice. + * + * ## OPTIONS + * + * <notice-id> + * : Identifier for the notice. + * + * ## EXAMPLE + * + * $ wp bp notice deactivate 123 + * Success: Sitewide notice has been deactivated. + */ + public function deactivate($args) + { + } + /** + * Get a list of sitewide notices. + * + * ## OPTIONS + * + * [--fields=<fields>] + * : Fields to display. + * + * [--count=<number>] + * : How many notices to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - ids + * - count + * - csv + * - json + * - yaml + * --- + * ## EXAMPLES + * + * # List all sitewide notices, and output only the IDs. + * $ wp bp notice list --format=ids + * 15 25 34 37 198 + * + * # List all sitewide notices, and output the count. + * $ wp bp notice list --format=count + * 10 + * + * # List all sitewide notices, and output the IDs. + * $ wp bp notice list --fields=id + * | id | + * | 66546 | + * | 54554 | + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + } + /** + * Scaffold BuddyPress unit tests. + * + * ## EXAMPLE + * + * # Scaffold BuddyPress specific tests. + * $ wp bp scaffold tests sample-plugin + * Success: Created BuddyPress test files. + * + * @since 2.0 + */ + class Scaffold extends \Scaffold_Command + { + /** + * Default dependency check for a BuddyPress CLI command. + */ + public static function check_dependencies() + { + } + /** + * Plugin scaffold command. + * + * ## OPTIONS + * + * <slug> + * : The slug of the BuddyPress plugin. + * + * [--force] + * : Whether to overwrite files. + * + * ## EXAMPLES + * + * # Scaffold BuddyPress specific tests. + * $ wp bp scaffold plugin sample-test + * Success: Created BuddyPress test files. + * + * # Scaffold BuddyPress specific tests. + * $ wp bp scaffold tests another-sample-test + * Success: Created BuddyPress test files. + * + * @subcommand tests + */ + public function plugin($args, $assoc_args) + { + } + /** + * Checks that the `$target_dir` is a child directory of the WP themes or plugins directory, depending on `$type`. + * + * @param string $type "theme" or "plugin" + * @param string $target_dir The theme/plugin directory to check. + * @return null|string Returns null on success, error message on error. + */ + public function check_target_directory($target_dir) + { + } + /** + * Canonicalizes a path. + * + * @param string $path Path. + * @return string + */ + public static function canonicalize_path($path) + { + } + /** + * Gets the template path based on installation type. + * + * @return string Template path. + */ + public static function get_template_path($template) + { + } + } + /** + * Manage BuddyPress Members. + * + * ## EXAMPLES + * + * # Generate 50 members. + * $ wp bp member generate --count=50 + * + * # Add meta to every generated users. + * $ wp user generate --format=ids --count=3 | xargs -d ' ' -I % wp user meta add % foo bar + * Success: Added custom field. + * Success: Added custom field. + * Success: Added custom field. + * + * @since 1.0.0 + */ + class Member extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Generate BuddyPress members. See documentation for `wp_user_generate`. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many members to generate. + * --- + * default: 100 + * --- + * + * [--role=<role>] + * : The role of the generated users. Defaults to role from WP. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 50 members. + * $ wp bp member generate --count=50 + * Generating users 100% [======================] 0:00 / 0:00 + * + * # Add meta to every generated users. + * $ wp user generate --format=ids --count=3 | xargs -d ' ' -I % wp user meta add % foo bar + * Success: Added custom field. + * Success: Added custom field. + * Success: Added custom field. + */ + public function generate($args, $assoc_args) + { + } + /** + * Update the last user activity with a random date. + * + * @since 1.0 + * + * @param int $user_id User ID. + */ + public static function update_user_last_activity_random($user_id) + { + } + } + /** + * Manage BuddyPress group invites. + * + * ## EXAMPLES + * + * # Invite a member to a group. + * $ wp bp group invite add --group-id=40 --user-id=10 --inviter-id=1331 + * Success: Member invited to the group. + * + * # Invite a member to a group. + * $ wp bp group invite create --group-id=40 --user-id=user_slug --inviter-id=804 + * Success: Member invited to the group. + * + * @since 1.5.0 + */ + class Group_Invite extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Group ID Object Key + * + * @var string + */ + protected $obj_id_key = 'group_id'; + /** + * Group Object Type + * + * @var string + */ + protected $obj_type = 'group'; + /** + * Invite a member to a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * --inviter-id=<user> + * : Identifier for the inviter. Accepts either a user_login or a numeric ID. + * + * [--message=<value>] + * : Message to send with the invitation. + * + * [--porcelain] + * : Return only the invitation id. + * + * [--silent] + * : Whether to silent the invite creation. + * + * ## EXAMPLES + * + * # Invite a member to a group. + * $ wp bp group invite add --group-id=40 --user-id=10 --inviter-id=1331 + * Success: Member invited to the group. + * + * # Invite a member to a group. + * $ wp bp group invite create --group-id=40 --user-id=user_slug --inviter-id=804 + * Success: Member invited to the group. + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Uninvite a user from a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Uninvite a user from a group. + * $ wp bp group invite uninvite --group-id=3 --user-id=10 + * Success: User uninvited from the group. + * + * # Uninvite a user from a group. + * $ wp bp group invite uninvite --group-id=foo --user-id=admin + * Success: User uninvited from the group. + */ + public function uninvite($args, $assoc_args) + { + } + /** + * Get a list of invitations from a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--count=<number>] + * : How many invitations to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLE + * + * # Get a list of invitations from a group. + * $ wp bp group invite list --group-id=56 --user-id=30 + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Generate group invitations. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many group invitations to generate. + * --- + * default: 100 + * --- + * + * [--user-id=<user>] + * : ID of the first user. Accepts either a user_login or a numeric ID. + * + * [--inviter-id=<user>] + * : ID for the inviter. Accepts either a user_login or a numeric ID. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate random group invitations. + * $ wp bp group invite generate --count=50 + * Generating group invitations 100% [======================] 0:00 / 0:00 + * + * # Generate random group invitations with a specific user. + * $ wp bp group invite generate --inviter-id=121 --count=5 + * Generating group invitations 100% [======================] 0:00 / 0:00 + * + * # Generate 5 random group invitations and output only the IDs. + * $ wp bp group invite generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Accept a group invitation. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Accept a group invitation. + * $ wp bp group invite accept --group-id=3 --user-id=10 + * Success: User is now a "member" of the group. + * + * # Accept a group invitation. + * $ wp bp group invite accept --group-id=foo --user-id=admin + * Success: User is now a "member" of the group. + */ + public function accept($args, $assoc_args) + { + } + /** + * Reject a group invitation. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Reject a group invitation. + * $ wp bp group invite reject --group-id=3 --user-id=10 + * Success: Member invitation rejected. + * + * # Reject a group invitation. + * $ wp bp group invite reject --group-id=foo --user-id=admin + * Success: Member invitation rejected. + */ + public function reject($args, $assoc_args) + { + } + /** + * Delete a group invitation. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a group invitation. + * $ wp bp group invite delete --group-id=3 --user-id=10 --yes + * Success: Group invitation deleted. + * + * # Delete a group invitation. + * $ wp bp group invite delete --group-id=foo --user-id=admin --yes + * Success: Group invitation deleted. + * + * @alias delete + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + } + /** + * Manage BuddyPress group members. + * + * ## EXAMPLES + * + * # Add a user to a group as a member. + * $ wp bp group member add --group-id=3 --user-id=10 + * Success: Added user #3 to group #3 as member. + * + * # Add a user to a group as a mod. + * $ wp bp group member create --group-id=bar --user-id=20 --role=mod + * Success: Added user #20 to group #45 as mod. + * + * @since 1.5.0 + */ + class Group_Member extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Group ID Object Key + * + * @var string + */ + protected $obj_id_key = 'group_id'; + /** + * Group Object Type + * + * @var string + */ + protected $obj_type = 'group'; + /** + * Add a member to a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--role=<role>] + * : Group member role (member, mod, admin). + * --- + * default: member + * options: + * - member + * - mod + * - admin + * --- + * + * ## EXAMPLES + * + * # Add a user to a group as a member. + * $ wp bp group member add --group-id=3 --user-id=10 + * Success: Added user #3 to group #3 as member. + * + * # Add a user to a group as a moderator. + * $ wp bp group member create --group-id=bar --user-id=20 --role=mod + * Success: Added user #20 to group #45 as mod. + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Remove a member from a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Remove a member from a group. + * $ wp bp group member remove --group-id=3 --user-id=10 + * Success: Member #10 removed from the group #3. + * + * # Remove a member from a group. + * $ wp bp group member delete --group-id=foo --user-id=admin + * Success: Member #545 removed from the group #12. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Get a list of group memberships. + * + * This command can be used to fetch a list of a user's groups (using the --user-id + * parameter) or a group's members (using the --group-id flag). + * + * ## OPTIONS + * + * <group-id> + * : Identifier for the group. Can be a numeric ID or the group slug. + * + * [--fields=<fields>] + * : Limit the output to specific signup fields. + * + * [--<field>=<value>] + * : One or more parameters to pass. See groups_get_group_members() + * + * [--role=<role>] + * : Limit the output to members with a specific role. + * --- + * default: members + * options: + * - members + * - mod + * - admin + * - banned + * --- + * + * [--count=<number>] + * : How many members to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## AVAILABLE FIELDS + * + * These fields will be displayed by default for each group member: + * + * * id + * * user_login + * * fullname + * * date_modified + * * role + * + * ## EXAMPLE + * + * # Get a list of group members. + * $ wp bp group member list 3 + * +---------+------------+----------+---------------------+-------+ + * | id | user_login | fullname | date_modified | role | + * +---------+------------+----------+---------------------+-------+ + * | 1 | user | User | 2022-07-04 02:12:02 | admin | + * +---------+------------+----------+---------------------+-------+ + * + * # Get a list of group members and get the count. + * $ wp bp group member list 65465 --format=count + * 100 + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Promote a member to a new status within a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * --role=<role> + * : Group role to promote the member. + * --- + * options: + * - mod + * - admin + * --- + * + * ## EXAMPLES + * + * # Promote a member to a new role. + * $ wp bp group member promote --group-id=3 --user-id=10 --role=admin + * Success: Member promoted to new role successfully. + * + * # Promote a member to a new role. + * $ wp bp group member promote --group-id=foo --user-id=admin --role=mod + * Success: Member promoted to new role successfully. + */ + public function promote($args, $assoc_args) + { + } + /** + * Demote user to the 'member' status. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Demote a user to the "member" status using numeric IDs. + * $ wp bp group member demote --group-id=3 --user-id=10 + * Success: User demoted to the "member" status. + * + * # Demote a user to the "member" status using slugs. + * $ wp bp group member demote --group-id=foo --user-id=admin + * Success: User demoted to the "member" status. + * + * # Demote a user not part of the group. + * $ wp bp group member demote --group-id=foo --user-id=admin + * Error: User is not a member of the group. + */ + public function demote($args, $assoc_args) + { + } + /** + * Ban a member from a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Ban a member from a group. + * $ wp bp group member ban --group-id=3 --user-id=10 + * Success: Member banned from the group. + * + * # Ban a member from a group. + * $ wp bp group member ban --group-id=foo --user-id=admin + * Success: Member banned from the group. + */ + public function ban($args, $assoc_args) + { + } + /** + * Unban a member from a group. + * + * ## OPTIONS + * + * --group-id=<group> + * : Identifier for the group. Accepts either a slug or a numeric ID. + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * # Unban a member from a group. + * $ wp bp group member unban --group-id=3 --user-id=10 + * Success: Member unbanned from the group. + * + * # Unban a member from a group. + * $ wp bp group member unban --group-id=foo --user-id=admin + * Success: Member unbanned from the group. + */ + public function unban($args, $assoc_args) + { + } + } + /** + * Fetch a BuddyPress group based on one of its attributes. + */ + class Group_Fetcher extends \WP_CLI\Fetchers\Base + { + /** + * @var string $msg Error message to use when invalid data is provided. + */ + protected $msg = 'Could not find the group with ID %d.'; + /** + * Get a group ID from its identifier (ID or slug). + * + * @param int|string $arg Group ID or slug. + * @return BP_Groups_Group|bool + */ + public function get($arg) + { + } + } + /** + * Adds, updates, deletes, and lists group custom fields. + * + * ## EXAMPLES + * + * # Set group meta + * $ wp bp group meta set 123 description "Mary is a Group user." + * Success: Updated custom field 'description'. + * + * # Get group meta + * $ wp bp group meta get 123 description + * Mary is a Group user. + * + * # Update group meta + * $ wp bp group meta update 123 description "Mary is an awesome Group user." + * Success: Updated custom field 'description'. + * + * # List group meta. + * $ wp bp group meta list 123 + * + * # Delete group meta + * $ wp bp group meta delete 123 description + * Success: Deleted custom field. + * + * @since 2.0.0 + */ + class Group_Meta extends \WP_CLI\CommandWithMeta + { + protected $meta_type = 'group'; + /** + * Wrapper method for add_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Metadata key to use. + * @param mixed $meta_value Metadata value. Must be serializable if + * non-scalar. + * @param bool $unique Optional, default is false. Whether the + * specified metadata key should be unique for the + * object. If true, and the object already has a + * value for the specified metadata key, no change + * will be made. + * + * @return int|false The meta ID on success, false on failure. + */ + protected function add_metadata($object_id, $meta_key, $meta_value, $unique = false) + { + } + /** + * Wrapper method for update_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Metadata key to use. + * @param mixed $meta_value Metadata value. Must be serializable if + * non-scalar. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise, update all entries. + * + * @return int|bool Meta ID if the key didn't exist, true on successful + * update, false on failure. + */ + protected function update_metadata($object_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Wrapper method for get_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object the metadata is for. + * @param string $meta_key Optional. Metadata key. If not specified, + * retrieve all metadata for the specified object. + * @param bool $single Optional, default is false. If true, return only + * the first value of the specified meta_key. This + * parameter has no effect if meta_key is not + * specified. + * + * @return mixed Single metadata value, or array of values. + */ + protected function get_metadata($object_id, $meta_key = '', $single = true) + { + } + /** + * Wrapper method for delete_metadata that can be overridden in sub classes. + * + * @param int $object_id ID of the object metadata is for + * @param string $meta_key Metadata key + * @param mixed $meta_value Optional. Metadata value. Must be serializable + * if non-scalar. If specified, only delete + * metadata entries with this value. Otherwise, + * delete all entries with the specified meta_key. + * Pass `null, `false`, or an empty string to skip + * this check. For backward compatibility, it is + * not possible to pass an empty string to delete + * those entries with an empty string for a value. + * + * @return bool True on successful delete, false on failure. + */ + protected function delete_metadata($object_id, $meta_key, $meta_value = '') + { + } + /** + * Check that the group ID exists. + * + * @param int $object_id Object ID. + * @return int + */ + protected function check_object_id($object_id) + { + } + } + /** + * Manage BuddyPress Friends. + * + * ## EXAMPLES + * + * $ wp bp friend create user1 another_use + * Success: Friendship successfully created. + * + * $ wp bp friend create user1 another_use --force-accept + * Success: Friendship successfully created. + * + * @since 1.6.0 + */ + class Friends extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'initiator_user_id', 'friend_user_id', 'is_confirmed', 'is_limited']; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Create a new friendship. + * + * ## OPTIONS + * + * <initiator> + * : ID of the user who is sending the friendship request. Accepts either a user_login or a numeric ID. + * + * <friend> + * : ID of the user whose friendship is being requested. Accepts either a user_login or a numeric ID. + * + * [--force-accept] + * : Whether to force acceptance. + * + * [--silent] + * : Whether to silent the message creation. + * + * [--porcelain] + * : Return only the friendship id. + * + * ## EXAMPLES + * + * # Create a new friendship. + * $ wp bp friend create user1 another_use + * Success: Friendship successfully created. + * + * # Create a new friendship, forcing acceptance. + * $ wp bp friend create user1 another_use --force-accept + * Success: Friendship successfully created. + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Remove a friendship. + * + * ## OPTIONS + * + * <initiator> + * : ID of the friendship initiator. Accepts either a user_login or a numeric ID. + * + * <friend> + * : ID of the friend user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLE + * + * # Remove a friendship. + * $ wp bp friend remove user_1 user_2 + * Success: Friendship successfully removed. + * + * @alias remove + * @alias trash + */ + public function delete($args) + { + } + /** + * Mark a friendship request as accepted. + * + * ## OPTIONS + * + * <friendship>... + * : ID(s) of the friendship(s). + * + * ## EXAMPLES + * + * $ wp bp friend accept-invitation 2161 + * Success: Friendship successfully accepted. + * + * $ wp bp friend accept 2161 + * Success: Friendship successfully accepted. + * + * @alias accept-invitation + */ + public function accept($args, $assoc_args) + { + } + /** + * Mark a friendship request as rejected. + * + * ## OPTIONS + * + * <friendship>... + * : ID(s) of the friendship(s). + * + * ## EXAMPLES + * + * $ wp bp friend reject-invitation 2161 + * Success: Friendship successfully accepted. + * + * $ wp bp friend reject 2161 151 2121 + * Success: Friendship successfully accepted. + * + * @alias reject-invitation + */ + public function reject($args, $assoc_args) + { + } + /** + * Check whether two users are friends. + * + * ## OPTIONS + * + * <user> + * : ID of the first user. Accepts either a user_login or a numeric ID. + * + * <friend> + * : ID of the other user. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLES + * + * $ wp bp friend check 2161 65465 + * Success: Yes, they are friends. + * + * $ wp bp friend see 2121 65456 + * Success: Yes, they are friends. + * + * @alias see + */ + public function check($args) + { + } + /** + * Get a list of user's friends. + * + * ## OPTIONS + * + * <user> + * : ID of the user. Accepts either a user_login or a numeric ID. + * + * [--fields=<fields>] + * : Fields to display. + * + * [--count=<number>] + * : How many user's friends to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - ids + * - count + * - csv + * - json + * - yaml + * --- + * + * ## EXAMPLES + * + * # List a user's friends and get the count. + * $ wp bp friend list 65465 --format=count + * 100 + * + * # List a user's friends and get the IDs. + * $ wp bp friend list 2422 --format=ids + * 70 71 72 73 74 + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Generate random friendships. + * + * ## OPTIONS + * + * [--initiator=<user>] + * : ID of the first user. Accepts either a user_login or a numeric ID. + * + * [--friend=<user>] + * : ID of the second user. Accepts either a user_login or a numeric ID. + * + * [--count=<number>] + * : How many friendships to generate. + * --- + * default: 100 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 50 random friendships. + * $ wp bp friend generate --count=50 + * Generating friendships 100% [======================] 0:00 / 0:00 + * + * # Generate 50 friendships with a specific user. + * $ wp bp friend generate --initiator=121 --count=50 + * Generating friendships 100% [======================] 0:00 / 0:00 + * + * # Generate 5 random friendships and output only the IDs. + * $ wp bp friend generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + } + /** + * Manage XProfile Fields. + * + * @since 1.5.0 + */ + class XProfile_Field extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * XProfile object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'name', 'description', 'type', 'group_id', 'is_required']; + /** + * Get a list of XProfile fields. + * + * ## OPTIONS + * + * [--<field>=<value>] + * : One or more parameters to pass. See bp_xprofile_get_groups() + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * * ## AVAILABLE FIELDS + * + * These fields will be displayed by default for each field: + * + * * id + * * name + * * description + * * type + * * group_id + * * is_required + * + * ## EXAMPLE + * + * # List XProfile fields. + * $ wp bp xprofile field list + * +----+------+-------------+---------+----------+-------------+ + * | id | name | description | type | group_id | is_required | + * +----+------+-------------+---------+----------+-------------+ + * | 1 | Name | | textbox | 1 | 1 | + * +----+------+-------------+---------+----------+-------------+ + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Create a XProfile field. + * + * ## OPTIONS + * + * --field-group-id=<field-group-id> + * : ID of the field group where the new field will be created. + * + * --name=<name> + * : Name of the new field. + * + * [--type=<type>] + * : Field type. + * --- + * default: textbox + * --- + * + * [--silent] + * : Whether to silent the XProfile field creation. + * + * [--porcelain] + * : Output just the new field id. + * + * ## EXAMPLES + * + * # Create a XProfile field. + * $ wp bp xprofile field create --type=checkbox --field-group-id=508 --name="Field Name" + * Success: Created XProfile field "Field Name" (ID 24564). + * + * # Create a XProfile field. + * $ wp bp xprofile field add --field-group-id=165 --name="Another Field" + * Success: Created XProfile field "Another Field" (ID 5465). + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Get an XProfile field. + * + * ## OPTIONS + * + * <field-id> + * : Identifier for the field. Accepts either the name of the field or a numeric ID. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get a xprofile field. + * $ wp bp xprofile field get 500 + * + * # Get a xprofile field in JSON format. + * $ wp bp xprofile field see 56 --format=json + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete an XProfile field. + * + * ## OPTIONS + * + * <field-id>... + * : ID or IDs for the field. Accepts either the name of the field or a numeric ID. + * + * [--delete-data] + * : Delete user data for the field as well. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a field. + * $ wp bp xprofile field delete 500 --yes + * Success: Deleted XProfile field "Field Name" (ID 500). + * + * # Delete a field and its data. + * $ wp bp xprofile field remove 458 --delete-data --yes + * Success: Deleted XProfile field "Another Field Name" (ID 458). + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + } + /** + * Manage BuddyPress Components. + * + * ## EXAMPLES + * + * # Activate a component. + * $ wp bp component activate groups + * Success: The Groups component has been activated. + * + * # Deactive a component. + * $ wp bp component deactivate groups + * Success: The Groups component has been deactivated. + * + * # List required components. + * $ wp bp component list --type=required + * +--------+---------+--------+------------------------+--------------------------------------------+ + * | number | id | status | title | description | + * +--------+---------+--------+------------------------------------------+--------------------------+ + * | 1 | core | Active | BuddyPress Core | It's what makes <del>time travel</del> | + * | | | | | BuddyPress possible! | + * | 2 | members | Active | Community Members | Everything in a BuddyPress community | + * | | | | | revolves around its members. | + * +--------+---------+--------+------------------------------------------+--------------------------+ + * + * @since 1.6.0 + */ + class Components extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['number', 'id', 'status', 'title', 'description']; + /** + * Activate a component. + * + * ## OPTIONS + * + * <component> + * : Name of the component to activate. + * + * ## EXAMPLE + * + * # Activate a component. + * $ wp bp component activate groups + * Success: The Groups component has been activated. + */ + public function activate($args) + { + } + /** + * Deactivate a component. + * + * ## OPTIONS + * + * <component> + * : Name of the component to deactivate. + * + * ## EXAMPLE + * + * # Deactive a component. + * $ wp bp component deactivate groups + * Success: The Groups component has been deactivated. + */ + public function deactivate($args) + { + } + /** + * Get a list of components. + * + * ## OPTIONS + * + * [--type=<type>] + * : Type of the component (all, optional, retired, required). + * --- + * default: all + * options: + * - all + * - optional + * - retired + * - required + * --- + * + * [--status=<status>] + * : Status of the component (all, active, inactive). + * --- + * default: all + * options: + * - all + * - active + * - inactive + * --- + * + * [--fields=<fields>] + * : Fields to display (id, title, description). + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLES + * + * # List components and get the count. + * $ wp bp component list --format=count + * 10 + * + * # List components and get the ids. + * $ wp bp component list --format=ids + * core members xprofile settings friends messages activity notifications groups + * + * # List components. + * $ wp bp component list + * +--------+---------------+--------+--------------------+---------------------------------------------------------------------------------+ + * | number | id | status | title | description | + * +--------+---------------+--------+--------------------+---------------------------------------------------------------------------------+ + * | 1 | core | active | BuddyPress Core | It‘s what makes <del>time travel</del> BuddyPress possible! | + * | 2 | members | active | Community Members | Everything in a BuddyPress community revolves around its members. | + * | 3 | xprofile | active | Extended Profiles | Customize your community with fully editable profile fields that allow your use | + * | | | | | rs to describe themselves. | + * | 4 | settings | active | Account Settings | Allow your users to modify their account and notification settings directly fro | + * | | | | | m within their profiles. | + * | 5 | friends | active | Friend Connections | Let your users make connections so they can track the activity of others and fo | + * | | | | | cus on the people they care about the most. | + * | 6 | messages | active | Private Messaging | Allow your users to talk to each other directly and in private. Not just limite | + * | | | | | d to one-on-one discussions, messages can be sent between any number of members | + * | | | | | . | + * | 7 | activity | active | Activity Streams | Global, personal, and group activity streams with threaded commenting, direct p | + * | | | | | osting, favoriting, and @mentions, all with full RSS feed and email notificatio | + * | | | | | n support. | + * | 8 | notifications | active | Notifications | Notify members of relevant activity with a toolbar bubble and/or via email, and | + * | | | | | allow them to customize their notification settings. | + * | 9 | groups | active | User Groups | Groups allow your users to organize themselves into specific public, private or | + * | | | | | hidden sections with separate activity streams and member listings. | + * | 10 | blogs | active | Site Tracking | Record activity for new sites, posts, and comments across your network. | + * +--------+---------------+--------+--------------------+---------------------------------------------------------------------------------+ + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Does the component exist? + * + * @param string $component_key Component key. + * @return bool + */ + protected function component_exists($component_key) + { + } + /** + * Verify Component Status. + * + * @since 1.7.0 + * + * @param string $component_key Component key. + * @return string + */ + protected function verify_component_status($component_key) + { + } + } + /** + * Fetch a BuddyPress activity based on one of its attributes. + * + * @since 2.0.0 + */ + class Activity_Fetcher extends \WP_CLI\Fetchers\Base + { + /** + * @var string $msg Error message to use when invalid data is provided. + */ + protected $msg = 'Could not find the activity with ID %d.'; + /** + * Get an activity ID. + * + * @param int $activity_id Activity ID. + * @return BP_Activity_Activity|bool + */ + public function get($activity_id) + { + } + } + /** + * Manage BuddyPress Signups. + * + * ## EXAMPLES + * + * # Add a signup. + * $ wp bp signup create --user-login=test_user --user-email=teste@site.com + * Success: Successfully added new user signup (ID #345). + * + * # Activate a signup. + * $ wp bp signup activate ee48ec319fef3nn4 + * Success: Signup activated, new user (ID #545). + * + * @since 1.5.0 + */ + class Signup extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Signup object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'user_name', 'user_login', 'user_email', 'registered', 'meta', 'activation_key', 'count_sent']; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Add a signup. + * + * ## OPTIONS + * + * [--user-login=<user-login>] + * : User login for the signup. + * + * [--user-email=<user-email>] + * : User email for the signup. + * + * [--activation-key=<activation-key>] + * : Activation key for the signup. If none is provided, a random one will be used. + * + * [--silent] + * : Whether to silent the signup creation. + * + * [--porcelain] + * : Output only the new signup id. + * + * ## EXAMPLES + * + * # Add a signup. + * $ wp bp signup create --user-login=test_user --user-email=teste@site.com + * Success: Successfully added new user signup (ID #345). + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Get a signup. + * + * ## OPTIONS + * + * <signup-id> + * : Identifier for the signup. Can be a signup ID, an email address, or a user_login. + * + * [--match-field=<match-field>] + * : Field to match the signup-id to. Use if there is ambiguity between, eg, signup ID and user_login. + * --- + * options: + * - signup_id + * - user_email + * - user_login + * --- + * + * [--fields=<fields>] + * : Limit the output to specific signup fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get a signup. + * $ wp bp signup get 35 --fields=id,user_login,user_name,count_sent + * +------------+------------+ + * | Field | Value | + * +------------+------------+ + * | id | 35 | + * | user_login | user897616 | + * | user_name | Test user | + * | count_sent | 4 | + * +------------+------------+ + */ + public function get($args, $assoc_args) + { + } + /** + * Delete a signup. + * + * ## OPTIONS + * + * <signup-id>... + * : ID or IDs of signup to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a signup. + * $ wp bp signup delete 520 --yes + * Success: Signup deleted 54565. + * + * # Delete multiple signups. + * $ wp bp signup delete 55654 54565 --yes + * Success: Signup deleted 55654. + * Success: Signup deleted 54565. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Activate a signup. + * + * ## OPTIONS + * + * <signup-id> + * : Identifier for the signup. Can be a signup ID, an email address, or a user_login. + * + * ## EXAMPLES + * + * # Activate a signup. + * $ wp bp signup activate ee48ec319fef3nn4 + * Success: Signup activated, new user (ID #545). + */ + public function activate($args, $assoc_args) + { + } + /** + * Generate random signups. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many signups to generate. + * --- + * default: 100 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 50 random signups. + * $ wp bp signup generate --count=50 + * Generating signups 100% [======================] 0:00 / 0:00 + * + * # Generate 5 random signups and return their IDs. + * $ wp bp signup generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Resend activation e-mail to a newly registered user. + * + * ## OPTIONS + * + * <signup-id> + * : Identifier for the signup. Can be a signup ID, an email address, or a user_login. + * + * ## EXAMPLES + * + * # Resend activation e-mail to a newly registered user. + * $ wp bp signup resend test@example.com + * Success: Email sent successfully. + * + * @alias send + */ + public function resend($args, $assoc_args) + { + } + /** + * Get a list of signups. + * + * ## OPTIONS + * + * [--<field>=<value>] + * : One or more parameters to pass. See \BP_Signup::get() + * + * [--fields=<fields>] + * : Fields to display. + * + * [--count=<number>] + * : How many signups to list. + * --- + * default: 50 + * --- + * + * [--format=<value>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## EXAMPLES + * + * # List signups and get the IDs. + * $ wp bp signup list --format=ids + * 70 71 72 73 74 + * + * # List 100 signups and return the count. + * $ wp bp signup list --count=100 --format=count + * 100 + * + * # List active signups. + * $ wp bp signup list --active=1 --count=10 + * 50 + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Look up a signup by the provided identifier. + * + * @since 1.5.0 + * + * @return mixed + */ + protected function get_signup_by_identifier($identifier, $assoc_args) + { + } + } + /** + * Manage BuddyPress XProfile. + * + * ## EXAMPLES + * + * # Save a xprofile data to a user with its field and value. + * $ wp bp xprofile data set --user-id=45 --field-id=120 --value=test + * Success: Updated XProfile field "Field Name" (ID 120) with value "test" for user user_login (ID 45). + * + * # Create a xprofile group. + * $ wp bp xprofile group create --name="Group Name" --description="Xprofile Group Description" + * Success: Created XProfile field group "Group Name" (ID 123). + * + * # List xprofile fields. + * $ wp bp xprofile field list + * +----+------+-------------+---------+----------+-------------+ + * | id | name | description | type | group_id | is_required | + * +----+------+-------------+---------+----------+-------------+ + * | 1 | Name | | textbox | 1 | 1 | + * +----+------+-------------+---------+----------+-------------+ + */ + class XProfile extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + } + /** + * Manage BuddyPress Activities. + * + * ## EXAMPLES + * + * # Create an activity marked as spam. + * $ wp bp activity create --is-spam=1 + * Success: Successfully created new activity item (ID #5464) + * + * # Create an activity in a group. + * $ wp bp activity add --component=groups --item-id=2 --user-id=10 + * Success: Successfully created new activity item (ID #48949) + * + * @since 1.5.0 + */ + class Activity extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'user_id', 'component', 'type', 'action', 'item_id', 'primary_link', 'secondary_item_id', 'date_recorded', 'hide_sitewide', 'is_spam']; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Create an activity item. + * + * ## OPTIONS + * + * [--component=<component>] + * : The component for the activity item (groups, activity, etc). If + * none is provided, a component will be randomly selected from the + * active components. + * + * [--type=<type>] + * : Activity type (activity_update, group_created, etc). If none is + * provided, a type will be randomly chose from those natively + * associated with your <component>. + * + * [--action=<action>] + * : Action text (eg "Joe created a new group Foo"). If none is + * provided, one will be generated automatically based on other params. + * + * [--content=<content>] + * : Activity content text. If none is provided, default text will be + * generated. + * + * [--primary-link=<primary-link>] + * : URL of the item, as used in RSS feeds. If none is provided, a URL + * will be generated based on passed parameters. + * + * [--user-id=<user>] + * : ID of the user associated with the new item. If none is provided, + * a user will be randomly selected. + * + * [--item-id=<item-id>] + * : ID of the associated item. If none is provided, one will be + * generated automatically, if your activity type requires it. + * + * [--secondary-item-id=<secondary-item-id>] + * : ID of the secondary associated item. If none is provided, one will + * be generated automatically, if your activity type requires it. + * + * [--date-recorded=<date-recorded>] + * : GMT timestamp, in Y-m-d h:i:s format. + * + * [--hide-sitewide=<hide-sitewide>] + * : Whether to hide in sitewide streams. + * + * [--is-spam=<is-spam>] + * : Whether the item should be marked as spam. + * + * [--silent] + * : Whether to silent the activity creation. + * + * [--porcelain] + * : Output only the new activity id. + * + * ## EXAMPLES + * + * # Create an activity marked as spam. + * $ wp bp activity create --is-spam=1 + * Success: Successfully created new activity item (ID #5464) + * + * # Create an activity. + * $ wp bp activity add --component=groups --item-id=564 --user-id=10 + * Success: Successfully created new activity item (ID #48949) + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Retrieve a list of activities. + * + * ## OPTIONS + * + * [--<field>=<value>] + * : One or more parameters to pass to \BP_Activity_Activity::get() + * + * [--user-id=<user>] + * : Limit activities to a specific user id. Accepts a numeric ID. + * + * [--component=<component>] + * : Limit activities to a specific or certain components. + * + * [--type=<type>] + * : Type of the activity. Ex.: activity_update, profile_updated. + * + * [--primary-id=<primary-id>] + * : Object ID to filter the activities. Ex.: group_id or forum_id or blog_id, etc. + * + * [--secondary-id=<secondary-id>] + * : Secondary object ID to filter the activities. Ex.: a post_id. + * + * [--count=<number>] + * : How many activities to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - csv + * - ids + * - json + * - count + * - yaml + * --- + * + * ## AVAILABLE FIELDS + * + * These fields will be displayed by default for each activity: + * + * * id + * * user_id + * * component + * * type + * * action + * * content + * * item_id + * * secondary_item_id + * * primary_link + * * date_recorded + * * is_spam + * * user_email + * * user_nicename + * * user_login + * * display_name + * * user_fullname + * + * ## EXAMPLES + * + * # List activities and get the count. + * $ wp bp activity list --format=count + * 100 + * + * # List activities and get the IDs. + * $ wp bp activity list --format=ids + * 70 71 72 73 74 + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Generate random activity items. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many activities to generate. + * --- + * default: 100 + * --- + * + * [--skip-activity-comments=<skip-activity-comments>] + * : Whether to skip activity comments. Recording activity_comment + * items requires a resource-intensive tree rebuild. + * --- + * default: 1 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 5 activity items. + * $ wp bp activity generate --count=5 + * Generating activities 100% [======================] 0:00 / 0:00 + * + * # Generate 5 activity items and output only the IDs. + * $ wp bp activity generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Fetch specific activity. + * + * ## OPTIONS + * + * <activity-id> + * : Identifier for the activity. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLE + * + * # Get activity by ID. + * $ wp bp activity get 58 + * +-------------------+----------------------------------------------------------------------------------------------+ + * | Field | Value | + * +-------------------+----------------------------------------------------------------------------------------------+ + * | id | 58 | + * | user_id | 7 | + * | component | xprofile | + * | type | updated_profile | + * | action | <a href="https://wp.test/members/user_1_4/profile/">User 4</a>'s profile was updated | + * | content | Here is some random text | + * | primary_link | | + * | item_id | 0 | + * | secondary_item_id | 0 | + * | date_recorded | 2024-02-08 01:53:59 | + * | hide_sitewide | 0 | + * | mptt_left | 0 | + * | mptt_right | 0 | + * | is_spam | 0 | + * | user_email | | + * | user_nicename | user_1_4 | + * | user_login | user_1_4 | + * | display_name | User 4 | + * | user_fullname | User 4 | + * | children | [] | + * | url | https://wp.test/activity/p/58/ | + * +-------------------+----------------------------------------------------------------------------------------------+ + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete an activity. + * + * ## OPTIONS + * + * <activity-id>... + * : ID or IDs of activities to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete an activity. + * $ wp bp activity delete 958695 --yes + * Success: Deleted activity 958695. + * + * # Delete multiple activities. + * $ wp bp activity delete 500 600 --yes + * Success: Deleted activity 500. + * Success: Deleted activity 600. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Spam an activity. + * + * ## OPTIONS + * + * <activity-id> + * : Identifier for the activity. + * + * ## EXAMPLES + * + * # Spam an activity. + * $ wp bp activity spam 500 + * Success: Activity marked as spam. + * + * # Spam an activity. + * $ wp bp activity unham 165165 + * Success: Activity marked as spam. + * + * @alias unham + */ + public function spam($args) + { + } + /** + * Ham an activity. + * + * ## OPTIONS + * + * <activity-id> + * : Identifier for the activity. + * + * ## EXAMPLES + * + * # Mark an activity as ham. + * $ wp bp activity ham 500 + * Success: Activity marked as ham. + * + * # Mark an activity as ham. + * $ wp bp activity unspam 4679 + * Success: Activity marked as ham. + * + * @alias unspam + */ + public function ham($args) + { + } + /** + * Post an activity update. + * + * ## OPTIONS + * + * --user-id=<user> + * : ID of the user. + * + * --content=<content> + * : Activity content text. + * + * [--silent] + * : Whether to silent the activity update. + * + * [--porcelain] + * : Output only the new activity id. + * + * ## EXAMPLES + * + * # Post an activity update. + * $ wp bp activity post-update --user-id=50 --content="Content to update" + * Success: Successfully updated with a new activity item (ID #13165) + * + * # Post an activity update. + * $ wp bp activity post-update --user-id=140 + * Success: Successfully updated with a new activity item (ID #4548) + * + * @alias post-update + */ + public function post_update($args, $assoc_args) + { + } + /** + * Add an activity comment. + * + * ## OPTIONS + * + * <activity-id> + * : ID of the activity to add the comment. + * + * --user-id=<user> + * : ID of the user. If none is provided, a user will be randomly selected. + * + * --content=<content> + * : Activity content text. If none is provided, default text will be generated. + * + * [--skip-notification] + * : Whether to skip notification. + * + * [--silent] + * : Whether to silent the activity comment. + * + * [--porcelain] + * : Output only the new activity comment id. + * + * ## EXAMPLES + * + * # Add an activity comment. + * $ wp bp activity comment 560 --user-id=50 --content="New activity comment" + * Success: Successfully added a new activity comment (ID #4645) + * + * # Add an activity comment, skipping notification. + * $ wp bp activity comment 459 --user-id=140 --skip-notification=1 + * Success: Successfully added a new activity comment (ID #494) + */ + public function comment($args, $assoc_args) + { + } + /** + * Delete an activity comment. + * + * ## OPTIONS + * + * <activity-id> + * : Identifier for the activity. + * + * --comment-id=<comment-id> + * : ID of the comment to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete an activity comment. + * $ wp bp activity delete-comment 100 --comment-id=500 --yes + * Success: Activity comment deleted. + * + * # Delete an activity comment. + * $ wp bp activity delete-comment 165 --comment-id=35435 --yes + * Success: Activity comment deleted. + * + * @alias remove-comment + * @alias delete-comment + */ + public function delete_comment($args, $assoc_args) + { + } + /** + * Get a random type from a component. + * + * @since 1.1 + * + * @param string $component Component name. + * @return string + */ + protected function get_random_type_from_component($component) + { + } + /** + * Generate item details. + * + * @global wpdb $wpdb WordPress database abstraction object. + * + * @since 1.1 + * + * @param array $r Params. + * @return array + */ + protected function generate_item_details($r) + { + } + } + /** + * Manage XProfile Data. + * + * @since 1.5.0 + */ + class XProfile_Data extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * XProfile object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'field_id', 'user_id', 'value', 'last_updated']; + /** + * Set profile data for a user. + * + * ## OPTIONS + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * --field-id=<field> + * : Identifier for the field. Accepts either the name of the field or a numeric ID. + * + * --value=<value> + * : Value to set. + * + * [--silent] + * : Whether to silent the success message. + * + * ## EXAMPLE + * + * # Set profile data for a user. + * $ wp bp xprofile data set --user-id=45 --field-id=120 --value=test + * Success: Updated XProfile field "Field Name" (ID 120) with value "test" for user user_login (ID 45). + * + * @alias set + * @alias add + * @alias update + */ + public function create($args, $assoc_args) + { + } + /** + * Get profile data for a user. + * + * ## OPTIONS + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--field-id=<field>] + * : Identifier for the field. Accepts either the name of the field or a numeric ID. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * [--multi-format=<value>] + * : The format for the array data. + * --- + * default: array + * options: + * - array + * - comma + * --- + * + * ## EXAMPLES + * + * # Get profile data for a user. + * $ wp bp xprofile data get --user-id=45 --field-id=120 + * + * # Get profile data for a user, formatting the data. + * $ wp bp xprofile data see --user-id=user_test --field-id=Hometown --multi-format=comma + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete XProfile data for a user. + * + * ## OPTIONS + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--field-id=<field>] + * : Identifier for the field. Accepts either the name of the field or a numeric ID. + * + * [--delete-all] + * : Delete all data for the user. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a specific XProfile field data. + * $ wp bp xprofile data delete --user-id=45 --field-id=120 --yes + * Success: XProfile data removed. + * + * # Delete all XProfile data for a user. + * $ wp bp xprofile data remove --user-id=user_test --delete-all --yes + * Success: XProfile data removed. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + } + /** + * Manage XProfile Groups. + * + * @since 1.5.0 + */ + class XProfile_Group extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * XProfile object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'name', 'description', 'group_order', 'can_delete']; + /** + * Object ID key. + * + * @var string + */ + protected $obj_id_key = 'id'; + /** + * Create an XProfile group. + * + * ## OPTIONS + * + * --name=<name> + * : The name for this field group. + * + * [--description=<description>] + * : The description for this field group. + * + * [--can-delete=<can-delete>] + * : Whether the group can be deleted. + * --- + * default: 1 + * --- + * + * [--silent] + * : Whether to silent the XProfile group creation. + * + * [--porcelain] + * : Output just the new group id. + * + * ## EXAMPLES + * + * # Create XProfile field group. + * $ wp bp xprofile group create --name="Group Name" --description="Xprofile Group Description" + * Success: Created XProfile field group "Group Name" (ID 123). + * + * # Create XProfile field group that can't be deleted. + * $ wp bp xprofile group add --name="Another Group" --can-delete=false + * Success: Created XProfile field group "Another Group" (ID 21212). + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Fetch specific XProfile field group. + * + * ## OPTIONS + * + * <field-group-id> + * : Identifier for the field group. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get a specific field group. + * $ wp bp xprofile group get 500 + * +-------------+---------------+ + * | Field | Value | + * +-------------+---------------+ + * | id | 2 | + * | name | Group | + * | description | | + * | can_delete | 1 | + * | group_order | 0 | + * | fields | null | + * +-------------+---------------+ + * + * # Get a specific field group in JSON format. + * $ wp bp xprofile group see 56 --format=json + * {"id":2,"name":"Group","description":"","can_delete":1,"group_order":0,"fields":null} + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete specific XProfile field group(s). + * + * ## OPTIONS + * + * <field-group-id>... + * : ID or IDs of field groups to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a specific field group. + * $ wp bp xprofile group delete 500 --yes + * Success: Field group deleted 500. + * + * $ wp bp xprofile group delete 55654 54564 --yes + * Success: Field group deleted 55654. + * Success: Field group deleted 54564. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + } + /** + * Manage BuddyPress Notifications. + * + * ## EXAMPLES + * + * # Create notification item. + * $ wp bp notification create + * Success: Successfully created new notification. (ID #5464) + * + * # Delete a notification item. + * $ wp bp notification delete 520 + * Success: Notification deleted. + * + * @since 1.8.0 + */ + class Notification extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'user_id', 'item_id', 'secondary_item_id', 'component_name', 'component_action', 'date_notified', 'is_new']; + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Create a notification. + * + * ## OPTIONS + * + * [--component=<component>] + * : The component for the notification item (groups, activity, etc). If + * none is provided, a component will be randomly selected from the + * active components. + * + * [--action=<action>] + * : Name of the action to associate the notification. (comment_reply, update_reply, etc). + * + * [--user-id=<user>] + * : ID of the user associated with the new notification. + * + * [--item-id=<item>] + * : ID of the associated notification. + * + * [--secondary-item-id=<item>] + * : ID of the secondary associated notification. + * + * [--date=<date>] + * : GMT timestamp, in Y-m-d h:i:s format. + * + * [--silent] + * : Whether to silent the notification creation. + * + * [--porcelain] + * : Output only the new notification id. + * + * ## EXAMPLES + * + * # Create a `update_reply` notification. + * $ wp bp notification create --component=messages --action=update_reply --user-id=523 + * Success: Successfully created new notification. (ID #5464) + * + * # Create a `comment_reply` notification. + * $ wp bp notification add --component=groups --action=comment_reply --user-id=10 + * Success: Successfully created new notification (ID #48949) + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Get specific notification. + * + * ## OPTIONS + * + * <notification-id> + * : Identifier for the notification. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get a notification by ID. + * $ wp bp notification get 10071 + * +-------------------+---------------------+ + * | Field | Value | + * +-------------------+---------------------+ + * | id | 10071 | + * | item_id | 0 | + * | secondary_item_id | 0 | + * | user_id | 7 | + * | component_name | activity | + * | component_action | comment_reply | + * | date_notified | 2024-02-06 00:28:45 | + * | is_new | 1 | + * +-------------------+---------------------+ + * + * # Get a notification in JSON format. + * $ wp bp notification get 10071 --format=json + * {"id":10071,"item_id":0,"secondary_item_id":0,"user_id":7,"component_name":"activity","component_action":"comment_reply","date_notified":"2024-02-06 00:28:45","is_new":1} + * + * # Get a notification using a invalid ID. + * $ wp bp notification see buddypress + * Error: Please provide a numeric notification ID. + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Delete a notification. + * + * ## OPTIONS + * + * <notification-id>... + * : ID or IDs of notification to delete. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * # Delete a notification. + * $ wp bp notification delete 520 --yes + * Success: Deleted notification 520. + * + * # Delete multiple notifications. + * $ wp bp notification delete 55654 54564 --yes + * Success: Deleted notification 55654. + * Success: Deleted notification 54564. + * + * @alias remove + * @alias trash + */ + public function delete($args, $assoc_args) + { + } + /** + * Generate random notifications. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many notifications to generate. + * --- + * default: 100 + * --- + * + * [--user-id=<user>] + * : ID of the user. Accepts either a user_login or a numeric ID. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate 5 random notifications. + * $ wp bp notification generate --count=5 + * Generating notifications 100% [======================] 0:00 / 0:00 + * + * # Generate 5 random notifications and output only the IDs. + * $ wp bp notification generate --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Get a list of notifications. + * + * ## OPTIONS + * + * [--<field>=<value>] + * : One or more parameters to pass. + * + * [--fields=<fields>] + * : Fields to display. + * + * [--user-id=<user>] + * : Limit results to a specific member. Accepts either a user_login or a numeric ID. + * + * [--component=<component>] + * : The component to fetch notifications (groups, activity, etc). + * + * [--action=<action>] + * : Name of the action to fetch notifications. (comment_reply, update_reply, etc). + * + * [--count=<number>] + * : How many notification items to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - ids + * - count + * - csv + * - json + * - yaml + * --- + * ## EXAMPLES + * + * # List all notifications and output only the IDs. + * $ wp bp notification list --format=ids + * 15 25 34 37 198 + * + * # List all notifications and output the count. + * $ wp bp notification list --format=count + * 10 + * + * # List all notifications and output the IDs and user_id. + * $ wp bp notification list --fields=id,user_id + * | id | user_id | + * | 66546 | 656 | + * | 54554 | 646546 | + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Get random notification actions based on component. + * + * @since 1.8.0 + * + * @param string $component BuddyPress Component. + * @return string + */ + protected function get_random_action($component) + { + } + } + /** + * Manage BuddyPress through the command-line. + * + * ## EXAMPLES + * + * # Create a user signup. + * $ wp bp signup create --user-login=test_user --user-email=teste@site.com + * Success: Successfully added new user signup (ID #345). + * + * # Activate a component. + * $ wp bp component activate groups + * Success: The Groups component has been activated. + * + * # List xprofile fields. + * $ wp bp xprofile field list + * +----+------+-------------+---------+----------+-------------+ + * | id | name | description | type | group_id | is_required | + * +----+------+-------------+---------+----------+-------------+ + * | 1 | Name | | textbox | 1 | 1 | + * +----+------+-------------+---------+----------+-------------+ + */ + class BuddyPress extends \Buddypress\CLI\Command\BuddyPressCommand + { + } + /** + * Manage BuddyPress Messages. + * + * ## EXAMPLES + * + * # Create message. + * $ wp bp message create --from=user1 --to=user2 --subject="Message Title" --content="We are ready" + * Success: Message successfully created. + * + * # Delete a thread. + * $ wp bp message delete-thread 564 5465465 456456 --user-id=user_login --yes + * Success: Thread successfully deleted. + * + * @since 1.6.0 + */ + class Messages extends \Buddypress\CLI\Command\BuddyPressCommand + { + /** + * Dependency check for this CLI command. + */ + public static function check_dependencies() + { + } + /** + * Object fields. + * + * @var array + */ + protected $obj_fields = ['id', 'subject', 'message', 'thread_id', 'sender_id', 'date_sent']; + /** + * Add a message. + * + * ## OPTIONS + * + * --from=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--to=<user>] + * : Identifier for the recipient. To is not required when thread id is set. + * Accepts either a user_login or a numeric ID. + * + * --subject=<subject> + * : Subject of the message. + * + * --content=<content> + * : Content of the message. + * + * [--thread-id=<thread-id>] + * : Thread ID. + * + * [--date-sent=<date-sent>] + * : GMT timestamp, in Y-m-d h:i:s format. + * + * [--silent] + * : Whether to silent the message creation. + * + * [--porcelain] + * : Return the thread id of the message. + * + * ## EXAMPLES + * + * # Add a message. + * $ wp bp message add --from=user1 --to=user2 --subject="Message Title" --content="We are ready" + * Success: Message successfully created. + * + * # Create a message. + * $ wp bp message create --from=545 --to=313 --subject="Another Message Title" --content="Message OK" + * Success: Message successfully created. + * + * @alias add + */ + public function create($args, $assoc_args) + { + } + /** + * Delete thread(s) for a given user. + * + * ## OPTIONS + * + * <thread-id>... + * : Thread ID(s). + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--yes] + * : Answer yes to the confirmation message. + * + * ## EXAMPLES + * + * $ wp bp message delete-thread 500 687867 --user-id=40 + * Success: Thread successfully deleted. + * + * $ wp bp message delete-thread 564 5465465 456456 --user-id=user_logon --yes + * Success: Thread successfully deleted. + * + * @alias delete-thread + * @alias remove-thread + */ + public function delete_thread($args, $assoc_args) + { + } + /** + * Get a message. + * + * ## OPTIONS + * + * <message-id> + * : Identifier for the message. + * + * [--fields=<fields>] + * : Limit the output to specific fields. + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - json + * - csv + * - yaml + * --- + * + * ## EXAMPLES + * + * # Get message by ID. + * $ wp bp message get 5465 + * + * # Get message with a string + * $ wp bp message get invalid-id + * Error: Please provide a numeric message ID. + * + * @alias see + */ + public function get($args, $assoc_args) + { + } + /** + * Get a list of messages for a specific user. + * + * ## OPTIONS + * + * --user-id=<user> + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--<field>=<value>] + * : One or more parameters to pass. See \BP_Messages_Box_Template() + * + * [--fields=<fields>] + * : Fields to display. + * + * [--box=<box>] + * : Box of the message. + * --- + * default: sentbox + * options: + * - sentbox + * - inbox + * - notices + * --- + * + * [--type=<type>] + * : Type of the message. + * --- + * default: all + * options: + * - unread + * - read + * - all + * --- + * + * [--count=<number>] + * : How many messages to list. + * --- + * default: 50 + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: table + * options: + * - table + * - ids + * - count + * - csv + * - json + * - yaml + * --- + * + * ## AVAILABLE FIELDS + * + * These fields will be displayed by default for each message: + * + * * id + * * subject + * * message + * * thread_id + * * sender_id + * * date_sent + * + * ## EXAMPLES + * + * # Get a list of messages for a specific user. + * $ wp bp message list --user-id=544 --format=count + * 10 + * + * # Get a list of messages for a specific user and output only the IDs. + * $ wp bp message list --user-id=user_login --count=3 --format=ids + * 5454 45454 4545 465465 + * + * # Get a list of messages. + * # wp bp message list --user-id=1 --count=2 + * +----+----------------------+--------------------------+-----------+-----------+---------------------+ + * | id | subject | message | thread_id | sender_id | date_sent | + * +----+----------------------+--------------------------+-----------+-----------+---------------------+ + * | 35 | Another Thread | <p>Another thread</p> | 2 | 1 | 2022-10-27 16:29:29 | + * | 37 | Message Subject - #0 | Here is some random text | 2 | 7 | 2022-10-27 19:06:54 | + * +----+----------------------+--------------------------+-----------+-----------+---------------------+ + * + * @subcommand list + */ + public function list_($args, $assoc_args) + { + } + /** + * Generate random messages. + * + * ## OPTIONS + * + * [--count=<number>] + * : How many messages to generate. + * --- + * default: 100 + * --- + * + * [--from=<user>] + * : Identifier for the user. Accepts either a user_login or a numeric ID. + * + * [--to=<user>] + * : Identifier for the recipient. To is not required when thread id is set. + * Accepts either a user_login or a numeric ID. + * + * [--thread-id=<thread-id>] + * : Thread ID to generate messages against. + * --- + * + * [--format=<format>] + * : Render output in a particular format. + * --- + * default: progress + * options: + * - progress + * - ids + * --- + * + * ## EXAMPLES + * + * # Generate messages against a thread with a specific user. + * $ wp bp message generate --from=1 --to=2 --thread-id=6465 --count=30 + * Generating messages 100% [======================] 0:00 / 0:00 + * + * # Generate messages against a thread. + * $ wp bp message generate --thread-id=6465 --count=10 + * Generating messages 100% [======================] 0:00 / 0:00 + * + * # Generate 5 messages against a thread and output only the IDs. + * $ wp bp message generate --thread-id=5665456 --count=5 --format=ids + * 70 71 72 73 74 + */ + public function generate($args, $assoc_args) + { + } + /** + * Star a message. + * + * ## OPTIONS + * + * <message-id> + * : Message ID to star. + * + * --user-id=<user> + * : User that is starring the message. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLE + * + * # Star a message. + * $ wp bp message star 3543 --user-id=user_login + * Success: Message was successfully starred. + */ + public function star($args, $assoc_args) + { + } + /** + * Unstar a message. + * + * ## OPTIONS + * + * <message-id> + * : Message ID to unstar. + * + * --user-id=<user> + * : User that is unstarring the message. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLE + * + * # Unstar a message. + * $ wp bp message unstar 212 --user-id=another_user_login + * Success: Message was successfully unstarred. + */ + public function unstar($args, $assoc_args) + { + } + /** + * Star a thread. + * + * ## OPTIONS + * + * <thread-id> + * : Thread ID to star. + * + * --user-id=<user> + * : User that is starring the thread. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLE + * + * # Star a thread. + * $ wp bp message star-thread 212 --user-id=another_user_login + * Success: Thread was successfully starred. + * + * @alias star-thread + */ + public function star_thread($args, $assoc_args) + { + } + /** + * Unstar a thread. + * + * ## OPTIONS + * + * <thread-id> + * : Thread ID to unstar. + * + * --user-id=<user> + * : User that is unstarring the thread. Accepts either a user_login or a numeric ID. + * + * ## EXAMPLE + * + * # Unstar a thread. + * $ wp bp message unstar-thread 212 --user-id=another_user_login + * Success: Thread was successfully unstarred. + * + * @alias unstar-thread + */ + public function unstar_thread($args, $assoc_args) + { + } + /** + * Send a notice. + * + * ## OPTIONS + * + * --subject=<subject> + * : Subject of the notice/message. + * + * --content=<content> + * : Content of the notice. + * + * ## EXAMPLE + * + * # Send a notice. + * $ wp bp message send-notice --subject="Important notice" --content="We need to improve" + * Success: Notice was successfully sent. + * + * @alias send-notice + */ + public function send_notice($args, $assoc_args) + { + } + } +} +namespace { + /** + * Class to help set up XProfile fields. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_XProfile_Field + { + /** + * Field ID. + * + * @since 1.0.0 + * @var int + */ + public $id; + /** + * Field group ID. + * + * @since 1.0.0 + * @var int + */ + public $group_id; + /** + * Field parent ID. + * + * @since 1.0.0 + * @var int + */ + public $parent_id; + /** + * Field type. + * + * @since 1.0.0 + * @var string + */ + public $type = ''; + /** + * Field name. + * + * @since 1.0.0 + * @var string + */ + public $name = ''; + /** + * Field description. + * + * @since 1.0.0 + * @var string + */ + public $description = ''; + /** + * Required field? + * + * @since 1.0.0 + * @var bool + */ + public $is_required; + /** + * Deletable field? + * + * @since 1.0.0 + * @var int + */ + public $can_delete = '1'; + /** + * Field position. + * + * @since 1.0.0 + * @var int + */ + public $field_order; + /** + * Option order. + * + * @since 1.0.0 + * @var int + */ + public $option_order; + /** + * Order child fields. + * + * @since 1.0.0 + * @var string + */ + public $order_by = ''; + /** + * Is this the default option? + * + * @since 1.0.0 + * @var bool + */ + public $is_default_option; + /** + * Field data visibility. + * + * @since 1.0.0 + * @var string + */ + public $visibility; + /** + * Field data visibility. + * + * @since 1.9.0 + * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_default_visibility()`. + * @var string + */ + protected $default_visibility; + /** + * Is the visibility able to be modified? + * + * @since 2.3.0 + * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_allow_custom_visibility()`. + * @var string + */ + protected $allow_custom_visibility; + /** + * Whether values from this field are autolinked to directory searches. + * + * @since 2.5.0 + * @var bool + */ + public $do_autolink; + /** + * The signup position of the field into the signups form. + * + * @since 8.0.0 + * @var int + */ + public $signup_position; + /** + * Field type option. + * + * @since 2.0.0 + * @var BP_XProfile_Field_Type Field type object used for validation. + */ + public $type_obj = \null; + /** + * Field data for user ID. + * + * @since 2.0.0 + * @var BP_XProfile_ProfileData Field data for user ID. + */ + public $data; + /** + * Member types to which the profile field should be applied. + * + * @since 2.4.0 + * @var array Array of member types. + */ + protected $member_types; + /** + * Initialize and/or populate profile field. + * + * @since 1.1.0 + * + * @param int|null $id Field ID. + * @param int|null $user_id User ID. + * @param bool $get_data Get data. + */ + public function __construct($id = \null, $user_id = \null, $get_data = \true) + { + } + /** + * Populate a profile field object. + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * @global object $userdata + * + * @param int $id Field ID. + * @param int|null $user_id User ID. + * @param bool $get_data Get data. + */ + public function populate($id, $user_id = \null, $get_data = \true) + { + } + /** + * Retrieve a `BP_XProfile_Field` instance. + * + * @since 2.4.0 + * @since 2.8.0 Added `$user_id` and `$get_data` parameters. + * + * @global wpdb $wpdb WordPress database object. + * + * @static + * + * @param int $field_id ID of the field. + * @param int|null $user_id Optional. ID of the user associated with the field. + * Ignored if `$get_data` is false. If `$get_data` is + * true, but no `$user_id` is provided, defaults to + * logged-in user ID. + * @param bool $get_data Whether to fetch data for the specified `$user_id`. + * @return BP_XProfile_Field|false Field object if found, otherwise false. + */ + public static function get_instance($field_id, $user_id = \null, $get_data = \true) + { + } + /** + * Fill object vars based on data passed to the method. + * + * @since 2.4.0 + * + * @param array|object $args Array or object representing the `BP_XProfile_Field` properties. + * Generally, this is a row from the fields database table. + */ + public function fill_data($args) + { + } + /** + * Magic getter. + * + * @since 2.4.0 + * + * @param string $key Property name. + * @return string|null + */ + public function __get($key) + { + } + /** + * Magic issetter. + * + * @since 2.4.0 + * + * @param string $key Property name. + * @return bool + */ + public function __isset($key) + { + } + /** + * Delete a profile field. + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param boolean $delete_data Whether or not to delete data. + * @return bool + */ + public function delete($delete_data = \false) + { + } + /** + * Save a profile field. + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Get field data for a user ID. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user to get field data for. + * @return BP_XProfile_ProfileData + */ + public function get_field_data($user_id = 0) + { + } + /** + * Get all child fields for this field ID. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param bool $for_editing Whether or not the field is for editing. Default to false. + * @return array + */ + public function get_children($for_editing = \false) + { + } + /** + * Delete all field children for this field. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function delete_children() + { + } + /** + * Gets the member types to which this field should be available. + * + * Will not return inactive member types, even if associated metadata is found. + * + * 'null' is a special pseudo-type, which represents users that do not have a member type. + * + * @since 2.4.0 + * + * @return array Array of member type names. + */ + public function get_member_types() + { + } + /** + * Sets the member types for this field. + * + * @since 2.4.0 + * + * @param array $member_types Array of member types. Can include 'null' (users with no type) in addition to any + * registered types. + * @param bool $append Whether to append to existing member types. If false, all existing member type + * associations will be deleted before adding your `$member_types`. Default false. + * @return array Member types for the current field, after being saved. + */ + public function set_member_types($member_types, $append = \false) + { + } + /** + * Gets a label representing the field's member types. + * + * This label is displayed alongside the field's name on the Profile Fields Dashboard panel. + * + * @since 2.4.0 + * + * @return string + */ + public function get_member_type_label() + { + } + /** + * Get the field's default visibility setting. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to 'public' if no visibility setting is found in the database. + * + * @since 2.4.0 + * + * @return string + */ + public function get_default_visibility() + { + } + /** + * Get whether the field's default visibility can be overridden by users. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to 'allowed'. + * + * @since 4.4.0 + * + * @return string 'disabled' or 'allowed'. + */ + public function get_allow_custom_visibility() + { + } + /** + * Get the field's signup position. + * + * @since 8.0.0 + * + * @return int the field's signup position. + * 0 if the field has not been added to the signup form. + */ + public function get_signup_position() + { + } + /** + * Get whether the field values should be auto-linked to a directory search. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to true for multi and default fields, false for single fields. + * + * @since 2.5.0 + * + * @return bool + */ + public function get_do_autolink() + { + } + /* Static Methods ********************************************************/ + /** + * Get the type for provided field ID. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id Field ID to get type of. + * @return bool|null|string + */ + public static function get_type($field_id = 0) + { + } + /** + * Delete all fields in a field group. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $group_id ID of the field group to delete fields from. + * @return bool + */ + public static function delete_for_group($group_id = 0) + { + } + /** + * Get field ID from field name. + * + * @since 1.5.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $field_name Name of the field to query the ID for. + * @return int|null Field ID on success; null on failure. + */ + public static function get_id_from_name($field_name = '') + { + } + /** + * Update field position and/or field group when relocating. + * + * @since 1.5.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id ID of the field to update. + * @param int|null $position Field position to update. + * @param int|null $field_group_id ID of the field group. + * @return bool + */ + public static function update_position($field_id, $position = \null, $field_group_id = \null) + { + } + /** + * Gets the IDs of fields applicable for a given member type or array of member types. + * + * @since 2.4.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string|array $member_types Member type or array of member types. Use 'any' to return unrestricted + * fields (those available for anyone, regardless of member type). + * @return array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types + * associated with each field as values. + */ + public static function get_fields_for_member_type($member_types) + { + } + /** + * Validate form field data on submission. + * + * @since 2.2.0 + * + * @global string $message The feedback message to show. + * + * @return bool + */ + public static function admin_validate() + { + } + /** + * Save miscellaneous settings for this field. + * + * Some field types have type-specific settings, which are saved here. + * + * @since 2.7.0 + * + * @param array $settings Array of settings. + */ + public function admin_save_settings($settings) + { + } + /** + * Populates the items for radio buttons, checkboxes, and dropdown boxes. + */ + public function render_admin_form_children() + { + } + /** + * Oupput the admin form for this field. + * + * @since 1.9.0 + * + * @param string $message Message to display. + */ + public function render_admin_form($message = '') + { + } + /** + * Gets field type supports. + * + * @since 8.0.0 + * + * @return bool[] Supported features. + */ + public function get_field_type_supports() + { + } + /** + * Checks whether the field type supports the requested feature. + * + * @since 8.0.0 + * + * @param string $support The name of the feature. + * @return bool True if the field type supports the feature. False otherwise. + */ + public function field_type_supports($support = '') + { + } + /** + * Private method used to display the submit metabox. + * + * @since 2.3.0 + * + * @param string $button_text Text to put on button. + */ + private function submit_metabox($button_text = '') + { + } + /** + * Private method used to output field name and description fields. + * + * @since 2.3.0 + */ + private function name_and_description() + { + } + /** + * Private method used to output field Member Type metabox. + * + * @since 2.4.0 + */ + private function member_type_metabox() + { + } + /** + * Private method used to output field visibility metaboxes. + * + * @since 2.3.0 + */ + private function visibility_metabox() + { + } + /** + * Output the metabox for setting if field is required or not. + * + * @since 2.3.0 + */ + private function required_metabox() + { + } + /** + * Private method used to output autolink metabox. + * + * @since 2.5.0 + */ + private function autolink_metabox() + { + } + /** + * Output the metabox for setting what type of field this is. + * + * @since 2.3.0 + */ + private function type_metabox() + { + } + /** + * Output the metabox for setting the field's position into the signup form. + * + * @since 8.0.0 + */ + private function signup_position_metabox() + { + } + /** + * Output hidden fields used by default field. + * + * @since 2.3.0 + */ + private function default_field_hidden_inputs() + { + } + /** + * Return if a field ID is the default field. + * + * @since 2.3.0 + * + * @param int $field_id ID of field to check. + * @return bool + */ + private function is_default_field($field_id = 0) + { + } + } + /** + * Represents a type of XProfile field and holds meta information about the type of value that it accepts. + * + * @since 2.0.0 + */ + abstract class BP_XProfile_Field_Type + { + /** + * Validation regex rules for field type. + * + * @since 2.0.0 + * @var array Field type validation regexes. + */ + protected $validation_regex = array(); + /** + * Allowed values for field type. + * + * @since 2.0.0 + * @var array Field type allowed values. + */ + protected $validation_allowed_values = array(); + /** + * Name for field type. + * + * @since 2.0.0 + * @var string The name of this field type. + */ + public $name = ''; + /** + * The name of the category that this field type should be grouped with. Used on the [Users > Profile Fields] screen in wp-admin. + * + * @since 2.0.0 + * @var string + */ + public $category = ''; + /** + * If allowed to store null/empty values. + * + * @since 2.0.0 + * @var bool If this is set, allow BP to store null/empty values for this field type. + */ + public $accepts_null_value = \false; + /** + * If this is set, BP will set this field type's list of allowed values from the field's options (e.g checkbox, selectbox). + * + * @since 2.0.0 + * @var bool Does this field support options? e.g. selectbox, radio buttons, etc. + */ + public $supports_options = \false; + /** + * If allowed to support multiple options as default. + * + * @since 2.0.0 + * @var bool Does this field type support multiple options being set as default values? e.g. multiselectbox, checkbox. + */ + public $supports_multiple_defaults = \false; + /** + * If the field type supports rich text by default. + * + * @since 2.4.0 + * @var bool + */ + public $supports_richtext = \false; + /** + * If the field type has a type-specific settings section on the Edit Field panel. + * + * @since 2.7.0 + * @var bool|null Boolean if set explicitly by the type object, otherwise null. + */ + protected $do_settings_section = \null; + /** + * If object is created by an BP_XProfile_Field object. + * + * @since 2.0.0 + * @var BP_XProfile_Field If this object is created by instantiating a {@link BP_XProfile_Field}, + * this is a reference back to that object. + */ + public $field_obj = \null; + /** + * Field data visibility. + * + * @since 2.0.0 + * @var string + */ + public $visibility; + /** + * Constructor. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Set a regex that profile data will be asserted against. + * + * You can call this method multiple times to set multiple formats. When validation is performed, + * it's successful as long as the new value matches any one of the registered formats. + * + * @since 2.0.0 + * + * @param string $format Regex string. + * @param string $replace_format Optional; if 'replace', replaces the format instead of adding to it. + * Defaults to 'add'. + * @return BP_XProfile_Field_Type + */ + public function set_format($format, $replace_format = 'add') + { + } + /** + * Add a value to this type's list of allowed values that profile data will be asserted against. + * + * @since 2.0.0 + * @deprecated 7.0.0 Use set_allowed_values() instead. + * + * @param string|array $values Whitelisted values. + * @return BP_XProfile_Field_Type + */ + public function set_whitelist_values($values) + { + } + /** + * Add a value to this type's list of allowed values that profile data will be asserted against. + * + * You can call this method multiple times to set multiple formats. When validation is performed, + * it's successful as long as the new value matches any one of the registered formats. + * + * @since 7.0.0 + * + * @param string|array $values Allowed values. + * @return BP_XProfile_Field_Type + */ + public function set_allowed_values($values) + { + } + /** + * Check the given string against the registered formats for this field type. + * + * This method doesn't support chaining. + * + * @since 2.0.0 + * + * @param string|array $values Value to check against the registered formats. + * @return bool True if the value validates + */ + public function is_valid($values) + { + } + /** + * Check whether the current field type should have a settings ("options") section on the Edit Field panel. + * + * Falls back on `supports_options` if no value is set by the field type. + * + * @since 2.7.0 + * + * @return bool + */ + public function do_settings_section() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public abstract function edit_field_html(array $raw_properties = array()); + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public abstract function admin_field_html(array $raw_properties = array()); + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * Populate this method in a child class if it's required. Otherwise, you can leave it out. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. + * + * You don't need to implement this method for all field types. It's used in core by the + * selectbox, multi selectbox, checkbox, and radio button fields, to allow the admin to + * enter the child option values (e.g. the choices in a select box). + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Allow field types to modify submitted values before they are validated. + * + * In some cases, it may be appropriate for a field type to catch + * submitted values and modify them before they are passed to the + * is_valid() method. For example, URL validation requires the + * 'http://' scheme (so that the value saved in the database is always + * a fully-formed URL), but in order to allow users to enter a URL + * without this scheme, BP_XProfile_Field_Type_URL prepends 'http://' + * when it's not present. + * + * By default, this is a pass-through method that does nothing. Only + * override in your own field type if you need this kind of pre- + * validation filtering. + * + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. + * + * @param mixed $field_value Submitted field value. + * @param string|int $field_id Optional. ID of the field. + * @return mixed + */ + public static function pre_validate_filter($field_value, $field_id = '') + { + } + /** + * Allow field types to modify the appearance of their values. + * + * By default, this is a pass-through method that does nothing. Only + * override in your own field type if you need to provide custom + * filtering for output values. + * + * @since 2.1.0 + * @since 2.4.0 Added `$field_id` parameter. + * + * @param mixed $field_value Field value. + * @param string|int $field_id ID of the field. + * @return mixed + */ + public static function display_filter($field_value, $field_id = '') + { + } + /** + * Save miscellaneous settings related to this field type. + * + * Override in a specific field type if it requires an admin save routine. + * + * @since 2.7.0 + * + * @param int $field_id Field ID. + * @param array $settings Array of settings. + */ + public function admin_save_settings($field_id, $settings) + { + } + /** Protected *************************************************************/ + /** + * Get a sanitized and escaped string of the edit field's HTML elements and attributes. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * This method was intended to be static but couldn't be because php.net/lsb/ requires PHP >= 5.3. + * + * @since 2.0.0 + * + * @param array $properties Optional key/value array of attributes for this edit field. + * @return string + */ + protected function get_edit_field_html_elements(array $properties = array()) + { + } + /** + * Output a sanitized and escaped string of the edit field's HTML elements and attributes. + * + * @since 12.4.1 + * + * @param array $properties Optional key/value array of attributes for this edit field. + */ + protected function output_edit_field_html_elements(array $properties = array()) + { + } + } + /** + * Checkbox xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Checkbox extends \BP_XProfile_Field_Type + { + /** + * Constructor for the checkbox field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.checkbox.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * XProfile Field Groups Endpoints. + * + * Use /xprofile/groups + * Use /xprofile/groups/{id} + * + * @since 5.0.0 + */ + class BP_REST_XProfile_Field_Groups_Endpoint extends \WP_REST_Controller + { + /** + * XProfile Fields Class. + * + * @since 5.0.0 + * + * @var BP_REST_XProfile_Fields_Endpoint + */ + protected $fields_endpoint; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Edit some properties for the CREATABLE & EDITABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Retrieve XProfile groups. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to XProfile field groups items. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve single XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get information about a specific field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create a XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Check if a given request has access to create a XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update a XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to create a XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete a XProfile field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a field group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares single XProfile field group data for return as an object. + * + * @since 5.0.0 + * + * @param BP_XProfile_Group $group XProfile field group data. + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($group, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_XProfile_Group $group XProfile field group. + * @return array + */ + protected function prepare_links($group) + { + } + /** + * Get XProfile field group object. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return BP_XProfile_Group|string XProfile field group object. + */ + public function get_xprofile_field_group_object($request) + { + } + /** + * Get the XProfile field group schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for XProfile field groups. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Telephone number xprofile field type. + * + * @since 3.0.0 + */ + class BP_XProfile_Field_Type_Telephone extends \BP_XProfile_Field_Type + { + /** + * Constructor for the telephone number field type. + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 3.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 3.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 3.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the + * current field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Format URL values for display. + * + * @since 3.0.0 + * + * @param string $field_value The URL value, as saved in the database. + * @param string|int $field_id Optional. ID of the field. + * + * @return string URL converted to a link. + */ + public static function display_filter($field_value, $field_id = '') + { + } + } + /** + * Textarea xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Textarea extends \BP_XProfile_Field_Type + { + /** + * Constructor for the textarea field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * Textbox xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Textbox extends \BP_XProfile_Field_Type + { + /** + * Constructor for the textbox field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the + * current field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * URL xprofile field type. + * + * @since 2.1.0 + */ + class BP_XProfile_Field_Type_URL extends \BP_XProfile_Field_Type + { + /** + * Supported features for the URL field type. + * + * @since 8.0.0 + * @var bool[] The URL field type supported features. + */ + public static $supported_features = array('do_autolink' => \false); + /** + * Constructor for the URL field type + * + * @since 2.1.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.1.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.1.0 + * + * @param array $raw_properties Optional key/value array of permitted + * attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options + * on the wp-admin Profile Fields "Add Field" and "Edit Field" screens, but + * for this field type, we don't want it, so it's stubbed out. + * + * @since 2.1.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Modify submitted URL values before validation. + * + * The URL validation regex requires a http(s) protocol, so that all + * values saved in the database are fully-formed URLs. However, we + * still want to allow users to enter URLs without a protocol, for a + * better user experience. So we catch submitted URL values, and if + * the protocol is missing, we prepend 'http://' before passing to + * is_valid(). + * + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. + * + * @param string $submitted_value Raw value submitted by the user. + * @param string|int $field_id Optional. ID of the field. + * @return string + */ + public static function pre_validate_filter($submitted_value = '', $field_id = '') + { + } + /** + * Format URL values for display. + * + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. + * + * @param string $field_value The URL value, as saved in the database. + * @param string|int $field_id Optional. ID of the field. + * @return string URL converted to a link. + */ + public static function display_filter($field_value, $field_id = '') + { + } + } + /** + * XProfile Fields endpoints. + * + * Use /xprofile/fields + * Use /xprofile/fields/{id} + * + * @since 5.0.0 + */ + class BP_REST_XProfile_Fields_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve XProfile fields. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to XProfile fields. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve single XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get information about a specific XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Set additional field properties. + * + * @since 5.0.0 + * + * @param integer $field_id The profile field object ID. + * @param WP_REST_Request $request The request sent to the API. + */ + public function set_additional_field_properties($field_id, \WP_REST_Request $request) + { + } + /** + * Create a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Check if a given request has access to create a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a XProfile field. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares single XProfile field data to return as an object. + * + * @since 5.0.0 + * + * @param BP_XProfile_Field $field XProfile field object. + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($field, $request) + { + } + /** + * Assembles single XProfile field data to return as an object. + * + * @since 5.0.0 + * + * @param BP_XProfile_Field $field XProfile field object. + * @param WP_REST_Request $request Full data about the request. + * @return array + */ + public function assemble_response_data($field, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_XProfile_Field $field XProfile field object. + * @return array + */ + protected function prepare_links($field) + { + } + /** + * Get XProfile field object. + * + * @since 5.0.0 + * + * @param WP_REST_Request|int $request Request info or integer. + * @return BP_XProfile_Field|string + */ + public function get_xprofile_field_object($request) + { + } + /** + * Retrieve the rendered value of a profile field. + * + * @since 5.0.0 + * + * @param string $value The raw value of the field. + * @param integer|BP_XProfile_Field $profile_field The ID or the full object for the field. + * @return string The field value for the display context. + */ + public function get_profile_field_rendered_value($value = '', $profile_field = \null) + { + } + /** + * Retrieve the unserialized value of a profile field. + * + * @since 5.0.0 + * + * @param string $value The raw value of the field. + * @return array The unserialized field value. + */ + public function get_profile_field_unserialized_value($value = '') + { + } + /** + * Edit some properties for the CREATABLE & EDITABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the XProfile field schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for the XProfile fields. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Datebox xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Datebox extends \BP_XProfile_Field_Type + { + /** + * Constructor for the datebox field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Get settings for a given date field. + * + * @since 2.7.0 + * + * @param int $field_id ID of the field. + * @return array + */ + public static function get_field_settings($field_id) + { + } + /** + * Validate date field settings. + * + * @since 2.7.0 + * + * @param array $settings Raw settings. + * @return array Validated settings. + */ + public static function validate_settings($settings) + { + } + /** + * Save settings from the field edit screen in the Dashboard. + * + * @param int $field_id ID of the field. + * @param array $settings Array of settings. + * @return bool + */ + public function admin_save_settings($field_id, $settings) + { + } + /** + * Generate the settings markup for Date fields. + * + * @since 2.7.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Format Date values for display. + * + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. + * + * @param string $field_value The date value, as saved in the database. Typically, this is a MySQL-formatted + * date string (Y-m-d H:i:s). + * @param string|int $field_id Optional. ID of the field. + * @return string Date formatted by bp_format_time(). + */ + public static function display_filter($field_value, $field_id = '') + { + } + /** + * Gets the default date formats available when configuring a Date field. + * + * @since 2.7.0 + * + * @return array + */ + public function get_date_formats() + { + } + } + /** + * Base class for xprofile field types that set/get WordPress profile data from usermeta. + * + * @since 8.0.0 + */ + abstract class BP_XProfile_Field_Type_WordPress extends \BP_XProfile_Field_Type + { + /** + * The usermeta key for the WordPress field. + * + * @since 8.0.0 + * @var string The meta key name of this WordPress field. + */ + public $wp_user_key = ''; + /** + * The WordPress supported user keys. + * + * @since 8.0.0 + * @var string[] The WordPress supported user keys. + */ + public $supported_keys = array(); + /** + * WordPress field's visibility setting. + * + * Defaults to 'public'. This property enforces Field's default visibility. + * + * @since 8.0.0 + * + * @return string The WordPress field's visibility setting. + */ + public $visibility = 'public'; + /** + * Supported features for the WordPress field type. + * + * @since 8.0.0 + * @var bool[] The WordPress field supported features. + */ + public static $supported_features = array('switch_fieldtype' => \false, 'required' => \false, 'do_autolink' => \false, 'allow_custom_visibility' => \false, 'member_types' => \false, 'signup_position' => \true); + /** + * Constructor for the WordPress field type. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Sanitize the user field before inserting it into db. + * + * @since 8.0.0 + * + * @param string $value The user field value. + */ + public abstract function sanitize_for_db($value); + /** + * Sanitize the user field before displaying it as an attribute. + * + * @since 8.0.0 + * + * @param string $value The user field value. + * @param integer $user_id The user ID. + */ + public abstract function sanitize_for_output($value, $user_id = 0); + /** + * Sets the WordPress field value. + * + * @since 8.0.0 + * + * @param boolean $retval Whether to shortcircuit the $bp->profile->table_name_data table. + * Default `false`. + * @param array $field_args { + * An array of arguments. + * + * @type object $field_type_obj Field type object. + * @type BP_XProfile_Field $field Field object. + * @type integer $user_id The user ID. + * @type mixed $value Value passed to xprofile_set_field_data(). + * @type boolean $is_required Whether or not the field is required. + * } + * @return bool Whether to shortcircuit the $bp->profile->table_name_data table. + */ + public function set_field_value($retval = \false, $field_args = array()) + { + } + /** + * Gets the WordPress field value during an xProfile fields loop. + * + * This function is used inside `BP_XProfile_ProfileData::get_data_for_user()` + * to include the WordPress field value into the xProfile fields loop. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param integer $user_id The user ID. + * @param integer $field_id The xProfile field ID. + * @return array An array containing the metadata `id`, `value` and `table_name`. + */ + public function get_field_value($user_id, $field_id = 0) + { + } + } + /** + * Class to help set up XProfile Groups. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_XProfile_Group + { + /** + * Field group ID. + * + * @since 1.1.0 + * @var int ID of field group. + */ + public $id = \null; + /** + * Field group name. + * + * @since 1.1.0 + * @var string Name of field group. + */ + public $name; + /** + * Field group Description. + * + * @since 1.1.0 + * @var string Description of field group. + */ + public $description; + /** + * Group deletion boolean. + * + * @since 1.1.0 + * @var bool Can this group be deleted? + */ + public $can_delete; + /** + * Group order. + * + * @since 1.1.0 + * @var int Group order relative to other groups. + */ + public $group_order; + /** + * Group fields. + * + * @since 1.1.0 + * @var array Fields of group. + */ + public $fields; + /** + * Initialize and/or populate profile field group. + * + * @since 1.1.0 + * + * @param int|null $id Field group ID. + */ + public function __construct($id = \null) + { + } + /** + * Populate a profile field group. + * + * @since 1.0.0 + * + * @param int $id Field group ID. + * @return bool + */ + public function populate($id) + { + } + /** + * Save a profile field group. + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Delete a profile field group + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function delete() + { + } + /** Static Methods ********************************************************/ + /** + * Populates the BP_XProfile_Group object with profile field groups, fields, + * and field data. + * + * @since 1.2.0 + * @since 2.4.0 Introduced `$member_type` argument. + * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments. + * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of optional arguments. + * + * @type int|int[]|bool $profile_group_id Limit results to a single profile group or a comma-separated list or array of + * profile group ids. Default: false. + * @type int $user_id Required if you want to load a specific user's data. + * Default: displayed user's ID. + * @type array|string $member_type Limit fields by those restricted to a given member type, or array of + * member types. If `$user_id` is provided, the value of `$member_type` + * will be overridden by the member types of the provided user. The + * special value of 'any' will return only those fields that are + * unrestricted by member type - i.e., those applicable to any type. + * @type bool $hide_empty_groups True to hide groups that don't have any fields. Default: false. + * @type bool $hide_empty_fields True to hide fields where the user has not provided data. + * Default: false. + * @type bool $fetch_fields Whether to fetch each group's fields. Default: false. + * @type bool $fetch_field_data Whether to fetch data for each field. Requires a $user_id. + * Default: false. + * @type int[]|bool $exclude_groups Comma-separated list or array of group IDs to exclude. + * @type int[]|bool $exclude_fields Comma-separated list or array of field IDs to exclude. + * @type string[] $hide_field_types List of field types to hide form loop. Default: empty array. + * @type bool $signup_fields_only Whether to only return signup fields. Default: false. + * @type bool $update_meta_cache Whether to pre-fetch xprofilemeta for all retrieved groups, fields, + * and data. Default: true. + * } + * @return array + */ + public static function get($args = array()) + { + } + /** + * Gets group IDs, based on passed parameters. + * + * @since 5.0.0 + * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of optional arguments. + * + * @type int|int[]|bool $profile_group_id Limit results to a single profile group or a comma-separated list or array of + * profile group ids. Default: false. + * @type int[] $exclude_groups Comma-separated list or array of group IDs to exclude. Default: false. + * @type bool $hide_empty_groups True to hide groups that don't have any fields. Default: false. + * } + * @return array + */ + public static function get_group_ids($args = array()) + { + } + /** + * Gets group field IDs, based on passed parameters. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $group_ids Array of group IDs. + * @param array $args { + * Array of optional arguments: + * @type array $exclude_fields Comma-separated list or array of field IDs to exclude. + * Default empty. + * @type int $user_id Limit results to fields associated with a given user's + * member type. Default empty. + * @type array|string $member_type Limit fields by those restricted to a given member type, or array of + * member types. If `$user_id` is provided, the value of `$member_type` + * is honored. + * } + * @return array + */ + public static function get_group_field_ids($group_ids, $args = array()) + { + } + /** + * Get data about a set of groups, based on IDs. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $group_ids Array of IDs. + * @return array + */ + protected static function get_group_data($group_ids) + { + } + /** + * Validate field group when form submitted. + * + * @since 1.0.0 + * + * @global string $message The feedback message to show. + * + * @return bool + */ + public static function admin_validate() + { + } + /** + * Update field group position. + * + * @since 1.5.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_group_id ID of the group the field belongs to. + * @param int $position Field group position. + * @return bool + */ + public static function update_position($field_group_id, $position) + { + } + /** + * Fetch the field visibility level for the fields returned by the query. + * + * @since 1.6.0 + * + * @param int $user_id The profile owner's user_id. + * @param array $fields The database results returned by the get() query. + * @return array $fields The database results, with field_visibility added + */ + public static function fetch_visibility_level($user_id = 0, $fields = array()) + { + } + /** + * Fetch the admin-set preferences for all fields. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return array $default_visibility_levels An array, keyed by field_id, of default + * visibility level + allow_custom + * (whether the admin allows this + * field to be set by user) + */ + public static function fetch_default_visibility_levels() + { + } + /** Admin Output **********************************************************/ + /** + * Output the admin area field group form. + * + * @since 1.0.0 + * + * @global string $message The feedback message to show. + */ + public function render_admin_form() + { + } + } + /** + * Multi-selectbox xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Multiselectbox extends \BP_XProfile_Field_Type + { + /** + * Constructor for the multi-selectbox field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/select.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type's children options on the wp-admin Profile Fields, + * "Add Field" and "Edit Field" screens. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * WordPress xProfile regular field type. + * + * @since 8.0.0 + */ + class BP_XProfile_Field_Type_WordPress_Textbox extends \BP_XProfile_Field_Type_WordPress + { + /** + * Constructor for the WordPress regular field type. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Sets the WordPress field wp_user_key property before saving the xProfile field. + * + * @since 8.0.0 + * + * @param BP_XProfile_Field $field Field object. + */ + public function set_wp_user_key($field) + { + } + /** + * Gets the WordPress field value during an xProfile fields loop. + * + * This function is used inside `BP_XProfile_ProfileData::get_data_for_user()` + * to include the WordPress field value into the xProfile fields loop. + * + * @since 8.0.0 + * + * @param integer $user_id The user ID. + * @param integer $field_id The xProfile field ID. + * @return array An array containing the metadata `id`, `value` and `table_name`. + */ + public function get_field_value($user_id, $field_id = 0) + { + } + /** + * Sanitize the user field before saving it to db. + * + * @since 8.0.0 + * + * @param string $value The user field value. + * @return string The sanitized field value. + */ + public function sanitize_for_db($value) + { + } + /** + * Sanitize the user field before displaying it as an attribute. + * + * @since 8.0.0 + * + * @param string $value The user field value. + * @return string The sanitized field value. + */ + public function sanitize_for_output($value, $user_id = 0) + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 8.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 8.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Get settings for a given WordPress field. + * + * @since 8.0.0 + * + * @param int $field_id ID of the field. + * @return string The meta_key used for this field. + */ + public static function get_field_settings($field_id) + { + } + /** + * Save settings from the field edit screen in the Dashboard. + * + * @since 8.0.0 + * + * @param int $field_id ID of the field. + * @param array $settings Array of settings. + * @return bool + */ + public function admin_save_settings($field_id, $settings) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 8.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the + * current field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Format WordPress field values for display. + * + * @since 8.0.0 + * + * @param string $field_value The field value, as saved in the database. + * @param string|int $field_id Optional. ID of the field. + * @return string The sanitized WordPress field. + */ + public static function display_filter($field_value, $field_id = '') + { + } + } + /** + * Selectbox xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Selectbox extends \BP_XProfile_Field_Type + { + /** + * Constructor for the selectbox field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/select.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * Load xProfile Profile admin area. + * + * @since 2.0.0 + */ + class BP_XProfile_User_Admin + { + /** + * Setup xProfile User Admin. + * + * @since 2.0.0 + * + * @return BP_XProfile_User_Admin + */ + public static function register_xprofile_user_admin() + { + } + /** + * Constructor method. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Set admin-related actions and filters. + * + * @since 2.0.0 + */ + private function setup_actions() + { + } + /** + * Register the xProfile metabox on Community Profile admin page. + * + * @since 2.0.0 + * + * @param int $user_id ID of the user being edited. + * @param string $screen_id Screen ID to load the metabox in. + * @param object|null $stats_metabox Context and priority for the stats metabox. + */ + public function register_metaboxes($user_id = 0, $screen_id = '', $stats_metabox = \null) + { + } + /** + * Save the profile fields in Members community profile page. + * + * Loaded before the page is rendered, this function is processing form + * requests. + * + * @since 2.0.0 + * @since 6.0.0 The `delete_avatar` action is now managed into BP_Members_Admin::user_admin_load(). + * + * @param string $doaction Action being run. + * @param int $user_id ID for the user whose profile is being saved. + * @param array $request Request being made. + * @param string $redirect_to Where to redirect user to. + */ + public function user_admin_load($doaction = '', $user_id = 0, $request = array(), $redirect_to = '') + { + } + /** + * Render the xprofile metabox for Community Profile screen. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + * @param array $args Array of arguments for metaboxes. + */ + public function user_admin_profile_metaboxes($user = \null, $args = array()) + { + } + /** + * Render the fallback metabox in case a user has been marked as a spammer. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + */ + public function user_admin_spammer_metabox($user = \null) + { + } + } + /** + * WordPress Biography xProfile field type. + * + * @since 8.0.0 + */ + class BP_XProfile_Field_Type_WordPress_Biography extends \BP_XProfile_Field_Type_WordPress + { + /** + * Constructor for the WordPress biography field type. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Sanitize the user field before saving it to db. + * + * @since 8.0.0 + * + * @param string $value The user field value. + * @return string The sanitized field value. + */ + public function sanitize_for_db($value) + { + } + /** + * Sanitize the user field before displaying it as an attribute. + * + * @since 8.0.0 + * + * @param string $value The user field value. + * @param integer $user_id The user ID. + * @return string The sanitized field value. + */ + public function sanitize_for_output($value, $user_id = 0) + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 8.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 8.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 8.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the + * current field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Format WordPress Biography for display. + * + * @since 8.0.0 + * + * @param string $field_value The field value, as saved in the database. + * @param string|int $field_id Optional. ID of the field. + * @return string The sanitized WordPress field. + */ + public static function display_filter($field_value, $field_id = '') + { + } + } + /** + * Class for generating SQL clauses to filter a user query by xprofile data. + * + * @since 2.2.0 + */ + class BP_XProfile_Query + { + /** + * Array of xprofile queries. + * + * See {@see WP_XProfile_Query::__construct()} for information on parameters. + * + * @since 2.2.0 + * @var array + */ + public $queries = array(); + /** + * Database table that where the metadata's objects are stored (eg $wpdb->users). + * + * @since 2.2.0 + * @var string + */ + public $primary_table; + /** + * Column in primary_table that represents the ID of the object. + * + * @since 2.2.0 + * @var string + */ + public $primary_id_column; + /** + * A flat list of table aliases used in JOIN clauses. + * + * @since 2.2.0 + * @var array + */ + protected $table_aliases = array(); + /** + * Constructor. + * + * @since 2.2.0 + * + * @param array $xprofile_query { + * Array of xprofile query clauses. + * + * @type string $relation Optional. The MySQL keyword used to join the clauses of the query. + * Accepts 'AND', or 'OR'. Default 'AND'. + * @type array { + * Optional. An array of first-order clause parameters, or another fully-formed xprofile query. + * + * @type string|int $field XProfile field to filter by. Accepts a field name or ID. + * @type string $value XProfile value to filter by. + * @type string $compare MySQL operator used for comparing the $value. Accepts '=', '!=', '>', + * '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', + * 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', or 'RLIKE'. Default is 'IN' + * when `$value` is an array, '=' otherwise. + * @type string $type MySQL data type that the `value` column will be CAST to for comparisons. + * Accepts 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', + * 'SIGNED', 'TIME', or 'UNSIGNED'. Default is 'CHAR'. + * } + * } + */ + public function __construct($xprofile_query) + { + } + /** + * Ensure the `xprofile_query` argument passed to the class constructor is well-formed. + * + * Eliminates empty items and ensures that a 'relation' is set. + * + * @since 2.2.0 + * + * @param array $queries Array of query clauses. + * @return array Sanitized array of query clauses. + */ + public function sanitize_query($queries) + { + } + /** + * Determine whether a query clause is first-order. + * + * A first-order query clause is one that has either a 'key' or a 'value' array key. + * + * @since 2.2.0 + * + * @param array $query XProfile query arguments. + * @return bool Whether the query clause is a first-order clause. + */ + protected function is_first_order_clause($query) + { + } + /** + * Return the appropriate alias for the given field type if applicable. + * + * @since 2.2.0 + * + * @param string $type MySQL type to cast `value`. + * @return string MySQL type. + */ + public function get_cast_for_type($type = '') + { + } + /** + * Generate SQL clauses to be appended to a main query. + * + * Called by the public {@see BP_XProfile_Query::get_sql()}, this method is abstracted out to maintain parity + * with WP's Query classes. + * + * @since 2.2.0 + * + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to the main query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + protected function get_sql_clauses() + { + } + /** + * Generate SQL clauses for a single query array. + * + * If nested subqueries are found, this method recurses the tree to produce the properly nested SQL. + * + * @since 2.2.0 + * + * @param array $query Query to parse. Passed by reference. + * @param int $depth Optional. Number of tree levels deep we currently are. Used to calculate indentation. + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to a single query array. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + protected function get_sql_for_query(&$query, $depth = 0) + { + } + /** + * Generates SQL clauses to be appended to a main query. + * + * @since 2.2.0 + * + * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). + * @param string $primary_id_column ID column for the filtered object in $primary_table. + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to the main query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + public function get_sql($primary_table, $primary_id_column) + { + } + /** + * Generate SQL JOIN and WHERE clauses for a first-order query clause. + * + * "First-order" means that it's an array with a 'field' or 'value'. + * + * @since 2.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $clause Query clause. + * @param array $parent_query Parent query array. + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to a first-order query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + public function get_sql_for_clause(&$clause, $parent_query) + { + } + /** + * Identify an existing table alias that is compatible with the current query clause. + * + * We avoid unnecessary table joins by allowing each clause to look for an existing table alias that is + * compatible with the query that it needs to perform. An existing alias is compatible if (a) it is a + * sibling of $clause (ie, it's under the scope of the same relation), and (b) the combination of + * operator and relation between the clauses allows for a shared table join. In the case of BP_XProfile_Query, + * this * only applies to IN clauses that are connected by the relation OR. + * + * @since 2.2.0 + * + * @param array $clause Query clause. + * @param array $parent_query Parent query of $clause. + * @return string|bool Table alias if found, otherwise false. + */ + protected function find_compatible_table_alias($clause, $parent_query) + { + } + } + /** + * Creates our XProfile component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_XProfile_Component extends \BP_Component + { + /** + * Profile field types. + * + * @since 1.5.0 + * @var array + */ + public $field_types; + /** + * The acceptable visibility levels for xprofile fields. + * + * @see bp_xprofile_get_visibility_levels() + * + * @since 1.6.0 + * @var array + */ + public $visibility_levels = array(); + /** + * Start the xprofile component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include files. + * + * @since 1.5.0 + * + * @param array $includes Array of files to include. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Setup globals. + * + * The BP_XPROFILE_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @param array $args Array of globals to set up. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @param array $main_nav See `BP_Component::register_nav()` for details. + * @param array $sub_nav See `BP_Component::register_nav()` for details. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the Settings > Profile nav item. + * + * Loaded in a separate method because the Settings component may not + * be loaded in time for BP_XProfile_Component::setup_nav(). + * + * @since 2.1.0 + * @deprecated 12.0.0 + */ + public function setup_settings_nav() + { + } + /** + * Set up the Admin Bar. + * + * @since 1.5.0 + * + * @param array $wp_admin_nav Admin Bar items. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Add custom hooks. + * + * @since 2.0.0 + */ + public function setup_hooks() + { + } + /** + * Sets up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() + { + } + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Adds "Settings > Profile" subnav item under the "Settings" adminbar menu. + * + * @since 2.0.0 + * + * @param array $wp_admin_nav The settings adminbar nav array. + * @return array + */ + public function setup_settings_admin_nav($wp_admin_nav) + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP xProfile Blocks. + * + * @since 9.0.0 + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * XProfile Data endpoints. + * + * Use /xprofile/{field_id}/data/{user_id} + * + * @since 5.0.0 + */ + class BP_REST_XProfile_Data_Endpoint extends \WP_REST_Controller + { + /** + * XProfile Fields Class. + * + * @since 5.0.0 + * + * @var BP_REST_XProfile_Fields_Endpoint + */ + protected $fields_endpoint; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve single XProfile field data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get users's data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Save XProfile data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to save XProfile field data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete user's XProfile data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete users's data. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares XProfile data to return as an object. + * + * @since 5.0.0 + * + * @param BP_XProfile_ProfileData $field_data XProfile field data object. + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($field_data, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_XProfile_ProfileData $field_data XProfile field data object. + * @return array + */ + protected function prepare_links($field_data) + { + } + /** + * Get XProfile field object. + * + * @since 5.0.0 + * + * @param int $field_id Field id. + * @return BP_XProfile_Field + */ + public function get_xprofile_field_object($field_id) + { + } + /** + * Get XProfile field data object. + * + * @since 5.0.0 + * + * @param int $field_id Field id. + * @param int $user_id User id. + * @return BP_XProfile_ProfileData + */ + public function get_xprofile_field_data_object($field_id, $user_id) + { + } + /** + * Can this user see the XProfile data? + * + * @since 5.0.0 + * + * @param int $field_user_id User ID of the field. + * @return bool + */ + protected function can_see($field_user_id) + { + } + /** + * Get the XProfile data schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + } + /** + * Class for XProfile Profile Data setup. + * + * @since 1.6.0 + */ + #[\AllowDynamicProperties] + class BP_XProfile_ProfileData + { + /** + * XProfile ID. + * + * @since 1.6.0 + * @var int $id + */ + public $id; + /** + * User ID. + * + * @since 1.6.0 + * @var int $user_id + */ + public $user_id; + /** + * XProfile field ID. + * + * @since 1.6.0 + * @var int $field_id + */ + public $field_id; + /** + * XProfile field value. + * + * @since 1.6.0 + * @var string $value + */ + public $value; + /** + * XProfile field last updated time. + * + * @since 1.6.0 + * @var string $last_updated + */ + public $last_updated; + /** + * BP_XProfile_ProfileData constructor. + * + * @since 1.5.0 + * + * @param int|null $field_id Field ID to instantiate. + * @param int|null $user_id User ID to instantiate for. + */ + public function __construct($field_id = \null, $user_id = \null) + { + } + /** + * Populates the XProfile profile data. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id Field ID to populate. + * @param int $user_id User ID to populate for. + */ + public function populate($field_id, $user_id) + { + } + /** + * Check if there is data already for the user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function exists() + { + } + /** + * Check if this data is for a valid field. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function is_valid_field() + { + } + /** + * Save the data for the XProfile field. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Delete specific XProfile field data. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function delete() + { + } + /** Static Methods ********************************************************/ + /** + * Get a user's profile data for a set of fields. + * + * @since 2.0.0 + * @since 8.0.0 Checks if a null field data is an xProfile WP Field. + * Adds a new parameter `$field_type_objects` to pass the list of field type objects. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of user whose data is being queried. + * @param array $field_ids Array of field IDs to query for. + * @param array $field_type_objects Array of field type objects keyed by the queried filed IDs. + * @return array + */ + public static function get_data_for_user($user_id, $field_ids, $field_type_objects = array()) + { + } + /** + * Get all of the profile information for a specific user. + * + * @since 1.2.0 + * @since 8.0.0 Checks if a null field data is an xProfile WP Field. + * + * @param int $user_id ID of the user. + * @return array + */ + public static function get_all_for_user($user_id) + { + } + /** + * Get the user's field data id by the id of the xprofile field. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id Field ID being queried for. + * @param int $user_id User ID associated with field. + * @return int $fielddata_id + */ + public static function get_fielddataid_byid($field_id, $user_id) + { + } + /** + * Get profile field values by field ID and user IDs. + * + * Supports multiple user IDs. + * + * @since 1.0.0 + * @since 8.0.0 Checks if a null field data is an xProfile WP Field. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id ID of the field. + * @param int|array|null $user_ids ID or IDs of user(s). + * @return string|array Single value if a single user is queried, + * otherwise an array of results. + */ + public static function get_value_byid($field_id, $user_ids = \null) + { + } + /** + * Get profile field values by field name and user ID. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @deprecated 8.0.0 This function is not used anymore. + * + * @param array|string $fields Field(s) to get. + * @param int|null $user_id User ID to get field data for. + * @return array|bool + */ + public static function get_value_byfieldname($fields, $user_id = \null) + { + } + /** + * Delete field. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $field_id ID of the field to delete. + * @return bool + */ + public static function delete_for_field($field_id) + { + } + /** + * Get time for last XProfile field data update by user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id User ID to get time for. + * @return null|string + */ + public static function get_last_updated($user_id) + { + } + /** + * Delete all data for provided user ID. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id User ID to remove data for. + * @return false|int + */ + public static function delete_data_for_user($user_id) + { + } + /** + * Get random field type by user ID. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id User ID to query for. + * @param string $exclude_fullname SQL portion used to exclude by field ID. + * @return array|null|object + */ + public static function get_random($user_id, $exclude_fullname) + { + } + /** + * Get fullname for provided user ID. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user to query. + * @return mixed + */ + public static function get_fullname($user_id = 0) + { + } + } + /** + * Radio button xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Radiobutton extends \BP_XProfile_Field_Type + { + /** + * Constructor for the radio button field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.radio.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output the edit field options HTML for this field type. + * + * BuddyPress considers a field's "options" to be, for example, the items in a selectbox. + * These are stored separately in the database, and their templating is handled separately. + * + * This templating is separate from {@link BP_XProfile_Field_Type::edit_field_html()} because + * it's also used in the wp-admin screens when creating new fields, and for backwards compatibility. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $args Optional. The arguments passed to {@link bp_the_profile_field_options()}. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * Number xprofile field type. + * + * @since 2.0.0 + */ + class BP_XProfile_Field_Type_Number extends \BP_XProfile_Field_Type + { + /** + * Constructor for the number field type. + * + * @since 2.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Output HTML for this field type on the wp-admin Profile Fields screen. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * This method usually outputs HTML for this field type's children options on the wp-admin Profile Fields + * "Add Field" and "Edit Field" screens, but for this field type, we don't want it, so it's stubbed out. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * Checkbox Acceptance xProfile field type. + * + * @since 8.0.0 + */ + class BP_XProfile_Field_Type_Checkbox_Acceptance extends \BP_XProfile_Field_Type + { + /** + * Checkbox Acceptance field's visibility setting. + * + * Defaults to 'adminsonly'. This property enforces Field's default visibility. + * + * @since 8.0.0 + * + * @return string The Checkbox Acceptance field's visibility setting. + */ + public $visibility = 'adminsonly'; + /** + * Supported features for the Checkbox Acceptance field type. + * + * @since 8.0.0 + * @var bool[] The WordPress field supported features. + */ + public static $supported_features = array('switch_fieldtype' => \false, 'required' => \true, 'do_autolink' => \false, 'allow_custom_visibility' => \false, 'member_types' => \false); + /** + * Constructor for the Checkbox Acceptance field type. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Output the edit field HTML for this field type. + * + * Must be used inside the {@link bp_profile_fields()} template loop. + * + * @since 8.0.0 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/textarea.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Field html for Admin-> User->Profile Fields screen. + * + * @since 8.0.0 + * + * @param array $raw_properties properties. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Admin new field screen. + * + * @since 8.0.0 + * + * @param BP_XProfile_Field $current_field Profile field object. + * @param string $control_type Control type. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + /** + * Save settings from the field edit screen in the Dashboard. + * + * @since 8.0.0 + * + * @param int $field_id ID of the field. + * @param array $settings Array of settings. + * @return bool + */ + public function admin_save_settings($field_id, $settings) + { + } + /** + * Profile edit/register options html. + * + * @since 8.0.0 + * + * @param array $args args. + */ + public function edit_field_options_html(array $args = array()) + { + } + /** + * Enforces the field value if it has been already accepted. + * + * As it's always possible to edit HTML source and remove the `readonly="readonly"` attribute + * of the checkbox, we may need to enforce the field value. + * + * @since 8.0.0 + * + * @param mixed $value Value passed to xprofile_set_field_data(). + * @param BP_XProfile_Field $field Field object. + * @return mixed The field value. + */ + public function enforce_field_value($value, \BP_XProfile_Field $field) + { + } + /** + * Check if field is valid? + * + * @since 8.0.0 + * + * @param string|int $values value. + * @return bool + */ + public function is_valid($value) + { + } + /** + * Modify the appearance of value. + * + * @since 8.0.0 + * + * @param string $field_value Original value of field. + * @param int $field_id field id. + * + * @return string Value formatted + */ + public static function display_filter($field_value, $field_id = 0) + { + } + } + /** + * The main profile template loop class. + * + * This is responsible for loading profile field, group, and data and displaying it. + * + * @since 1.0.0 + */ + class BP_XProfile_Data_Template + { + /** + * The loop iterator. + * + * @since 1.5.0 + * @var int + */ + public $current_group = -1; + /** + * The number of groups returned by the paged query. + * + * @since 1.5.0 + * @var int + */ + public $group_count; + /** + * Array of groups located by the query. + * + * @since 1.5.0 + * @var array + */ + public $groups; + /** + * The group object currently being iterated on. + * + * @since 1.5.0 + * @var object + */ + public $group; + /** + * The current field. + * + * @since 1.5.0 + * @var int + */ + public $current_field = -1; + /** + * The field count. + * + * @since 1.5.0 + * @var int + */ + public $field_count; + /** + * Field has data. + * + * @since 1.5.0 + * @var bool + */ + public $field_has_data; + /** + * The field. + * + * @since 1.5.0 + * @var int + */ + public $field; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.5.0 + * @var bool + */ + public $in_the_loop; + /** + * The user ID. + * + * @since 1.5.0 + * @var int + */ + public $user_id; + /** + * Get activity items, as specified by parameters. + * + * @see BP_XProfile_Group::get() for more details about parameters. + * + * @since 1.5.0 + * @since 2.4.0 Introduced `$member_type` argument. + * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments. + * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids. + * + * @param array|string $args { + * An array of arguments. All items are optional. + * + * @type int $user_id Fetch field data for this user ID. + * @type string|array $member_type Limit results to those matching member type(s). + * @type int|int[]|bool $profile_group_id Field group(s) to fetch fields & data for. Default: false. + * @type int|bool $hide_empty_groups Should empty field groups be skipped. + * @type int|bool $fetch_fields Fetch fields for field group. + * @type int|bool $fetch_field_data Fetch field data for fields in group. + * @type array $exclude_groups Exclude these field groups. + * @type array $exclude_fields Exclude these fields. + * @type int|bool $hide_empty_fields Should empty fields be skipped. + * @type int|bool $fetch_visibility_level Fetch visibility levels. + * @type string[] $hide_field_types List of field types to hide form loop. Default: empty array. + * @type bool $signup_fields_only Whether to only return signup fields. Default: false. + * @type int|bool $update_meta_cache Should metadata cache be updated. + * } + */ + public function __construct($args = '') + { + } + /** + * Whether or not the loop has field groups. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_groups() + { + } + /** + * Increments to the next group of fields. + * + * @since 1.0.0 + * + * @return object + */ + public function next_group() + { + } + /** + * Rewinds to the start of the groups list. + * + * @since 1.0.0 + */ + public function rewind_groups() + { + } + /** + * Kicks off the profile groups. + * + * @since 1.0.0 + * + * @return bool + */ + public function profile_groups() + { + } + /** + * Sets up the profile group. + * + * @since 1.0.0 + * + * @global object $group Current group of profile fields. + * + */ + public function the_profile_group() + { + } + /** Fields ****************************************************************/ + /** + * Increments to the next field. + * + * @since 1.0.0 + * + * @return int + */ + public function next_field() + { + } + /** + * Rewinds to the start of the fields. + * + * @since 1.0.0 + */ + public function rewind_fields() + { + } + /** + * Whether or not the loop has fields. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_fields() + { + } + /** + * Kick off the profile fields. + * + * @since 1.0.0 + * + * @return bool + */ + public function profile_fields() + { + } + /** + * Set up the profile fields. + * + * @since 1.0.0 + * + * @global object $field Current profile field. + * + */ + public function the_profile_field() + { + } + } + /** + * A placeholder xprofile field type. Doesn't do anything. + * + * Used if an existing field has an unknown type (e.g. one provided by a missing third-party plugin). + * + * @since 2.0.1 + */ + class BP_XProfile_Field_Type_Placeholder extends \BP_XProfile_Field_Type + { + /** + * Constructor for the placeholder field type. + * + * @since 2.0.1 + */ + public function __construct() + { + } + /** + * Prevent any HTML being output for this field type. + * + * @since 2.0.1 + * + * @param array $raw_properties Optional key/value array of + * {@link http://dev.w3.org/html5/markup/input.text.html permitted attributes} + * that you want to add. + */ + public function edit_field_html(array $raw_properties = array()) + { + } + /** + * Prevent any HTML being output for this field type. + * + * @since 2.0.1 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + */ + public function admin_field_html(array $raw_properties = array()) + { + } + /** + * Prevent any HTML being output for this field type. + * + * @since 2.0.1 + * + * @param BP_XProfile_Field $current_field The current profile field on the add/edit screen. + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. + */ + public function admin_new_field_html(\BP_XProfile_Field $current_field, $control_type = '') + { + } + } + /** + * Class for generating SQL clauses that filter a primary query according to + * XProfile metadata keys and values. + * + * `BP_XProfile_Meta_Query` is a helper that allows primary query classes, such + * as {@see WP_Query} and {@see WP_User_Query}, to filter their results by object + * metadata, by generating `JOIN` and `WHERE` subclauses to be attached + * to the primary SQL query string. + * + * @since 2.3.0 + */ + class BP_XProfile_Meta_Query extends \WP_Meta_Query + { + /** + * Determine whether a query clause is first-order. + * + * A first-order meta query clause is one that has either a 'key', 'value', + * or 'object' array key. + * + * @since 2.3.0 + * + * @param array $query Meta query arguments. + * @return bool Whether the query clause is a first-order clause. + */ + protected function is_first_order_clause($query) + { + } + /** + * Constructs a meta query based on 'meta_*' query vars. + * + * @since 2.3.0 + * + * @param array $qv The query variables. + */ + public function parse_query_vars($qv) + { + } + /** + * Generates SQL clauses to be appended to a main query. + * + * @since 2.3.0 + * + * @param string $type Type of meta, eg 'user', 'post'. + * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). + * @param string $primary_id_column ID column for the filtered object in $primary_table. + * @param object|null $context Optional. The main query object. + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to the main query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + public function get_sql($type, $primary_table, $primary_id_column, $context = \null) + { + } + /** + * Generate SQL JOIN and WHERE clauses for a first-order query clause. + * + * "First-order" means that it's an array with a 'key' or 'value'. + * + * @since 2.3.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $clause Query clause, passed by reference. + * @param array $parent_query Parent query array. + * @param string $clause_key Optional. The array key used to name the clause in the original `$meta_query` + * parameters. If not provided, a key will be generated automatically. + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to a first-order query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + public function get_sql_for_clause(&$clause, $parent_query, $clause_key = '') + { + } + } + /** + * BuddyPress User Query class. + * + * Used for querying users in a BuddyPress context, in situations where WP_User_Query won't do the trick: + * Member directories, the Friends component, etc. + * + * @since 1.7.0 + * @since 10.0.0 Added `$date_query` parameter. + * + * @param array $query { + * Query arguments. All items are optional. + * @type string $type Determines sort order. Select from 'newest', 'active', 'online', + * 'random', 'popular', 'alphabetical'. Default: 'newest'. + * @type int $per_page Number of results to return. Default: 0 (no limit). + * @type int $page Page offset (together with $per_page). Default: 1. + * @type int $user_id ID of a user. If present, and if the friends component is activated, + * results will be limited to the friends of that user. Default: 0. + * @type string|bool $search_terms Terms to search by. Search happens across xprofile fields. Requires + * XProfile component. Default: false. + * @type string $search_wildcard When searching with $search_terms, set where wildcards around the + * term should be positioned. Accepts 'both', 'left', 'right'. + * Default: 'both'. + * @type array|string|bool $include An array or comma-separated list of user IDs to which query should + * be limited. Default: false. + * @type array|string|bool $exclude An array or comma-separated list of user IDs that will be excluded + * from query results. Default: false. + * @type array|string|bool $user_ids An array or comma-separated list of IDs corresponding to the users + * that should be returned. When this parameter is passed, it will + * override all others; BP User objects will be constructed using these + * IDs only. Default: false. + * @type array|string $member_type Array or comma-separated list of member types to limit results to. + * @type array|string $member_type__in Array or comma-separated list of member types to limit results to. + * @type array|string $member_type__not_in Array or comma-separated list of member types that will be + * excluded from results. + * @type string|bool $meta_key Limit results to users that have usermeta associated with this meta_key. + * Usually used with $meta_value. Default: false. + * @type string|bool $meta_value When used with $meta_key, limits results to users whose usermeta value + * associated with $meta_key matches $meta_value. Default: false. + * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile component. + * See {@see BP_XProfile_Query} for details. + * @type array $date_query Filter results by member last activity date. See first parameter of + * {@link WP_Date_Query::__construct()} for syntax. Only applicable if + * $type is either 'active', 'random', 'newest', or 'online'. + * @type bool $populate_extras True if you want to fetch extra metadata + * about returned users, such as total group and friend counts. + * @type string $count_total Determines how BP_User_Query will do a count of total users matching + * the other filter criteria. Default value is 'count_query', which + * does a separate SELECT COUNT query to determine the total. + * 'sql_count_found_rows' uses SQL_COUNT_FOUND_ROWS and + * SELECT FOUND_ROWS(). Pass an empty string to skip the total user + * count query. + * } + */ + class BP_User_Query + { + /** Variables *************************************************************/ + /** + * Unaltered params as passed to the constructor. + * + * @since 1.8.0 + * + * @var array + */ + public $query_vars_raw = array(); + /** + * Array of variables to query with. + * + * @since 1.7.0 + * + * @var array + */ + public $query_vars = array(); + /** + * List of found users and their respective data. + * + * @since 1.7.0 + * + * @var array + */ + public $results = array(); + /** + * Total number of found users for the current query. + * + * @since 1.7.0 + * + * @var int + */ + public $total_users = 0; + /** + * List of found user IDs. + * + * @since 1.7.0 + * + * @var array + */ + public $user_ids = array(); + /** + * SQL clauses for the user ID query. + * + * @since 1.7.0 + * + * @var array + */ + public $uid_clauses = array(); + /** + * SQL table where the user ID is being fetched from. + * + * @since 2.2.0 + * + * @var string + */ + public $uid_table = ''; + /** + * SQL database column name to order by. + * + * @since 1.7.0 + * + * @var string + */ + public $uid_name = ''; + /** + * Standard response when the query should not return any rows. + * + * @since 1.7.0 + * + * @var array + */ + protected $no_results = array('join' => '', 'where' => '0 = 1'); + /** Methods ***************************************************************/ + /** + * Constructor. + * + * @since 1.7.0 + * + * @param string|array|null $query See {@link BP_User_Query}. + */ + public function __construct($query = \null) + { + } + /** + * Allow extending classes to set up action/filter hooks. + * + * When extending BP_User_Query, you may need to use some of its + * internal hooks to modify the output. It's not convenient to call + * add_action() or add_filter() in your class constructor, because + * BP_User_Query::__construct() contains a fair amount of logic that + * you may not want to override in your class. Define this method in + * your own class if you need a place where your extending class can + * add its hooks early in the query-building process. See + * {@link BP_Group_Member_Query::setup_hooks()} for an example. + * + * @since 1.8.0 + */ + public function setup_hooks() + { + } + /** + * Prepare the query for user_ids. + * + * @since 1.7.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function prepare_user_ids_query() + { + } + /** + * Query for IDs of users that match the query parameters. + * + * Perform a database query to specifically get only user IDs, using + * existing query variables set previously in the constructor. + * + * Also used to quickly perform user total counts. + * + * @since 1.7.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function do_user_ids_query() + { + } + /** + * Use WP_User_Query() to pull data for the user IDs retrieved in the main query. + * + * @since 1.7.0 + */ + public function do_wp_user_query() + { + } + /** + * Fetch the IDs of users to put in the IN clause of the main query. + * + * By default, returns the value passed to it + * ($this->query_vars['include']). Having this abstracted into a + * standalone method means that extending classes can override the + * logic, parsing together their own user_id limits with the 'include' + * ids passed to the class constructor. See {@link BP_Group_Member_Query} + * for an example. + * + * @since 1.8.0 + * + * @param array $include_ids Sanitized array of user IDs, as passed to the 'include' + * parameter of the class constructor. + * @return array The list of users to which the main query should be + * limited. + */ + public function get_include_ids($include_ids = array()) + { + } + /** + * Perform a database query to populate any extra metadata we might need. + * + * Different components will hook into the 'bp_user_query_populate_extras' + * action to loop in the things they want. + * + * @since 1.7.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate_extras() + { + } + /** + * Get a SQL clause representing member_type include/exclusion. + * + * @since 2.4.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string|array $member_types Array or comma-separated list of member types. + * @param string $operator 'IN' or 'NOT IN'. + * @return string + */ + protected function get_sql_clause_for_member_types($member_types, $operator) + { + } + } + /** + * Query for the members of a group. + * + * Special notes about the group members data schema: + * - *Members* are entries with is_confirmed = 1. + * - *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0. + * - *Pending and sent invitations* are entries with is_confirmed = 0 and + * inviter_id != 0 and invite_sent = 1. + * - *Pending and unsent invitations* are entries with is_confirmed = 0 and + * inviter_id != 0 and invite_sent = 0. + * - *Membership requests* are entries with is_confirmed = 0 and + * inviter_id = 0 (and invite_sent = 0). + * + * @since 1.8.0 + * @since 3.0.0 $group_id now supports multiple values. + * + * @param array $args { + * Array of arguments. Accepts all arguments from + * {@link BP_User_Query}, with the following additions: + * + * @type int|array|string $group_id ID of the group to limit results to. Also accepts multiple values + * either as an array or as a comma-delimited string. + * @type array $group_role Array of group roles to match ('member', 'mod', 'admin', 'banned'). + * Default: array( 'member' ). + * @type bool $is_confirmed Whether to limit to confirmed members. Default: true. + * @type string $type Sort order. Accepts any value supported by {@link BP_User_Query}, in + * addition to 'last_joined' and 'first_joined'. Default: 'last_joined'. + * } + */ + class BP_Group_Member_Query extends \BP_User_Query + { + /** + * Array of group member ids, cached to prevent redundant lookups. + * + * @since 1.8.1 + * @var null|array Null if not yet defined, otherwise an array of ints. + */ + protected $group_member_ids; + /** + * Constructor. + * + * @since 10.3.0 + * + * @param string|array|null $query See {@link BP_User_Query}. + */ + public function __construct($query = \null) + { + } + /** + * Set up action hooks. + * + * @since 1.8.0 + */ + public function setup_hooks() + { + } + /** + * Use WP_User_Query() to pull data for the user IDs retrieved in the main query. + * + * If a `count` query is performed, the function is used to validate existing users. + * + * @since 10.3.0 + */ + public function do_wp_user_query() + { + } + /** + * Get a list of user_ids to include in the IN clause of the main query. + * + * Overrides BP_User_Query::get_include_ids(), adding our additional + * group-member logic. + * + * @since 1.8.0 + * + * @param array $include Existing group IDs in the $include parameter, + * as calculated in BP_User_Query. + * @return array + */ + public function get_include_ids($include = array()) + { + } + /** + * Get the members of the queried group. + * + * @since 1.8.0 + * + * @return array $ids User IDs of relevant group member ids. + */ + protected function get_group_member_ids() + { + } + /** + * Tell BP_User_Query to order by the order of our query results. + * + * We only override BP_User_Query's native ordering in case of the + * 'last_joined' and 'first_joined' $type parameters. + * + * @since 1.8.1 + * + * @param BP_User_Query $query BP_User_Query object. + */ + public function set_orderby($query) + { + } + /** + * Fetch additional data required in bp_group_has_members() loops. + * + * Additional data fetched: + * - is_banned + * - date_modified + * + * @since 1.8.0 + * + * @param BP_User_Query $query BP_User_Query object. Because we're + * filtering the current object, we use + * $this inside of the method instead. + * @param string $user_ids_sql Sanitized, comma-separated string of + * the user ids returned by the main query. + */ + public function populate_group_member_extras($query, $user_ids_sql) + { + } + /** + * Sort user IDs by how recently they have generated activity within a given group. + * + * @since 2.1.0 + * + * @param BP_User_Query $query BP_User_Query object. + * @param array $gm_ids array of group member ids. + * @return array + */ + public function get_gm_ids_ordered_by_activity($query, $gm_ids = array()) + { + } + /** + * Perform a database query to populate any extra metadata we might need. + * + * If a `count` query is performed, the function is used to validate active users. + * + * @since 10.3.0 + * @since 11.0.0 Include inactive users added by a community administrators to the group members count. + */ + public function populate_extras() + { + } + } + /** + * Group membership endpoints. + * + * Use /groups/{group_id}/members + * Use /groups/{group_id}/members/{user_id} + * + * @since 5.0.0 + */ + class BP_REST_Group_Membership_Endpoint extends \WP_REST_Controller + { + /** + * Reuse some parts of the BP_REST_Groups_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Groups_Endpoint + */ + protected $groups_endpoint; + /** + * Reuse some parts of the BP_REST_Members_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Members_Endpoint + */ + protected $members_endpoint; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve group members. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to group members. + * + * We are using the same permissions check done on group access. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Add member to a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to join a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update user status on a group (add, remove, promote, demote or ban). + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a group member. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete a group membership. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a group member. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares group member data for return as an object. + * + * @since 5.0.0 + * + * @param BP_Groups_Member $group_member Group member object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($group_member, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Groups_Member $group_member Group member object. + * @return array + */ + protected function prepare_links($group_member) + { + } + /** + * GET arguments for the endpoint's CREATABLE, EDITABLE & DELETABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_method($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the group member schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections of group memberships. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Group Membership Request Endpoint. + * + * Use /groups/{group_id}/membership-request + * Use /groups/membership-request/{request_id} + * + * @since 5.0.0 + */ + class BP_REST_Group_Membership_Request_Endpoint extends \WP_REST_Controller + { + /** + * Reuse some parts of the BP_REST_Groups_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Groups_Endpoint + */ + protected $groups_endpoint; + /** + * Reuse some parts of the BP_REST_Group_Invites_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Group_Invites_Endpoint + */ + protected $invites_endpoint; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Fetch pending group membership requests. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to fetch group membership requests. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Fetch a sepcific pending group membership request by ID. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to fetch group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Request membership to a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to make a group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Accept or reject a pending group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Checks if a given request has access to accept a group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Reject a pending group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Checks if a given request has access to reject a group membership request. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares group invitation data to return as an object. + * + * @since 5.0.0 + * + * @param BP_Invitation $invite Invite object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($invite, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Invitation $invite Invite object. + * @return array + */ + protected function prepare_links($invite) + { + } + /** + * Helper function to fetch a single group invite. + * + * @since 5.0.0 + * + * @param int $request_id The ID of the request you wish to fetch. + * @return BP_Invitation|bool $group_request Membership request if found, false otherwise. + */ + public function fetch_single_membership_request($request_id = 0) + { + } + /** + * Endpoint args. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the group membership request schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections of group invites. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * API for creating group extensions without having to hardcode the content into + * the theme. + * + * To implement, extend this class. In your constructor, pass an optional array + * of arguments to parent::init() to configure your widget. The config array + * supports the following values: + * - 'slug' A unique identifier for your extension. This value will be used + * to build URLs, so make it URL-safe. + * - 'name' A translatable name for your extension. This value is used to + * populate the navigation tab, as well as the default titles for admin/ + * edit/create tabs. + * - 'visibility' Set to 'public' (default) for your extension (the main tab + * as well as the widget) to be available to anyone who can access the + * group, 'private' otherwise. + * - 'nav_item_position' An integer explaining where the nav item should + * appear in the tab list. + * - 'enable_nav_item' Set to true for your extension's main tab to be + * available to anyone who can access the group. + * - 'nav_item_name' The translatable text you want to appear in the nav tab. + * Defaults to the value of 'name'. + * - 'display_hook' The WordPress action that the widget_display() method is + * hooked to. + * - 'template_file' The template file that will be used to load the content + * of your main extension tab. Defaults to 'groups/single/plugins.php'. + * - 'screens' A multi-dimensional array, described below. + * - 'access' Which users can visit the plugin's tab. + * - 'show_tab' Which users can see the plugin's navigation tab. + * + * BP_Group_Extension uses the concept of "settings screens". There are three + * contexts for settings screens: + * - 'create', which inserts a new step into the group creation process + * - 'edit', which adds a tab for your extension into the Admin section of + * a group + * - 'admin', which adds a metabox to the Groups administration panel in the + * WordPress Dashboard + * Each of these settings screens is populated by a pair of methods: one that + * creates the markup for the screen, and one that processes form data + * submitted from the screen. If your plugin needs screens in all three + * contexts, and if the markup and form processing logic will be the same in + * each case, you can define two methods to handle all of the screens: + * function settings_screen() {} + * function settings_screen_save() {} + * If one or more of your settings screen needs separate logic, you may define + * context-specific methods, for example: + * function edit_screen() {} + * function edit_screen_save() {} + * BP_Group_Extension will use the more specific methods if they are available. + * + * You can further customize the settings screens (tab names, etc) by passing + * an optional 'screens' parameter to the init array. The format is as follows: + * 'screens' => array( + * 'create' => array( + * 'slug' => 'foo', + * 'name' => 'Foo', + * 'position' => 55, + * 'screen_callback' => 'my_create_screen_callback', + * 'screen_save_callback' => 'my_create_screen_save_callback', + * ), + * 'edit' => array( // ... + * ), + * Only provide those arguments that you actually want to change from the + * default configuration. BP_Group_Extension will do the rest. + * + * Note that the 'edit' screen accepts an additional parameter: 'submit_text', + * which defines the text of the Submit button automatically added to the Edit + * screen of the extension (defaults to 'Save Changes'). Also, the 'admin' + * screen accepts two additional parameters: 'metabox_priority' and + * 'metabox_context'. See the docs for add_meta_box() for more details on these + * arguments. + * + * Prior to BuddyPress 1.7, group extension configurations were set slightly + * differently. The legacy method is still supported, though deprecated. + * + * @since 1.1.0 + */ + class BP_Group_Extension + { + /** Public ************************************************************/ + /** + * Information about this extension's screens. + * + * @since 1.8.0 + * @var array + */ + public $screens = array(); + /** + * The name of the extending class. + * + * @since 1.8.0 + * @var string + */ + public $class_name = ''; + /** + * A ReflectionClass object of the current extension. + * + * @since 1.8.0 + * @var ReflectionClass + */ + public $class_reflection = \null; + /** + * Parsed configuration parameters for the extension. + * + * @since 1.8.0 + * @var array + */ + public $params = array(); + /** + * Raw config params, as passed by the extending class. + * + * @since 2.1.0 + * @var array + */ + public $params_raw = array(); + /** + * The ID of the current group. + * + * @since 1.8.0 + * @var int + */ + public $group_id = 0; + /** + * The slug of the current extension. + * + * @since 1.1.0 + * @var string + */ + public $slug = ''; + /** + * The translatable name of the current extension. + * + * @since 1.1.0 + * @var string + */ + public $name = ''; + /** + * The visibility of the extension tab. 'public' or 'private'. + * + * @since 1.1.0 + * @var string + */ + public $visibility = 'public'; + /** + * The numeric position of the main nav item. + * + * @since 1.1.0 + * @var int + */ + public $nav_item_position = 81; + /** + * Whether to show the nav item. + * + * @since 1.1.0 + * @var bool + */ + public $enable_nav_item = \true; + /** + * Whether the current user should see the navigation item. + * + * @since 2.1.0 + * @var bool + */ + public $user_can_see_nav_item; + /** + * The Callback function to use before showing the navigation item. + * + * @since 12.0.0 + * @var string + */ + public $show_tab_callback = ''; + /** + * Whether the current user can visit the tab. + * + * @since 2.1.0 + * @var bool + */ + public $user_can_visit; + /** + * The text of the nav item. Defaults to self::name. + * + * @since 1.1.0 + * @var string + */ + public $nav_item_name = ''; + /** + * The WP action that self::widget_display() is attached to. + * + * Default: 'groups_custom_group_boxes'. + * + * @since 1.1.0 + * @var string + */ + public $display_hook = 'groups_custom_group_boxes'; + /** + * The template file used to load the plugin content. + * + * Default: 'groups/single/plugins'. + * + * @since 1.1.0 + * @var string + */ + public $template_file = 'groups/single/plugins'; + /** + * The template file. + * + * @since 1.1.0 + * @var string + */ + public $edit_screen_template; + /** Protected *********************************************************/ + /** + * Has the extension been initialized? + * + * @since 1.8.0 + * @var bool + */ + protected $initialized = \false; + /** + * Extension properties as set by legacy extensions. + * + * @since 1.8.0 + * @var array + */ + protected $legacy_properties = array(); + /** + * Converted legacy parameters. + * + * These are the extension properties as set by legacy extensions, but + * then converted to match the new format for params. + * + * @since 1.8.0 + * @var array + */ + protected $legacy_properties_converted = array(); + /** + * Redirect location as defined by post-edit save callback. + * + * @since 2.1.0 + * @var string + */ + protected $post_save_redirect; + /** + * Miscellaneous data as set by the __set() magic method. + * + * @since 1.8.0 + * @var array + */ + protected $data = array(); + /** Screen Overrides **************************************************/ + /* + * Screen override methods are how your extension will display content + * and handle form submits. Your extension should only override those + * methods that it needs for its purposes. + */ + /** + * The content of the group tab. + * + * @since 1.1.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function display($group_id = \null) + { + } + /** + * Content displayed in a widget sidebar, if applicable. + * + * @since 1.1.0 + */ + public function widget_display() + { + } + /* + * *_screen() displays the settings form for the given context + * *_screen_save() processes data submitted via the settings form + * The settings_* methods are generic fallbacks, which can optionally + * be overridden by the more specific edit_*, create_*, and admin_* + * versions. + */ + /** + * Provide the fallback markup for Group's Create/Admin/Edit screens. + * + * @since 1.8.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function settings_screen($group_id = \null) + { + } + /** + * Group's Fallback handler for the Create/Admin/Edit screens. + * + * @since 1.8.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function settings_screen_save($group_id = \null) + { + } + /** + * The content of the Manage sub tab. + * + * @since 1.1.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function edit_screen($group_id = \null) + { + } + /** + * Group Manage sub tab handler. + * + * @since 1.1.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function edit_screen_save($group_id = \null) + { + } + /** + * The content of the group create step tab. + * + * @since 1.1.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function create_screen($group_id = \null) + { + } + /** + * Group create step tab handler. + * + * @since 1.1.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function create_screen_save($group_id = \null) + { + } + /** + * The content of Group's WP Administration screen metabox. + * + * @since 1.8.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function admin_screen($group_id = \null) + { + } + /** + * Group's WP Administration screen handler. + * + * @since 1.8.0 + * + * @param int|null $group_id ID of the group to display. + */ + public function admin_screen_save($group_id = \null) + { + } + /** Setup *************************************************************/ + /** + * Initialize the extension, using your config settings. + * + * Your plugin should call this method at the very end of its + * constructor, like so: + * + * public function __construct() { + * $args = array( + * 'slug' => 'my-group-extension', + * 'name' => 'My Group Extension', + * // ... + * ); + * + * parent::init( $args ); + * } + * + * @since 1.8.0 + * @since 2.1.0 Added 'access' and 'show_tab' arguments to `$args`. + * @since 12.0.0 Set the Group Extension screens. + * + * @param array $args { + * Array of initialization arguments. + * @type string $slug Unique, URL-safe identifier for your extension. + * @type string $name Translatable name for your extension. Used to populate + * navigation items. + * @type string $visibility Optional. Set to 'public' for your extension (the main tab as well + * as the widget) to be available to anyone who can access the group; + * set to 'private' otherwise. Default: 'public'. + * @type int $nav_item_position Optional. Location of the nav item in the tab list. + * Default: 81. + * @type bool $enable_nav_item Optional. Whether the extension's tab should be accessible to + * anyone who can view the group. Default: true. + * @type string $nav_item_name Optional. The translatable text you want to appear in the nav tab. + * Default: the value of `$name`. + * @type string $display_hook Optional. The WordPress action that the widget_display() method is + * hooked to. Default: 'groups_custom_group_boxes'. + * @type string $template_file Optional. Theme-relative path to the template file BP should use + * to load the content of your main extension tab. + * Default: 'groups/single/plugins.php'. + * @type array $screens A multi-dimensional array of configuration information for the + * extension screens. See docblock of {@link BP_Group_Extension} + * for more details. + * @type string|array $access Which users can visit the plugin's tab. Possible values: 'anyone', + * 'loggedin', 'member', 'mod', 'admin' or 'noone'. ('member', 'mod', + * 'admin' refer to user's role in group.) Note that 'mod' targets + * only group moderators. If you want to allow access to group moderators + * and admins, specify `array( 'mod', 'admin' )`. Defaults to 'anyone' + * for public groups and 'member' for private groups. + * @type string|array $show_tab Which users can see the plugin's navigation tab. Possible values: + * 'anyone', 'loggedin', 'member', 'mod', 'admin' or 'noone'. + * ('member', 'mod', 'admin' refer to user's role in group.) Note + * that 'mod' targets only group moderators. If you want to show the + * tab to group moderators and admins, specify + * `array( 'mod', 'admin' )`. Defaults to 'anyone' for public groups + * and 'member' for private groups. + * @type string|array $show_tab_callback The function to execute to set the $show_tab argument. + * } + */ + public function init($args = array()) + { + } + /** + * The main setup routine for the extension. + * + * This method contains the primary logic for setting up an extension's + * configuration, setting up backward compatibility for legacy plugins, + * and hooking the extension's screen functions into WP and BP. + * + * Marked 'public' because it must be accessible to add_action(). + * However, you should never need to invoke this method yourself - it + * is called automatically at the right point in the load order by + * bp_register_group_extension(). + * + * @since 1.1.0 + */ + public function _register() + { + } + /** + * Set up some basic info about the Extension. + * + * Here we collect the name of the extending class, as well as a + * ReflectionClass that is used in get_screen_callback() to determine + * whether your extension overrides certain callback methods. + * + * @since 1.8.0 + */ + protected function setup_class_info() + { + } + /** + * Get the current group ID. + * + * Check for: + * - current group + * - new group + * - group admin + * + * @since 1.8.0 + * + * @return int + */ + public static function get_group_id() + { + } + /** + * Gather configuration data about your screens. + * + * @since 1.8.0 + * + * @return array + */ + protected function get_default_screens() + { + } + /** + * Set up screens array based on params. + * + * @since 1.8.0 + */ + protected function setup_screens() + { + } + /** + * Set up access-related settings for this extension. + * + * @since 2.1.0 + */ + protected function setup_access_settings() + { + } + /** + * Check whether the current user meets an access condition. + * + * @since 2.1.0 + * + * @param string $access_condition 'anyone', 'loggedin', 'member', + * 'mod', 'admin' or 'noone'. + * @return bool + */ + protected function user_meets_access_condition($access_condition) + { + } + /** Display ***********************************************************/ + /** + * Returns the Rewrite ID of the Group Extension Item according to the context. + * + * @since 12.0.0 + * + * @param string $context One of these contexts: 'create', 'manage', 'read'. + * @return string The found Rewrite ID, an empty string otherwise. + */ + protected function get_rewrite_id_for($context = '') + { + } + /** + * Hook this extension's group tab into BuddyPress, if necessary. + * + * @since 1.8.0 + */ + protected function setup_display_hooks() + { + } + /** + * Hook the main display method, and loads the template file. + * + * @since 1.1.0 + */ + public function _display_hook() + { + } + /** + * Call the display() method. + * + * We use this wrapper so that we can pass the group_id to the + * display() callback. + * + * @since 2.1.1 + */ + public function call_display() + { + } + /** + * Determine whether the current user should see this nav tab. + * + * Note that this controls only the display of the navigation item. + * Access to the tab is controlled by the user_can_visit() check. + * + * @since 2.1.0 + * + * @param bool $user_can_see_nav_item Whether or not the user can see the nav item. + * @return bool + */ + public function user_can_see_nav_item($user_can_see_nav_item = \false) + { + } + /** + * Determine whether the current user has access to visit this tab. + * + * Note that this controls the ability of a user to access a tab. + * Display of the navigation item is controlled by user_can_see_nav_item(). + * + * @since 2.1.0 + * + * @param bool $user_can_visit Whether or not the user can visit the tab. + * @return bool + */ + public function user_can_visit($user_can_visit = \false) + { + } + /** + * Filter the access check in bp_groups_group_access_protection() for this extension. + * + * Note that $no_access_args is passed by reference, as there are some + * circumstances where the bp_core_no_access() arguments need to be + * modified before the redirect takes place. + * + * @since 2.1.0 + * + * @param bool $user_can_visit Whether or not the user can visit the tab. + * @param array $no_access_args Array of args to help determine access. + * @return bool + */ + public function group_access_protection($user_can_visit, &$no_access_args) + { + } + /** Create ************************************************************/ + /** + * Hook this extension's Create step into BuddyPress, if necessary. + * + * @since 1.8.0 + */ + protected function setup_create_hooks() + { + } + /** + * Call the create_screen() method, if we're on the right page. + * + * @since 1.8.0 + */ + public function maybe_create_screen() + { + } + /** + * Call the create_screen_save() method, if we're on the right page. + * + * @since 1.8.0 + */ + public function maybe_create_screen_save() + { + } + /** Edit **************************************************************/ + /** + * Hook this extension's Edit panel into BuddyPress, if necessary. + * + * @since 1.8.0 + */ + protected function setup_edit_hooks() + { + } + /** + * Call the edit_screen() method. + * + * Previous versions of BP_Group_Extension required plugins to provide + * their own Submit button and nonce fields when building markup. In + * BP 1.8, this requirement was lifted - BP_Group_Extension now handles + * all required submit buttons and nonces. + * + * We put the edit screen markup into an output buffer before echoing. + * This is so that we can check for the presence of a hardcoded submit + * button, as would be present in legacy plugins; if one is found, we + * do not auto-add our own button. + * + * @since 1.8.0 + */ + public function call_edit_screen() + { + } + /** + * Check the nonce, and call the edit_screen_save() method. + * + * @since 1.8.0 + */ + public function call_edit_screen_save() + { + } + /** + * Load the template that houses the Edit screen. + * + * Separated out into a callback so that it can run after all other + * Group Extensions have had a chance to register their navigation, to + * avoid missing tabs. + * + * Hooked to 'bp_screens'. + * + * @since 1.8.0 + * + * @see BP_Group_Extension::setup_edit_hooks() + */ + public function call_edit_screen_template_loader() + { + } + /** + * Add a submit button to the edit form, if it needs one. + * + * There's an inconsistency in the way that the group Edit and Create + * screens are rendered: the Create screen has a submit button built + * in, but the Edit screen does not. This function allows plugin + * authors to write markup that does not contain the submit button for + * use on both the Create and Edit screens - BP will provide the button + * if one is not found. + * + * @since 1.8.0 + * + * @param string $screen The screen markup, captured in the output + * buffer. + * @return string $screen The same markup, with a submit button added. + */ + protected function maybe_add_submit_button($screen = '') + { + } + /** + * Does the given markup have a submit button? + * + * @since 1.8.0 + * + * @param string $screen The markup to check. + * @return bool True if a Submit button is found, otherwise false. + */ + public static function has_submit_button($screen = '') + { + } + /** + * Detect redirects hardcoded into edit_screen_save() callbacks. + * + * @since 2.1.0 + * + * @param string $redirect Redirect string. + * @return string + */ + public function detect_post_save_redirect($redirect = '') + { + } + /** Admin *************************************************************/ + /** + * Hook this extension's Admin metabox into BuddyPress, if necessary. + * + * @since 1.8.0 + */ + protected function setup_admin_hooks() + { + } + /** + * Call the admin_screen() method, and add a nonce field. + * + * @since 1.8.0 + */ + public function call_admin_screen() + { + } + /** + * Check the nonce, and call the admin_screen_save() method. + * + * @since 1.8.0 + */ + public function call_admin_screen_save() + { + } + /** + * Create the Dashboard meta box for this extension. + * + * @since 1.7.0 + */ + public function _meta_box_display_callback() + { + } + /** Utilities *********************************************************/ + /** + * Generate the nonce fields for a settings form. + * + * The nonce field name (the second param passed to wp_nonce_field) + * contains this extension's slug and is thus unique to this extension. + * This is necessary because in some cases (namely, the Dashboard), + * more than one extension may generate nonces on the same page, and we + * must avoid name clashes. + * + * @since 1.8.0 + * + * @param string $context Screen context. 'create', 'edit', or 'admin'. + */ + public function nonce_field($context = '') + { + } + /** + * Check the nonce on a submitted settings form. + * + * @since 1.8.0 + * + * @param string $context Screen context. 'create', 'edit', or 'admin'. + */ + public function check_nonce($context = '') + { + } + /** + * Is the specified screen enabled? + * + * To be enabled, a screen must both have the 'enabled' key set to true + * (legacy: $this->enable_create_step, etc), and its screen_callback + * must also exist and be callable. + * + * @since 1.8.0 + * + * @param string $context Screen context. 'create', 'edit', or 'admin'. + * @return bool True if the screen is enabled, otherwise false. + */ + public function is_screen_enabled($context = '') + { + } + /** + * Get the appropriate screen callback for the specified context/type. + * + * BP Group Extensions have three special "screen contexts": create, + * admin, and edit. Each of these contexts has a corresponding + * _screen() and _screen_save() method, which allow group extension + * plugins to define different markup and logic for each context. + * + * BP also supports fallback settings_screen() and + * settings_screen_save() methods, which can be used to define markup + * and logic that is shared between context. For each context, you may + * either provide context-specific methods, or you can let BP fall back + * on the shared settings_* callbacks. + * + * For example, consider a BP_Group_Extension implementation that looks + * like this: + * + * // ... + * function create_screen( $group_id ) { ... } + * function create_screen_save( $group_id ) { ... } + * function settings_screen( $group_id ) { ... } + * function settings_screen_save( $group_id ) { ... } + * // ... + * + * BP_Group_Extension will use your create_* methods for the Create + * steps, and will use your generic settings_* methods for the Edit + * and Admin contexts. This schema allows plugin authors maximum + * flexibility without having to repeat themselves. + * + * The get_screen_callback() method uses a ReflectionClass object to + * determine whether your extension has provided a given callback. + * + * @since 1.8.0 + * + * @param string $context Screen context. 'create', 'edit', or 'admin'. + * @param string $type Screen type. 'screen' or 'screen_save'. Default: + * 'screen'. + * @return callable A callable function handle. + */ + public function get_screen_callback($context = '', $type = 'screen') + { + } + /** + * Recursive argument parsing. + * + * This acts like a multi-dimensional version of wp_parse_args() (minus + * the querystring parsing - you must pass arrays). + * + * Values from $a override those from $b; keys in $b that don't exist + * in $a are passed through. + * + * This is different from array_merge_recursive(), both because of the + * order of preference ($a overrides $b) and because of the fact that + * array_merge_recursive() combines arrays deep in the tree, rather + * than overwriting the b array with the a array. + * + * The implementation of this function is specific to the needs of + * BP_Group_Extension, where we know that arrays will always be + * associative, and that an argument under a given key in one array + * will be matched by a value of identical depth in the other one. The + * function is NOT designed for general use, and will probably result + * in unexpected results when used with data in the wild. See, eg, + * https://core.trac.wordpress.org/ticket/19888 + * + * @since 1.8.0 + * + * @param array $a First set of arguments. + * @param array $b Second set of arguments. + * @return array Parsed arguments. + */ + public static function parse_args_r(&$a, $b) + { + } + /** Legacy Support ********************************************************/ + /* + * In BuddyPress 1.8, the recommended technique for configuring + * extensions changed from directly setting various object properties + * in the class constructor, to passing a configuration array to + * parent::init(). The following methods ensure that extensions created + * in the old way continue to work, by converting legacy configuration + * data to the new format. + */ + /** + * Provide access to otherwise unavailable object properties. + * + * This magic method is here for backward compatibility with plugins + * that refer to config properties that have moved to a different + * location (such as enable_create_step, which is now at + * $this->screens['create']['enabled'] + * + * The legacy_properties array is set up in + * self::setup_legacy_properties(). + * + * @since 1.8.0 + * + * @param string $key Property name. + * @return mixed The value if found, otherwise null. + */ + public function __get($key) + { + } + /** + * Provide a fallback for isset( $this->foo ) when foo is unavailable. + * + * This magic method is here for backward compatibility with plugins + * that have set their class config options directly in the class + * constructor. The parse_legacy_properties() method of the current + * class needs to check whether any legacy keys have been put into the + * $this->data array. + * + * @since 1.8.0 + * + * @param string $key Property name. + * @return bool True if the value is set, otherwise false. + */ + public function __isset($key) + { + } + /** + * Allow plugins to set otherwise unavailable object properties. + * + * This magic method is here for backward compatibility with plugins + * that may attempt to modify the group extension by manually assigning + * a value to an object property that no longer exists, such as + * $this->enable_create_step. + * + * @since 1.8.0 + * + * @param string $key Property name. + * @param mixed $value Property value. + */ + public function __set($key, $value) + { + } + /** + * Return a list of legacy properties. + * + * The legacy implementation of BP_Group_Extension used all of these + * object properties for configuration. Some have been moved. + * + * @since 1.8.0 + * + * @return array List of legacy property keys. + */ + protected function get_legacy_property_list() + { + } + /** + * Parse legacy properties. + * + * The old standard for BP_Group_Extension was for plugins to register + * their settings as properties in their constructor. The new method is + * to pass a config array to the init() method. In order to support + * legacy plugins, we slurp up legacy properties, and later on we'll + * parse them into the new init() array. + * + * @since 1.8.0 + */ + protected function parse_legacy_properties() + { + } + /** + * Set up legacy properties. + * + * This method is responsible for ensuring that all legacy config + * properties are stored in an array $this->legacy_properties, so that + * they remain available to plugins that reference the variables at + * their old locations. + * + * @since 1.8.0 + * + * @see BP_Group_Extension::__get() + */ + protected function setup_legacy_properties() + { + } + } + /** + * Base class for the BuddyPress Suggestions API. + * + * Originally built to power BuddyPress' at-mentions suggestions, it's flexible enough to be used + * for similar kinds of future core requirements, or those desired by third-party developers. + * + * To implement a new suggestions service, create a new class that extends this one, and update + * the list of default services in {@link bp_core_get_suggestions()}. If you're building a plugin, + * it's recommend that you use the `bp_suggestions_services` filter to do this. :) + * + * While the implementation of the query logic is left to you, it should be as quick and efficient + * as possible. When implementing the abstract methods in this class, pay close attention to the + * recommendations provided in the phpDoc blocks, particularly the expected return types. + * + * @since 2.1.0 + */ + abstract class BP_Suggestions + { + /** + * Default arguments common to all suggestions services. + * + * If your custom service requires further defaults, add them here. + * + * @since 2.1.0 + * @var array + */ + protected $default_args = array('limit' => 16, 'term' => '', 'type' => ''); + /** + * Holds the arguments for the query (about to made to the suggestions service). + * + * This includes `$default_args`, as well as the user-supplied values. + * + * @since 2.1.0 + * @var array + */ + protected $args = array(); + /** + * Constructor. + * + * @since 2.1.0 + * + * @param array $args Optional. If set, used as the parameters for the suggestions service query. + */ + public function __construct(array $args = array()) + { + } + /** + * Set the parameters for the suggestions service query. + * + * @since 2.1.0 + * + * @param array $args { + * Array of arguments for the suggestions service query. + * + * @type int $limit Maximum number of results to display. Optional, default: 16. + * @type string $type The name of the suggestion service to use for the request. Mandatory. + * @type string $term The suggestion service will try to find results that contain this string. + * Mandatory. + * } + */ + public function set_query(array $args = array()) + { + } + /** + * Validate and sanitise the parameters for the suggestion service query. + * + * Be sure to call this class' version of this method when implementing it in your own service. + * If validation fails, you must return a WP_Error object. + * + * @since 2.1.0 + * + * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). + */ + public function validate() + { + } + /** + * Find and return a list of suggestions that match the query. + * + * The return type is important. If no matches are found, an empty array must be returned. + * Matches must be returned as objects in an array. + * + * The object format for each match must be: { 'ID': string, 'image': string, 'name': string } + * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' } + * + * @since 2.1.0 + * + * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object. + */ + public abstract function get_suggestions(); + } + /** + * Adds support for user at-mentions to the Suggestions API. + * + * This class is in the Core component because it's required by a class in the Groups component, + * and Groups is loaded before Members (alphabetical order). + * + * @since 2.1.0 + */ + class BP_Members_Suggestions extends \BP_Suggestions + { + /** + * Default arguments for this suggestions service. + * + * @since 2.1.0 + * @var array $args { + * @type int $limit Maximum number of results to display. Default: 16. + * @type bool $only_friends If true, only match the current user's friends. Default: false. + * @type string $term The suggestion service will try to find results that contain this string. + * Mandatory. + * } + */ + protected $default_args = array('limit' => 10, 'only_friends' => \false, 'term' => '', 'type' => ''); + /** + * Validate and sanitise the parameters for the suggestion service query. + * + * @since 2.1.0 + * + * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). + */ + public function validate() + { + } + /** + * Find and return a list of username suggestions that match the query. + * + * @since 2.1.0 + * + * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object. + */ + public function get_suggestions() + { + } + } + /** + * Adds support for user at-mentions (for users in a specific Group) to the Suggestions API. + * + * @since 2.1.0 + */ + class BP_Groups_Member_Suggestions extends \BP_Members_Suggestions + { + /** + * Default arguments for this suggestions service. + * + * @since 2.1.0 + * @var array $args { + * @type int $group_id Positive integers will restrict the search to members in that group. + * Negative integers will restrict the search to members in every other group. + * @type int $limit Maximum number of results to display. Default: 16. + * @type bool $only_friends If true, only match the current user's friends. Default: false. + * @type string $term The suggestion service will try to find results that contain this string. + * Mandatory. + * } + */ + protected $default_args = array('group_id' => 0, 'limit' => 16, 'only_friends' => \false, 'term' => '', 'type' => ''); + /** + * Validate and sanitise the parameters for the suggestion service query. + * + * @since 2.1.0 + * + * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). + */ + public function validate() + { + } + /** + * Find and return a list of username suggestions that match the query. + * + * @since 2.1.0 + * + * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object. + */ + public function get_suggestions() + { + } + } + /** + * BuddyPress Group Membership object. + */ + class BP_Groups_Member + { + /** + * ID of the membership. + * + * @since 1.6.0 + * @var int + */ + var $id; + /** + * ID of the group associated with the membership. + * + * @since 1.6.0 + * @var int + */ + var $group_id; + /** + * ID of the user associated with the membership. + * + * @since 1.6.0 + * @var int + */ + var $user_id; + /** + * ID of the user whose invitation initiated the membership. + * + * @since 1.6.0 + * @var int + */ + var $inviter_id; + /** + * Whether the member is an admin of the group. + * + * @since 1.6.0 + * @var int + */ + var $is_admin; + /** + * Whether the member is a mod of the group. + * + * @since 1.6.0 + * @var int + */ + var $is_mod; + /** + * Whether the member is banned from the group. + * + * @since 1.6.0 + * @var int + */ + var $is_banned; + /** + * Title used to describe the group member's role in the group. + * + * Eg, 'Group Admin'. + * + * @since 1.6.0 + * @var int + */ + var $user_title; + /** + * Last modified date of the membership. + * + * This value is updated when, eg, invitations are accepted. + * + * @since 1.6.0 + * @var string + */ + var $date_modified; + /** + * Whether the membership has been confirmed. + * + * @since 1.6.0 + * @var int + */ + var $is_confirmed; + /** + * Comments associated with the membership. + * + * In BP core, these are limited to the optional message users can + * include when requesting membership to a private group. + * + * @since 1.6.0 + * @var string + */ + var $comments; + /** + * Whether an invitation has been sent for this membership. + * + * The purpose of this flag is to mark when an invitation has been + * "drafted" (the user has been added via the interface at Send + * Invites), but the Send button has not been pressed, so the + * invitee has not yet been notified. + * + * @since 1.6.0 + * @var int + */ + var $invite_sent; + /** + * WP_User object representing the membership's user. + * + * @since 1.6.0 + * @var WP_User + */ + protected $user; + /** + * Constructor method. + * + * @since 1.6.0 + * + * @param int $user_id Optional. Along with $group_id, can be used to + * look up a membership. + * @param int $group_id Optional. Along with $user_id, can be used to + * look up a membership. + * @param int|bool $id Optional. The unique ID of the membership object. + * @param bool $populate Whether to populate the properties of the + * located membership. Default: true. + */ + public function __construct($user_id = 0, $group_id = 0, $id = \false, $populate = \true) + { + } + /** + * Populate the object's properties. + * + * @since 1.6.0 + */ + public function populate() + { + } + /** + * Magic getter. + * + * @since 2.8.0 + * + * @param string $key Key. + * @return BP_Core_User|null + */ + public function __get($key) + { + } + /** + * Magic issetter. + * + * @since 2.8.0 + * + * @param string $key Key. + * @return bool + */ + public function __isset($key) + { + } + /** + * Get the user object corresponding to this membership. + * + * Used for lazyloading the protected `user` property. + * + * @since 2.8.0 + * + * @return BP_Core_User + */ + protected function get_user_object() + { + } + /** + * Save the membership data to the database. + * + * @since 1.6.0 + * + * @return bool + */ + public function save() + { + } + /** + * Promote a member to a new status. + * + * @since 1.6.0 + * + * @param string $status The new status. 'mod' or 'admin'. + * @return bool + */ + public function promote($status = 'mod') + { + } + /** + * Demote membership to Member status (non-admin, non-mod). + * + * @since 1.6.0 + * + * @return bool + */ + public function demote() + { + } + /** + * Ban the user from the group. + * + * @since 1.6.0 + * + * @return bool + */ + public function ban() + { + } + /** + * Unban the user from the group. + * + * @since 1.6.0 + * + * @return bool + */ + public function unban() + { + } + /** + * Mark a pending invitation as accepted. + * + * @since 1.6.0 + */ + public function accept_invite() + { + } + /** + * Confirm a membership request. + * + * @since 1.6.0 + */ + public function accept_request() + { + } + /** + * Remove the current membership. + * + * @since 1.6.0 + * + * @return bool + */ + public function remove() + { + } + /** Static Methods ****************************************************/ + /** + * Refresh the `total_group_count` for a user. + * + * @since 1.8.0 + * + * @param int $user_id ID of the user. + */ + public static function refresh_total_group_count_for_user($user_id) + { + } + /** + * Refresh the `total_member_count` for a group. + * + * The request skip the current cache so that we always grab the lastest total count. + * + * @since 1.8.0 + * @since 10.0.0 Updated to use `BP_Groups_Group::get_total_member_count` + * + * @param int $group_id ID of the group. + */ + public static function refresh_total_member_count_for_group($group_id) + { + } + /** + * Delete a membership, based on user + group IDs. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return bool + */ + public static function delete($user_id, $group_id) + { + } + /** + * Get the IDs of the groups of which a specified user is a member. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_group_ids($user_id, $limit = \false, $page = \false) + { + } + /** + * Get the IDs of the groups of which a specified user is a member, sorted by the date joined. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|bool $filter Optional. Limit results to groups whose name or + * description field matches search terms. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_recently_joined($user_id, $limit = \false, $page = \false, $filter = \false) + { + } + /** + * Get the IDs of the groups of which a specified user is an admin. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|bool $filter Optional. Limit results to groups whose name or + * description field matches search terms. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_is_admin_of($user_id, $limit = \false, $page = \false, $filter = \false) + { + } + /** + * Get the IDs of the groups of which a specified user is a moderator. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|bool $filter Optional. Limit results to groups whose name or + * description field matches search terms. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_is_mod_of($user_id, $limit = \false, $page = \false, $filter = \false) + { + } + /** + * Get the groups of which a specified user is banned from. + * + * @since 2.4.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|bool $filter Optional. Limit results to groups whose name or + * description field matches search terms. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_is_banned_of($user_id, $limit = \false, $page = \false, $filter = \false) + { + } + /** + * Get the count of groups of which the specified user is a member. + * + * @since 1.6.0 + * + * @param int $user_id Optional. Default: ID of the displayed user. + * @return int Group count. + */ + public static function total_group_count($user_id = 0) + { + } + /** + * Get group objects for groups that a user is currently invited to. + * + * @since 1.6.0 + * + * @param int $user_id ID of the invitee. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|array|bool $exclude Optional. Array or comma-separated list + * of group IDs to exclude from results. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_invites($user_id, $limit = \false, $page = \false, $exclude = \false) + { + } + /** + * Gets the total group invite count for a user. + * + * @since 2.0.0 + * + * @param int $user_id The user ID. + * @return int + */ + public static function get_invite_count_for_user($user_id = 0) + { + } + /** + * Gets memberships of a user for purposes of a personal data export. + * + * @since 4.0.0 + * + * @param int $user_id ID of the user. + * @param array $args { + * Array of optional arguments. + * @type int $page Page of memberships being requested. Default 1. + * @type int $per_page Memberships to return per page. Default 20. + * @type string $type Membership type being requested. Accepts 'membership', + * 'pending_request', 'pending_received_invitation', + * 'pending_sent_invitation'. Default 'membership'. + * } + * + * @return array + */ + public static function get_user_memberships($user_id, $args = array()) + { + } + /** + * Check whether a user has an outstanding invitation to a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the potential invitee. + * @param int $group_id ID of the group. + * @param string $type If 'sent', results are limited to those invitations + * that have actually been sent (non-draft). Default: 'sent'. + * @return int|null The ID of the invitation if found; null if not found. + */ + public static function check_has_invite($user_id, $group_id, $type = 'sent') + { + } + /** + * Delete an invitation, by specifying user ID and group ID. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $inviter_id ID of the inviter. Specify if you want to delete + * a specific invite. Leave false if you want to + * delete all invites to this group. + * @return int Number of records deleted. + */ + public static function delete_invite($user_id, $group_id, $inviter_id = \false) + { + } + /** + * Delete an unconfirmed membership request, by user ID and group ID. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int Number of records deleted. + */ + public static function delete_request($user_id, $group_id) + { + } + /** + * Check whether a user is an admin of a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return mixed + */ + public static function check_is_admin($user_id, $group_id) + { + } + /** + * Check whether a user is a mod of a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return mixed + */ + public static function check_is_mod($user_id, $group_id) + { + } + /** + * Check whether a user is a member of a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return mixed + */ + public static function check_is_member($user_id, $group_id) + { + } + /** + * Check whether a user is banned from a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|null int 1 if user is banned; int 0 if user is not banned; + * null if user is not part of the group or if group doesn't exist. + */ + public static function check_is_banned($user_id, $group_id) + { + } + /** + * Is the specified user the creator of the group? + * + * @since 1.2.6 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|null int of group ID if user is the creator; null on failure. + */ + public static function check_is_creator($user_id, $group_id) + { + } + /** + * Check whether a user has an outstanding membership request for a given group. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int Database ID of the membership if found; int 0 on failure. + */ + public static function check_for_membership_request($user_id, $group_id) + { + } + /** + * Get a list of randomly selected IDs of groups that the member belongs to. + * + * @since 1.6.0 + * + * @param int $user_id ID of the user. + * @param int $total_groups Max number of group IDs to return. Default: 5. + * @return array Group IDs. + */ + public static function get_random_groups($user_id = 0, $total_groups = 5) + { + } + /** + * Get the IDs of all a given group's members. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return array IDs of all group members. + */ + public static function get_group_member_ids($group_id) + { + } + /** + * Get a list of all a given group's admins. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return array Info about group admins (user_id + date_modified). + */ + public static function get_group_administrator_ids($group_id) + { + } + /** + * Prime the bp_group_admins cache for one or more groups. + * + * @since 2.7.0 + * + * @param array $group_ids IDs of the groups. + * @return bool + */ + public static function prime_group_admins_mods_cache($group_ids) + { + } + /** + * Get a list of all a given group's moderators. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return array Info about group mods (user_id + date_modified). + */ + public static function get_group_moderator_ids($group_id) + { + } + /** + * Get group membership objects by ID (or an array of IDs). + * + * @since 2.6.0 + * + * @param int|string|array $membership_ids Single membership ID or comma-separated/array list of membership IDs. + * @return array + */ + public static function get_memberships_by_id($membership_ids) + { + } + /** + * Get the IDs users with outstanding membership requests to the group. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return array IDs of users with outstanding membership requests. + */ + public static function get_all_membership_request_user_ids($group_id) + { + } + /** + * Get members of a group. + * + * @deprecated 1.6.0 + * + * @param int $group_id ID of the group being queried for. + * @param bool|int $limit Max amount to return. + * @param bool|int $page Pagination value. + * @param bool $exclude_admins_mods Whether or not to exclude admins and moderators. + * @param bool $exclude_banned Whether or not to exclude banned members. + * @param bool|array $exclude Array of user IDs to exclude. + * @return false|array + */ + public static function get_all_for_group($group_id, $limit = \false, $page = \false, $exclude_admins_mods = \true, $exclude_banned = \true, $exclude = \false) + { + } + /** + * Get all membership IDs for a user. + * + * @since 2.6.0 + * + * @param int $user_id ID of the user. + * @return array + */ + public static function get_membership_ids_for_user($user_id) + { + } + /** + * Delete all memberships for a given group. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return int Number of records deleted. + */ + public static function delete_all($group_id) + { + } + /** + * Delete all group membership information for the specified user. + * + * In cases where the user is the sole member of a group, a site administrator is + * assigned to be the group's administrator. Unhook `groups_remove_data_for_user()` + * to modify this behavior. + * + * @since 1.0.0 + * @since 4.0.0 The method behavior was changed so that single-member groups are not deleted. + * + * @param int $user_id ID of the user. + * @return bool + */ + public static function delete_all_for_user($user_id) + { + } + } + /** + * The main Groups template loop class. + * + * Responsible for loading a group of groups into a loop for display. + * + * @since 1.2.0 + */ + class BP_Groups_Template + { + /** + * The loop iterator. + * + * @since 1.2.0 + * @var int + */ + public $current_group = -1; + /** + * The number of groups returned by the paged query. + * + * @since 1.2.0 + * @var int + */ + public $group_count; + /** + * Array of groups located by the query. + * + * @since 1.2.0 + * @var array + */ + public $groups; + /** + * The group object currently being iterated on. + * + * @since 1.2.0 + * @var object + */ + public $group; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.2.0 + * @var bool + */ + public $in_the_loop; + /** + * The page number being requested. + * + * @since 1.2.0 + * @var string + */ + public $pag_page; + /** + * The number of items being requested per page. + * + * @since 1.2.0 + * @var string + */ + public $pag_num; + /** + * URL argument used for the pagination param. + * + * @since 1.2.0 + * @var string + */ + public $pag_arg; + /** + * An HTML string containing pagination links. + * + * @since 1.2.0 + * @var string + */ + public $pag_links; + /** + * The total number of groups matching the query parameters. + * + * @since 1.2.0 + * @var int + */ + public $total_group_count; + /** + * Whether the template loop is for a single group page. + * + * @since 1.2.0 + * @var bool + */ + public $single_group = \false; + /** + * Field to sort by. + * + * @since 1.2.0 + * @var string + */ + public $sort_by; + /** + * Sort order. + * + * @since 1.2.0 + * @var string + */ + public $order; + /** + * Constructor method. + * + * @see BP_Groups_Group::get() for an in-depth description of arguments. + * + * @param array $args { + * Array of arguments. Accepts all arguments accepted by + * {@link BP_Groups_Group::get()}. In cases where the default + * values of the params differ, they have been discussed below. + * @type int $per_page Default: 20. + * @type int $page Default: 1. + * } + */ + function __construct(...$args) + { + } + /** + * Whether there are groups available in the loop. + * + * @since 1.2.0 + * + * @see bp_has_groups() + * + * @return bool True if there are items in the loop, otherwise false. + */ + function has_groups() + { + } + /** + * Set up the next group and iterate index. + * + * @since 1.2.0 + * + * @return object The next group to iterate over. + */ + function next_group() + { + } + /** + * Rewind the groups and reset member index. + * + * @since 1.2.0 + */ + function rewind_groups() + { + } + /** + * Whether there are groups left in the loop to iterate over. + * + * This method is used by {@link bp_groups()} as part of the while loop + * that controls iteration inside the groups loop, eg: + * while ( bp_groups() ) { ... + * + * @since 1.2.0 + * + * @see bp_groups() + * + * @return bool True if there are more groups to show, otherwise false. + */ + function groups() + { + } + /** + * Set up the current group inside the loop. + * + * Used by {@link bp_the_group()} to set up the current group data + * while looping, so that template tags used during that iteration make + * reference to the current member. + * + * @since 1.2.0 + * + * @see bp_the_group() + */ + function the_group() + { + } + } + /** + * Creates our Groups component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Groups_Component extends \BP_Component + { + /** + * Auto-join group when non group member performs group activity. + * + * @since 1.5.0 + * @var bool + */ + public $auto_join; + /** + * The group being currently accessed. + * + * @since 1.5.0 + * @var BP_Groups_Group + */ + public $current_group; + /** + * Default group extension. + * + * @since 1.6.0 + * @var string + */ + public $default_extension; + /** + * Illegal group names/slugs. + * + * @since 1.5.0 + * @var array + */ + public $forbidden_names; + /** + * Group creation/edit steps (e.g. Details, Settings, Avatar, Invites). + * + * @since 1.5.0 + * @var array + */ + public $group_creation_steps; + /** + * Types of group statuses (Public, Private, Hidden). + * + * @since 1.5.0 + * @var array + */ + public $valid_status; + /** + * Group types. + * + * @see bp_groups_register_group_type() + * + * @since 2.6.0 + * @var array + */ + public $types = array(); + /** + * Nav for the Group component. + * + * @since 2.6.0 + * @var BP_Core_Nav + */ + public $nav; + /** + * Current directory group type. + * + * @see groups_directory_groups_setup() + * + * @since 2.7.0 + * @var string + */ + public $current_directory_type = ''; + /** + * List of registered Group extensions. + * + * @see bp_register_group_extension() + * + * @since 10.0.0 + * @var array + */ + public $group_extensions = array(); + /** + * Start the groups component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include Groups component files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Sets up the current (displayed) group it it exists. + * + * @since 12.0.0 + * + * @param string $group_slug The current action which is possibly a group slug. + * @return BP_Groups_Group|Object|integer A group's object or 0 if no groups were found. + */ + public function setup_current_group($group_slug = '') + { + } + /** + * Set up the component actions. + * + * @since 12.0.0 + */ + public function setup_actions() + { + } + /** + * Set up additional globals for the component. + * + * @since 10.0.0 + */ + public function setup_additional_globals() + { + } + /** + * Set up component global data. + * + * The BP_GROUPS_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @param array $args See BP_Component::setup_globals() for a description. + */ + public function setup_globals($args = array()) + { + } + /** + * Set up canonical stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.5.0 + * @since 12.0.0 Used to customize the main navigation name and set + * a Groups single item navigation. + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_nav() for a description of the $wp_admin_nav + * parameter array. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() + { + } + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Set up taxonomies. + * + * @since 2.6.0 + * @since 7.0.0 The Group Type taxonomy is registered using the `bp_groups_register_group_type_taxonomy()` function. + */ + public function register_taxonomies() + { + } + /** + * Adds the Groups directory type & Group create rewrite tags. + * + * @since 12.0.0 + * + * @param array $rewrite_tags Optional. See BP_Component::add_rewrite_tags() for + * description. + */ + public function add_rewrite_tags($rewrite_tags = array()) + { + } + /** + * Adds the Groups directory type & Group create rewrite rules. + * + * @since 12.0.0 + * + * @param array $rewrite_rules Optional. See BP_Component::add_rewrite_rules() for + * description. + */ + public function add_rewrite_rules($rewrite_rules = array()) + { + } + /** + * Parse the WP_Query and eventually display the component's directory or single item. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. See BP_Component::parse_query() for + * description. + */ + public function parse_query($query) + { + } + /** + * Check the parsed query is consistent with Group’s registered screens. + * + * @since 12.0.0 + */ + public function check_parsed_query() + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * @since 6.0.0 Adds the Group Cover REST endpoint. + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Groups Blocks. + * + * @since 6.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * Membership request template loop class. + * + * @since 1.0.0 + */ + class BP_Groups_Membership_Requests_Template + { + /** + * @since 1.0.0 + * @var int + */ + public $current_request = -1; + /** + * @since 1.0.0 + * @var int + */ + public $request_count; + /** + * @since 1.0.0 + * @var array + */ + public $requests; + /** + * @since 1.0.0 + * @var object + */ + public $request; + /** + * @sine 1.0.0 + * @var bool + */ + public $in_the_loop; + /** + * @since 1.0.0 + * @var int + */ + public $pag_page; + /** + * @since 1.0.0 + * @var int + */ + public $pag_num; + /** + * @since 1.0.0 + * @var array|string|null + */ + public $pag_links; + /** + * URL argument used for the pagination param. + * + * @since 1.0.0 + * @var string + */ + public $pag_arg; + /** + * @since 1.0.0 + * @var int + */ + public $total_request_count; + /** + * Constructor method. + * + * @since 1.5.0 + * + * @param array $args { + * @type int $group_id ID of the group whose membership requests + * are being queried. Default: current group id. + * @type int $per_page Number of records to return per page of + * results. Default: 10. + * @type int $page Page of results to show. Default: 1. + * @type int $max Max items to return. Default: false (show all) + * } + */ + public function __construct($args = array()) + { + } + /** + * Whether or not there are requests to show. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_requests() + { + } + /** + * Moves up to the next request. + * + * @since 1.0.0 + * + * @return object + */ + public function next_request() + { + } + /** + * Rewinds the requests to the first in the list. + * + * @since 1.0.0 + */ + public function rewind_requests() + { + } + /** + * Finishes up the requests to display. + * + * @since 1.0.0 + * + * @return bool + */ + public function requests() + { + } + /** + * Sets up the request to display. + * + * @since 1.0.0 + */ + public function the_request() + { + } + } + /** + * Group Cover endpoints. + * + * /groups/<group_id>/cover + * + * @since 6.0.0 + */ + class BP_REST_Attachments_Group_Cover_Endpoint extends \WP_REST_Controller + { + use \BP_REST_Attachments; + /** + * BP_Attachment_Cover_Image Instance. + * + * @since 6.0.0 + * + * @var BP_Attachment_Cover_Image + */ + protected $attachment_instance; + /** + * Reuse some parts of the BP_REST_Groups_Endpoint class. + * + * @since 6.0.0 + * + * @var BP_REST_Groups_Endpoint + */ + protected $groups_endpoint; + /** + * Hold the group object. + * + * @since 6.0.0 + * + * @var BP_Groups_Group + */ + protected $group; + /** + * Group object type. + * + * @since 6.0.0 + * + * @var string + */ + protected $object = 'group'; + /** + * Constructor. + * + * @since 6.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 6.0.0 + */ + public function register_routes() + { + } + /** + * Fetch an existing group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Checks if a given request has access to get a group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Upload a group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to upload a group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Delete an existing group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Checks if a given request has access to delete a group cover. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares group cover to return as an object. + * + * @since 6.0.0 + * + * @param string $cover_url Group cover url. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($cover_url, $request) + { + } + /** + * Get the plugin schema, conforming to JSON Schema. + * + * @since 6.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + } + /** + * Group invitations class. + * + * An extension of the core Invitations class that adapts the + * core logic to accommodate group invitation behavior. + * + * @since 5.0.0 + */ + class BP_Groups_Invitation_Manager extends \BP_Invitation_Manager + { + /** + * Construct parameters. + * + * @since 5.0.0 + * + * @param array|string $args. + */ + public function __construct($args = '') + { + } + /** + * This is where custom actions are added to run when notifications of an + * invitation or request need to be generated & sent. + * + * @since 5.0.0 + * + * @param BP_Invitation $invitation The invitation to send. + * @return bool + */ + public function run_send_action(\BP_Invitation $invitation) + { + } + /** + * This is where custom actions are added to run when an invitation + * or request is accepted. + * + * @since 5.0.0 + * + * @param string $type Are we accepting an invitation or request? + * @param array $r Parameters that describe the invitation being accepted. + * @return bool + */ + public function run_acceptance_action($type, $r) + { + } + /** + * With group invitations, we don't need to keep the old record, so we delete rather than + * mark invitations as "accepted." + * + * @since 5.0.0 + * + * @see BP_Invitation::mark_accepted_by_data() + * for a description of arguments. + * + * @param array $args. + */ + public function mark_accepted($args) + { + } + /** + * Should this invitation be created? + * + * @since 5.0.0 + * + * @param array $args Array of arguments. + * @return bool + */ + public function allow_invitation($args) + { + } + /** + * Should this request be created? + * + * @since 5.0.0 + * + * @param array $args. + * @return bool. + */ + public function allow_request($args) + { + } + } + /** + * Groups endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Groups_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve groups. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Request List of groups object data. + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to group items. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get information about a specific group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to create a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Retrieves the current user groups. + * + * @since 7.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. + */ + public function get_current_user_groups($request) + { + } + /** + * Check if a given request has access to fetch the user's groups. + * + * @since 7.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_current_user_groups_permissions_check($request) + { + } + /** + * Prepares group data for return as an object. + * + * @since 5.0.0 + * + * @param BP_Groups_Group $item The group object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($item, $request) + { + } + /** + * Prepare a group for create or update. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return stdClass|WP_Error + */ + protected function prepare_item_for_database($request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Groups_Group $group Group object. + * @return array + */ + protected function prepare_links($group) + { + } + /** + * See if user can delete or update a group. + * + * @since 5.0.0 + * + * @param BP_Groups_Group $group Group item. + * @return bool + */ + protected function can_user_delete_or_update($group) + { + } + /** + * Can a user see a group? + * + * @since 5.0.0 + * + * @param BP_Groups_Group $group Group object. + * @return bool + */ + public function can_see($group) + { + } + /** + * Can this user see hidden groups? + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return bool + */ + protected function can_see_hidden_groups($request) + { + } + /** + * Get group object. + * + * @since 5.0.0 + * + * @param int|WP_REST_Request $request Full details about the request or an group integer. + * @return false|BP_Groups_Group + */ + public function get_group_object($request) + { + } + /** + * Edit some arguments for the endpoint's CREATABLE and EDITABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the group schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections of groups. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Group Invites endpoints. + * + * Use /groups/{group_id}/invites + * Use /groups/{group_id}/invites/{invite_id} + * + * @since 5.0.0 + */ + class BP_REST_Group_Invites_Endpoint extends \WP_REST_Controller + { + /** + * Reuse some parts of the BP_REST_Groups_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Groups_Endpoint + */ + protected $groups_endpoint; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve group invitations. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to group invitations. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return bool|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Fetch a specific group invitation by ID. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to fetch group invitation. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Invite a member to a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to invite a member to a group. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Accept a group invitation. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to accept a group invitation. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Remove (reject/delete) a group invitation. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a group invitation. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return bool|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares group invitation data to return as an object. + * + * @since 5.0.0 + * + * @param BP_Invitation $invite The invitation object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($invite, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Invitation $invite Invite object. + * @return array + */ + protected function prepare_links($invite) + { + } + /** + * Check access. + * + * @param int $group_id Group ID. + * @return bool + */ + protected function can_see($group_id) + { + } + /** + * Helper function to fetch a single group invite. + * + * @since 5.0.0 + * + * @param int $invite_id The ID of the invitation you wish to fetch. + * @return BP_Invitation|bool $invite Invitation if found, false otherwise. + */ + public function fetch_single_invite($invite_id = 0) + { + } + /** + * Edit the type of the some properties for the CREATABLE & EDITABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the group invite schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections of group invites. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * BuddyPress Group object. + * + * @since 1.6.0 + */ + #[\AllowDynamicProperties] + class BP_Groups_Group + { + /** + * ID of the group. + * + * @since 1.6.0 + * @var int + */ + public $id; + /** + * User ID of the group's creator. + * + * @since 1.6.0 + * @var int + */ + public $creator_id; + /** + * Name of the group. + * + * @since 1.6.0 + * @var string + */ + public $name; + /** + * Group slug. + * + * @since 1.6.0 + * @var string + */ + public $slug; + /** + * Group description. + * + * @since 1.6.0 + * @var string + */ + public $description; + /** + * Group status. + * + * Core statuses are 'public', 'private', and 'hidden'. + * + * @since 1.6.0 + * @var string + */ + public $status; + /** + * Parent ID. + * + * ID of parent group, if applicable. + * + * @since 2.7.0 + * @var int + */ + public $parent_id; + /** + * Controls whether the group has a forum enabled. + * + * @since 1.6.0 + * @since 3.0.0 Previously, this referred to Legacy Forums. It's still used by bbPress 2 for integration. + * + * @var int + */ + public $enable_forum; + /** + * Date the group was created. + * + * @since 1.6.0 + * @var string + */ + public $date_created; + /** + * Data about the group's admins. + * + * @since 1.6.0 + * @var array + */ + protected $admins; + /** + * Data about the group's moderators. + * + * @since 1.6.0 + * @var array + */ + protected $mods; + /** + * Total count of group members. + * + * @since 1.6.0 + * @var int + */ + protected $total_member_count; + /** + * Is the current user a member of this group? + * + * @since 1.2.0 + * @var bool + */ + protected $is_member; + /** + * Is the current user a member of this group? + * Alias of $is_member for backward compatibility. + * + * @since 2.9.0 + * @var bool + */ + protected $is_user_member; + /** + * Does the current user have an outstanding invitation to this group? + * + * @since 1.9.0 + * @var bool + */ + protected $is_invited; + /** + * Does the current user have a pending membership request to this group? + * + * @since 1.9.0 + * @var bool + */ + protected $is_pending; + /** + * Timestamp of the last activity that happened in this group. + * + * @since 1.2.0 + * @var string + */ + protected $last_activity; + /** + * If this is a private or hidden group, does the current user have access? + * + * @since 1.6.0 + * @var bool + */ + protected $user_has_access; + /** + * Can the current user know that this group exists? + * + * @since 2.9.0 + * @var bool + */ + protected $is_visible; + /** + * Raw arguments passed to the constructor. + * + * Not currently used by BuddyPress. + * + * @since 2.0.0 + * @var array + */ + public $args; + /** + * Constructor method. + * + * @since 1.6.0 + * + * @param int|null $id Optional. If the ID of an existing group is provided, + * the object will be pre-populated with info about that group. + * @param array $args { + * Array of optional arguments. + * @type bool $populate_extras Deprecated. + * } + */ + public function __construct($id = \null, $args = array()) + { + } + /** + * Set up data about the current group. + * + * @since 1.6.0 + */ + public function populate() + { + } + /** + * Save the current group to the database. + * + * @since 1.6.0 + * + * @return bool + */ + public function save() + { + } + /** + * Delete the current group. + * + * @since 1.6.0 + * + * @return bool + */ + public function delete() + { + } + /** + * Magic getter. + * + * @since 2.7.0 + * + * @param string $key Property name. + * @return mixed + */ + public function __get($key) + { + } + /** + * Magic issetter. + * + * Used to maintain backward compatibility for properties that are now + * accessible only via magic method. + * + * @since 2.7.0 + * + * @param string $key Property name. + * @return bool + */ + public function __isset($key) + { + } + /** + * Magic setter. + * + * Used to maintain backward compatibility for properties that are now + * accessible only via magic method. + * + * @since 2.7.0 + * + * @param string $key Property name. + * @param mixed $value Property value. + * @return bool + */ + public function __set($key, $value) + { + } + /** + * Get a list of the group's admins. + * + * Used to provide cache-friendly access to the 'admins' property of + * the group object. + * + * @since 2.7.0 + * + * @return array|null + */ + protected function get_admins() + { + } + /** + * Get a list of the group's mods. + * + * Used to provide cache-friendly access to the 'mods' property of + * the group object. + * + * @since 2.7.0 + * + * @return array|null + */ + protected function get_mods() + { + } + /** + * Set up admins and mods for the current group object. + * + * Called only when the 'admins' or 'mods' property is accessed. + * + * @since 2.7.0 + */ + protected function set_up_admins_and_mods() + { + } + /** + * Checks whether the logged-in user is a member of the group. + * + * @since 2.7.0 + * + * @return bool|int + */ + protected function get_is_member() + { + } + /** + * Checks whether the logged-in user has access to the group. + * + * @since 2.7.0 + * + * @return bool + */ + protected function get_user_has_access() + { + } + /** + * Checks whether the current user can know the group exists. + * + * @since 2.9.0 + * + * @return bool + */ + protected function is_visible() + { + } + /** Static Methods ****************************************************/ + /** + * Get whether a group exists for a given slug. + * + * @since 1.6.0 + * @since 10.0.0 Updated to add the deprecated notice. + * + * @param string $slug Slug to check. + * @param string|bool $table_name Deprecated. + * @return int|null|bool False if empty slug, group ID if found; `null` if not. + */ + public static function group_exists($slug, $table_name = \false) + { + } + /** + * Get the ID of a group by the group's slug. + * + * Alias of {@link BP_Groups_Group::group_exists()}. + * + * @since 1.6.0 + * + * @param string $slug See {@link BP_Groups_Group::group_exists()}. + * @return int|null|bool See {@link BP_Groups_Group::group_exists()}. + */ + public static function get_id_from_slug($slug) + { + } + /** + * Get whether a group exists for an old slug. + * + * @since 2.9.0 + * + * @param string $slug Slug to check. + * @return int|null|false Group ID if found; null if not; false if missing parameters. + */ + public static function get_id_by_previous_slug($slug) + { + } + /** + * Get IDs of users with outstanding invites to a given group from a specified user. + * + * @since 1.6.0 + * @since 2.9.0 Added $sent as a parameter. + * + * @param int $user_id ID of the inviting user. + * @param int $group_id ID of the group. + * @param int|null $sent Query for a specific invite sent status. If 0, this will query for users + * that haven't had an invite sent to them yet. If 1, this will query for + * users that have had an invite sent to them. If null, no invite status will + * queried. Default: null. + * @return array IDs of users who have been invited to the group by the user but have not + * yet accepted. + */ + public static function get_invites($user_id, $group_id, $sent = \null) + { + } + /** + * Get a list of a user's groups, filtered by a search string. + * + * @since 1.6.0 + * + * @param string $filter Search term. Matches against 'name' and + * 'description' fields. + * @param int $user_id ID of the user whose groups are being searched. + * Default: the displayed user. + * @param mixed $order Not used. + * @param int|null $limit Optional. The max number of results to return. + * Default: null (no limit). + * @param int|null $page Optional. The page offset of results to return. + * Default: null (no limit). + * @return false|array { + * @type array $groups Array of matched and paginated group IDs. + * @type int $total Total count of groups matching the query. + * } + */ + public static function filter_user_groups($filter, $user_id = 0, $order = \false, $limit = \null, $page = \null) + { + } + /** + * Get a list of groups, filtered by a search string. + * + * @since 1.6.0 + * + * @param string $filter Search term. Matches against 'name' and + * 'description' fields. + * @param int|null $limit Optional. The max number of results to return. + * Default: null (no limit). + * @param int|null $page Optional. The page offset of results to return. + * Default: null (no limit). + * @param string|bool $sort_by Column to sort by. Default: false (default + * sort). + * @param string|bool $order ASC or DESC. Default: false (default sort). + * @return array { + * @type array $groups Array of matched and paginated group IDs. + * @type int $total Total count of groups matching the query. + * } + */ + public static function search_groups($filter, $limit = \null, $page = \null, $sort_by = \false, $order = \false) + { + } + /** + * Check for the existence of a slug. + * + * @since 1.6.0 + * + * @param string $slug Slug to check. + * @return string|null The slug, if found. Otherwise null. + */ + public static function check_slug($slug) + { + } + /** + * Get the slug for a given group ID. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return string|null The slug, if found. Otherwise null. + */ + public static function get_slug($group_id) + { + } + /** + * Check whether a given group has any members. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return bool True if the group has members, otherwise false. + */ + public static function has_members($group_id) + { + } + /** + * Check whether a group has outstanding membership requests. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @return int|null The number of outstanding requests, or null if + * none are found. + */ + public static function has_membership_requests($group_id) + { + } + /** + * Get outstanding membership requests for a group. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @param int|null $limit Optional. Max number of results to return. + * Default: null (no limit). + * @param int|null $page Optional. Page offset of results returned. Default: + * null (no limit). + * @return array { + * @type array $requests The requested page of located requests. + * @type int $total Total number of requests outstanding for the + * group. + * } + */ + public static function get_membership_requests($group_id, $limit = \null, $page = \null) + { + } + /** + * Query for groups. + * + * @see WP_Meta_Query::queries for a description of the 'meta_query' + * parameter format. + * + * @since 1.6.0 + * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters. + * @since 2.7.0 Added `$update_admin_cache` and `$parent_id` parameters. + * @since 2.8.0 Changed `$search_terms` parameter handling and added `$search_columns` parameter. + * @since 2.9.0 Added `$slug` parameter. + * @since 10.0.0 Added `$date_query` parameter. + * + * @param array $args { + * Array of parameters. All items are optional. + * @type string $type Optional. Shorthand for certain orderby/order combinations. + * 'newest', 'active', 'popular', 'alphabetical', 'random'. + * When present, will override orderby and order params. + * Default: null. + * @type string $orderby Optional. Property to sort by. 'date_created', 'last_activity', + * 'total_member_count', 'name', 'random', 'meta_id'. + * Default: 'date_created'. + * @type string $order Optional. Sort order. 'ASC' or 'DESC'. Default: 'DESC'. + * @type int $per_page Optional. Number of items to return per page of results. + * Default: null (no limit). + * @type int $page Optional. Page offset of results to return. + * Default: null (no limit). + * @type int $user_id Optional. If provided, results will be limited to groups + * of which the specified user is a member. Default: null. + * @type array|string $slug Optional. Array or comma-separated list of group slugs to limit + * results to. + * Default: false. + * @type string $search_terms Optional. If provided, only groups whose names or descriptions + * match the search terms will be returned. Allows specifying the + * wildcard position using a '*' character before or after the + * string or both. Works in concert with $search_columns. + * Default: false. + * @type string $search_columns Optional. If provided, only apply the search terms to the + * specified columns. Works in concert with $search_terms. + * Default: empty array. + * @type array|string $group_type Array or comma-separated list of group types to limit results to. + * @type array|string $group_type__in Array or comma-separated list of group types to limit results to. + * @type array|string $group_type__not_in Array or comma-separated list of group types that will be + * excluded from results. + * @type array $meta_query Optional. An array of meta_query conditions. + * See {@link WP_Meta_Query::queries} for description. + * @type array $date_query Optional. Filter results by group last activity date. See first + * paramter of {@link WP_Date_Query::__construct()} for syntax. Only + * applicable if $type is either 'newest' or 'active'. + * @type array|string $value Optional. Array or comma-separated list of group IDs. Results + * will be limited to groups within the list. Default: false. + * @type array|string $parent_id Optional. Array or comma-separated list of group IDs. Results + * will be limited to children of the specified groups. Default: null. + * @type array|string $exclude Optional. Array or comma-separated list of group IDs. + * Results will exclude the listed groups. Default: false. + * @type bool $update_meta_cache Whether to pre-fetch groupmeta for the returned groups. + * Default: true. + * @type bool $update_admin_cache Whether to pre-fetch administrator IDs for the returned + * groups. Default: false. + * @type bool $show_hidden Whether to include hidden groups in results. Default: false. + * @type array|string $status Optional. Array or comma-separated list of group statuses to limit + * results to. If specified, $show_hidden is ignored. + * Default: empty array. + * @type string $fields Which fields to return. Specify 'ids' to fetch a list of IDs. + * Default: 'all' (return BP_Groups_Group objects). + * If set, meta and admin caches will not be prefetched. + * } + * @return array { + * @type array $groups Array of group objects returned by the + * paginated query. (IDs only if `fields` is set to `ids`.) + * @type int $total Total count of all groups matching non- + * paginated query params. + * } + */ + public static function get($args = array()) + { + } + /** + * Get the SQL for the 'meta_query' param in BP_Groups_Group::get() + * + * We use WP_Meta_Query to do the heavy lifting of parsing the + * meta_query array and creating the necessary SQL clauses. + * + * @since 1.8.0 + * + * @param array $meta_query An array of meta_query filters. See the + * documentation for {@link WP_Meta_Query} for details. + * @return array $sql_array 'join' and 'where' clauses. + */ + protected static function get_meta_query_sql($meta_query = array()) + { + } + /** + * Convert the 'type' parameter to 'order' and 'orderby'. + * + * @since 1.8.0 + * + * @param string $type The 'type' shorthand param. + * + * @return array { + * @type string $order SQL-friendly order string. + * @type string $orderby SQL-friendly orderby column name. + * } + */ + protected static function convert_type_to_order_orderby($type = '') + { + } + /** + * Convert the 'orderby' param into a proper SQL term/column. + * + * @since 1.8.0 + * + * @param string $orderby Orderby term as passed to get(). + * @return string $order_by_term SQL-friendly orderby term. + */ + protected static function convert_orderby_to_order_by_term($orderby) + { + } + /** + * Get a list of groups whose names start with a given letter. + * + * @since 1.6.0 + * + * @param string $letter The letter. + * @param int|null $limit Optional. The max number of results to return. + * Default: null (no limit). + * @param int|null $page Optional. The page offset of results to return. + * Default: null (no limit). + * @param bool $populate_extras Deprecated. + * @param string|array|bool $exclude Optional. Array or comma-separated list of group + * IDs to exclude from results. + * @return false|array { + * @type array $groups Array of group objects returned by the + * paginated query. + * @type int $total Total count of all groups matching non- + * paginated query params. + * } + */ + public static function get_by_letter($letter, $limit = \null, $page = \null, $populate_extras = \true, $exclude = \false) + { + } + /** + * Get a list of random groups. + * + * Use BP_Groups_Group::get() with 'type' = 'random' instead. + * + * @since 1.6.0 + * @since 10.0.0 Deprecate the `$populate_extras` arg. + * + * @param int|null $limit Optional. The max number of results to return. + * Default: null (no limit). + * @param int|null $page Optional. The page offset of results to return. + * Default: null (no limit). + * @param int $user_id Optional. If present, groups will be limited to + * those of which the specified user is a member. + * @param string|bool $search_terms Optional. Limit groups to those whose name + * or description field contain the search string. + * @param bool $populate_extras Deprecated. + * @param string|array|bool $exclude Optional. Array or comma-separated list of group + * IDs to exclude from results. + * @return array { + * @type array $groups Array of group objects returned by the + * paginated query. + * @type int $total Total count of all groups matching non- + * paginated query params. + * } + */ + public static function get_random($limit = \null, $page = \null, $user_id = 0, $search_terms = \false, $populate_extras = \true, $exclude = \false) + { + } + /** + * Fetch extra data for a list of groups. + * + * This method is used throughout the class, by methods that take a + * $populate_extras parameter. + * + * Data fetched: + * - Logged-in user's status within each group (is_member, + * is_confirmed, is_pending, is_banned) + * + * @since 1.6.0 + * + * @param array $paged_groups Array of groups. + * @param string|array $group_ids Array or comma-separated list of IDs matching + * $paged_groups. + * @param string|bool $type Not used. + * @return array $paged_groups + */ + public static function get_group_extras(&$paged_groups, &$group_ids, $type = \false) + { + } + /** + * Delete all invitations to a given group. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group whose invitations are being deleted. + * @return int|null Number of rows records deleted on success, null on + * failure. + */ + public static function delete_all_invites($group_id) + { + } + /** + * Get a total group count for the site. + * + * Will include hidden groups in the count only if + * bp_current_user_can( 'bp_moderate' ). + * + * @since 1.6.0 + * @since 10.0.0 Added the `$skip_cache` parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param bool $skip_cache Optional. Skip getting count from cache. + * Defaults to false. + * @return int + */ + public static function get_total_group_count($skip_cache = \false) + { + } + /** + * Get the member count for a group. + * + * @since 1.6.0 + * @since 10.0.0 Updated to use the `groups_get_group_members`. + * + * @param int $group_id Group ID. + * @param bool $skip_cache Optional. Skip getting count from cache. Defaults to false. + * @return int Count of confirmed members for the group. + */ + public static function get_total_member_count($group_id, $skip_cache = \false) + { + } + /** + * Get an array containing ids for each group type. + * + * A bit of a kludge workaround for some issues + * with bp_has_groups(). + * + * @since 1.7.0 + * + * @return array + */ + public static function get_group_type_ids() + { + } + /** + * Get SQL clause for group type(s). + * + * @since 2.6.0 + * + * @param string|array $group_types Group type(s). + * @param string $operator 'IN' or 'NOT IN'. + * @return string $clause SQL clause. + */ + protected static function get_sql_clause_for_group_types($group_types, $operator) + { + } + /** + * Strips the leading AND and any surrounding whitespace from a string. + * + * Used here to normalize SQL fragments generated by `WP_Meta_Query` and + * other utility classes. + * + * @since 2.7.0 + * + * @param string $s String. + * @return string + */ + protected static function strip_leading_and($s) + { + } + } + /** + * Group Members Loop template class. + * + * @since 1.0.0 + */ + class BP_Groups_Group_Members_Template + { + /** + * @since 1.0.0 + * @var int + */ + public $current_member = -1; + /** + * @since 1.0.0 + * @var int + */ + public $member_count; + /** + * @since 1.0.0 + * @var array + */ + public $members; + /** + * @since 1.0.0 + * @var object + */ + public $member; + /** + * @since 1.0.0 + * @var bool + */ + public $in_the_loop; + /** + * @since 1.0.0 + * @var int + */ + public $pag_page; + /** + * @since 1.0.0 + * @var int + */ + public $pag_num; + /** + * @since 1.0.0 + * @var array|string|null + */ + public $pag_links; + /** + * URL argument used for the pagination param. + * + * @since 1.0.0 + * @var string + */ + public $pag_arg; + /** + * The type of member being requested. Used for ordering results. + * + * @since 2.3.0 + * @var string + */ + public $type = ''; + /** + * The total number of members. + * + * @var int + */ + public $total_member_count; + /** + * @since 1.0.0 + * @var int + */ + public $total_group_count; + /** + * Constructor. + * + * @since 1.5.0 + * + * @param array $args { + * An array of optional arguments. + * @type int $group_id ID of the group whose members are being + * queried. Default: current group ID. + * @type int $page Page of results to be queried. Default: 1. + * @type int $per_page Number of items to return per page of + * results. Default: 20. + * @type int $max Optional. Max number of items to return. + * @type array $exclude Optional. Array of user IDs to exclude. + * @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from + * results. Default: 1. + * @type bool|int $exclude_banned True (or 1) to exclude banned users from results. + * Default: 1. + * @type array $group_role Optional. Array of group roles to include. + * @type string $search_terms Optional. Search terms to match. + * } + */ + public function __construct($args = array()) + { + } + /** + * Whether or not there are members to display. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_members() + { + } + /** + * Increments to the next member to display. + * + * @since 1.0.0 + * + * @return object + */ + public function next_member() + { + } + /** + * Rewinds to the first member to display. + * + * @since 1.0.0 + */ + public function rewind_members() + { + } + /** + * Finishes up the members for display. + * + * @since 1.0.0 + * + * @return bool + */ + public function members() + { + } + /** + * Sets up the member to display. + * + * @since 1.0.0 + */ + public function the_member() + { + } + } + /** + * The main theme compat class for BuddyPress Groups. + * + * This class sets up the necessary theme compatibility actions to safely output + * group template parts to the_title and the_content areas of a theme. + * + * @since 1.7.0 + */ + class BP_Groups_Theme_Compat + { + /** + * Set up theme compatibility for the Groups component. + * + * @since 1.7.0 + */ + public function __construct() + { + } + /** + * Are we looking at something that needs group theme compatibility? + * + * @since 1.7.0 + */ + public function is_group() + { + } + /** Directory *********************************************************/ + /** + * Add template hierarchy to theme compat for the group directory page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function directory_template_hierarchy($templates) + { + } + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() + { + } + /** + * Filter the_content with the groups index template part. + * + * @since 1.7.0 + */ + public function directory_content() + { + } + /** Create ************************************************************/ + /** + * Add custom template hierarchy to theme compat for the group create page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function create_template_hierarchy($templates) + { + } + /** + * Update the global $post with create screen data. + * + * @since 1.7.0 + */ + public function create_dummy_post() + { + } + /** + * Filter the_content with the create screen template part. + * + * @since 1.7.0 + */ + public function create_content() + { + } + /** Single ************************************************************/ + /** + * Add custom template hierarchy to theme compat for group pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function single_template_hierarchy($templates) + { + } + /** + * Update the global $post with single group data. + * + * @since 1.7.0 + */ + public function single_dummy_post() + { + } + /** + * Filter the_content with the single group template part. + * + * @since 1.7.0 + */ + public function single_content() + { + } + } + /** + * Group Avatar endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Attachments_Group_Avatar_Endpoint extends \WP_REST_Controller + { + use \BP_REST_Attachments; + /** + * Reuse some parts of the BP_REST_Groups_Endpoint class. + * + * @since 5.0.0 + * + * @var BP_REST_Groups_Endpoint + */ + protected $groups_endpoint; + /** + * BP_Attachment_Avatar Instance. + * + * @since 5.0.0 + * + * @var BP_Attachment_Avatar + */ + protected $avatar_instance; + /** + * Hold the group object. + * + * @since 5.0.0 + * + * @var BP_Groups_Group + */ + protected $group; + /** + * Group object type. + * + * @since 5.0.0 + * + * @var string + */ + protected $object = 'group'; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Fetch an existing group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Checks if a given request has access to get a group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Upload a group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to upload a group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Delete an existing group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Checks if a given request has access to delete a group avatar. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares avatar data to return as an object. + * + * @since 5.0.0 + * + * @param stdClass|string $avatar Avatar object or string with url or image with html. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($avatar, $request) + { + } + /** + * Get the plugin schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for the `get_item`. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_collection_params() + { + } + } + /** + * Groups widget. + * + * @since 1.0.3 + * @deprecated 12.0.0 + */ + class BP_Groups_Widget + { + /** + * Working as a group, we get things done better. + * + * @since 1.0.3 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Enqueue scripts. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function enqueue_scripts() + { + } + /** + * Extends our front-end output method. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $args Array of arguments for the widget. + * @param array $instance Widget instance data. + */ + public function widget($args, $instance) + { + } + /** + * Extends our update method. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $new_instance New instance data. + * @param array $old_instance Original instance data. + * @return array + */ + public function update($new_instance, $old_instance) + { + } + /** + * Extends our form method. + * + * @since 1.0.3 + * @deprecated 12.0.0 + * + * @param array $instance Current instance. + * @return mixed + */ + public function form($instance) + { + } + } + /** + * Group invitation template loop class. + * + * @since 1.1.0 + */ + class BP_Groups_Invite_Template + { + /** + * @since 1.1.0 + * @var int + */ + public $current_invite = -1; + /** + * @since 1.1.0 + * @var int + */ + public $invite_count; + /** + * @since 1.1.0 + * @var array + */ + public $invites; + /** + * @since 1.1.0 + * @var object + */ + public $invite; + /** + * List of invites found and their respective data. + * + * @since 1.1.0 + * @var array + */ + public $invite_data = array(); + /** + * @since 1.1.0 + * @var bool + */ + public $in_the_loop; + /** + * @since 1.1.0 + * @var int + */ + public $pag_page; + /** + * @since 1.1.0 + * @var int + */ + public $pag_num; + /** + * @since 1.1.0 + * @var string + */ + public $pag_links; + /** + * URL argument used for the pagination param. + * + * @since 1.1.0 + * @var string + */ + public $pag_arg; + /** + * @since 1.1.0 + * @var int + */ + public $total_invite_count; + /** + * BP_Groups_Invite_Template constructor. + * + * @since 1.5.0 + * + * @param array $args + */ + public function __construct($args = array()) + { + } + /** + * Whether or not there are invites to show. + * + * @since 1.1.0 + * + * @return bool + */ + public function has_invites() + { + } + /** + * Increments up to the next invite to show. + * + * @since 1.1.0 + * + * @return object + */ + public function next_invite() + { + } + /** + * Rewinds to the first invite to show. + * + * @since 1.1.0 + */ + public function rewind_invites() + { + } + /** + * Finishes up the invites to show. + * + * @since 1.1.0 + * + * @return bool + */ + public function invites() + { + } + /** + * Sets up the invite to show. + * + * @since 1.1.0 + */ + public function the_invite() + { + } + } + /** + * List table class for the Groups component admin page. + * + * @since 1.7.0 + */ + class BP_Groups_List_Table extends \WP_List_Table + { + /** + * The type of view currently being displayed. + * + * E.g. "All", "Pending", "Approved", "Spam"... + * + * @since 1.7.0 + * @var string + */ + public $view = 'all'; + /** + * Group counts for each group type. + * + * @since 1.7.0 + * @var int + */ + public $group_counts = 0; + /** + * Multidimensional array of group visibility (status) types and their groups. + * + * @link https://buddypress.trac.wordpress.org/ticket/6277 + * @var array + */ + public $group_type_ids = array(); + /** + * Constructor + * + * @since 1.7.0 + */ + public function __construct() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 1.7.0 + */ + public function prepare_items() + { + } + /** + * Get an array of all the columns on the page. + * + * @since 1.7.0 + * + * @return array Array of column headers. + */ + public function get_column_info() + { + } + /** + * Get name of default primary column + * + * @since 2.3.3 + * + * @return string + */ + protected function get_default_primary_column_name() + { + } + /** + * Display a message on screen when no items are found ("No groups found"). + * + * @since 1.7.0 + */ + public function no_items() + { + } + /** + * Output the Groups data table. + * + * @since 1.7.0 + */ + public function display() + { + } + /** + * Extra controls to be displayed between bulk actions and pagination + * + * @since 2.7.0 + * @access protected + * + * @param string $which + */ + protected function extra_tablenav($which) + { + } + /** + * Generate content for a single row of the table. + * + * @since 1.7.0 + * + * @param object|array $item The current group item in the loop. + */ + public function single_row($item = array()) + { + } + /** + * Get the list of views available on this table (e.g. "all", "public"). + * + * @since 1.7.0 + */ + public function get_views() + { + } + /** + * Get bulk actions for single group row. + * + * @since 1.7.0 + * + * @return array Key/value pairs for the bulk actions dropdown. + */ + public function get_bulk_actions() + { + } + /** + * Get the table column titles. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @return array Array of column titles. + */ + public function get_columns() + { + } + /** + * Get the column names for sortable columns. + * + * Note: It's not documented in WP, but the second item in the + * nested arrays below is $desc_first. Normally, we would set + * last_active to be desc_first (since you're generally interested in + * the *most* recently active group, not the *least*). But because + * the default sort for the Groups admin screen is DESC by last_active, + * we want the first click on the Last Active column header to switch + * the sort order - ie, to make it ASC. Thus last_active is set to + * $desc_first = false. + * + * @since 1.7.0 + * + * @return array Array of sortable column names. + */ + public function get_sortable_columns() + { + } + /** + * Override WP_List_Table::row_actions(). + * + * Basically a duplicate of the row_actions() method, but removes the + * unnecessary <button> addition. + * + * @since 2.3.3 + * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. + * + * @param array $actions The list of actions. + * @param bool $always_visible Whether the actions should be always visible. + * @return string + */ + public function row_actions($actions, $always_visible = \false) + { + } + /** + * Markup for the Checkbox column. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_cb($item = array()) + { + } + /** + * Markup for the Group ID column. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_gid($item = array()) + { + } + /** + * Name column, and "quick admin" rollover actions. + * + * Called "comment" in the CSS so we can re-use some WP core CSS. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_comment($item = array()) + { + } + /** + * Markup for the Description column. + * + * @since 1.7.0 + * + * @param array $item Information about the current row. + */ + public function column_description($item = array()) + { + } + /** + * Markup for the Status column. + * + * @since 1.7.0 + * + * @param array $item Information about the current row. + */ + public function column_status($item = array()) + { + } + /** + * Markup for the Number of Members column. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `groups_get_total_member_count`. + * + * @param array $item Information about the current row. + */ + public function column_members($item = array()) + { + } + /** + * Markup for the Last Active column. + * + * @since 1.7.0 + * + * @param array $item Information about the current row. + */ + public function column_last_active($item = array()) + { + } + /** + * Allow plugins to add their custom column. + * + * @since 2.0.0 + * + * @param array $item Information about the current row. + * @param string $column_name The column name. + * @return string + */ + public function column_default($item = array(), $column_name = '') + { + } + // Group Types + /** + * Add group type column to the WordPress admin groups list table. + * + * @since 2.7.0 + * + * @param array $columns Groups table columns. + * + * @return array $columns + */ + public function add_type_column($columns = array()) + { + } + /** + * Markup for the Group Type column. + * + * @since 2.7.0 + * + * @param string $retval Empty string. + * @param string $column_name Name of the column being rendered. + * @param array $item The current group item in the loop. + * @return string + */ + public function column_content_group_type($retval = '', $column_name = '', $item = array()) + { + } + /** + * Filters the group type list permalink in the Group Type column. + * + * Changes the group type permalink to use the admin URL. + * + * @since 2.7.0 + * + * @param string $retval Current group type permalink. + * @param object $type Group type object. + * @return string + */ + public function group_type_permalink_use_admin_filter($retval, $type) + { + } + /** + * Markup for the Group Type bulk change select. + * + * @since 2.7.0 + * + * @param string $which The location of the extra table nav markup: 'top' or 'bottom'. + */ + public function add_group_type_bulk_change_select($which) + { + } + } + /** + * Messages endpoints. + * + * /messages/ + * /messages/{thread_id} + * /messages/starred/{message_id} + * + * @since 5.0.0 + */ + class BP_REST_Messages_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve threads. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to thread items. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Get a single thread. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to a thread item. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Init a Messages Thread or add a reply to an existing Thread. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Check if a given request has access to create a message. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update metadata for one of the messages of the thread. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a message. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Adds or removes the message from the current user's starred box. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_starred($request) + { + } + /** + * Check if a given request has access to update user starred messages. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_starred_permissions_check($request) + { + } + /** + * Delete a thread. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a thread. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepare a message for create. + * + * @since 6.0.0 + * + * @param WP_REST_Request $request The request sent to the API. + * @return stdClass + */ + protected function prepare_item_for_database($request) + { + } + /** + * Prepares message data for the REST response. + * + * @since 5.0.0 + * + * @param BP_Messages_Message $message The Message object. + * @param WP_REST_Request $request Full details about the request. + * @return array The Message data for the REST response. + */ + public function prepare_message_for_response($message, $request) + { + } + /** + * Prepares recipient data for the REST response. + * + * @since 5.0.0 + * + * @param object $recipient The recipient object. + * @param WP_REST_Request $request Full details about the request. + * @return array The recipient data for the REST response. + */ + public function prepare_recipient_for_response($recipient, $request) + { + } + /** + * Prepares thread data for return as an object. + * + * @since 5.0.0 + * + * @param BP_Messages_Thread $thread The thread object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($thread, $request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Messages_Thread $thread Thread object. + * @return array + */ + protected function prepare_links($thread) + { + } + /** + * Get the thread object. + * + * @since 5.0.0 + * + * @param int $thread_id Thread ID. + * @param int $user_id User ID. + * @return BP_Messages_Thread|string + */ + public function get_thread_object($thread_id, $user_id = 0) + { + } + /** + * Get the message object. + * + * @since 5.0.0 + * + * @param int $message_id Message ID. + * @return BP_Messages_Message|string + */ + public function get_message_object($message_id) + { + } + /** + * Select the item schema arguments needed for the CREATABLE, EDITABLE and DELETABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the message schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for Messages collections. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * A widget that displays sitewide notices. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + class BP_Messages_Sitewide_Notices_Widget extends \WP_Widget + { + /** + * Constructor method. + * + * @since 1.9.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Render the widget. + * + * @deprecated 12.0.0 + * + * @see WP_Widget::widget() for a description of parameters. + * + * @param array $args See {@WP_Widget::widget()}. + * @param array $instance See {@WP_Widget::widget()}. + */ + public function widget($args, $instance) + { + } + /** + * Process the saved settings for the widget. + * + * @deprecated 12.0.0 + * + * @see WP_Widget::update() for a description of parameters and + * return values. + * + * @param array $new_instance See {@WP_Widget::update()}. + * @param array $old_instance See {@WP_Widget::update()}. + * @return array $instance See {@WP_Widget::update()}. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Render the settings form for Appearance > Widgets. + * + * @deprecated 12.0.0 + * + * @see WP_Widget::form() for a description of parameters. + * + * @param array $instance See {@WP_Widget::form()}. + */ + public function form($instance) + { + } + } + /** + * BuddyPress Notices Admin class. + */ + #[\AllowDynamicProperties] + class BP_Messages_Notices_Admin + { + /** + * The ID returned by `add_users_page()`. + * + * @since 3.0.0 + * @var string + */ + public $screen_id = ''; + /** + * The URL of the admin screen. + * + * @since 3.0.0 + * @var string + */ + public $url = ''; + /** + * The current instance of the BP_Messages_Notices_List_Table class. + * + * @since 3.0.0 + * @var BP_Messages_Notices_List_Table|string + */ + public $list_table = ''; + /** + * Create a new instance or access the current instance of this class. + * + * @since 3.0.0 + * + * @return BP_Messages_Notices_Admin + */ + public static function register_notices_admin() + { + } + /** + * Constructor. + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Populate the classs variables. + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Add action hooks. + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Add the 'Site Notices' admin menu item. + * + * @since 3.0.0 + */ + public function admin_menu() + { + } + /** + * Catch save/update requests or load the screen. + * + * @since 3.0.0 + */ + public function admin_load() + { + } + /** + * Generate content for the bp-notices admin screen. + * + * @since 3.0.0 + */ + public function admin_index() + { + } + } + /** + * BuddyPress Notices class. + * + * Use this class to create, activate, deactivate or delete notices. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_Messages_Notice + { + /** + * The notice ID. + * + * @var int|null + */ + public $id = \null; + /** + * The subject line for the notice. + * + * @var string + */ + public $subject; + /** + * The content of the notice. + * + * @var string + */ + public $message; + /** + * The date the notice was created. + * + * @var string + */ + public $date_sent; + /** + * Whether the notice is active or not. + * + * @var int + */ + public $is_active; + /** + * Constructor. + * + * @since 1.0.0 + * + * @param int|null $id Optional. The ID of the current notice. + */ + public function __construct($id = \null) + { + } + /** + * Populate method. + * + * Runs during constructor. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** + * Saves a notice. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Activates a notice. + * + * @since 1.0.0 + * + * @return bool + */ + public function activate() + { + } + /** + * Deactivates a notice. + * + * @since 1.0.0 + * + * @return bool + */ + public function deactivate() + { + } + /** + * Deletes a notice. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function delete() + { + } + /** Static Methods ********************************************************/ + /** + * Pulls up a list of notices. + * + * To get all notices, pass a value of -1 to pag_num. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of parameters. + * @type int $pag_num Number of notices per page. Defaults to 20. + * @type int $pag_page The page number. Defaults to 1. + * } + * @return array List of notices to display. + */ + public static function get_notices($args = array()) + { + } + /** + * Returns the total number of recorded notices. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return int + */ + public static function get_total_notice_count() + { + } + /** + * Returns the active notice that should be displayed on the front end. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return BP_Messages_Notice + */ + public static function get_active() + { + } + } + /** + * BuddyPress Message Thread class. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_Messages_Thread + { + /** + * The message thread ID. + * + * @since 1.0.0 + * @var int + */ + public $thread_id; + /** + * The current messages in the message thread. + * + * @since 1.0.0 + * @var array + */ + public $messages; + /** + * The current messages count in the message thread. + * + * @since 12.0.0 + * @var int + */ + public $messages_total_count; + /** + * The current recipients in the message thread. + * + * @since 1.0.0 + * @var array + */ + public $recipients; + /** + * The user IDs of all messages in the message thread. + * + * @since 1.2.0 + * @var array + */ + public $sender_ids; + /** + * The unread count for the logged-in user. + * + * @since 1.2.0 + * @var int + */ + public $unread_count; + /** + * The content of the last message in this thread. + * + * @since 1.2.0 + * @var string + */ + public $last_message_content; + /** + * The date of the last message in this thread. + * + * @since 1.2.0 + * @var string + */ + public $last_message_date; + /** + * The ID of the last message in this thread. + * + * @since 1.2.0 + * @var int + */ + public $last_message_id; + /** + * The subject of the last message in this thread. + * + * @since 1.2.0 + * @var string + */ + public $last_message_subject; + /** + * The user ID of the author of the last message in this thread. + * + * @since 1.2.0 + * @var int + */ + public $last_sender_id; + /** + * Sort order of the messages in this thread (ASC or DESC). + * + * @since 1.5.0 + * @var string + */ + public $messages_order; + /** + * Constructor. + * + * @since 1.0.0 + * @since 10.0.0 Updated the `$args` with new paremeters. + * + * @param int $thread_id The message thread ID. + * @param string $order The order to sort the messages. Either 'ASC' or 'DESC'. + * Defaults to 'ASC'. + * @param array $args { + * Array of arguments. + * @type int $user_id ID of the user to get the unread count. + * @type bool $update_meta_cache Whether to pre-fetch metadata for + * queried message items. Default: true. + * @type int|null $page Page of messages being requested. Default to null, meaning all. + * @type int|null $per_page Messages to return per page. Default to null, meaning all. + * @type string $order Optional. The order to sort the messages. Either 'ASC' or 'DESC'. + * Defaults to 'ASC'. + * @type int|null $recipients_page Page of recipients being requested. Default to null, meaning all. + * @type int|null $recipients_per_page Recipients to return per page. Defaults to null, meaning all. + * } + */ + public function __construct($thread_id = 0, $order = 'ASC', $args = array()) + { + } + /** + * Populate method. + * + * Used in the constructor. + * + * @since 1.0.0 + * @since 10.0.0 Updated the `$args` with new paremeters. + * + * @param int $thread_id The message thread ID. + * @param string $order The order to sort the messages. Either 'ASC' or 'DESC'. + * Defaults to 'ASC'. + * @param array $args { + * Array of arguments. + * @type int $user_id ID of the user to get the unread count. + * @type bool $update_meta_cache Whether to pre-fetch metadata for + * queried message items. Default: true. + * @type int|null $page Page of messages being requested. Default to null, meaning all. + * @type int|null $per_page Messages to return per page. Default to null, meaning all. + * @type string $order The order to sort the messages. Either 'ASC' or 'DESC'. + * Defaults to 'ASC'. + * @type int|null $recipients_page Page of recipients being requested. Default to null, meaning all. + * @type int|null $recipients_per_page Recipients to return per page. Defaults to null, meaning all. + * } + * @return bool False if there are no messages. + */ + public function populate($thread_id = 0, $order = 'ASC', $args = array()) + { + } + /** + * Mark a thread initialized in this class as read. + * + * @since 1.0.0 + * + * @see BP_Messages_Thread::mark_as_read() + */ + public function mark_read() + { + } + /** + * Mark a thread initialized in this class as unread. + * + * @since 1.0.0 + * + * @see BP_Messages_Thread::mark_as_unread() + */ + public function mark_unread() + { + } + /** + * Returns recipients for a message thread. + * + * @since 1.0.0 + * @since 2.3.0 Added `$thread_id` as a parameter. + * @since 10.0.0 Added `$args` as a parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id Message thread ID. + * @param array $args { + * Array of arguments. + * @type int|null $recipients_page Page of recipients being requested. Default to all. + * @type int|null $recipients_per_page Recipients to return per page. Defaults to all. + * } + * @return array + */ + public function get_recipients($thread_id = 0, $args = array()) + { + } + /** Static Functions ******************************************************/ + /** + * Get messages associated with a thread. + * + * @since 2.3.0 + * @since 10.0.0 Added `$args` as a parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @param array $args { + * Array of arguments. + * @type int|null $page Page of messages being requested. Default to all. + * @type int|null $per_page Messages to return per page. Default to all. + * @type string $order The order to sort the messages. Either 'ASC' or 'DESC'. + * Defaults to 'ASC'. + * } + * @return array + */ + public static function get_messages($thread_id = 0, $args = array()) + { + } + /** + * Get latest thread message. + * + * @since 12.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param integer $thread_id The message thread ID. + * @return object|null + */ + public static function get_latest_thread_message($thread_id) + { + } + /** + * Static method to get message recipients by thread ID. + * + * @since 2.3.0 + * + * @param int $thread_id The thread ID. + * @return array + */ + public static function get_recipients_for_thread($thread_id = 0) + { + } + /** + * Mark messages in a thread as deleted or delete all messages in a thread. + * + * Note: All messages in a thread are deleted once every recipient in a thread + * has marked the thread as deleted. + * + * @since 1.0.0 + * @since 2.7.0 The $user_id parameter was added. Previously the current user + * was always assumed. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @param int $user_id The ID of the user in the thread to mark messages as + * deleted for. Defaults to the current logged-in user. + * + * @return bool + */ + public static function delete($thread_id = 0, $user_id = 0) + { + } + /** + * Exit a user from a thread. + * + * @since 10.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @param int $user_id The ID of the user in the thread. + * Defaults to the current logged-in user. + * + * @return bool + */ + public static function exit_thread($thread_id = 0, $user_id = 0) + { + } + /** + * Get current message threads for a user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of arguments. + * @type int $user_id The user ID. + * @type string $box The type of mailbox to get. Either 'inbox' or 'sentbox'. + * Defaults to 'inbox'. + * @type string $type The type of messages to get. Either 'all' or 'unread' + * or 'read'. Defaults to 'all'. + * @type int $limit The number of messages to get. Defaults to null. + * @type int $page The page number to get. Defaults to null. + * @type string $search_terms The search term to use. Defaults to ''. + * @type array $meta_query Meta query arguments. See WP_Meta_Query for more details. + * @type int|null $recipients_page Page of recipients being requested. Default to null, meaning all. + * @type int|null $recipients_per_page Recipients to return per page. Defaults to null, meaning all. + * @type int|null $messages_page Page of messages being requested. Default to null, meaning all. + * @type int|null $messages_per_page Messages to return per page. Defaults to null, meaning all. + * } + * @return array|bool Array on success. False on failure. + */ + public static function get_current_threads_for_user($args = array()) + { + } + /** + * Get the SQL for the 'meta_query' param in BP_Messages_Thread::get_current_threads_for_user(). + * + * We use WP_Meta_Query to do the heavy lifting of parsing the meta_query array + * and creating the necessary SQL clauses. + * + * @since 2.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $meta_query An array of meta_query filters. See the + * documentation for WP_Meta_Query for details. + * @return array $sql_array 'join' and 'where' clauses. + */ + public static function get_meta_query_sql($meta_query = array()) + { + } + /** + * Mark a thread as read. + * + * @since 1.0.0 + * @since 9.0.0 Added the `user_id` parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @param int $user_id The user the thread will be marked as read. + * + * @return bool|int Number of threads marked as read or false on error. + */ + public static function mark_as_read($thread_id = 0, $user_id = 0) + { + } + /** + * Mark a thread as unread. + * + * @since 1.0.0 + * @since 9.0.0 Added the `user_id` parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @param int $user_id The user the thread will be marked as unread. + * + * @return bool|int Number of threads marked as unread or false on error. + */ + public static function mark_as_unread($thread_id = 0, $user_id = 0) + { + } + /** + * Returns the total number of message threads for a user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param int $user_id The user ID. + * @param string $box The type of mailbox to get. Either 'inbox' or 'sentbox'. + * Defaults to 'inbox'. + * @param string $type The type of messages to get. Either 'all' or 'unread'. + * or 'read'. Defaults to 'all'. + * @return int Total thread count for the provided user. + */ + public static function get_total_threads_for_user($user_id, $box = 'inbox', $type = 'all') + { + } + /** + * Returns the total number of messages in a thread. + * + * @since 12.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param integer $thread_id The message thread ID. + * @return integer Total thread message count + */ + public static function get_total_thread_message_count($thread_id) + { + } + /** + * Determine if the logged-in user is a sender of any message in a thread. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @return bool + */ + public static function user_is_sender($thread_id) + { + } + /** + * Returns the userlink of the last sender in a message thread. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id The message thread ID. + * @return string|bool The user link on success. Boolean false on failure. + */ + public static function get_last_sender($thread_id) + { + } + /** + * Gets the unread message count for a user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The user ID. + * @return int Total inbox unread count for user. + */ + public static function get_inbox_count($user_id = 0) + { + } + /** + * Checks whether a user is a part of a message thread discussion. + * + * @since 1.0.0 + * + * @param int $thread_id The message thread ID. + * @param int $user_id The user ID. Default: ID of the logged-in user. + * @return int|null The recorded recipient ID on success, null on failure. + */ + public static function check_access($thread_id, $user_id = 0) + { + } + /** + * Checks whether a message thread exists. + * + * @since 1.0.0 + * + * @param int $thread_id The message thread ID. + * @return bool|int|null The message thread ID on success, null on failure. + */ + public static function is_valid($thread_id = 0) + { + } + /** + * Returns a string containing all the message recipient userlinks. + * + * String is comma-delimited. + * + * If a message thread has more than four users, the returned string is simply + * "X Recipients" where "X" is the number of recipients in the message thread. + * + * @since 1.0.0 + * + * @param array $recipients Array containing the message recipients (array of objects). + * @return string String of message recipent userlinks. + */ + public static function get_recipient_links($recipients) + { + } + /** + * Upgrade method for the older BP message thread DB table. + * + * @todo We should remove this. No one is going to upgrade from v1.1, right? + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public static function update_tables() + { + } + } + /** + * Message Thread Template Class + */ + class BP_Messages_Thread_Template + { + /** + * The loop iterator. + * + * @var int + */ + public $current_message = -1; + /** + * Number of messages returned by the paged query. + * + * @var int + */ + public $message_count = 0; + /** + * The message object currently being iterated on. + * + * @var object + */ + public $message; + /** + * Thread that the current messages belong to. + * + * @var BP_Messages_Thread + */ + public $thread; + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop = \false; + /** + * The page number being requested. + * + * @var int + */ + public $pag_page = 1; + /** + * The number of items being requested per page. + * + * @var int + */ + public $pag_num = 10; + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links = ''; + /** + * The total number of messages matching the query. + * + * @var int + */ + public $total_message_count = 0; + /** + * Constructor method. + * + * @see BP_Messages_Thread::populate() for full parameter info. + * + * @param int $thread_id ID of the message thread to display. + * @param string $order Optional. Order to show the thread's messages in. + * Default: 'ASC'. + * @param array $args Array of arguments for the query. + */ + public function __construct($thread_id = 0, $order = 'ASC', $args = array()) + { + } + /** + * Whether there are messages available in the loop. + * + * @see bp_thread_has_messages() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_messages() + { + } + /** + * Set up the next message and iterate index. + * + * @return object The next message to iterate over. + */ + public function next_message() + { + } + /** + * Rewind the messages and reset message index. + */ + public function rewind_messages() + { + } + /** + * Whether there are messages left in the loop to iterate over. + * + * This method is used by {@link bp_thread_messages()} as part of the + * while loop that controls iteration inside the messages loop, eg: + * while ( bp_thread_messages() ) { ... + * + * @see bp_thread_messages() + * + * @return bool True if there are more messages to show, otherwise false. + */ + public function messages() + { + } + /** + * Set up the current message inside the loop. + * + * Used by {@link bp_thread_the_message()} to set up the current + * message data while looping, so that template tags used during + * that iteration make reference to the current message. + * + * @see bp_thread_the_message() + */ + public function the_message() + { + } + } + /** + * BuddyPress Notices List Table class. + */ + class BP_Messages_Notices_List_Table extends \WP_List_Table + { + /** + * Constructor + * + * @since 3.0.0 + * + * @param array $args Arguments passed to the WP_List_Table::constructor. + */ + public function __construct($args = array()) + { + } + /** + * Checks the current user's permissions + * + * @since 3.0.0 + */ + public function ajax_user_can() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 3.0.0 + */ + public function prepare_items() + { + } + /** + * Get a list of columns. The format is: + * 'internal-name' => 'Title' + * + * @since 3.0.0 + * + * @return array + */ + public function get_columns() + { + } + /** + * Generates content for a single row of the table + * + * @since 3.0.0 + * + * @param object $item The current item + */ + public function single_row($item) + { + } + /** + * Generates content for the "subject" column. + * + * @since 3.0.0 + * + * @param object $item The current item + */ + public function column_subject($item) + { + } + /** + * Generates content for the "message" column. + * + * @since 3.0.0 + * + * @param object $item The current item + */ + public function column_message($item) + { + } + /** + * Generates content for the "date_sent" column. + * + * @since 3.0.0 + * + * @param object $item The current item + */ + public function column_date_sent($item) + { + } + } + /** + * Implementation of BP_Component for the Messages component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Messages_Component extends \BP_Component + { + /** + * If this is true, the Message autocomplete will return friends only, unless + * this is set to false, in which any matching users will be returned. + * + * @since 1.5.0 + * @var bool + */ + public $autocomplete_all; + /** + * Start the messages component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include files. + * + * @since 1.5.0 + * + * @param array $includes See {BP_Component::includes()} for details. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up globals for the Messages component. + * + * The BP_MESSAGES_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @param array $args Not used. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @param array $main_nav See `BP_Component::register_nav()` for details. + * @param array $sub_nav See `BP_Component::register_nav()` for details. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.5.0 + * @since 12.0.0 Used to customize the main navigation name. + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the Toolbar. + * + * @param array $wp_admin_nav See {BP_Component::setup_admin_bar()} for details. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and <title>. + */ + public function setup_title() + { + } + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Messages Blocks. + * + * @since 9.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * Single message class. + */ + #[\AllowDynamicProperties] + class BP_Messages_Message + { + /** + * ID of the message. + * + * @var int + */ + public $id; + /** + * ID of the message thread. + * + * @var int + */ + public $thread_id; + /** + * ID of the sender. + * + * @var int + */ + public $sender_id; + /** + * Subject line of the message. + * + * @var string + */ + public $subject; + /** + * Content of the message. + * + * @var string + */ + public $message; + /** + * Date the message was sent. + * + * @var string + */ + public $date_sent; + /** + * Message recipients. + * + * @var array + */ + public $recipients = array(); + /** + * Constructor. + * + * @param int|null $id Optional. ID of the message. + */ + public function __construct($id = \null) + { + } + /** + * Set up data related to a specific message object. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $id ID of the message. + */ + public function populate($id) + { + } + /** + * Send a message. + * + * @global wpdb $wpdb WordPress database object. + * + * @return int|bool ID of the newly created message on success, false on failure. + */ + public function send() + { + } + /** + * Get a list of recipients for a message. + * + * @global wpdb $wpdb WordPress database object. + * + * @return object $value List of recipients for a message. + */ + public function get_recipients() + { + } + /** Static Functions **************************************************/ + /** + * Get list of recipient IDs from their usernames. + * + * @param array $recipient_usernames Usernames of recipients. + * + * @return bool|array $recipient_ids Array of Recepient IDs. + */ + public static function get_recipient_ids($recipient_usernames) + { + } + /** + * Get the ID of the message last sent by the logged-in user for a given thread. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $thread_id ID of the thread. + * + * @return int|null ID of the message if found, otherwise null. + */ + public static function get_last_sent_for_user($thread_id) + { + } + /** + * Check whether a user is the sender of a message. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user. + * @param int $message_id ID of the message. + * + * @return int|null Returns the ID of the message if the user is the + * sender, otherwise null. + */ + public static function is_user_sender($user_id, $message_id) + { + } + /** + * Get the ID of the sender of a message. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $message_id ID of the message. + * + * @return int|null The ID of the sender if found, otherwise null. + */ + public static function get_message_sender($message_id) + { + } + } + /** + * Sitewide Notices endpoints. + * + * @since 9.0.0 + */ + class BP_REST_Sitewide_Notices_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 9.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 9.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve sitewide notices. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request is allowed to get notices. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_Error|bool + */ + public function get_items_permissions_check($request) + { + } + /** + * Get a single notice by ID. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response + */ + public function get_item($request) + { + } + /** + * Check if a given request is allowed to get a sitewide notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_Error|bool + */ + public function get_item_permissions_check($request) + { + } + /** + * Create a sitewide notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Check if a given request has access to create a notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|bool + */ + public function create_item_permissions_check($request) + { + } + /** + * Update a notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|bool + */ + public function update_item_permissions_check($request) + { + } + /** + * Dismisses the currently active notice for the current user. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function dismiss_notice($request) + { + } + /** + * Check if a given request has access to dismiss the current notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|bool + */ + public function dismiss_notice_permissions_check($request) + { + } + /** + * Delete a sitewide notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to generally manage a notice. + * Granular filters are provided in the edit_, create_, and delete_ + * permissions checks. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|bool + */ + public function manage_item_permissions_check($request) + { + } + /** + * Check if a given request has access to delete a notice. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_Error|bool + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepare links for the request. + * + * @since 9.0.0 + * + * @param BP_Messages_Notice $notice Notice object. + * @return array + */ + protected function prepare_links($notice) + { + } + /** + * Prepares sitewide notice data for return as an object. + * + * @since 9.0.0 + * + * @param BP_Messages_Notice $notice The notice object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($notice, $request) + { + } + /** + * Get sitewide notice object. + * + * @since 9.0.0 + * + * @param int $id Notice ID. + * @return BP_Messages_Notice + */ + public function get_notice_object($id) + { + } + /** + * Select the item schema arguments needed for the CREATABLE, EDITABLE and DELETABLE methods. + * + * @since 9.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the message schema, conforming to JSON Schema. + * + * @since 9.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for sitewide notices collections. + * + * @since 9.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + /** + * Prepare a notice for creation or update. + * + * @since 9.0.0 + * + * @param WP_REST_Request $request Request object. + * @return BP_Messages_Notice|WP_Error Object or WP_Error. + */ + protected function prepare_item_for_database($request) + { + } + } + /** + * Message Box Template Class + */ + #[\AllowDynamicProperties] + class BP_Messages_Box_Template + { + /** + * The loop iterator. + * + * @var int + */ + public $current_thread = -1; + /** + * The number of threads returned by the paged query. + * + * @var int + */ + public $current_thread_count = 0; + /** + * Total number of threads matching the query params. + * + * @var int + */ + public $total_thread_count = 0; + /** + * Total number of threads available to iterate on. + * + * @var int + */ + public $thread_count = 0; + /** + * Array of threads located by the query. + * + * @var array + */ + public $threads = array(); + /** + * The thread object currently being iterated on. + * + * @var BP_Messages_Thread|bool + */ + public $thread = \false; + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop = \false; + /** + * User ID of the current inbox. + * + * @var int + */ + public $user_id = 0; + /** + * The current "box" view ('notices', 'sentbox', 'inbox'). + * + * @var string + */ + public $box = 'inbox'; + /** + * The page number being requested. + * + * @var int + */ + public $pag_page = 1; + /** + * The number of items (threads) being requested per page. + * + * @var int + */ + public $pag_num = 10; + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links = ''; + /** + * URL argument used for the pagination param. + * + * @var string + */ + public $pag_arg = ''; + /** + * Search terms for limiting the thread query. + * + * @var string + */ + public $search_terms = ''; + /** + * Type of messages to return. Values: 'all', 'read', 'unread'. + * + * @var string + */ + public $type = ''; + /** + * Constructor method. + * + * @param array $args { + * Array of arguments. See bp_has_message_threads() for full description. + * }. + */ + public function __construct($args = array()) + { + } + /** + * Whether there are threads available in the loop. + * + * @see bp_has_message_threads() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_threads() + { + } + /** + * Set up the next member and iterate index. + * + * @return BP_Messages_Thread The next member to iterate over. + */ + public function next_thread() + { + } + /** + * Rewind the threads and reset thread index. + */ + public function rewind_threads() + { + } + /** + * Whether there are threads left in the loop to iterate over. + * + * This method is used by {@link bp_message_threads()} as part of the + * while loop that controls iteration inside the threads loop, eg: + * while ( bp_message_threads() ) { ... + * + * @see bp_message_threads() + * + * @return bool True if there are more threads to show, otherwise false. + */ + public function message_threads() + { + } + /** + * Set up the current thread inside the loop. + * + * Used by {@link bp_message_thread()} to set up the current thread data + * while looping, so that template tags used during that iteration make + * reference to the current thread. + * + * @see bp_message_thread() + */ + public function the_message_thread() + { + } + } + /** + * Theme Compatibility base class. + * + * This is only intended to be extended, and is included here as a basic guide + * for future Theme Packs to use. {@link BP_Legacy} is a good example of + * extending this class. + * + * @since 1.7.0 + * + * @todo We should probably do something similar to BP_Component::start(). + * @todo If this is only intended to be extended, it should be abstract. + * + * @param array $properties { + * An array of properties describing the theme compat package. + * @type string $id ID of the package. Must be unique. + * @type string $name Name of the theme. This should match the name given + * in style.css. + * @type string $version Theme version. Used for busting script and style + * browser caches. + * @type string $dir Filesystem path of the theme. + * @type string $url Base URL of the theme. + * } + */ + class BP_Theme_Compat + { + /** + * Template package properties, as passed to the constructor. + * + * @since 1.7.0 + * + * @var array + */ + protected $_data = array(); + /** + * Pass the $properties to the object on creation. + * + * @since 1.7.0 + * + * @param array $properties Array of properties for BP_Theme_Compat. + */ + public function __construct(array $properties = array()) + { + } + /** + * Set up the BuddyPress-specific theme compat methods. + * + * Themes should use this method in their constructor. + * + * @since 1.7.0 + */ + protected function start() + { + } + /** + * Set up global data for your template package. + * + * Meant to be overridden in your class. See + * {@link BP_Legacy::setup_globals()} for an example. + * + * @since 1.7.0 + */ + protected function setup_globals() + { + } + /** + * Set up theme hooks for your template package. + * + * Meant to be overridden in your class. See + * {@link BP_Legacy::setup_actions()} for an example. + * + * @since 1.7.0 + */ + protected function setup_actions() + { + } + /** + * Set a theme's property. + * + * @since 1.7.0 + * + * @param string $property Property name. + * @param mixed $value Property value. + * @return bool + */ + public function __set($property, $value) + { + } + /** + * Get a theme's property. + * + * @since 1.7.0 + * + * @param string $property Property name. + * @return mixed The value of the property if it exists, otherwise an + * empty string. + */ + public function __get($property) + { + } + /** + * Check a theme's property exists. + * + * @since 9.0.0 + * + * @param string $property Property name. + * @return bool True if the property exists. False otherwise. + */ + public function __isset($property) + { + } + } + /** + * Loads BuddyPress Legacy Theme functionality. + * + * This is not a real theme by WordPress standards, and is instead used as the + * fallback for any WordPress theme that does not have BuddyPress templates in it. + * + * To make your custom theme BuddyPress compatible and customize the templates, you + * can copy these files into your theme without needing to merge anything + * together; BuddyPress should safely handle the rest. + * + * See @link BP_Theme_Compat() for more. + * + * @since 1.7.0 + * + * @package BuddyPress + * @subpackage BP_Theme_Compat + */ + class BP_Legacy extends \BP_Theme_Compat + { + /** Functions *************************************************************/ + /** + * The main BuddyPress (Legacy) Loader. + * + * @since 1.7.0 + * + */ + public function __construct() + { + } + /** + * Component global variables. + * + * You'll want to customize the values in here, so they match whatever your + * needs are. + * + * @since 1.7.0 + */ + protected function setup_globals() + { + } + /** + * Setup the theme hooks. + * + * @since 1.7.0 + * + */ + protected function setup_actions() + { + } + /** + * Load the theme CSS + * + * @since 1.7.0 + * @since 2.3.0 Support custom CSS file named after the current theme or parent theme. + * + */ + public function enqueue_styles() + { + } + /** + * Enqueue the required JavaScript files + * + * @since 1.7.0 + */ + public function enqueue_scripts() + { + } + /** + * Get the URL and handle of a web-accessible CSS or JS asset + * + * We provide two levels of customizability with respect to where CSS + * and JS files can be stored: (1) the child theme/parent theme/theme + * compat hierarchy, and (2) the "template stack" of /buddypress/css/, + * /community/css/, and /css/. In this way, CSS and JS assets can be + * overloaded, and default versions provided, in exactly the same way + * as corresponding PHP templates. + * + * We are duplicating some of the logic that is currently found in + * bp_locate_template() and the _template_stack() functions. Those + * functions were built with PHP templates in mind, and will require + * refactoring in order to provide "stack" functionality for assets + * that must be accessible both using file_exists() (the file path) + * and at a public URI. + * + * This method is marked private, with the understanding that the + * implementation is subject to change or removal in an upcoming + * release, in favor of a unified _template_stack() system. Plugin + * and theme authors should not attempt to use what follows. + * + * @since 1.8.0 + * @param string $file A filename like buddypress.css. + * @param string $type Optional. Either "js" or "css" (the default). + * @param string $script_handle Optional. If set, used as the script name in `wp_enqueue_script`. + * @return array An array of data for the wp_enqueue_* function: + * 'handle' (eg 'bp-child-css') and a 'location' (the URI of the + * asset) + */ + private function locate_asset_in_stack($file, $type = 'css', $script_handle = '') + { + } + /** + * Adds the no-js class to the body tag. + * + * This function ensures that the <body> element will have the 'no-js' class by default. If you're + * using JavaScript for some visual functionality in your theme, and you want to provide noscript + * support, apply those styles to body.no-js. + * + * The no-js class is removed by the JavaScript created in buddypress.js. + * + * @since 1.7.0 + * + * @param array $classes Array of classes to append to body tag. + * @return array $classes + */ + public function add_nojs_body_class($classes) + { + } + /** + * Load localizations for topic script. + * + * These localizations require information that may not be loaded even by init. + * + * @since 1.7.0 + */ + public function localize_scripts() + { + } + /** + * Outputs sitewide notices markup in the footer. + * + * @since 1.7.0 + * + * @see https://buddypress.trac.wordpress.org/ticket/4802 + */ + public function sitewide_notices() + { + } + /** + * Add secondary avatar image to this activity stream's record, if supported. + * + * @since 1.7.0 + * + * @param string $action The text of this activity. + * @param BP_Activity_Activity $activity Activity object. + * @return string + */ + function secondary_avatars($action, $activity) + { + } + /** + * Filter the default theme compatibility root template hierarchy, and prepend + * a page template to the front if it's set. + * + * @see https://buddypress.trac.wordpress.org/ticket/6065 + * + * @since 2.2.0 + * + * @param array $templates Array of templates. + * to use the defined page template for component's directory and its single items + * @return array + */ + public function theme_compat_page_templates($templates = array()) + { + } + } + /** + * Blogs Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Blogs + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + } + /** + * Messages Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Messages + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + } + /** + * Builds a group of BP_Button + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Buttons_Group + { + /** + * The parameters of the Group of buttons + * + * @var array + */ + protected $group = array(); + /** + * Constructor + * + * @since 3.0.0 + * + * @param array $args Optional array having the following parameters { + * @type string $id A string to use as the unique ID for the button. Required. + * @type int $position Where to insert the Button. Defaults to 99. + * @type string $component The Component's the button is build for (eg: Activity, Groups..). Required. + * @type bool $must_be_logged_in Whether the button should only be displayed to logged in users. Defaults to True. + * @type bool $block_self Optional. True if the button should be hidden when a user is viewing his own profile. + * Defaults to False. + * @type string $parent_element Whether to use a wrapper. Defaults to false. + * @type string $parent_attr set an array of attributes for the parent element. + * @type string $button_element Set this to 'button', 'img', or 'a', defaults to anchor. + * @type string $button_attr Any attributes required for the button_element + * @type string $link_text The text of the link. Required. + * } + */ + public function __construct($args = array()) + { + } + /** + * Sort the Buttons of the group according to their position attribute + * + * @since 3.0.0 + * + * @param array the list of buttons to sort. + * + * @return array the list of buttons sorted. + */ + public function sort($buttons) + { + } + /** + * Get the BuddyPress buttons for the group + * + * @since 3.0.0 + * + * @param bool $sort whether to sort the buttons or not. + * + * @return array An array of HTML links. + */ + public function get($sort = \true) + { + } + /** + * Update the group of buttons + * + * @since 3.0.0 + * + * @param array $args Optional. See the __constructor for a description of this argument. + */ + public function update($args = array()) + { + } + /** + * Adds a button. + * + * @since 9.0.0 + * + * @param array $args Required. See the __constructor for a description of this argument. + * @return bool + */ + private function add($args) + { + } + } + /** + * Activity Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Activity + { + /** + * Nouveau Activity directory. + * + * @since 3.0.0 + * @var string + */ + public $dir = ''; + /** + * RSS feed link data. + * + * @since 3.0.0 + * @var string + */ + public $current_rss_feed = array(); + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + } + /** + * Groups Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Groups + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + * @since 6.0.0 Removes the BP Core number formatting filter on total groups count. + */ + protected function setup_filters() + { + } + /** + * Add filters to be sure the (BuddyPress) widgets display will be consistent + * with the current group's default front page. + * + * @since 3.0.0 + * + * @param string $sidebar_index The Sidebar identifier. + */ + public function group_home_sidebar_set($sidebar_index = '') + { + } + /** + * Remove filters to be sure the (BuddyPress) widgets display will no more take + * the current group displayed in account. + * + * @since 3.0.0 + * + * @param string $sidebar_index The Sidebar identifier. + */ + public function group_home_sidebar_unset($sidebar_index = '') + { + } + } + /** + * Query to get members that are not already members of the group + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Group_Invite_Query extends \BP_User_Query + { + /** + * Array of group member ids, cached to prevent redundant lookups + * + * @var null|array Null if not yet defined, otherwise an array of ints + * @since 3.0.0 + */ + protected $group_member_ids; + /** + * Set up action hooks + * + * @since 3.0.0 + */ + public function setup_hooks() + { + } + /** + * Exclude group members from the user query as it's not needed to invite members to join the group. + * + * @since 3.0.0 + */ + public function build_exclude_args() + { + } + /** + * Get the members of the queried group + * + * @since 3.0.0 + * + * @return array $ids User IDs of relevant group member ids + */ + protected function get_group_member_ids() + { + } + /** + * Build the Meta Query to get all members list. + * + * @since 3.0.0 + * + * @param BP_User_Query $bp_user_query The User Query object. + */ + public function build_meta_query(\BP_User_Query $bp_user_query) + { + } + /** + * Get the list of group invites. + * + * @since 3.0.0 + * + * @param integer $user_id The User ID. + * @param integer $group_id The Group ID. + * @return array Matching BP_Invitation objects. + */ + public static function get_inviter_ids($user_id = 0, $group_id = 0) + { + } + } + /** + * BuddyPress Nav. + * + * This class is used to build each component's navigation. + * + * @since 2.6.0 + */ + class BP_Core_Nav + { + /** + * An associative array containing the nav items for the object ID. + * + * @since 2.6.0 + * + * @var array + */ + protected $nav; + /** + * The current object ID. + * + * @since 2.6.0 + * + * @var int + */ + private $object_id; + /** + * The component ID. + * + * @since 12.0.0 + * + * @var string + */ + private $component_id; + /** + * Initializes the Nav belonging to the specified object. + * + * @since 2.6.0 + * + * @param int $object_id The item ID to build the nav for. Default is the displayed user ID. + * @param string $component_id Optional. The component ID. Default is 'members'. + */ + public function __construct($object_id = 0, $component_id = 'members') + { + } + /** + * Checks whether a nav item is set. + * + * @since 2.6.0 + * + * @param string $key The requested nav slug. + * @return bool True if the nav item is set, false otherwise. + */ + public function __isset($key) + { + } + /** + * Gets a nav item. + * + * @since 2.6.0 + * + * @param string $key The requested nav slug. + * @return mixed The value corresponding to the requested nav item. + */ + public function __get($key) + { + } + /** + * Sets a nav item. + * + * @since 2.6.0 + * + * @param string $key The requested nav slug. + * @param mixed $value The value of the nav item. + */ + public function __set($key, $value) + { + } + /** + * Gets a specific nav item or array of nav items. + * + * @since 2.6.0 + * + * @param string $key The nav item slug to get. Optional. + * @return mixed An array of nav item, a single nav item, or null if none found. + */ + public function get($key = '') + { + } + /** + * Adds a new nav item. + * + * @since 2.6.0 + * + * @param array $args The nav item's arguments. + * @return BP_Core_Nav_Item + */ + public function add_nav($args) + { + } + /** + * Edits a nav item. + * + * @since 2.6.0 + * + * @param array $args The nav item's arguments. + * @param string $slug The slug of the nav item. + * @param string $parent_slug The slug of the parent nav item (required to edit a child). + * @return BP_Core_Nav_Item + */ + public function edit_nav($args = array(), $slug = '', $parent_slug = '') + { + } + /** + * Unset an item or a subitem of the nav. + * + * @since 2.6.0 + * + * @param string $slug The slug of the main item. + * @param string $parent_slug The slug of the sub item. + * @return false|callable|array False on failure, the screen function(s) on success. + */ + public function delete_nav($slug = '', $parent_slug = '') + { + } + /** + * Sorts a list of nav items. + * + * @since 2.6.0 + * + * @param array $items The nav items to sort. + * @return array + */ + public function sort_nav($items) + { + } + /** + * Gets the primary nav items. + * + * @since 2.6.0 + * + * @param array $args Filters to select the specific primary items. See wp_list_filter(). + * @param bool $sort True to sort the nav items. False otherwise. + * @return array The list of primary objects nav + */ + public function get_primary($args = array(), $sort = \true) + { + } + /** + * Gets the secondary nav items. + * + * @since 2.6.0 + * + * @param array $args Filters to select the specific secondary items. See wp_list_filter(). + * @param bool $sort True to sort the nav items. False otherwise. + * @return bool|array The list of secondary objects nav, or false if none set. + */ + public function get_secondary($args = array(), $sort = \true) + { + } + /** + * Gets a nested list of visible nav items. + * + * @since 2.6.0 + * + * @return array The list of visible nav items. + */ + public function get_item_nav() + { + } + } + /** + * A specific Group Nav class to make it possible to set new positions for + * buddypress()->groups->nav. + * + * @since 3.0.0 + */ + class BP_Nouveau_Customizer_Group_Nav extends \BP_Core_Nav + { + /** + * The group being requested. + * + * @since 3.0.0 + * @var BP_Groups_Group + */ + public $group = \null; + /** + * Constructor + * + * @param int $object_id Optional. The random group ID used to generate the nav. + */ + public function __construct($object_id = 0) + { + } + /** + * Checks whether a property is set. + * + * Overrides BP_Core_Nav::__isset() to avoid looking into its nav property. + * + * @since 3.0.0 + * + * @param string $key The property. + * + * @return bool True if the property is set, false otherwise. + */ + public function __isset($key) + { + } + /** + * Gets a property. + * + * Overrides BP_Core_Nav::__isset() to avoid looking into its nav property. + * + * @since 3.0.0 + * + * @param string $key The property. + * + * @return mixed The value corresponding to the property. + */ + public function __get($key) + { + } + /** + * Sets a property. + * + * Overrides BP_Core_Nav::__isset() to avoid adding a value to its nav property. + * + * @since 3.0.0 + * + * @param string $key The property. + * + * @param mixed $value The value of the property. + */ + public function __set($key, $value) + { + } + /** + * Setup a temporary nav with only the needed parameters. + * + * @since 3.0.0 + */ + protected function setup_nav() + { + } + /** + * Front template: do not look into group's template hierarchy. + * + * @since 3.0.0 + * + * @param array $templates The list of possible group front templates. + * + * @return array The list of "global" group front templates. + */ + public function all_groups_fronts($templates = array()) + { + } + /** + * Get the original order for the group navigation. + * + * @since 3.0.0 + * + * @return array a list of nav items slugs ordered. + */ + public function get_default_value() + { + } + /** + * Get the list of nav items ordered according to the Site owner preferences. + * + * @since 3.0.0 + * + * @return array the nav items ordered. + */ + public function get_group_nav() + { + } + } + /** + * Group template meta backwards compatibility class. + * + * @since 7.0.0 + */ + class BP_Nouveau_Group_Meta + { + /** + * Used to get the template meta used in Groups loop. + * + * @since 7.0.0 + * @var string $meta The template meta used in Groups loop. + */ + public $meta = ''; + /** + * Magic getter. + * + * This exists specifically for supporting deprecated object vars. + * + * @since 7.0.0 + * + * @param string $key + * @return string + */ + public function __get($key = '') + { + } + /** + * Constructor + * + * @since 7.0.0 + */ + public function __construct() + { + } + } + /** + * This control let users change the order of the BuddyPress + * single items navigation items. + * + * NB: this is a first pass to improve by using Javascript templating as explained here: + * https://developer.wordpress.org/themes/advanced-topics/customizer-api/#putting-the-pieces-together + * + * @since 3.0.0 + */ + class BP_Nouveau_Nav_Customize_Control extends \WP_Customize_Control + { + /** + * @var string + */ + public $type = ''; + /** + * Render the control's content. + * + * @since 3.0.0 + */ + public function render_content() + { + } + } + /** + * Members Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Members + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + * @since 6.0.0 Removes the BP Core number formatting filter on total members count. + */ + protected function setup_filters() + { + } + /** + * Add filters to be sure the (BuddyPress) widgets display will be consistent + * with the displayed user's default front page. + * + * @since 3.0.0 + * + * @param string $sidebar_index The Sidebar identifier. + */ + public function user_home_sidebar_set($sidebar_index = '') + { + } + /** + * Remove filters to be sure the (BuddyPress) widgets display will no more take + * the displayed user in account. + * + * @since 3.0.0 + * + * @param string $sidebar_index The Sidebar identifier. + */ + public function user_home_sidebar_unset($sidebar_index = '') + { + } + } + /** + * xProfile Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_xProfile + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + } + /** + * Friends Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Friends + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + /** + * Register notifications filters for the friends component. + * + * @since 3.0.0 + */ + public function notification_filters() + { + } + /** + * Register Friends Ajax actions. + * + * @since 12.0.0 + */ + public function register_ajax_actions() + { + } + } + /** + * Notifications Loader class + * + * @since 3.0.0 + */ + #[\AllowDynamicProperties] + class BP_Nouveau_Notifications + { + /** + * Constructor + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * Globals + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Include needed files + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Register do_action() hooks + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Register add_filter() hooks + * + * @since 3.0.0 + */ + protected function setup_filters() + { + } + } + /** Theme Setup ***************************************************************/ + /** + * Loads BuddyPress Nouveau Template pack functionality. + * + * See @link BP_Theme_Compat() for more. + * + * @since 3.0.0 + */ + class BP_Nouveau extends \BP_Theme_Compat + { + /** + * Instance of this class. + * + * @var BP_Nouveau|null + */ + protected static $instance = \null; + /** + * Return the instance of this class. + * + * @since 3.0.0 + * + * @return BP_Nouveau + */ + public static function get_instance() + { + } + /** + * The BP Nouveau constructor. + * + * @since 3.0.0 + */ + public function __construct() + { + } + /** + * BP Nouveau global variables. + * + * @since 3.0.0 + */ + protected function setup_globals() + { + } + /** + * Includes! + * + * @since 3.0.0 + */ + protected function includes() + { + } + /** + * Setup the Template Pack features support. + * + * @since 3.0.0 + */ + protected function setup_support() + { + } + /** + * Setup the Template Pack common actions. + * + * @since 3.0.0 + */ + protected function setup_actions() + { + } + /** + * Enqueue the template pack css files + * + * @since 3.0.0 + */ + public function enqueue_styles() + { + } + /** + * Register Template Pack JavaScript files + * + * @since 3.0.0 + */ + public function register_scripts() + { + } + /** + * Enqueue the required JavaScript files + * + * @since 3.0.0 + */ + public function enqueue_scripts() + { + } + /** + * Adds the no-js class to the body tag. + * + * This function ensures that the <body> element will have the 'no-js' class by default. If you're + * using JavaScript for some visual functionality in your theme, and you want to provide noscript + * support, apply those styles to body.no-js. + * + * The no-js class is removed by the JavaScript created in buddypress.js. + * + * @since 3.0.0 + * + * @param array $classes Array of classes to append to body tag. + * + * @return array $classes + */ + public function add_nojs_body_class($classes) + { + } + /** + * Load localizations for topic script. + * + * These localizations require information that may not be loaded even by init. + * + * @since 3.0.0 + */ + public function localize_scripts() + { + } + /** + * Filter the default theme compatibility root template hierarchy, and prepend + * a page template to the front if it's set. + * + * @see https://buddypress.trac.wordpress.org/ticket/6065 + * + * @since 3.0.0 + * + * @param array $templates Array of templates. + * + * @return array + */ + public function theme_compat_page_templates($templates = array()) + { + } + /** + * Add our special 'buddypress' div wrapper to the theme compat template part. + * + * @since 3.0.0 + * + * @see bp_buffer_template_part() + * + * @param string $retval Current template part contents. + * + * @return string + */ + public function theme_compat_wrapper($retval) + { + } + /** + * Define the directory nav items + * + * @since 3.0.0 + */ + public function setup_directory_nav() + { + } + /** + * We'll handle template notices from BP Nouveau. + * + * @since 3.0.0 + */ + public function neutralize_core_template_notices() + { + } + /** + * Set the BP Uri for the customizer in case of Ajax requests. + * + * @since 3.0.0 + * @deprecated 12.0.0 + * + * @param string $path The BP Uri. + * @return string The BP Uri. + */ + public function customizer_set_uri($path) + { + } + /** + * Modify "registration disabled" message in Nouveau template pack. + * Modify welcome message in Nouveau template pack. + * + * @since 8.0.0 + * + * @param array $messages The list of feedback messages. + * + * @return array $messages + */ + public function filter_registration_messages($messages) + { + } + } + /** + * Creates our Settings component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Settings_Component extends \BP_Component + { + /** + * Start the settings component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include files. + * + * @since 1.5.0 + * + * @param array $includes Array of values to include. Not used. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Setup globals. + * + * The BP_SETTINGS_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @param array $args See BP_Component::setup_globals() for a description. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see `BP_Component::setup_admin_bar()` for a description of the $wp_admin_nav + * parameter array. + * + * @param array $wp_admin_nav See `BP_Component::setup_admin_bar()` for a + * description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Register the BP Settings Blocks. + * + * @since 9.0.0 + * + * @param array $blocks Optional. See BP_Component::blocks_init() for the description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * Load BuddyPress plugin admin area. + * + * @todo Break this apart into each applicable Component. + * + * @since 1.6.0 + */ + #[\AllowDynamicProperties] + class BP_Admin + { + /** Directory *************************************************************/ + /** + * Path to the BuddyPress admin directory. + * + * @since 1.6.0 + * @var string + */ + public $admin_dir = ''; + /** URLs ******************************************************************/ + /** + * URL to the BuddyPress admin directory. + * + * @since 1.6.0 + * @var string + */ + public $admin_url = ''; + /** + * URL to the BuddyPress images directory. + * + * @since 1.6.0 + * @var string + */ + public $images_url = ''; + /** + * URL to the BuddyPress admin CSS directory. + * + * @since 1.6.0 + * @var string + */ + public $css_url = ''; + /** + * URL to the BuddyPress admin JS directory. + * + * @since 1.6.0 + * @var string + */ + public $js_url = ''; + /** Other *****************************************************************/ + /** + * Notices used for user feedback, like saving settings. + * + * @since 1.9.0 + * @var array + */ + public $notices = array(); + /** + * BuddyPress admin screens nav tabs. + * + * @since 10.0.0 + * @var array + */ + public $nav_tabs = array(); + /** + * BuddyPress admin active nav tab. + * + * @since 10.0.0 + * @var string + */ + public $active_nav_tab = ''; + /** + * BuddyPress admin screens submenu pages. + * + * @since 10.0.0 + * @var array + */ + public $submenu_pages = array(); + /** Methods ***************************************************************/ + /** + * The main BuddyPress admin loader. + * + * @since 1.6.0 + */ + public function __construct() + { + } + /** + * Set admin-related globals. + * + * @since 1.6.0 + */ + private function setup_globals() + { + } + /** + * Include required files. + * + * @since 1.6.0 + */ + private function includes() + { + } + /** + * Set up the admin hooks, actions, and filters. + * + * @since 1.6.0 + */ + private function setup_actions() + { + } + /** + * Register site- or network-admin nav menu elements. + * + * Contextually hooked to site or network-admin depending on current configuration. + * + * @since 1.6.0 + */ + public function admin_menus() + { + } + /** + * Register site-admin nav menu elements. + * + * @since 2.5.0 + */ + public function site_admin_menus() + { + } + /** + * Register the settings. + * + * @since 1.6.0 + */ + public function register_admin_settings() + { + } + /** + * Add a link to BuddyPress Hello to the admin bar. + * + * @since 1.9.0 + * @since 3.0.0 Hooked at priority 100 (was 15). + * + * @param WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + */ + public function admin_bar_about_link($wp_admin_bar) + { + } + /** + * Add Settings link to plugins area. + * + * @since 1.6.0 + * + * @param array $links Links array in which we would prepend our link. + * @param string $file Current plugin basename. + * @return array Processed links. + */ + public function modify_plugin_action_links($links, $file) + { + } + /** + * Displays an admin notice to inform settings have been saved. + * + * The notice is only displayed inside the Network Admin when + * BuddyPress is network activated. + * + * @since 10.0.0 + */ + public function admin_load() + { + } + /** + * Add some general styling to the admin area. + * + * @since 1.6.0 + */ + public function admin_head() + { + } + /** + * Add some general styling to the admin area. + * + * @since 1.6.0 + */ + public function enqueue_scripts() + { + } + /** + * Registers BuddyPress's suggested privacy policy language. + * + * @since 4.0.0 + */ + public function add_privacy_policy_content() + { + } + /** About *****************************************************************/ + /** + * Output the BuddyPress Hello template. + * + * @since 1.7.0 Screen content. + * @since 3.0.0 Now outputs BuddyPress Hello template. + */ + public function about_screen() + { + } + /** + * Output the credits screen. + * + * Hardcoding this in here is pretty janky. It's fine for now, but we'll + * want to leverage api.wordpress.org eventually. + * + * @since 1.7.0 + */ + public function credits_screen() + { + } + /** Emails ****************************************************************/ + /** + * Registers 'Situations' column on Emails dashboard page. + * + * @since 2.6.0 + * + * @param array $columns Current column data. + * @return array + */ + public function emails_register_situation_column($columns = array()) + { + } + /** + * Output column data for our custom 'Situations' column. + * + * @since 2.6.0 + * + * @param string $column Current column name. + * @param int $post_id Current post ID. + */ + public function emails_display_situation_column_data($column = '', $post_id = 0) + { + } + /** + * Adds BP Custom Post Types Admin screen's help tab. + * + * @since 14.0.0 + */ + public function post_type_load_admin_screen() + { + } + /** Helpers ***************************************************************/ + /** + * Return true/false based on whether a query argument is set. + * + * @see bp_do_activation_redirect() + * + * @since 2.2.0 + * + * @return bool + */ + public static function is_new_install() + { + } + /** + * Return a user-friendly version-number string, for use in translations. + * + * @since 2.2.0 + * + * @return string + */ + public static function display_version() + { + } + /** + * Add Emails menu item to custom menus array. + * + * Several BuddyPress components have top-level menu items in the Dashboard, + * which all appear together in the middle of the Dashboard menu. This function + * adds the Emails screen to the array of these menu items. + * + * @since 2.4.0 + * + * @param array $custom_menus The list of top-level BP menu items. + * @return array $custom_menus List of top-level BP menu items, with Emails added. + */ + public function emails_admin_menu_order($custom_menus = array()) + { + } + /** + * Register styles commonly used by BuddyPress wp-admin screens. + * + * @since 2.5.0 + */ + public function admin_register_styles() + { + } + /** + * Register JS commonly used by BuddyPress wp-admin screens. + * + * @since 2.5.0 + */ + public function admin_register_scripts() + { + } + /** + * Adds inline styles to adapt the number of grid columns according to the number of BP Admin tabs. + * + * @since 10.0.0 + */ + public function add_inline_styles() + { + } + /** + * Add a "BuddyPress Add-ons" tab to the Add Plugins Admin screen. + * + * @since 10.0.0 + * + * @param array $tabs The list of "Add Plugins" Tabs (Featured, Recommended, etc..). + * @return array The same list including the "BuddyPress Add-ons" tab. + */ + public function addons_tab($tabs = array()) + { + } + /** + * Customize the Plugins API query arguments. + * + * The most important argument is the $user one which is set to "buddypress". + * Using this key and value will fetch the plugins the w.org "buddypress" user favorited. + * + * @since 10.0.0 + * + * @global int $paged The current page of the Plugin results. + * + * @return array The "BuddyPress add-ons" args. + */ + public function addons_args() + { + } + /** + * Displays the list of "BuddyPress Add-ons". + * + * @since 10.0.0 + */ + public function display_addons_table() + { + } + /** + * Display the Admin Notifications screen. + * + * @since 11.4.0 + */ + public function admin_notifications() + { + } + } + /** + * BP_Email_Address Interface. + * + * @since 2.5.0 + */ + interface BP_Email_Address + { + /** + * Gets the email address of the user. + * + * @since 5.0.0 + * + * @return string + */ + public function get_address(); + /** + * Gets the display name of the user. + * + * @since 5.0.0 + * + * @return string + */ + public function get_name(); + /** + * Sets the email address of the user. + * + * @since 5.0.0 + * + * @param string $email_address Email address. + */ + public function set_address($email_address); + /** + * Sets the name of the user. + * + * @since 5.0.0 + * + * @param string $name Name. + */ + public function set_name($name); + } + /** + * BP_Email_Participant class. + * + * @since 5.0.0 + */ + abstract class BP_Email_Participant implements \BP_Email_Address + { + /** + * Recipient's email address. + * + * @since 5.0.0 + * + * @var string + */ + protected $address = ''; + /** + * Recipient's name. + * + * @since 5.0.0 + * + * @var string + */ + protected $name = ''; + /** + * Gets the email address of the user. + * + * @since 5.0.0 + * + * @return string + */ + public function get_address() + { + } + /** + * Gets the email name of the user. + * + * @since 5.0.0 + * + * @return string + */ + public function get_name() + { + } + /** + * Sets the email address of the user. + * + * @since 5.0.0 + * + * @param string $email_address Email address. + */ + public function set_address($email_address) + { + } + /** + * Sets the name of the user. + * + * @since 5.0.0 + * + * @param string $name Name. + */ + public function set_name($name) + { + } + } + /** + * This class is used to provide backward compatibility for extensions that access and modify + * the $bp->bp_nav global. + * + * Backward compatibility class for `bp_nav`. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + class BP_Core_BP_Nav_BackCompat implements \ArrayAccess + { + /** + * Nav items. + * + * @since 2.6.0 + * + * @var array + */ + public $backcompat_nav = array(); + /** + * Component to which nav items belong. + * + * @since 2.6.0 + * + * @var array + */ + public $component; + /** + * Constructor. + * + * @since 2.6.0 + * + * @param array $backcompat_nav Optional. Array of nav items. + */ + public function __construct($backcompat_nav = array()) + { + } + /** + * Assign a value to the nav array at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + * @param array $value Nav item. + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + } + /** + * Get a value of the nav array at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + } + /** + * Check whether nav array has a value at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + } + /** + * Unset a nav array value at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + } + /** + * Set the component to which the nav belongs. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function set_component() + { + } + /** + * Get the component to which the a nav item belongs. + * + * We use the following heuristic to guess, based on an offset, which component the item belongs to: + * - If this is a group, and the offset is the same as the current group's slug, it's a group nav item. + * - Otherwise, it's a member nav item. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function get_component() + { + } + /** + * Reset the cached nav items. + * + * Called when the nav API removes items from the nav array. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function reset() + { + } + /** + * Get the nav object corresponding to the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + protected function get_nav($offset) + { + } + /** + * Get the BP_Core_Nav object corresponding to the component, based on a nav item name. + * + * The way bp_nav was previously organized makes it impossible to know for sure which component's nav is + * being referenced by a given nav item name. We guess in the following manner: + * - If we're looking at a group, and the nav item name (`$offset`) is the same as the slug of the current + * group, we assume that the proper component nav is 'groups'. + * - Otherwise, fall back on 'members'. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param string $offset Nav item name. + */ + protected function get_component_nav($offset = '') + { + } + /** + * Get the nav data, formatted as a flat array. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + protected function to_array() + { + } + } + /** + * BuddyPress date query class. + * + * Extends the {@see WP_Date_Query} class for use with BuddyPress. + * + * @since 2.1.0 + * + * @param array $date_query { + * Date query arguments. See first parameter of {@see WP_Date_Query::__construct()}. + * } + * @param string $column The DB column to query against. + */ + class BP_Date_Query extends \WP_Date_Query + { + /** + * The column to query against. Can be changed via the query arguments. + * + * @var string + */ + public $column; + /** + * Whether to prepend the 'AND' operator to the WHERE SQL clause. + * + * @since 10.0.0 + * + * @var bool + */ + public $prepend_and = \false; + /** + * Constructor. + * + * @since 2.1.0 + * @since 10.0.0 Added `$prepend_and` argument. + * + * @see WP_Date_Query::__construct() + * + * @param array $date_query Date query arguments. + * @param string $column The DB column to query against. + * @param bool $prepend_and Whether to prepend the 'AND' operator to the WHERE SQL clause. + */ + public function __construct($date_query, $column = '', $prepend_and = \false) + { + } + /** + * Destructor. + */ + public function __destruct() + { + } + /** + * Registers our date column with WP Date Query to pass validation. + * + * @param array $retval Current DB columns. + * @return array + */ + public function register_date_column($retval = array()) + { + } + /** + * Generate SQL clauses to be appended to a main query. + * + * Since BuddyPress builds its SQL queries differently than WP_Query, we have + * to override the parent method to remove the leading 'AND' operator from the + * WHERE clause. + * + * @since 10.0.0 + * + * @return array { + * Array containing JOIN and WHERE SQL clauses to append to the main query. + * + * @type string $join SQL fragment to append to the main JOIN clause. + * @type string $where SQL fragment to append to the main WHERE clause. + * } + */ + protected function get_sql_clauses() + { + } + /** + * Helper method to generate and fetch the WHERE SQL clause for a date query. + * + * See {@link BP_Date_Query::__construct()} for all argument documentation. + * + * @since 10.0.0 + * + * @param array $date_query Date query arguments. + * @param string $column DB column to query against date. + * @param bool $prepend_and Whether to prepend the 'AND' operator to the WHERE clause. + * @return string + */ + public static function get_where_sql($date_query = array(), $column = '', $prepend_and = \false) + { + } + } + /** + * List table class for nonmember opt-outs admin page. + * + * @since 8.0.0 + */ + class BP_Optouts_List_Table extends \WP_Users_List_Table + { + /** + * Opt-out count. + * + * @since 8.0.0 + * + * @var int + */ + public $total_items = 0; + /** + * Constructor. + * + * @since 8.0.0 + */ + public function __construct() + { + } + /** + * Set up items for display in the list table. + * + * Handles filtering of data, sorting, pagination, and any other data + * manipulation required prior to rendering. + * + * @since 8.0.0 + */ + public function prepare_items() + { + } + /** + * Gets the name of the default primary column. + * + * @since 10.1.0 + * + * @return string Name of the default primary column, in this case, 'email_address'. + */ + protected function get_default_primary_column_name() + { + } + /** + * Get the list of views available on this table. + * + * @since 8.0.0 + */ + public function views() + { + } + /** + * Get rid of the extra nav. + * + * WP_Users_List_Table will add an extra nav to change user's role. + * As we're dealing with opt-outs, we don't need this. + * + * @since 8.0.0 + * + * @param array $which Current table nav item. + */ + public function extra_tablenav($which) + { + } + /** + * Specific opt-out columns. + * + * @since 8.0.0 + * + * @return array + */ + public function get_columns() + { + } + /** + * Specific bulk actions for opt-outs. + * + * @since 8.0.0 + */ + public function get_bulk_actions() + { + } + /** + * The text shown when no items are found. + * + * Nice job, clean sheet! + * + * @since 8.0.0 + */ + public function no_items() + { + } + /** + * The columns opt-outs can be reordered by. + * + * @since 8.0.0 + */ + public function get_sortable_columns() + { + } + /** + * Display opt-out rows. + * + * @since 8.0.0 + */ + public function display_rows() + { + } + /** + * Display an opt-out row. + * + * @since 8.0.0 + * + * @see WP_List_Table::single_row() for explanation of params. + * + * @param BP_Optout $optout BP_Optout object. + * @param string $style Styles for the row. + * @param string $role Role to be assigned to user. + * @param int $numposts Number of posts. + */ + public function single_row($optout = \null, $style = '', $role = '', $numposts = 0) + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 8.0.0 + * + * @param BP_Optout $optout BP_Optout object. + */ + public function column_cb($optout = \null) + { + } + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_email_address($optout = \null) + { + } + /** + * The inviter/site member who sent the email that prompted the opt-out. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_username($optout = \null) + { + } + /** + * Display registration date of user whose communication prompted opt-out. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_user_registered($optout = \null) + { + } + /** + * Display type of email that prompted opt-out. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_email_type($optout = \null) + { + } + /** + * Display description of bp-email-type that prompted opt-out. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_email_type_description($optout = \null) + { + } + /** + * Display opt-out date. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + */ + public function column_optout_date_modified($optout = \null) + { + } + /** + * Allow plugins to add custom columns. + * + * @since 8.0.0 + * + * @param BP_Optout|null $optout BP_Optout object. + * @param string $column_name The column name. + * @return string + */ + public function column_default($optout = \null, $column_name = '') + { + } + } + /** + * Navigation item. + * + * @since 2.6.0 + */ + class BP_Core_Nav_Item extends \ArrayObject + { + /** + * Constructor. + * + * @param array $data Data to populate the nav item. + */ + public function __construct($data) + { + } + } + /** + * BP Attachment class. + * + * Extend it to manage your component's uploads. + * + * @since 2.3.0 + */ + abstract class BP_Attachment + { + /** Upload properties *****************************************************/ + /** + * The file being uploaded. + * + * @var array + */ + public $attachment = array(); + /** + * The default args to be merged with the + * ones passed by the child class. + * + * @var array + */ + protected $default_args = array('original_max_filesize' => 0, 'allowed_mime_types' => array(), 'base_dir' => '', 'action' => '', 'file_input' => '', 'upload_error_strings' => array(), 'required_wp_files' => array('file'), 'upload_dir_filter_args' => 0); + /** + * Construct Upload parameters. + * + * @since 2.3.0 + * @since 2.4.0 Add the $upload_dir_filter_args argument to the $arguments array + * + * @param array|string $args { + * Array of upload parameters. + * + * @type int $original_max_filesize Maximum file size in kilobytes. Defaults to php.ini settings. + * @type array $allowed_mime_types List of allowed file extensions (eg: array( 'jpg', 'gif', 'png' ) ). + * Defaults to WordPress allowed mime types. + * @type string $base_dir Component's upload base directory. Defaults to WordPress 'uploads'. + * @type string $action The upload action used when uploading a file, $_POST['action'] must be set + * and its value must equal $action {@link wp_handle_upload()} (required). + * @type string $file_input The name attribute used in the file input. (required). + * @type array $upload_error_strings A list of specific error messages (optional). + * @type array $required_wp_files The list of required WordPress core files. Default: array( 'file' ). + * @type int $upload_dir_filter_args 1 to receive the original Upload dir array in the Upload dir filter, 0 otherwise. + * Defaults to 0 (optional). + * } + */ + public function __construct($args = '') + { + } + /** + * Set upload path and url for the component. + * + * @since 2.3.0 + */ + public function set_upload_dir() + { + } + /** + * Set Upload error messages. + * + * Used into the $overrides argument of BP_Attachment->upload() + * + * @since 2.3.0 + * + * @param array $param A list of error messages to add to BuddyPress core ones. + * @return array $upload_errors The list of upload errors. + */ + public function set_upload_error_strings($param = array()) + { + } + /** + * Include the WordPress core needed files. + * + * @since 2.3.0 + */ + public function includes() + { + } + /** + * Upload the attachment. + * + * @since 2.3.0 + * + * @param array $file The appropriate entry the from $_FILES superglobal. + * @param string $upload_dir_filter A specific filter to be applied to 'upload_dir' (optional). + * @param string|null $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @return false|array On success, returns an associative array of file attributes. + * On failure, returns an array containing the error message + * (eg: array( 'error' => $message ) ) + */ + public function upload($file, $upload_dir_filter = '', $time = \null) + { + } + /** + * Helper to convert utf-8 characters in filenames to their ASCII equivalent. + * + * @since 2.9.0 + * + * @param string $retval Filename. + * @return string + */ + public function sanitize_utf8_filename($retval) + { + } + /** + * Validate the allowed mime types using WordPress allowed mime types. + * + * In case of a multisite, the mime types are already restricted by + * the 'upload_filetypes' setting. BuddyPress will respect this setting. + * + * @since 2.3.0 + * + * @see check_upload_mimes() + * + * @return array Valid mime types. + */ + protected function validate_mime_types() + { + } + /** + * Specific upload rules. + * + * Override this function from your child class to build your specific rules + * By default, if an original_max_filesize is provided, a check will be done + * on the file size. + * + * @see BP_Attachment_Avatar->validate_upload() for an example of use + * + * @since 2.3.0 + * + * @param array $file The temporary file attributes (before it has been moved). + * @return array The file. + */ + public function validate_upload($file = array()) + { + } + /** + * Default filter to save the attachments. + * + * @since 2.3.0 + * @since 2.4.0 Add the $upload_dir parameter to the method + * + * regarding to context + * + * @param array $upload_dir The original Uploads dir. + * @return array The upload directory data. + */ + public function upload_dir_filter($upload_dir = array()) + { + } + /** + * Create the custom base directory for the component uploads. + * + * Override this function in your child class to run specific actions. + * (eg: add an .htaccess file) + * + * @since 2.3.0 + * + * @return bool + */ + public function create_dir() + { + } + /** + * Crop an image file. + * + * @since 2.3.0 + * + * @param array $args { + * Array of arguments for the crop method. + * + * @type string $original_file The source file (absolute path) for the Attachment. + * @type int $crop_x The start x position to crop from. + * @type int $crop_y The start y position to crop from. + * @type int $crop_w The width to crop. + * @type int $crop_h The height to crop. + * @type int $dst_w The destination width. + * @type int $dst_h The destination height. + * @type int $src_abs Optional. If the source crop points are absolute. + * @type string $dst_file Optional. The destination file to write to. + * } + * + * @return string|WP_Error New filepath on success, WP_Error on failure. + */ + public function crop($args = array()) + { + } + /** + * Build script datas for the Uploader UI. + * + * Override this method from your child class to build the script datas. + * + * @since 2.3.0 + * + * @return array The javascript localization data. + */ + public function script_data() + { + } + /** + * Adds a new revision of a file. + * + * @since 10.0.0 + * + * @param string $attachment_type The attachement type (eg: avatar). + * @param array $args { + * Optional. Array of arguments for the add_revision method. + * + * @type string $file_abspath The source file (absolute path) for the attachment. + * @type string $file_id Optional. The file ID to use as a suffix for the revision directory. + * } + * @return object|WP_Error An object informing about the URL an Path to a revision file, a WP_Error object on failure. + */ + public function add_revision($attachment_type, $args = array()) + { + } + /** + * Get full data for an image + * + * @since 2.4.0 + * + * @param string $file Absolute path to the uploaded image. + * @return bool|array An associate array containing the width, height and metadatas. + * False in case an important image attribute is missing. + */ + public static function get_image_data($file) + { + } + /** + * Edit an image file to resize it or rotate it + * + * @since 2.4.0 + * + * @param string $attachment_type The attachment type (eg: avatar or cover_image). Required. + * @param array $args { + * Optional. Array of arguments for the edit_image method. + * + * @type string $file Absolute path to the image file (required). + * @type int $max_w Max width attribute for the editor's resize method (optional). + * @type int $max_h Max height attribute for the editor's resize method (optional). + * @type bool $crop Crop attribute for the editor's resize method (optional). + * @type float $rotate Angle for the editor's rotate method (optional). + * @type int $quality Compression quality on a 1-100% scale (optional). + * @type bool $save Whether to use the editor's save method or not (optional). + * } + * @return string|WP_Image_Editor|WP_Error The edited image path or the WP_Image_Editor object in case of success, + * an WP_Error object otherwise. + */ + public static function edit_image($attachment_type, $args = array()) + { + } + } + /** + * BP Attachment Avatar class. + * + * Extends BP Attachment to manage the avatar uploads. + * + * @since 2.3.0 + */ + #[\AllowDynamicProperties] + class BP_Attachment_Avatar extends \BP_Attachment + { + /** + * Construct Upload parameters. + * + * @since 2.3.0 + * + * @see BP_Attachment::__construct() for list of parameters + */ + public function __construct() + { + } + /** + * Gets the available avatar types. + * + * @since 2.3.0 + * + * @param array $allowed_types Array of allowed avatar types. + * @return string comma separated list of allowed avatar types. + */ + public static function get_avatar_types($allowed_types = array()) + { + } + /** + * Set Upload Dir data for avatars. + * + * @since 2.3.0 + */ + public function set_upload_dir() + { + } + /** + * Avatar specific rules. + * + * Adds an error if the avatar size or type don't match BuddyPress needs. + * The error code is the index of $upload_error_strings. + * + * @since 2.3.0 + * + * @param array $file the temporary file attributes (before it has been moved). + * @return array the file with extra errors if needed. + */ + public function validate_upload($file = array()) + { + } + /** + * Maybe shrink the attachment to fit maximum allowed width. + * + * @since 2.3.0 + * @since 2.4.0 Add the $ui_available_width parameter, to inform about the Avatar UI width. + * + * @param string $file The absolute path to the file. + * @param int $ui_available_width Available width for the UI. + * @return false|string|WP_Image_Editor|WP_Error + */ + public static function shrink($file = '', $ui_available_width = 0) + { + } + /** + * Check if the image dimensions are smaller than full avatar dimensions. + * + * @since 2.3.0 + * + * @param string $file the absolute path to the file. + * @return bool + */ + public static function is_too_small($file = '') + { + } + /** + * Crop the avatar. + * + * @since 2.3.0 + * + * @see BP_Attachment::crop() for the list of parameters + * + * @param array $args Array of arguments for the cropping. + * @return array The cropped avatars (full, thumb and the timestamp). + */ + public function crop($args = array()) + { + } + /** + * Get the user id to set its avatar. + * + * @since 2.3.0 + * + * @return integer The user ID. + */ + private function get_user_id() + { + } + /** + * Get the group id to set its avatar. + * + * @since 2.3.0 + * + * @return integer The group ID. + */ + private function get_group_id() + { + } + /** + * Build script data for the Uploader UI. + * + * @since 2.3.0 + * + * @return array The javascript localization data. + */ + public function script_data() + { + } + } + /** + * BP_Email_Delivery Interface. + * + * When implementing support for an email delivery service into BuddyPress, + * you are required to create a class that implements this interface. + * + * @since 2.5.0 + */ + interface BP_Email_Delivery + { + /** + * Send email(s). + * + * @since 2.5.0 + * + * @param BP_Email $email Email to send. + * @return bool|WP_Error Returns true if email send, else a descriptive WP_Error. + */ + public function bp_email(\BP_Email $email); + } + /** + * BuddyPress Customizer font size control. + * + * @since 2.5.0 + */ + class BP_Customizer_Control_Range extends \WP_Customize_Control + { + /** + * Control type. + * + * @var string + */ + public $type = 'range'; + /** + * Enqueue scripts/styles for the color picker. + * + * @since 2.5.0 + */ + public function enqueue() + { + } + /** + * Render the control. + * + * @since 2.5.0 + */ + public function render_content() + { + } + } + /** + * This class is used to provide backward compatibility for extensions that access and modify + * the $bp->bp_options_nav global. + * + * Backward compatibility class for `bp_options_nav`. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + class BP_Core_BP_Options_Nav_BackCompat extends \BP_Core_BP_Nav_BackCompat + { + /** + * Parent slug of the current nav item. + * + * @since 2.6.0 + * + * @var string + */ + protected $parent_slug = ''; + /** + * Get a value of the nav array at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + public function offsetGet($offset) + { + } + /** + * Unset a nav array value at the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + } + /** + * Get the parent slug of the current nav item. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function get_parent_slug() + { + } + /** + * Set the parent slug of the current nav item. + * + * @since 2.6.0 + * @deprecated 12.0.0 + */ + public function set_parent_slug() + { + } + /** + * Get the nav object corresponding to the specified offset. + * + * @since 2.6.0 + * @deprecated 12.0.0 + * + * @param mixed $offset Array offset. + */ + public function get_nav($offset) + { + } + } + /** + * BuddyPress Invitations. + * + * Use this class to create, access, edit, or delete BuddyPress Invitations. + * + * @since 5.0.0 + */ + class BP_Invitation + { + /** + * The invitation ID. + * + * @since 5.0.0 + * + * @var int + */ + public $id; + /** + * The ID of the invited user. + * + * @since 5.0.0 + * + * @var int + */ + public $user_id; + /** + * The ID of the user who created the invitation. + * + * @since 5.0.0 + * + * @var int + */ + public $inviter_id; + /** + * The email address of the invited user. + * Used when extending an invitation to someone who does not belong to the site. + * + * @since 5.0.0 + * + * @var string + */ + public $invitee_email; + /** + * The name of the related class. + * + * @since 5.0.0 + * + * @var string + */ + public $class; + /** + * The ID associated with the invitation and component. + * Example: the group ID if a group invitation + * + * @since 5.0.0 + * + * @var int + */ + public $item_id; + /** + * The secondary ID associated with the invitation and component. + * Example: a taxonomy term ID if invited to a site's category-specific RSS feed + * + * @since 5.0.0 + * + * @var int|null + */ + public $secondary_item_id = \null; + /** + * Invite or request. + * + * @since 5.0.0 + * + * @var string + */ + public $type; + /** + * Extra information provided by the requester or inviter. + * + * @since 5.0.0 + * + * @var string + */ + public $content; + /** + * The date the invitation was last modified. + * + * @since 5.0.0 + * + * @var string + */ + public $date_modified; + /** + * Has the invitation been sent, or is it a draft invite? + * + * @since 5.0.0 + * + * @var bool + */ + public $invite_sent; + /** + * Has the invitation been accepted by the invitee? + * + * @since 5.0.0 + * + * @var bool + */ + public $accepted; + /** + * Columns in the invitations table. + * + * @since 9.0.0 + * + * @var array + */ + public static $columns = array('id', 'user_id', 'inviter_id', 'invitee_email', 'class', 'item_id', 'secondary_item_id', 'type', 'content', 'date_modified', 'invite_sent', 'accepted'); + /** Public Methods ****************************************************/ + /** + * Constructor method. + * + * @since 5.0.0 + * + * @param int $id Optional. Provide an ID to access an existing invitation item. + */ + public function __construct($id = 0) + { + } + /** + * Update or insert invitation details into the database. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Fetch data for an existing invitation from the database. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** Protected Static Methods ******************************************/ + /** + * Create an invitation entry. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $data { + * Array of invitation data, passed to {@link wpdb::insert()}. + * @type int $user_id ID of the invited user. + * @type int $inviter_id ID of the user who created the invitation. + * @type string $invitee_email Email address of the invited user. + * @type string $class Name of the related class. + * @type int $item_id ID associated with the invitation and component. + * @type int $secondary_item_id Secondary ID associated with the invitation and + * component. + * @type string $content Extra information provided by the requester + * or inviter. + * @type string $date_modified Date the invitation was last modified. + * @type int $invite_sent Has the invitation been sent, or is it a draft + * invite? + * } + * @param array $data_format See {@link wpdb::insert()}. + * @return int|false The number of rows inserted, or false on error. + */ + protected static function _insert($data = array(), $data_format = array()) + { + } + /** + * Update invitations. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::update() for further description of paramater formats. + * + * @param array $data Array of invitation data to update, passed to + * {@link wpdb::update()}. Accepts any property of a + * BP_Invitation object. + * @param array $where The WHERE params as passed to wpdb::update(). + * Typically consists of array( 'ID' => $id ) to specify the ID + * of the item being updated. See {@link wpdb::update()}. + * @param array $data_format See {@link wpdb::insert()}. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _update($data = array(), $where = array(), $data_format = array(), $where_format = array()) + { + } + /** + * Delete invitations. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::update() for further description of paramater formats. + * + * @param array $where Array of WHERE clauses to filter by, passed to + * {@link wpdb::delete()}. Accepts any property of a + * BP_Invitation object. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _delete($where = array(), $where_format = array()) + { + } + /** + * Assemble the WHERE clause of a get() SQL statement. + * + * Used by BP_Invitation::get() to create its WHERE + * clause. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args See {@link BP_Invitation::get()} for more details. + * @return string WHERE clause. + */ + protected static function get_where_sql($args = array()) + { + } + /** + * Assemble the ORDER BY clause of a get() SQL statement. + * + * Used by BP_Invitation::get() to create its ORDER BY + * clause. + * + * @since 5.0.0 + * + * @param array $args See {@link BP_Invitation::get()} for more details. + * @return string ORDER BY clause. + */ + protected static function get_order_by_sql($args = array()) + { + } + /** + * Assemble the LIMIT clause of a get() SQL statement. + * + * Used by BP_Invitation::get() to create its LIMIT clause. + * + * @since 5.0.0 + * + * @param array $args See {@link BP_Invitation::get()} for more details. + * @return string LIMIT clause. + */ + protected static function get_paged_sql($args = array()) + { + } + /** + * Assemble query clauses, based on arguments, to pass to $wpdb methods. + * + * The insert(), update(), and delete() methods of {@link wpdb} expect + * arguments of the following forms: + * + * - associative arrays whose key/value pairs are column => value, to + * be used in WHERE, SET, or VALUES clauses + * - arrays of "formats", which tell $wpdb->prepare() which type of + * value to expect when sanitizing (eg, array( '%s', '%d' )) + * + * This utility method can be used to assemble both kinds of params, + * out of a single set of associative array arguments, such as: + * + * $args = array( + * 'user_id' => 4, + * 'class' => 'BP_Groups_Invitation_Manager', + * ); + * + * This will be converted to: + * + * array( + * 'data' => array( + * 'user_id' => 4, + * 'class' => 'BP_Groups_Invitation_Manager', + * ), + * 'format' => array( + * '%d', + * '%s', + * ), + * ) + * + * which can easily be passed as arguments to the $wpdb methods. + * + * @since 5.0.0 + * + * @param array $args Associative array of filter arguments. + * See {@BP_Invitation::get()} for a breakdown. + * @return array Associative array of 'data' and 'format' args. + */ + protected static function get_query_clauses($args = array()) + { + } + /** Public Static Methods *********************************************/ + /** + * Get invitations, based on provided filter parameters. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Associative array of arguments. All arguments but $page and + * $per_page can be treated as filter values for get_where_sql() + * and get_query_clauses(). All items are optional. + * @type int|array $id ID of invitation being fetched. + * Can be an array of IDs. + * @type int|array $user_id ID of user being queried. Can be an + * Can be an array of IDs. + * @type int|array $inviter_id ID of user who created the + * invitation. Can be an array of IDs. + * @type string|array $invitee_email Email address of invited users + * being queried. Can be an array of + * addresses. + * @type string|array $class Name of the class to filter by. + * Can be an array of class names. + * @type int|array $item_id ID of associated item. + * Can be an array of multiple item IDs. + * @type int|array $secondary_item_id ID of secondary associated item. + * Can be an array of multiple IDs. + * @type string|array $type Type of item. An "invite" is sent + * from one user to another. + * A "request" is submitted by a + * user and no inviter is required. + * 'all' returns all. Default: 'all'. + * @type string $invite_sent Limit to draft, sent or all + * 'draft' limits to unsent invites, + * 'sent' returns only sent invites, + * 'all' returns all. Default: 'all'. + * @type bool $accepted Limit to accepted or + * not-yet-accepted invitations. + * 'accepted' returns accepted invites, + * 'pending' returns pending invites, + * 'all' returns all. Default: 'pending' + * @type string $search_terms Term to match against class field. + * @type string $order_by Database column to order by. + * @type string $sort_order Either 'ASC' or 'DESC'. + * @type string $order_by Field to order results by. + * @type string $sort_order ASC or DESC. + * @type int $page Number of the current page of results. + * Default: false (no pagination, + * all items). + * @type int $per_page Number of items to show per page. + * Default: false (no pagination, + * all items). + * @type string $fields Which fields to return. Specify 'item_ids' to fetch a list of Item_IDs. + * Specify 'ids' to fetch a list of Invitation IDs. + * Default: 'all' (return BP_Invitation objects). + * } + * + * @return int[]|BP_Invitation[] BP_Invitation objects | IDs of found invite. + */ + public static function get($args = array()) + { + } + /** + * Get a count of total invitations matching a set of arguments. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see BP_Invitation::get() for a description of + * arguments. + * + * @param array $args See {@link BP_Invitation::get()}. + * @return int Count of located items. + */ + public static function get_total_count($args) + { + } + /** + * Update invitations. + * + * @since 5.0.0 + * + * @see BP_Invitation::get() for a description of + * accepted update/where arguments. + * + * @param array $update_args Associative array of fields to update, + * and the values to update them to. Of the format + * array( 'user_id' => 4, 'class' => 'BP_Groups_Invitation_Manager', ). + * @param array $where_args Associative array of columns/values, to + * determine which rows should be updated. Of the format + * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', ). + * @return int|bool Number of rows updated on success, false on failure. + */ + public static function update($update_args = array(), $where_args = array()) + { + } + /** + * Delete invitations. + * + * @since 5.0.0 + * + * @see BP_Invitation::get() for a description of + * accepted where arguments. + * + * @param array $args Associative array of columns/values, to determine + * which rows should be deleted. Of the format + * array( 'item_id' => 7, 'class' => 'BP_Groups_Invitation_Manager', ). + * @return int|bool Number of rows deleted on success, false on failure. + */ + public static function delete($args = array()) + { + } + /** Convenience methods ***********************************************/ + /** + * Delete a single invitation by ID. + * + * @since 5.0.0 + * + * @see BP_Invitation::delete() for explanation of + * return value. + * + * @param int $id ID of the invitation item to be deleted. + * @return bool|int Number of rows deleted on success, false on failure. + */ + public static function delete_by_id($id) + { + } + /** Sent status ***********************************************************/ + /** + * Mark specific invitations as sent by invitation ID. + * + * @since 5.0.0 + * + * @param int $id The ID of the invitation to mark as sent. + * @param array $args { + * Optional. Invitation characteristics used + * to override certain sending behaviors. + * + * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT. + * Defaults to current time if not specified. + * } + * @return int|bool The number of rows updated, or false on error. + */ + public static function mark_sent($id = 0, $args = array()) + { + } + /** + * Mark invitations as sent that are found by user_id, inviter_id, item id, and optional + * secondary item id, and class name. + * + * @since 5.0.0 + * + * @param array $args See BP_Invitation::update(). + * @return int|bool The number of rows updated, or false on error. + */ + public static function mark_sent_by_data($args) + { + } + /** Accepted status ***********************************************************/ + /** + * Mark specific invitations as accepted by invitation ID. + * + * @since 5.0.0 + * + * @param int $id The ID of the invitation to mark as sent. + * @param array $args { + * Optional. Invitation characteristics used + * to override certain sending behaviors. + * + * @type string $date_modified Modified time in 'Y-m-d h:i:s' format, GMT. + * Defaults to current time if not specified. + * } + * @return int|bool The number of rows updated, or false on error. + */ + public static function mark_accepted($id = 0, $args = array()) + { + } + /** + * Mark invitations as accepted that are found by user_id, inviter_id, + * item id, and optional secondary item id, and class name. + * + * @since 5.0.0 + * + * @param array $args See BP_Invitation::update(). + * @return int|bool The number of rows updated, or false on error. + */ + public static function mark_accepted_by_data($args) + { + } + } + /** + * BP Block Class. + * + * @since 6.0.0 + */ + class BP_Block + { + /** + * WP Block Type object. + * + * @since 6.0.0 + * + * @var WP_Block_Type|WP_Error + */ + public $block; + /** + * The script types registered. + * + * @since 6.0.0 + * + * @var array + */ + private $registered_scripts; + /** + * The style types registered. + * + * @since 6.0.0 + * + * @var array + */ + private $registered_styles; + /** + * Construct the BuddyPress Block. + * + * @since 6.0.0 + * @since 11.0.0 Add support for WP Block API v2 { apiVersion: 2 }. + * + * @param array $args { + * The registration arguments for the BP Block. Part of the arguments are the ones + * used by `WP_Block_Type`. Below are BP specific arguments. + * + * @type string $editor_script_url URL to the JavaScript main file of the BP Block + * to load into the Block Editor. + * @type array $editor_script_deps The list of JavaScript dependency handles for the + * BP Block main file. + * @type string $script_url URL to the JavaScript file to load into the Block + * Editor and on front-end. + * @type array $script_deps The list of JavaScript dependency handles for the + * JavaScript file to load into the Block Editor and + * on front-end. + * @type string $view_script_url URL to the JavaScript file to load on front-end. + * @type array $view_script_deps The list of JavaScript dependency handles for the + * JavaScript file to load on front-end. + * @type string $editor_style_url URL to the CSS main file of the BP Block to load + * into the Block Editor. + * @type array $editor_style_deps The list of CSS dependency handles for the + * CSS main file. + * @type string $style_url URL to the CSS file to load into the Block Editor + * and on front-end. + * @type array $style_deps The list of CSS dependency handles for the CSS file + * to load into the Block Editor and on front-end. + * @type string $domain_path The path to the folder where custom block translations + * are located. + * @type array $buddypress_contexts The list of BuddyPress contexts a block can be loaded into. + * } + */ + public function __construct($args) + { + } + } + /** + * Create HTML list of BP nav items. + * + * @since 1.7.0 + */ + class BP_Walker_Nav_Menu extends \Walker_Nav_Menu + { + /** + * Description of fields indexes for building markup. + * + * @since 1.7.0 + * + * @var array + */ + public $db_fields = array('id' => 'css_id', 'parent' => 'parent'); + /** + * Tree type. + * + * @since 1.7.0 + * + * @var string + */ + public $tree_type = array(); + /** + * Display array of elements hierarchically. + * + * This method is almost identical to the version in {@link Walker::walk()}. + * The only change is on one line which has been commented. An IF was + * comparing 0 to a non-empty string which was preventing child elements + * being grouped under their parent menu element. + * + * This caused a problem for BuddyPress because our primary/secondary + * navigations don't have a unique numerical ID that describes a + * hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and + * those have ID/post_parent. + * + * @since 1.7.0 + * @since 5.1.0 Method was renamed from `walk` to `do_walk` to ensure PHP 5.3 compatibility + * + * @see Walker::walk() + * + * @param array $elements See {@link Walker::walk()}. + * @param int $max_depth See {@link Walker::walk()}. + * @param array $args Optional additional arguments. + * @return string See {@link Walker::walk()}. + */ + public function do_walk($elements, $max_depth, $args = array()) + { + } + /** + * Overrides Walker::walk() method. + * + * @since 6.0.0 Formalized the existing `...$args` parameter by adding it + * to the function signature to match WordPress 5.3. + * + * @param array $elements See {@link Walker::walk()}. + * @param int $max_depth See {@link Walker::walk()}. + * @param mixed ...$args See {@link Walker::walk()}. + */ + public function walk($elements, $max_depth, ...$args) + { + } + /** + * Display the current <li> that we are on. + * + * @see Walker::start_el() for complete description of parameters. + * + * @since 1.7.0 + * + * @param string $output Passed by reference. Used to append + * dditional content. + * @param object $item Menu item data object. + * @param int $depth Optional. Depth of menu item. Used for padding. + * Defaults to 0. + * @param stdClass $args Optional. See {@link Walker::start_el()}. + * @param int $id Menu item ID. Optional. + */ + public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) + { + } + } + /** + * Enable oEmbeds in BuddyPress contexts. + * + * Extends WP_Embed class for use with BuddyPress. + * + * @since 1.5.0 + * + * @see WP_Embed + */ + class BP_Embed extends \WP_Embed + { + /** + * Constructor + * + * @global WP_Embed $wp_embed + */ + public function __construct() + { + } + /** + * The {@link do_shortcode()} callback function. + * + * Attempts to convert a URL into embed HTML. Starts by checking the + * URL against the regex of the registered embed handlers. Next, checks + * the URL against the regex of registered {@link WP_oEmbed} providers + * if oEmbed discovery is false. If none of the regex matches and it's + * enabled, then the URL will be passed to {@link BP_Embed::parse_oembed()} + * for oEmbed parsing. + * + * @param array $attr Shortcode attributes. + * @param string $url The URL attempting to be embeded. + * @return string The embed HTML on success, otherwise the original URL. + */ + public function shortcode($attr, $url = '') + { + } + /** + * Base function so BP components/plugins can parse links to be embedded. + * + * View an example to add support in {@link bp_activity_embed()}. + * + * on success. + * oEmbed failure. + * + * @param int $id ID to do the caching for. + * @param string $url The URL attempting to be embedded. + * @param array $attr Shortcode attributes from {@link WP_Embed::shortcode()}. + * @param array $rawattr Untouched shortcode attributes from + * {@link WP_Embed::shortcode()}. + * @return string The embed HTML on success, otherwise the original URL. + */ + public function parse_oembed($id, $url, $attr, $rawattr) + { + } + } + /** + * API for responding and returning a custom oEmbed request. + * + * @since 2.6.0 + */ + abstract class BP_Core_oEmbed_Extension + { + /** START PROPERTIES ****************************************************/ + /** + * (required) The slug endpoint. + * + * Should be your component id. + * + * @since 2.6.0 + * + * @var string + */ + public $slug_endpoint = ''; + /** END PROPERTIES ******************************************************/ + /** + * Constructor. + */ + public final function __construct() + { + } + /** REQUIRED METHODS ****************************************************/ + /** + * Add content for your oEmbed response here. + * + * @since 2.6.0 + */ + protected abstract function content(); + /** + * Add a check for when you are on the page you want to oEmbed. + * + * You'll want to return a boolean here. eg. bp_is_single_activity(). + * + * @since 2.6.0 + * + * @return bool + */ + protected abstract function is_page(); + /** + * Validate the URL to see if it matches your item ID. + * + * @since 2.6.0 + * + * @param string $url URL to validate. + * @return int Your item ID + */ + protected abstract function validate_url_to_item_id($url); + /** + * Set the oEmbed response data. + * + * @since 2.6.0 + * + * @param int $item_id Your item ID to do checks against. + * @return array Should contain 'content', 'title', 'author_url', 'author_name' as array + * keys. 'author_url' and 'author_name' is optional; the rest are required. + */ + protected abstract function set_oembed_response_data($item_id); + /** + * Sets the fallback HTML for the oEmbed response. + * + * In a WordPress oEmbed item, the fallback HTML is a <blockquote>. This is + * usually hidden after the <iframe> is loaded. + * + * @since 2.6.0 + * + * @param int $item_id Your item ID to do checks against. + * @return string Fallback HTML you want to output. + */ + protected abstract function set_fallback_html($item_id); + /** OPTIONAL METHODS ****************************************************/ + /** + * If your oEmbed endpoint requires additional arguments, set them here. + * + * @see register_rest_route() View the $args parameter for more info. + * + * @since 2.6.0 + * + * @return array + */ + protected function set_route_args() + { + } + /** + * Set the iframe title. + * + * If not set, this will fallback to WP's 'Embedded WordPress Post'. + * + * @since 2.6.0 + * + * @param int $item_id The item ID to do checks for. + */ + protected function set_iframe_title($item_id) + { + } + // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found + /** + * Do what you need to do here to initialize any custom hooks. + * + * @since 2.6.0 + */ + protected function custom_hooks() + { + } + /** + * Set permalink for oEmbed link discovery. + * + * This method will be called on the page we want to oEmbed. In most cases, + * you will not need to override this method. However, if you need to, do + * override in your extended class. + * + * @since 2.6.0 + * + * @return string + */ + protected function set_permalink() + { + } + /** HELPERS *************************************************************/ + /** + * Get the item ID when filtering the oEmbed HTML. + * + * Should only be used during the 'embed_html' hook. + * + * @since 2.6.0 + * + * @return int + */ + protected function get_item_id() + { + } + /** SET UP **************************************************************/ + /** + * Set up properties. + * + * @since 2.6.0 + */ + protected function setup_properties() + { + } + /** + * Hooks! We do the dirty work here, so you don't have to! :) + * + * More hooks are available in the setup_template_parts() method. + * + * @since 2.6.0 + */ + protected function setup_hooks() + { + } + /** HOOKS ***************************************************************/ + /** + * Register the oEmbed REST API route. + * + * @since 2.6.0 + */ + public function register_route() + { + } + /** + * Set up custom embed template parts for BuddyPress use. + * + * @since 2.6.0 + * + * @param string $template File path to current embed template. + * @return string + */ + public function setup_template_parts($template) + { + } + /** + * Start object buffer. + * + * We're going to override WP's get_template_part( 'embed, 'content' ) call + * and inject our own template for BuddyPress use. + * + * @since 2.6.0 + * + * @param string $slug Template slug. + * @param string $name Template name. + */ + public function content_buffer_start($slug, $name) + { + } + /** + * End object buffer. + * + * We're going to override WP's get_template_part( 'embed, 'content' ) call + * and inject our own template for BuddyPress use. + * + * @since 2.6.0 + * + * @param string $name Template name. + */ + public function content_buffer_end($name) + { + } + /** + * Adds oEmbed discovery links on single activity pages. + * + * @since 2.6.0 + * + * @param string $retval Current discovery links. + * @return string + */ + public function add_oembed_discovery_links($retval) + { + } + /** + * Fetch our oEmbed response data to return. + * + * A simplified version of {@see get_oembed_response_data()}. + * + * @since 2.6.0 + * + * @link http://oembed.com/ View the 'Response parameters' section for more details. + * + * @param array $item Custom oEmbed response data. + * @param int $width The requested width. + * @return array + */ + protected function get_oembed_response_data($item, $width) + { + } + /** + * Callback for the API endpoint. + * + * Returns the JSON object for the item. + * + * @since 2.6.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_Error|array oEmbed response data or WP_Error on failure. + */ + public function get_item($request) + { + } + /** + * If oEmbed request wants XML, return XML instead of JSON. + * + * Basically a copy of {@link _oembed_rest_pre_serve_request()}. Unfortunate + * that we have to duplicate this just for a URL check. + * + * @since 2.6.0 + * + * @param bool $served Whether the request has already been served. + * @param WP_HTTP_ResponseInterface $result Result to send to the client. Usually a WP_REST_Response. + * @param WP_REST_Request $request Request used to generate the response. + * @param WP_REST_Server $server Server instance. + * @return bool + */ + public function oembed_xml_request($served, $result, $request, $server) + { + } + /** + * Pass our BuddyPress activity permalink for embedding. + * + * @since 2.6.0 + * + * @see bp_activity_embed_rest_route_callback() + * + * @param string $retval Current embed URL. + * @return string + */ + public function filter_embed_url($retval) + { + } + /** + * Filters the embed HTML for our BP oEmbed endpoint. + * + * @since 2.6.0 + * + * @param string $retval Current embed HTML. + * @return string + */ + public function filter_embed_html($retval) + { + } + /** + * Append our custom slug endpoint to oEmbed endpoint URL. + * + * Meant to be used as a filter on 'rest_url' before any call to + * {@link get_oembed_endpoint_url()} is used. + * + * @since 2.6.0 + * + * @see add_oembed_discovery_links() + * + * @param string $retval Current oEmbed endpoint URL. + * @return string + */ + public function filter_rest_url($retval = '') + { + } + /** + * Inject content into the embed template. + * + * @since 2.6.0 + */ + public function inject_content() + { + } + } + /** + * BP Attachment Cover Image class. + * + * Extends BP Attachment to manage the cover images uploads. + * + * @since 2.4.0 + */ + #[\AllowDynamicProperties] + class BP_Attachment_Cover_Image extends \BP_Attachment + { + /** + * The constuctor. + * + * @since 2.4.0 + */ + public function __construct() + { + } + /** + * Gets the available cover image types. + * + * @since 2.4.0 + * + * @param array $allowed_types Array of allowed cover image types. + * @return string $value Comma-separated list of allowed cover image types. + */ + public static function get_cover_image_types($allowed_types = array()) + { + } + /** + * Cover image specific rules. + * + * Adds an error if the cover image size or type don't match BuddyPress needs. + * The error code is the index of $upload_error_strings. + * + * @since 2.4.0 + * + * @param array $file The temporary file attributes (before it has been moved). + * @return array $file The file with extra errors if needed. + */ + public function validate_upload($file = array()) + { + } + /** + * Set the directory when uploading a file. + * + * @since 2.4.0 + * + * @param array $upload_dir The original Uploads dir. + * @return array $value Upload data (path, url, basedir...). + */ + public function upload_dir_filter($upload_dir = array()) + { + } + /** + * Adjust the cover image to fit with advised width & height. + * + * @since 2.4.0 + * + * @param string $file The absolute path to the file. + * @param array $dimensions Array of dimensions for the cover image. + * @return mixed + */ + public function fit($file = '', $dimensions = array()) + { + } + /** + * Generate a filename for the cover image. + * + * @since 2.4.0 + * + * @param string $file The absolute path to the file. + * @return false|string + */ + public function generate_filename($file = '') + { + } + /** + * Build script datas for the Uploader UI. + * + * @since 2.4.0 + * + * @return array The javascript localization data + */ + public function script_data() + { + } + } + /** + * Base class for creating query classes that generate SQL fragments for filtering results based on recursive query params. + * + * @since 2.2.0 + */ + abstract class BP_Recursive_Query + { + /** + * Query arguments passed to the constructor. + * + * @since 2.2.0 + * + * @var array + */ + public $queries = array(); + /** + * Generate SQL clauses to be appended to a main query. + * + * Extending classes should call this method from within a publicly + * accessible get_sql() method, and manipulate the SQL as necessary. + * For example, {@link BP_XProfile_Query::get_sql()} is merely a wrapper for + * get_sql_clauses(), while {@link BP_Activity_Query::get_sql()} discards + * the empty 'join' clause, and only passes the 'where' clause. + * + * @since 2.2.0 + * + * @return array + */ + protected function get_sql_clauses() + { + } + /** + * Generate SQL clauses for a single query array. + * + * If nested subqueries are found, this method recurses the tree to + * produce the properly nested SQL. + * + * Subclasses generally do not need to call this method. It is invoked + * automatically from get_sql_clauses(). + * + * @since 2.2.0 + * + * @param array $query Query to parse. + * @param int $depth Optional. Number of tree levels deep we + * currently are. Used to calculate indentation. + * @return array + */ + protected function get_sql_for_query($query, $depth = 0) + { + } + /** + * Recursive-friendly query sanitizer. + * + * Ensures that each query-level clause has a 'relation' key, and that + * each first-order clause contains all the necessary keys from + * $defaults. + * + * Extend this method if your class uses different sanitizing logic. + * + * @since 2.2.0 + * + * @param array $queries Array of query clauses. + * + * @return array Sanitized array of query clauses. + */ + protected function sanitize_query($queries) + { + } + /** + * Generate JOIN and WHERE clauses for a first-order clause. + * + * Must be overridden in a subclass. + * + * @since 2.2.0 + * + * @param array $clause Array of arguments belonging to the clause. + * @param array $parent_query Parent query to which the clause belongs. + * + * @return array { + * @type array $join Array of subclauses for the JOIN statement. + * @type array $where Array of subclauses for the WHERE statement. + * } + */ + protected abstract function get_sql_for_clause($clause, $parent_query); + /** + * Determine whether a clause is first-order. + * + * Must be overridden in a subclass. + * + * @since 2.2.0 + * + * @param array $query Clause to check. + * + * @return bool + */ + protected abstract function is_first_order_clause($query); + } + /** + * Creates the Core component. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Core extends \BP_Component + { + /** + * Start the members component creation process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Magic getter. + * + * This exists specifically for supporting deprecated object vars. + * + * @since 7.0.0 + * + * @param string $key The object var to get. + * @return mixed + */ + public function __get($key = '') + { + } + /** + * Populate the global data needed before BuddyPress can continue. + * + * This involves figuring out the currently required, activated, deactivated, + * and optional components. + * + * @since 1.5.0 + */ + private function bootstrap() + { + } + /** + * Include bp-core files. + * + * @since 1.6.0 + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes($includes = array()) + { + } + /** + * Set up bp-core global settings. + * + * Sets up a majority of the BuddyPress globals that require a minimal + * amount of processing, meaning they cannot be set in the BuddyPress class. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals($args = array()) + { + } + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Set up post types. + * + * @since 2.4.0 + * @since 12.0.0 Registers the 'buddypress' post type for component directories. + */ + public function register_post_types() + { + } + /** + * Parse the WP_Query and eventually set the BP Search mechanism. + * + * Search doesn't have an associated page, so we check for it separately. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. See BP_Component::parse_query() for + * description. + */ + public function parse_query($query) + { + } + /** + * Init the Core controllers of the BP REST API. + * + * @since 9.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Core Blocks. + * + * @since 9.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * BuddyPress opt-outs. + * + * Use this class to create, access, edit, or delete BuddyPress Nonmember Opt-outs. + * + * @since 8.0.0 + */ + class BP_Optout + { + /** + * The opt-out ID. + * + * @since 8.0.0 + * + * @var int + */ + public $id; + /** + * The hashed email address of the user that wishes to opt out of + * communications from this site. + * + * @since 8.0.0 + * + * @var string + */ + public $email_address; + /** + * The ID of the user that generated the contact that resulted in the opt-out. + * + * @since 8.0.0 + * + * @var int + */ + public $user_id; + /** + * The type of email contact that resulted in the opt-out. + * This should be one of the known BP_Email types. + * + * @since 8.0.0 + * + * @var string + */ + public $email_type; + /** + * The date the opt-out was last modified. + * + * @since 8.0.0 + * + * @var string + */ + public $date_modified; + /** Public Methods ****************************************************/ + /** + * Constructor method. + * + * @since 8.0.0 + * + * @param int $id Optional. Provide an ID to access an existing optout item. + */ + public function __construct($id = 0) + { + } + /** + * Get the opt-outs table name. + * + * @since 8.0.0 + * + * @return string + */ + public static function get_table_name() + { + } + /** + * Update or insert opt-out details into the database. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Fetch data for an existing opt-out from the database. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** Protected Static Methods ******************************************/ + /** + * Create an opt-out entry. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $data { + * Array of optout data, passed to {@link wpdb::insert()}. + * @type string $email_address The hashed email address of the user that wishes to opt out of + * communications from this site. + * @type int $user_id The ID of the user that generated the contact that resulted in the opt-out. + * @type string $email_type The type of email contact that resulted in the opt-out. + * @type string $date_modified Date the opt-out was last modified. + * } + * @param array $data_format See {@link wpdb::insert()}. + * @return int|false The number of rows inserted, or false on error. + */ + protected static function _insert($data = array(), $data_format = array()) + { + } + /** + * Update opt-outs. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::update() for further description of paramater formats. + * + * @param array $data Array of opt-out data to update, passed to + * {@link wpdb::update()}. Accepts any property of a + * BP_optout object. + * @param array $where The WHERE params as passed to wpdb::update(). + * Typically consists of array( 'ID' => $id ) to specify the ID + * of the item being updated. See {@link wpdb::update()}. + * @param array $data_format See {@link wpdb::insert()}. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _update($data = array(), $where = array(), $data_format = array(), $where_format = array()) + { + } + /** + * Delete opt-outs. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::update() for further description of paramater formats. + * + * @param array $where Array of WHERE clauses to filter by, passed to + * {@link wpdb::delete()}. Accepts any property of a + * BP_optout object. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _delete($where = array(), $where_format = array()) + { + } + /** + * Assemble the WHERE clause of a get() SQL statement. + * + * Used by BP_optout::get() to create its WHERE + * clause. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args See {@link BP_optout::get()} for more details. + * @return string WHERE clause. + */ + protected static function get_where_sql($args = array()) + { + } + /** + * Assemble the ORDER BY clause of a get() SQL statement. + * + * Used by BP_Optout::get() to create its ORDER BY + * clause. + * + * @since 8.0.0 + * + * @param array $args See {@link BP_optout::get()} for more details. + * @return string ORDER BY clause. + */ + protected static function get_order_by_sql($args = array()) + { + } + /** + * Assemble the LIMIT clause of a get() SQL statement. + * + * Used by BP_Optout::get() to create its LIMIT clause. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args See {@link BP_optout::get()} for more details. + * @return string LIMIT clause. + */ + protected static function get_paged_sql($args = array()) + { + } + /** + * Assemble query clauses, based on arguments, to pass to $wpdb methods. + * + * The insert(), update(), and delete() methods of {@link wpdb} expect + * arguments of the following forms: + * + * - associative arrays whose key/value pairs are column => value, to + * be used in WHERE, SET, or VALUES clauses + * - arrays of "formats", which tell $wpdb->prepare() which type of + * value to expect when sanitizing (eg, array( '%s', '%d' )) + * + * This utility method can be used to assemble both kinds of params, + * out of a single set of associative array arguments, such as: + * + * $args = array( + * 'user_id' => 4, + * 'email_type' => 'type_string', + * ); + * + * This will be converted to: + * + * array( + * 'data' => array( + * 'user_id' => 4, + * 'email_type' => 'type_string', + * ), + * 'format' => array( + * '%d', + * '%s', + * ), + * ) + * + * which can easily be passed as arguments to the $wpdb methods. + * + * @since 8.0.0 + * + * @param array $args Associative array of filter arguments. + * See {@BP_optout::get()} for a breakdown. + * @return array Associative array of 'data' and 'format' args. + */ + protected static function get_query_clauses($args = array()) + { + } + /** Public Static Methods *********************************************/ + /** + * Get opt-outs, based on provided filter parameters. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Associative array of arguments. All arguments but $page and + * $per_page can be treated as filter values for get_where_sql() + * and get_query_clauses(). All items are optional. + * @type int|array $id ID of opt-out. + * Can be an array of IDs. + * @type string|array $email_address Email address of users who have opted out + * being queried. Can be an array of addresses. + * @type int|array $user_id ID of user whose communication prompted the + * opt-out. Can be an array of IDs. + * @type string|array $email_type Name of the emil type to filter by. + * Can be an array of email types. + * @type string $search_terms Term to match against email_address field. + * @type string $order_by Database column to order by. + * @type string $sort_order Either 'ASC' or 'DESC'. + * @type int $page Number of the current page of results. + * Default: false (no pagination, + * all items). + * @type int $per_page Number of items to show per page. + * Default: false (no pagination, + * all items). + * @type string $fields Which fields to return. Specify 'email_addresses' to + * fetch a list of opt-out email_addresses. + * Specify 'user_ids' to + * fetch a list of opt-out user_ids. + * Specify 'ids' to fetch a list of opt-out IDs. + * Default: 'all' (return BP_Optout objects). + * } + * + * @return array BP_Optout objects | IDs of found opt-outs | Email addresses of matches. + */ + public static function get($args = array()) + { + } + /** + * Get a count of total optouts matching a set of arguments. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see BP_optout::get() for a description of + * arguments. + * + * @param array $args See {@link BP_optout::get()}. + * @return int Count of located items. + */ + public static function get_total_count($args) + { + } + /** + * Update optouts. + * + * @since 8.0.0 + * + * @see BP_optout::get() for a description of + * accepted update/where arguments. + * + * @param array $update_args Associative array of fields to update, + * and the values to update them to. Of the format + * array( 'user_id' => 4, 'email_address' => 'bar@foo.com', ). + * @param array $where_args Associative array of columns/values, to + * determine which rows should be updated. Of the format + * array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ). + * @return int|bool Number of rows updated on success, false on failure. + */ + public static function update($update_args = array(), $where_args = array()) + { + } + /** + * Delete opt-outs. + * + * @since 8.0.0 + * + * @see BP_optout::get() for a description of + * accepted where arguments. + * + * @param array $args Associative array of columns/values, to determine + * which rows should be deleted. Of the format + * array( 'user_id' => 7, 'email_address' => 'bar@foo.com', ). + * @return int|bool Number of rows deleted on success, false on failure. + */ + public static function delete($args = array()) + { + } + /** Convenience methods ***********************************************/ + /** + * Check whether an invitation exists matching the passed arguments. + * + * @since 5.0.0 + * + * @see BP_Optout::get() for a description of accepted parameters. + * + * @param array $args Arguments to pass to BP_optout::get(). + * @return int|bool ID of first found invitation or false if none found. + */ + public function optout_exists($args = array()) + { + } + /** + * Delete a single opt-out by ID. + * + * @since 8.0.0 + * + * @see BP_optout::delete() for explanation of + * return value. + * + * @param int $id ID of the opt-out item to be deleted. + * @return bool|int Number of rows deleted on success, false on failure. + */ + public static function delete_by_id($id) + { + } + } + /** + * BP_Email_Recipient class. + * + * @since 2.5.0 + */ + class BP_Email_Recipient extends \BP_Email_Participant + { + /** + * Optional. A `WP_User` object relating to this recipient. + * + * @since 2.5.0 + * + * @var WP_User|null + */ + protected $user_object = \null; + /** + * Constructor. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_or_user Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $email_or_user is a string, this is the + * recipient's name. + */ + public function __construct($email_or_user, $name = '') + { + } + /** + * Get recipient's address. + * + * @since 2.5.0 + * + * @return string + */ + public function get_address() + { + } + /** + * Get recipient's name. + * + * @since 2.5.0 + * + * @return string + */ + public function get_name() + { + } + /** + * Get WP_User object for this recipient. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'search-email'. + * @return WP_User|null WP_User object, or null if not set. + */ + public function get_user($transform = 'raw') + { + } + } + /** + * BP_Email_Sender class. + */ + class BP_Email_Sender extends \BP_Email_Participant + { + } + /** + * BuddyPress Login Widget. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + class BP_Core_Login_Widget + { + /** + * Constructor method. + * + * @since 1.9.0 + * @since 9.0.0 Adds the `show_instance_in_rest` property to Widget options. + * @deprecated 12.0.0 + */ + public function __construct() + { + } + /** + * Display the login widget. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @see WP_Widget::widget() for description of parameters. + * + * @param array $args Widget arguments. + * @param array $instance Widget settings, as saved by the user. + */ + public function widget($args, $instance) + { + } + /** + * Update the login widget options. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @param array $new_instance The new instance options. + * @param array $old_instance The old instance options. + */ + public function update($new_instance, $old_instance) + { + } + /** + * Output the login widget options form. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @param array $instance Settings for this widget. + */ + public function form($instance = array()) + { + } + } + /** + * Extracts media from text. Use {@link extract()}. + * + * @since 2.3.0 + * + * The supported types are links, mentions, images, shortcodes, embeds, audio, video, and "all". + * This is what each type extracts: + * + * Links: <a href="http://example.com"> + * Mentions: @name + * If the Activity component is enabled, we use it to parse out any at-names. A consequence + * to note is that the "name" mentioned must match a real user account. If it's a made-up + * at-name, then it isn't extracted. + * If the Activity component is disabled, any at-name is extracted (both those matching + * real accounts, and those made-up). + * Images: <img src="image.gif">, [gallery], [gallery ids="2,3"], featured images (Post thumbnails). + * If an extracted image is in the Media Library, then its resolution will be included. + * Shortcodes: Extract information about any (registered) shortcodes. + * This includes any shortcodes indirectly covered by any of the other media extraction types. + * For example, [gallery]. + * Embeds: Extract any URL matching a registered oEmbed handler. + * Audio: <a href="*.mp3"">, [audio] + * See wp_get_audio_extensions() for supported audio formats. + * Video: [video] + * See wp_get_video_extensions() for supported video formats. + * + * @see BP_Media_Extractor::extract() Use this to extract media. + */ + class BP_Media_Extractor + { + /** + * Media type. + * + * @since 2.3.0 + * @var int + */ + const ALL = 255; + const LINKS = 1; + const MENTIONS = 2; + const IMAGES = 4; + const SHORTCODES = 8; + const EMBEDS = 16; + const AUDIO = 32; + const VIDEOS = 64; + /** + * Extract media from text. + * + * @since 2.3.0 + * + * @param string|WP_Post $richtext Content to parse. + * @param int $what_to_extract Media type to extract (optional). + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $audio + * @type int $embeds + * @type int $images + * @type int $links + * @type int $mentions + * @type int $shortcodes + * @type int $video + * } + * @type array $audio Extracted audio. { + * Array of extracted media. + * + * @type string $source Media source. Either "html" or "shortcodes". + * @type string $url Link to audio. + * } + * @type array $embeds Extracted oEmbeds. { + * Array of extracted media. + * + * @type string $url oEmbed link. + * } + * @type array $images Extracted images. { + * Array of extracted media. + * + * @type int $gallery_id Gallery ID. Optional, not always set. + * @type int $height Width of image. If unknown, set to 0. + * @type string $source Media source. Either "html" or "galleries". + * @type string $url Link to image. + * @type int $width Width of image. If unknown, set to 0. + * } + * @type array $links Extracted URLs. { + * Array of extracted media. + * + * @type string $url Link. + * } + * @type array $mentions Extracted mentions. { + * Array of extracted media. + * + * @type string $name @mention. + * @type string $user_id User ID. Optional, only set if Activity component enabled. + * } + * @type array $shortcodes Extracted shortcodes. { + * Array of extracted media. + * + * @type array $attributes Key/value pairs of the shortcodes attributes (if any). + * @type string $content Text wrapped by the shortcode. + * @type string $type Shortcode type. + * @type string $original The entire shortcode. + * } + * @type array $videos Extracted video. { + * Array of extracted media. + * + * @type string $source Media source. Currently only "shortcodes". + * @type string $url Link to audio. + * } + * } + */ + public function extract($richtext, $what_to_extract = self::ALL, $extra_args = array()) + { + } + /** + * Content type specific extraction methods. + * + * You shouldn't need to use these directly; just use {@link BP_Media_Extractor::extract()}. + */ + /** + * Extract `<a href>` tags from text. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $links + * } + * @type array $links Extracted URLs. { + * Array of extracted media. + * + * @type string $url Link. + * } + * } + */ + protected function extract_links($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract @mentions tags from text. + * + * If the Activity component is enabled, it is used to parse @mentions. + * The mentioned "name" must match a user account, otherwise it is discarded. + * + * If the Activity component is disabled, any @mentions are extracted. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor. + * @return array { + * @type array $has Extracted media counts. { + * @type int $mentions + * } + * @type array $mentions Extracted mentions. { + * Array of extracted media. + * + * @type string $name @mention. + * @type string $user_id User ID. Optional, only set if Activity component enabled. + * } + * } + */ + protected function extract_mentions($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract images from `<img src>` tags, [galleries], and featured images from a Post. + * + * If an image is in the Media Library, then its resolution is included in the results. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $images + * } + * @type array $images Extracted images. { + * Array of extracted media. + * + * @type int $gallery_id Gallery ID. Optional, not always set. + * @type int $height Width of image. If unknown, set to 0. + * @type string $source Media source. Either "html" or "galleries". + * @type string $url Link to image. + * @type int $width Width of image. If unknown, set to 0. + * } + * } + */ + protected function extract_images($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract shortcodes from text. + * + * This includes any shortcodes indirectly used by other media extraction types. + * For example, [gallery] and [audio]. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $shortcodes + * } + * @type array $shortcodes Extracted shortcodes. { + * Array of extracted media. + * + * @type array $attributes Key/value pairs of the shortcodes attributes (if any). + * @type string $content Text wrapped by the shortcode. + * @type string $type Shortcode type. + * @type string $original The entire shortcode. + * } + * } + */ + protected function extract_shortcodes($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract any URL, matching a registered oEmbed endpoint, from text. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $embeds + * } + * @type array $embeds Extracted oEmbeds. { + * Array of extracted media. + * + * @type string $url oEmbed link. + * } + * } + */ + protected function extract_embeds($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract [audio] shortcodes and `<a href="*.mp3">` tags, from text. + * + * @since 2.3.0 + * + * @see wp_get_audio_extensions() for supported audio formats. + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $audio + * } + * @type array $audio Extracted audio. { + * Array of extracted media. + * + * @type string $original The entire shortcode. + * @type string $source Media source. Either "html" or "shortcodes". + * @type string $url Link to audio. + * } + * } + */ + protected function extract_audio($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract [video] shortcodes from text. + * + * @since 2.3.0 + * + * @see wp_get_video_extensions() for supported video formats. + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array { + * @type array $has Extracted media counts. { + * @type int $video + * } + * @type array $videos Extracted video. { + * Array of extracted media. + * + * @type string $source Media source. Currently only "shortcodes". + * @type string $url Link to audio. + * } + * } + */ + protected function extract_video($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Helpers and utility methods. + */ + /** + * Extract images in [galleries] shortcodes from text. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Bespoke data for a particular extractor (optional). + * @return array + */ + protected function extract_images_from_galleries($richtext, $plaintext, $extra_args = array()) + { + } + /** + * Extract the featured image from a Post. + * + * @since 2.3.0 + * + * @param string $richtext Content to parse. + * @param string $plaintext Sanitized version of the content. + * @param array $extra_args Contains data that an implementation might need beyond the defaults. + * @return array + */ + protected function extract_images_from_featured_images($richtext, $plaintext, $extra_args) + { + } + /** + * Sanitize and format raw content to prepare for content extraction. + * + * HTML tags and shortcodes are removed, and HTML entities are decoded. + * + * @since 2.3.0 + * + * @param string $richtext Content to sanitize. + * @return string + */ + protected function strip_markup($richtext) + { + } + } + /** + * Components endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Components_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve components. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to list components. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Activate/Deactivate a component. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a component. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Prepares component data for return as an object. + * + * @since 5.0.0 + * + * @param array $component The component and its values. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($component, $request) + { + } + /** + * Verify Component Status. + * + * @since 5.0.0 + * @since 9.0.0 Adds the `$return_type` parameter. + * + * @param string $name Component name. + * @param string $return_type Use `string` to get the l10n string. Default. + * Use `bool` to get whether the component is active or not. + * Use `array` to get both information. + * @return string|bool|array By default a l10n string is returned. + * True if the component is active, false otherwise when 'bool' is requested. + * An array containing both information when 'array' is requested. + */ + protected function verify_component_status($name, $return_type = 'string') + { + } + /** + * Deactivate component helper. + * + * @since 5.0.0 + * + * @param string $component Component id. + * @return array + */ + protected function deactivate_helper($component) + { + } + /** + * Activate component helper. + * + * @since 5.0.0 + * + * @param string $component Component id. + * @return array + */ + protected function activate_helper($component) + { + } + /** + * Get component info helper. + * + * @since 5.0.0 + * @since 9.0.0 Adds a `features` property to component's info. + * + * @param string $component Component id. + * @return array + */ + public function get_component_info($component) + { + } + /** + * Does the component exist? + * + * @since 5.0.0 + * + * @param string $component Component. + * @return bool + */ + protected function component_exists($component) + { + } + /** + * Get the components schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * BP_Core_Notification is deprecated. + * + * Use BP_Notifications_Notification instead. + * + * @deprecated since 1.9.0 + */ + class BP_Core_Notification + { + /** + * The notification id. + * + * @var int + */ + public $id = 0; + /** + * The ID to which the notification relates to within the component. + * + * @var int + */ + public $item_id = 0; + /** + * The secondary ID to which the notification relates to within the component. + * + * @var int + */ + public $secondary_item_id = \null; + /** + * The user ID for who the notification is for. + * + * @var int + */ + public $user_id = 0; + /** + * The name of the component that the notification is for. + * + * @var string + */ + public $component_name = ''; + /** + * The action within the component which the notification is related to. + * + * @var string + */ + public $component_action = ''; + /** + * The date the notification was created. + * + * @var string + */ + public $date_notified = ''; + /** + * Is the notification new or has it already been read. + * + * @var boolean + */ + public $is_new = \false; + /** Public Methods ********************************************************/ + /** + * Constructor + * + * @param int $id ID for the notification. + */ + public function __construct($id = 0) + { + } + /** + * Update or insert notification details into the database. + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** Private Methods *******************************************************/ + /** + * Fetches the notification data from the database. + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** Static Methods ********************************************************/ + /** + * Check the access for a user. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID to check access for. + * @param int $notification_id Notification ID to check for. + * @return string + */ + public static function check_access($user_id = 0, $notification_id = 0) + { + } + /** + * Fetches all the notifications in the database for a specific user. + * + * @global wpdb $wpdb WordPress database object + * + * @param int $user_id User ID. + * @param string $status 'is_new' or 'all'. + * @return array Associative array + */ + public static function get_all_for_user($user_id, $status = 'is_new') + { + } + /** + * Delete all the notifications for a user based on the component name and action. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user to delet notification for. + * @param string $component_name Component name. + * @param string $component_action Component action. + * @return mixed + */ + public static function delete_for_user_by_type($user_id, $component_name, $component_action) + { + } + /** + * Delete all the notifications that have a specific item id, component name and action. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the user who the notifications are for. + * @param int $item_id The item ID of the notifications we wish to delete. + * @param string $component_name The name of the component that the notifications we wish to delete. + * @param string $component_action The action of the component that the notifications we wish to delete. + * @param int $secondary_item_id (optional) The secondary item id of the notifications that we wish to + * use to delete. + * @return mixed + */ + public static function delete_for_user_by_item_id($user_id, $item_id, $component_name, $component_action, $secondary_item_id = 0) + { + } + /** + * Deletes all the notifications sent by a specific user, by component and action. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the user whose sent notifications we wish to delete. + * @param string $component_name The name of the component the notification was sent from. + * @param string $component_action The action of the component the notification was sent from. + * @return mixed + */ + public static function delete_from_user_by_type($user_id, $component_name, $component_action) + { + } + /** + * Deletes all the notifications for all users by item id, and optional secondary item id, + * and component name and action. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $item_id The item id that they notifications are to be for. + * @param string $component_name The component that the notifications are to be from. + * @param string $component_action The action that the notifications are to be from. + * @param int $secondary_item_id Optional secondary item id that the notifications are to have. + * @return mixed + */ + public static function delete_all_by_type($item_id, $component_name, $component_action = '', $secondary_item_id = 0) + { + } + } + /** + * BP_Email class. + * + * @since 2.5.0 + */ + class BP_Email + { + /** + * Addressee details (BCC). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] BCC recipients. + */ + protected $bcc = array(); + /** + * Addressee details (CC). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] CC recipients. + */ + protected $cc = array(); + /** + * Email content (HTML). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_html = ''; + /** + * Email content (plain text). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_plaintext = ''; + /** + * The content type to send the email in ("html" or "plaintext"). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_type = 'html'; + /** + * Sender details. + * + * @since 2.5.0 + * + * @var BP_Email_Sender + */ + protected $from = \null; + /** + * Email preheader. + * + * @since 4.0.0 + * + * @var string + */ + protected $preheader = \null; + /** + * Email headers. + * + * Associative pairing of email header name/value. + * + * @since 2.5.0 + * + * @var string[] + */ + protected $headers = array(); + /** + * The Post object (the source of the email's content and subject). + * + * @since 2.5.0 + * + * @var WP_Post|null + */ + protected $post_object = \null; + /** + * Reply To details. + * + * @since 2.5.0 + * + * @var BP_Email_Sender|null + */ + protected $reply_to = \null; + /** + * Email subject. + * + * @since 2.5.0 + * + * @var string + */ + protected $subject = ''; + /** + * Email template (the HTML wrapper around the email content). + * + * @since 2.5.0 + * + * @var string + */ + protected $template = '{{{content}}}'; + /** + * Addressee details (to). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] Email recipients. + * } + */ + protected $to = array(); + /** + * Unique identifier for this particular type of email. + * + * @since 2.5.0 + * + * @var string + */ + protected $type = ''; + /** + * Token names and replacement values for this email. + * + * Associative pairing of token name (key) and replacement value (value). + * + * @since 2.5.0 + * + * @var string[] + */ + protected $tokens = array(); + /** + * Constructor. + * + * Set the email type and default "from" and "reply to" name and address. + * + * @since 2.5.0 + * + * @param string $email_type Unique identifier for a particular type of email. + */ + public function __construct($email_type) + { + } + /* + * Setters/getters. + */ + /** + * Getter function to expose object properties. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $property_name Property to access. + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return mixed Returns null if property does not exist, otherwise the value. + */ + public function get($property_name, $transform = 'raw') + { + } + /** + * Get email preheader. + * + * @since 4.0.0 + * + * @return string + */ + public function get_preheader() + { + } + /** + * Get email headers. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string[] Associative pairing of email header name/value. + */ + public function get_headers($transform = 'raw') + { + } + /** + * Get the email's "bcc" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[] BCC recipients. + */ + public function get_bcc($transform = 'raw') + { + } + /** + * Get the email's "cc" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[] CC recipients. + */ + public function get_cc($transform = 'raw') + { + } + /** + * Get the email content. + * + * HTML or plaintext is returned, depending on the email's $content_type. + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string HTML or plaintext, depending on $content_type. + */ + public function get_content($transform = 'raw') + { + } + /** + * Get the email content (in HTML). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string HTML email content. + */ + public function get_content_html($transform = 'raw') + { + } + /** + * Get the email content (in plaintext). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Plain text email content. + */ + public function get_content_plaintext($transform = 'raw') + { + } + /** + * Get the email content type (HTML or plain text) that the email will be sent in. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Email content type ("html" or "plaintext"). + */ + public function get_content_type($transform = 'raw') + { + } + /** + * Get the email's "from" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Sender "From" recipient. + */ + public function get_from($transform = 'raw') + { + } + /** + * Get the Post associated with the email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. Defaults to 'raw'. + * @return WP_Post|null WP_Post object, or null if not set. + */ + public function get_post_object($transform = 'raw') + { + } + /** + * Get the email's "reply to" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient|null "Reply to" recipient, or null if not set. + */ + public function get_reply_to($transform = 'raw') + { + } + /** + * Get the email subject. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string|null Email subject, or null if not set. + */ + public function get_subject($transform = 'raw') + { + } + /** + * Get the email template (the HTML wrapper around the email content). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string|null Email template. Assumed to be HTML. Or null if not set. + */ + public function get_template($transform = 'raw') + { + } + /** + * Get the email's "to" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[]|null "To" recipients. Or null if not set. + */ + public function get_to($transform = 'raw') + { + } + /** + * Get token names and replacement values for this email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string[]|null Associative pairing of token name (key) and replacement value (value). + * Or null if not set. + */ + public function get_tokens($transform = 'raw') + { + } + /** + * Set email headers. + * + * Does NOT let you override to/from, etc. Use the methods provided to set those. + * + * @since 2.5.0 + * + * @param string[] $headers Key/value pairs of header name/values (strings). + * @return BP_Email + */ + public function set_headers(array $headers) + { + } + /** + * Set the email's "bcc" address and name. + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $bcc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $bcc_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_bcc($bcc_address, $name = '', $operation = 'replace') + { + } + /** + * Set the email's "cc" address and name. + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $cc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $cc_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_cc($cc_address, $name = '', $operation = 'replace') + { + } + /** + * Set the email content (HTML). + * + * @since 2.5.0 + * + * @param string $content HTML email content. + * @return BP_Email + */ + public function set_content_html($content) + { + } + /** + * Set the email content (plain text). + * + * @since 2.5.0 + * + * @param string $content Plain text email content. + * @return BP_Email + */ + public function set_content_plaintext($content) + { + } + /** + * Set the content type (HTML or plain text) to send the email in. + * + * @since 2.5.0 + * + * @param string $content_type Email content type ("html" or "plaintext"). + * @return BP_Email + */ + public function set_content_type($content_type) + { + } + /** + * Set the email's "from" address and name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_address Either a email address, user ID, or WP_User object. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @return BP_Email + */ + public function set_from($email_address, $name = '') + { + } + /** + * Set the Post object containing the email content template. + * + * Also sets the email's subject, content, and template from the Post, for convenience. + * + * @since 2.5.0 + * + * @param WP_Post $post Post object. + * @return BP_Email + */ + public function set_post_object(\WP_Post $post) + { + } + /** + * Set the email's "reply to" address and name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @return BP_Email + */ + public function set_reply_to($email_address, $name = '') + { + } + /** + * Set the email subject. + * + * @since 2.5.0 + * + * @param string $subject Email subject. + * @return BP_Email + */ + public function set_subject($subject) + { + } + /** + * Set the email template (the HTML wrapper around the email content). + * + * This needs to include the string "{{{content}}}" to have the post content added + * when the email template is rendered. + * + * @since 2.5.0 + * + * @param string $template Email template. Assumed to be HTML. + * @return BP_Email + */ + public function set_template($template) + { + } + /** + * Set the email's "to" address and name. + * + * IMPORTANT NOTE: the assumption with all emails sent by (and belonging to) BuddyPress itself + * is that there will only be a single `$to_address`. This is to simplify token and templating + * logic (for example, if multiple recipients, the "unsubscribe" link in the emails will all + * only link to the first recipient). + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $to_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $to_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_to($to_address, $name = '', $operation = 'replace') + { + } + /** + * Set token names and replacement values for this email. + * + * In templates, tokens are inserted with a Handlebars-like syntax, e.g. `{{token_name}}`. + * { and } are reserved characters. There's no need to specify these brackets in your token names. + * + * @since 2.5.0 + * + * @param string[] $tokens Associative array, contains key/value pairs of token name/value. + * Values are a string or a callable function. + * @return BP_Email + */ + public function set_tokens(array $tokens) + { + } + /* + * Sanitisation and validation logic. + */ + /** + * Check that we'd be able to send this email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @return bool|WP_Error Returns true if validation succesful, else a descriptive WP_Error. + */ + public function validate() + { + } + } + /** + * Load BuddyPress Types admin area. + * + * @since 7.O.0 + */ + class BP_Admin_Types + { + /** + * Current BuddyPress taxonomy. + * + * @since 7.0.0 + * @var string + */ + public $taxonomy = ''; + /** + * All registered BuddyPress taxonomies. + * + * @since 7.0.0 + * @var array + */ + public $taxonomies = array(); + /** + * Current screen ID. + * + * @since 7.0.0 + * @var string + */ + public $screen_id = ''; + /** + * The main BuddyPress Types admin loader. + * + * @since 7.0.0 + */ + public function __construct() + { + } + /** + * Register BP Types Admin. + * + * @since 7.0.0 + * + * @return BP_Admin_Types|null The BP Types Admin object or null if not in admin. + */ + public static function register_types_admin() + { + } + /** + * Set the globals. + * + * @since 7.0.0 + */ + private function setup_globals() + { + } + /** + * Include Admin functions. + * + * @since 7.0.0 + */ + private function includes() + { + } + /** + * Set hooks. + * + * @since 7.0.0 + */ + private function setup_hooks() + { + } + /** + * Handle BP Type actions. + * + * @since 7.0.0 + * + * @param string $action Required. The action to handle ('add-tag', 'editedtag' or 'delete' ). + */ + private function handle_action($action) + { + } + /** + * Override the Admin parent file to highlight the right menu. + * + * @since 7.0.0 + * + * @global string $parent_file The parent file of the current admin screen. + */ + public function screen_head() + { + } + /** + * Registers script. + * + * @since 7.0.0 + * + * @param array $scripts The registered scripts. + */ + public function register_scripts($scripts = array()) + { + } + /** + * Enqueues script. + * + * @since 7.0.0 + */ + public function screen_scripts() + { + } + /** + * Outputs the BP type add form. + * + * @since 7.0.0 + * + * @param string $taxonomy The type taxonomy name. + * @param null|object $type The type object, `null` if not passed to the method. + */ + public function add_form_fields($taxonomy = '', $type = \null) + { + } + /** + * Outputs the BP type edit form. + * + * @since 7.0.0 + * + * @param WP_Term|null $term The term object for the BP Type. + * @param string $taxonomy The type taxonomy name. + */ + public function edit_form_fields($term = \null, $taxonomy = '') + { + } + /** + * Filters the terms list table column headers to customize them for BuddyPress Types. + * + * @since 7.0.0 + * + * @param array $column_headers The column header labels keyed by column ID. + * @return arrayThe column header labels keyed by column ID. + */ + public function column_headers($column_headers = array()) + { + } + /** + * Sets the content for the Plural name & Counts columns. + * + * @since 7.0.0 + * + * @param string $column_content The column content. + * @param string $column_name Name of the column. + * @param int $type_id The type's term ID. + * @return string|null|int + */ + public function column_contents($column_content = '', $column_name = '', $type_id = 0) + { + } + /** + * Customizes the Types Admin list table row actions. + * + * @since 7.0.0 + * + * @param array $actions The table row actions. + * @param WP_Term|null $type The current BP Type for the row. + * @return array The table row actions for the current BP type. + */ + public function row_actions($actions = array(), $type = \null) + { + } + } + /** + * BP_PHPMailer class. + * + * @since 2.5.0 + */ + class BP_PHPMailer implements \BP_Email_Delivery + { + /** + * Send email(s). + * + * @since 2.5.0 + * + * @param BP_Email $email Email to send. + * @return bool|WP_Error Returns true if email send, else a descriptive WP_Error. + */ + public function bp_email(\BP_Email $email) + { + } + /** + * Get an appropriate hostname for the email. Varies depending on site configuration. + * + * @since 2.5.0 + * + * @deprecated 2.5.3 No longer used. + * + * @return string + */ + public static function get_hostname() + { + } + } + /** + * Core component classes. + * + * @package BuddyPress + * @subpackage Core + * @since 2.7.0 + */ + /** + * Generate markup for an HTML element. + * + * @since 2.7.0 + */ + class BP_Core_HTML_Element + { + /** + * Open tag for an element. + * + * This would include attributes if applicable. eg. '<a href="" class="">' + * + * @since 2.7.0 + * + * @var string + */ + public $open_tag = ''; + /** + * Inner HTML for an element. + * + * For example, this could be anchor text within an <a> element. + * + * @since 2.7.0 + * + * @var string + */ + public $inner_html = ''; + /** + * Closing tag for an element. + * + * For example, "</a>". + * + * @since 2.7.0 + * + * @var string + */ + public $close_tag = ''; + /** + * Constructor. + * + * @since 2.7.0 + * + * @param array $r { + * An array of arguments. + * @type string $element The element to render. eg. 'a' for the anchor element. + * @type array $attr Optional. The element's attributes set as key/value pairs. eg. + * array( 'href' => 'http://example.com', 'class' => 'my-class' ) + * @type string $inner_html Optional. The inner HTML for the element if applicable. Please note that + * this isn't sanitized, so you should use your own sanitization routine + * before using this parameter. + * } + */ + public function __construct($r = array()) + { + } + /** + * Returns a property from this class. + * + * @since 2.7.0 + * + * @param string $prop Property name. Either 'open_tag', 'inner_html', 'close_tag'. + * @return string + */ + public function get($prop = '') + { + } + /** + * Returns full contents of HTML element. + * + * @since 2.7.0 + * + * @return string + */ + public function contents() + { + } + } + /** + * Walker class to output an unordered list of category checkbox input elements. + * + * A modification of WordPress 4.4.1's Walker_Category_Checklist class which prints term description + * instead of term name, and makes it work for non-hierarchical taxonomys. Some lines have undergone + * slight adjustment to meet modern coding standards, but any improvements should be contributed upstream. + * + * @since 2.5.0 + */ + class BP_Walker_Category_Checklist extends \Walker + { + /** + * Tree type. + * + * @since 2.5.0 + * + * @var string + */ + public $tree_type = 'category'; + /** + * DB Fields. + * + * @since 2.5.0 + * + * @var array + */ + public $db_fields = array('parent' => 'parent', 'id' => 'term_id'); + /** + * Starts the list before the elements are added. + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. + */ + public function start_lvl(&$output, $depth = 0, $args = array()) + { + } + /** + * Ends the list of after the elements are added. + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. + */ + public function end_lvl(&$output, $depth = 0, $args = array()) + { + } + /** + * Start the element output. + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. + * @param int $id ID of the current term. + */ + public function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0) + { + } + /** + * Ends the element output, if needed. + * + * @see Walker::end_el() + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. + */ + public function end_el(&$output, $category, $depth = 0, $args = array()) + { + } + } + /** + * Fetch data about a BuddyPress user. + * + * BP_Core_User class can be used by any component. It will fetch useful + * details for any user when provided with a user_id. + * + * Example: + * $user = new BP_Core_User( $user_id ); + * $user_avatar = $user->avatar; + * $user_email = $user->email; + * $user_status = $user->status; + * etc. + */ + class BP_Core_User + { + /** + * ID of the user which the object relates to. + * + * @var integer + */ + public $id; + /** + * The URL to the full size of the avatar for the user. + * + * @var string + */ + public $avatar; + /** + * The URL to the thumb size of the avatar for the user. + * + * @var string + */ + public $avatar_thumb; + /** + * The URL to the mini size of the avatar for the user. + * + * @var string + */ + public $avatar_mini; + /** + * The full name of the user. + * + * @var string + */ + public $fullname; + /** + * The email for the user. + * + * @var string + */ + public $email; + /** + * The absolute url for the user's profile. + * + * @var string + */ + public $user_url; + /** + * The HTML for the user link, with the link text being the user's full name. + * + * @var string + */ + public $user_link; + /** + * Contains a formatted string when the last time the user was active. + * + * Example: "active 2 hours and 50 minutes ago" + * + * @var string + */ + public $last_active; + /* Extras */ + /** + * The total number of "Friends" the user has on site. + * + * @var integer + */ + public $total_friends; + /** + * The total number of blog posts posted by the user. + * + * @var integer + * @deprecated No longer used + */ + public $total_blogs; + /** + * The total number of groups the user is a part of. + * + * Example: "1 group", "2 groups" + * + * @var string + */ + public $total_groups; + /** + * Profile information for the specific user. + * + * @since 1.2.0 + * @var array + */ + public $profile_data; + /** Public Methods *******************************************************/ + /** + * Class constructor. + * + * @param integer $user_id The ID for the user being queried. + * @param bool $populate_extras Optional. Whether to fetch extra information such as + * group/friendship counts or not. Default: false. + */ + public function __construct($user_id, $populate_extras = \false) + { + } + /** + * Populate the instantiated class with data based on the User ID provided. + */ + public function populate() + { + } + /** + * Populates extra fields such as group and friendship counts. + */ + public function populate_extras() + { + } + /** + * Fetch xprofile data for the current user. + * + * @see BP_XProfile_ProfileData::get_all_for_user() for description of + * return value. + * + * @return array See {@link BP_XProfile_Profile_Data::get_all_for_user()}. + */ + public function get_profile_data() + { + } + /** Static Methods ********************************************************/ + /** + * Get a list of users that match the query parameters. + * + * Since BuddyPress 1.7, use {@link BP_User_Query} instead. + * + * @deprecated 1.7.0 Use {@link BP_User_Query}. + * + * @global wpdb $wpdb WordPress database object. + * + * @see BP_User_Query for a description of parameters, most of which + * are used there in the same way. + * + * @param string $type See {@link BP_User_Query}. + * @param int $limit See {@link BP_User_Query}. Default: 0. + * @param int $page See {@link BP_User_Query}. Default: 1. + * @param int $user_id See {@link BP_User_Query}. Default: 0. + * @param mixed $include See {@link BP_User_Query}. Default: false. + * @param string|bool $search_terms See {@link BP_User_Query}. + * Default: false. + * @param bool $populate_extras See {@link BP_User_Query}. + * Default: true. + * @param mixed $exclude See {@link BP_User_Query}. Default: false. + * @param string|bool $meta_key See {@link BP_User_Query}. + * Default: false. + * @param string|bool $meta_value See {@link BP_User_Query}. + * Default: false. + * @return false|array { + * @type int $total_users Total number of users matched by query + * params. + * @type array $paged_users The current page of users matched by + * query params. + * } + */ + public static function get_users($type, $limit = 0, $page = 1, $user_id = 0, $include = \false, $search_terms = \false, $populate_extras = \true, $exclude = \false, $meta_key = \false, $meta_value = \false) + { + } + /** + * Fetch the details for all users whose usernames start with the given letter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $letter The letter the users names are to start with. + * @param int|null $limit The number of users we wish to retrive. + * @param int $page The page number we are currently on, used in conjunction + * with $limit to get the start position for the limit. + * @param bool $populate_extras If we should populate extra user fields. + * @param string $exclude Comma-separated IDs of users whose results + * aren't to be fetched. + * @return false|array False on error, otherwise associative array of results. + */ + public static function get_users_by_letter($letter, $limit = \null, $page = 1, $populate_extras = \true, $exclude = '') + { + } + /** + * Get details of specific users from the database. + * + * Use {@link BP_User_Query} with the 'user_ids' param instead. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $user_ids The user IDs of the users who we wish to + * fetch information on. + * @param int|null $limit The limit of results we want. + * @param int $page The page we are on for pagination. + * @param bool $populate_extras If we should populate extra user fields. + * @return array Associative array. + */ + public static function get_specific_users($user_ids, $limit = \null, $page = 1, $populate_extras = \true) + { + } + /** + * Find users who match on the value of an xprofile data. + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $search_terms The terms to search the profile table + * value column for. + * @param int|null $limit The limit of results we want. + * @param int $page The page we are on for pagination. + * @param boolean $populate_extras If we should populate extra user fields. + * @return array Associative array. + */ + public static function search_users($search_terms, $limit = \null, $page = 1, $populate_extras = \true) + { + } + /** + * Fetch extra user information, such as friend count and last profile update message. + * + * Accepts multiple user IDs to fetch data for. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $paged_users An array of stdClass containing the users. + * @param string $user_ids The user ids to select information about. + * @param string|bool $type The type of fields we wish to get. + * @return mixed False on error, otherwise associative array of results. + */ + public static function get_user_extras(&$paged_users, &$user_ids, $type = \false) + { + } + /** + * Get WordPress user details for a specified user. + * + * @since 3.0.0 Results might be from cache + * + * @param int $user_id User ID. + * @return false|object User object if successful, false on failure. + */ + public static function get_core_userdata($user_id) + { + } + /** + * Get last activity data for a user or set of users. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int|array $user_id User IDs or multiple user IDs. + * @return false|array + */ + public static function get_last_activity($user_id) + { + } + /** + * Set a user's last_activity value. + * + * Will create a new entry if it does not exist. Otherwise updates the + * existing entry. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose last_activity you are updating. + * @param string $time MySQL-formatted time string. + * @return bool + */ + public static function update_last_activity($user_id, $time) + { + } + /** + * Delete a user's last_activity value. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose activity should be deleted. + * @return bool + */ + public static function delete_last_activity($user_id) + { + } + } + /** + * API to create BuddyPress buttons. + * + * @since 1.2.6 + * @since 2.7.0 Introduced $parent_element, $parent_attr, $button_element, $button_attr as + * $args parameters. + * Deprecated $wrapper, $wrapper_id, $wrapper_class, $link_href, $link_class, + * $link_id, $link_rel, $link_title as $args params. + * + * @param array $args { + * Array of arguments. + * + * @type string $id String describing the button type. + * @type string $component The name of the component the button belongs to. Default: 'core'. + * @type bool $must_be_logged_in Optional. Does the user need to be logged in to see this button? Default: + * true. + * @type bool $block_self Optional. True if the button should be hidden when a user is viewing his + * own profile. Default: true. + * @type string $parent_element Optional. Parent element to wrap button around. Default: 'div'. + * @type array $parent_attr Optional. Element attributes for parent element. Set whatever attributes + * like 'id', 'class' as array keys. + * @type string $button_element Optional. Button element. Default: 'a'. + * @type array $button_attr Optional. Button attributes. Set whatever attributes like 'id', 'class' as + * array keys. + * @type string $link_text Optional. Text to appear on the button. Default: ''. + * @type string|bool $wrapper Deprecated. Use $parent_element instead. + * @type string $wrapper_id Deprecated. Use $parent_attr and set 'id' as array key. + * @type string $wrapper_class Deprecated. Use $parent_attr and set 'class' as array key. + * @type string $link_href Deprecated. Use $button_attr and set 'href' as array key. + * @type string $link_class Deprecated. Use $button_attr and set 'class' as array key. + * @type string $link_id Deprecated. Use $button_attr and set 'id' as array key. + * @type string $link_rel Deprecated. Use $button_attr and set 'rel' as array key. + * @type string $link_title Deprecated. Use $button_attr and set 'title' as array key. + * } + */ + class BP_Button + { + /** Button properties *****************************************************/ + /** + * The button ID. + * + * @since 1.2.6 + * + * @var string + */ + public $id = ''; + /** + * The name of the component that the button belongs to. + * + * @since 1.2.6 + * + * @var string + */ + public $component = 'core'; + /** + * Does the user need to be logged in to see this button? + * + * @since 1.2.6 + * + * @var bool + */ + public $must_be_logged_in = \true; + /** + * Whether the button should be hidden when viewing your own profile. + * + * @since 1.2.6 + * + * @var bool + */ + public $block_self = \true; + /** Wrapper ***************************************************************/ + /** + * Parent element to wrap button around. + * + * @since 2.7.0 + * + * @var string Default: 'div'. + */ + public $parent_element = ''; + /** + * Element attributes for parent element. + * + * @since 2.7.0 + * + * @var array Set whatever attributes like 'id', 'class' as array key. + */ + public $parent_attr = array(); + /** Button ****************************************************************/ + /** + * Button element. + * + * @since 2.7.0 + * + * @var string Default: 'a'. + */ + public $button_element = 'a'; + /** + * Button attributes. + * + * @since 2.7.0 + * + * @var array Set whatever attributes like 'id', 'href' as array key. + */ + public $button_attr = array(); + /** + * The contents of the button link. + * + * @since 1.2.6 + * + * @var string + */ + public $link_text = ''; + /** + * HTML result. + * + * @since 1.2.6 + * + * @var string + */ + public $contents = ''; + /** Deprecated ***********************************************************/ + /** + * The type of DOM element to use for a wrapper. + * + * @since 1.2.6 + * @deprecated 2.7.0 Use $parent_element instead. + * + * @var string|bool + */ + public $wrapper = 'div'; + /** + * The DOM class of the button wrapper. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'class' key in $parent_attr instead. + * + * @var string + */ + public $wrapper_class = ''; + /** + * The DOM ID of the button wrapper. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'id' key in $parent_attr instead. + * + * @var string + */ + public $wrapper_id = ''; + /** + * The destination link of the button. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'href' key in $button_attr instead. + * + * @var string + */ + public $link_href = ''; + /** + * The DOM class of the button link. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'class' key in $button_attr instead. + * + * @var string + */ + public $link_class = ''; + /** + * The DOM ID of the button link. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'id' key in $button_attr instead. + * + * @var string + */ + public $link_id = ''; + /** + * The DOM rel value of the button link. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'rel' key in $button_attr instead. + * + * @var string + */ + public $link_rel = ''; + /** + * Title of the button link. + * + * @since 1.2.6 + * @deprecated 2.7.0 Set 'title' key in $button_attr instead. + * + * @var string + */ + public $link_title = ''; + /** Methods ***************************************************************/ + /** + * Builds the button based on class parameters. + * + * @since 1.2.6 + * + * @param array|string $args See `BP_Button`. + */ + public function __construct($args = '') + { + } + /** + * Provide backward compatibility for deprecated button arguments. + * + * @since 2.7.0. + * + * @param array $r See {@see BP_Button} class for full documentation. + * @return array + */ + protected function backward_compatibility_args($r = array()) + { + } + /** + * Return the markup for the generated button. + * + * @since 1.2.6 + * + * @return string Button markup. + */ + public function contents() + { + } + /** + * Output the markup of button. + * + * @since 1.2.6 + */ + public function display() + { + } + } + /** + * Main BuddyPress Class. + * + * Tap tap tap... Is this thing on? + * + * @since 1.6.0 + */ + class BuddyPress + { + /** Magic *****************************************************************/ + /** + * BuddyPress uses many variables, most of which can be filtered to + * customize the way that it works. To prevent unauthorized access, + * these variables are stored in a private array that is magically + * updated using PHP 5.2+ methods. This is to prevent third party + * plugins from tampering with essential information indirectly, which + * would cause issues later. + * + * @see BuddyPress::setup_globals() + * @var array + */ + private $data; + /** Not Magic *************************************************************/ + /** + * Primary BuddyPress navigation. + * + * @var BP_Core_BP_Nav_BackCompat + */ + public $bp_nav; + /** + * Options for the BuddyPress navigation. + * + * @var BP_Core_BP_Options_Nav_BackCompat + */ + public $bp_options_nav; + /** + * Unfiltered URI. + * + * The unfiltered URI broken down into chunks. + * + * @var array + */ + public $unfiltered_uri = array(); + /** + * The canonical URI stack. + * + * @see bp_redirect_canonical() + * @see bp_core_new_nav_item() + * @var array + */ + public $canonical_stack = array(); + /** + * Current action variables. + * + * @var array + */ + public $action_variables = array(); + /** + * Current member directory type. + * + * @var string + */ + public $current_member_type = ''; + /** + * BuddyPress required components (core, members). + * + * @var array + */ + public $required_components = array(); + /** + * BuddyPress loaded components. + * + * @var array + */ + public $loaded_components = array(); + /** + * BuddyPress active components. + * + * @var array + */ + public $active_components = array(); + /** + * Whether autoload is in use. + * + * @since 2.5.0 + * @var bool + */ + public $do_autoload = \true; + /** + * Activity component. + * + * @since 1.6.0 + * @var BP_Activity_Component + */ + public $activity; + /** + * Blogs component. + * + * @since 1.5.0 + * @var BP_Blogs_Component + */ + public $blogs; + /** + * Core component. + * + * @since 1.6.0 + * @var BP_Core + */ + public $core; + /** + * Forums component. + * + * @since 1.5.0 + * @var BP_Forums_Component + */ + public $forums; + /** + * Friends component. + * + * @since 1.6.0 + * @var BP_Friends_Component + */ + public $friends; + /** + * Groups component. + * + * @since 1.5.0 + * @var BP_Groups_Component + */ + public $groups; + /** + * Members component. + * + * @since 1.5.0 + * @var BP_Members_Component + */ + public $members; + /** + * Messages component. + * + * @since 1.5.0 + * @var BP_Messages_Component + */ + public $messages; + /** + * Notifications component. + * + * @since 1.9.0 + * @var BP_Notifications_Component + */ + public $notifications; + /** + * Settings component. + * + * @since 1.6.0 + * @var BP_Settings_Component + */ + public $settings; + /** + * XProfile component. + * + * @since 1.6.0 + * @var BP_XProfile_Component + */ + public $profile; + /** + * BuddyPress Ajax actions. + * + * @since 12.0.0 + * + * @var array The list of registered Ajax actions. + */ + public $ajax_actions = array(); + /** Option Overload *******************************************************/ + /** + * BuddyPress options. + * + * Overloads default options retrieved from get_option(). + * + * @var array + */ + public $options = array(); + /** Singleton *************************************************************/ + /** + * Main BuddyPress Instance. + * + * BuddyPress is great. + * Please load it only one time. + * For this, we thank you. + * + * Insures that only one instance of BuddyPress exists in memory at any + * one time. Also prevents needing to define globals all over the place. + * + * @since 1.7.0 + * + * @static object $instance + * @see buddypress() + * + * @return BuddyPress|null The one true BuddyPress. + */ + public static function instance() + { + } + /** Magic Methods *********************************************************/ + /** + * A dummy constructor to prevent BuddyPress from being loaded more than once. + * + * @since 1.7.0 + * + * @see BuddyPress::instance() + * @see buddypress() + */ + private function __construct() + { + } + /** + * A dummy magic method to prevent BuddyPress from being cloned. + * + * @since 1.7.0 + */ + public function __clone() + { + } + /** + * A dummy magic method to prevent BuddyPress from being unserialized. + * + * @since 1.7.0 + */ + public function __wakeup() + { + } + /** + * Magic method for checking the existence of a certain custom field. + * + * @since 1.7.0 + * + * @param string $key Key to check the set status for. + * + * @return bool + */ + public function __isset($key) + { + } + /** + * Magic method for getting BuddyPress variables. + * + * @since 1.7.0 + * + * @param string $key Key to return the value for. + * + * @return mixed + */ + public function __get($key) + { + } + /** + * Magic method for setting BuddyPress variables. + * + * @since 1.7.0 + * + * @param string $key Key to set a value for. + * @param mixed $value Value to set. + */ + public function __set($key, $value) + { + } + /** + * Magic method for unsetting BuddyPress variables. + * + * @since 1.7.0 + * + * @param string $key Key to unset a value for. + */ + public function __unset($key) + { + } + /** + * Magic method to prevent notices and errors from invalid method calls. + * + * @since 1.7.0 + * + * @param string $name + * @param array $args + * + * @return null + */ + public function __call($name = '', $args = array()) + { + } + /** Private Methods *******************************************************/ + /** + * Bootstrap constants. + * + * @since 1.6.0 + */ + private function constants() + { + } + /** + * Component global variables. + * + * @since 1.6.0 + */ + private function setup_globals() + { + } + /** + * Legacy BuddyPress constants. + * + * Try to avoid using these. Their values have been moved into variables + * in the instance, and have matching functions to get/set their values. + * + * @since 1.7.0 + */ + private function legacy_constants() + { + } + /** + * Include required files. + * + * @since 1.6.0 + */ + private function includes() + { + } + /** + * Autoload classes. + * + * @since 2.5.0 + * + * @param string $class Classes to be autoloaded. + * @return string Path of a class. + */ + public function autoload($class) + { + } + /** + * Set up the default hooks and actions. + * + * @since 1.6.0 + */ + private function setup_actions() + { + } + /** + * Private method to align the active and database versions. + * + * @since 1.7.0 + */ + private function versions() + { + } + /** Public Methods ********************************************************/ + /** + * Set up BuddyPress's legacy theme directory. + * + * Starting with version 1.2, and ending with version 1.8, BuddyPress + * registered a custom theme directory - bp-themes - which contained + * the bp-default theme. Since BuddyPress 1.9, bp-themes is no longer + * registered (and bp-default no longer offered) on new installations. + * Sites using bp-default (or a child theme of bp-default) will + * continue to have bp-themes registered as before. + * Since 12.0, BuddyPress is no longer including BP Default. To find it + * back, you need to install and activate the BP Classic plugin. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + public function register_theme_directory() + { + } + /** + * Register bundled theme packages. + * + * Note that since we currently have complete control over bp-themes and + * the bp-legacy folders, it's fine to hardcode these here. If at a + * later date we need to automate this, an API will need to be built. + * + * @since 1.7.0 + */ + public function register_theme_packages() + { + } + /** + * Set up the default BuddyPress theme compatibility location. + * + * @since 1.7.0 + */ + public function setup_theme() + { + } + } + /** + * Notifications endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Notifications_Endpoint extends \WP_REST_Controller + { + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve notifications. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to the notifications. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get information about a specific notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to create a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error|bool + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete a notification. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Prepares notification data to return as an object. + * + * @since 5.0.0 + * + * @param BP_Notifications_Notification $notification Notification object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($notification, $request) + { + } + /** + * Prepare a notification for create or update. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return stdClass + */ + protected function prepare_item_for_database($request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Notifications_Notification $notification Notification item. + * @return array + */ + protected function prepare_links($notification) + { + } + /** + * Can this user see the notification? + * + * @since 5.0.0 + * + * @param int $notification_id Notification ID. + * @return bool + */ + protected function can_see($notification_id = 0) + { + } + /** + * Get a notification object. + * + * @since 5.0.0 + * + * @param int|WP_REST_Request $request Full details about the request or an integer. + * @return BP_Notifications_Notification|string A notification object|Empty string. + */ + public function get_notification_object($request) + { + } + /** + * Select the item schema arguments needed for the EDITABLE method. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the notification schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for the notifications collections. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * BuddyPress Notification items. + * + * Use this class to create, access, edit, or delete BuddyPress Notifications. + * + * @since 1.9.0 + */ + #[\AllowDynamicProperties] + class BP_Notifications_Notification + { + /** + * The notification ID. + * + * @since 1.9.0 + * @var int + */ + public $id; + /** + * The ID of the item associated with the notification. + * + * @since 1.9.0 + * @var int + */ + public $item_id; + /** + * The ID of the secondary item associated with the notification. + * + * @since 1.9.0 + * @var int|null + */ + public $secondary_item_id = \null; + /** + * The ID of the user the notification is associated with. + * + * @since 1.9.0 + * @var int + */ + public $user_id; + /** + * The name of the component that the notification is for. + * + * @since 1.9.0 + * @var string + */ + public $component_name; + /** + * The component action which the notification is related to. + * + * @since 1.9.0 + * @var string + */ + public $component_action; + /** + * The date the notification was created. + * + * @since 1.9.0 + * @var string + */ + public $date_notified; + /** + * Is the notification new, or has it already been read. + * + * @since 1.9.0 + * @var bool + */ + public $is_new; + /** + * Columns in the notifications table. + * + * @since 9.1.0 + * @var array + */ + public static $columns = array('id', 'user_id', 'item_id', 'secondary_item_id', 'component_name', 'component_action', 'date_notified', 'is_new'); + /** Public Methods ********************************************************/ + /** + * Constructor method. + * + * @since 1.9.0 + * + * @param int $id Optional. Provide an ID to access an existing + * notification item. + */ + public function __construct($id = 0) + { + } + /** + * Update or insert notification details into the database. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + public function save() + { + } + /** + * Fetch data for an existing notification from the database. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** Protected Static Methods **********************************************/ + /** + * Create a notification entry. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::insert() for further description of parameter formats. + * + * @param array $data { + * Array of notification data, passed to {@link wpdb::insert()}. + * @type int $user_id ID of the associated user. + * @type int $item_id ID of the associated item. + * @type int $secondary_item_id ID of the secondary associated item. + * @type string $component_name Name of the associated component. + * @type string $component_action Name of the associated component + * action. + * @type string $date_notified Timestamp of the notification. + * @type bool $is_new True if the notification is unread, otherwise false. + * } + * @param array $data_format See {@link wpdb::insert()}. + * @return int|false The number of rows inserted, or false on error. + */ + protected static function _insert($data = array(), $data_format = array()) + { + } + /** + * Update notifications. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::update() for further description of parameter formats. + * + * @param array $data Array of notification data to update, passed to + * {@link wpdb::update()}. Accepts any property of a + * BP_Notification_Notification object. + * @param array $where The WHERE params as passed to wpdb::update(). + * Typically consists of array( 'ID' => $id ) to specify the ID + * of the item being updated. See {@link wpdb::update()}. + * @param array $data_format See {@link wpdb::insert()}. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _update($data = array(), $where = array(), $data_format = array(), $where_format = array()) + { + } + /** + * Delete notifications. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see wpdb::delete() for further description of parameter formats. + * + * @param array $where Array of WHERE clauses to filter by, passed to + * {@link wpdb::delete()}. Accepts any property of a + * BP_Notification_Notification object. + * @param array $where_format See {@link wpdb::insert()}. + * @return int|false The number of rows updated, or false on error. + */ + protected static function _delete($where = array(), $where_format = array()) + { + } + /** + * Assemble the WHERE clause of a get() SQL statement. + * + * Used by BP_Notifications_Notification::get() to create its WHERE + * clause. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args See {@link BP_Notifications_Notification::get()} + * for more details. + * @param string $select_sql SQL SELECT fragment. + * @param string $from_sql SQL FROM fragment. + * @param string $join_sql SQL JOIN fragment. + * @param string $meta_query_sql SQL meta query fragment. + * @return string WHERE clause. + */ + protected static function get_where_sql($args = array(), $select_sql = '', $from_sql = '', $join_sql = '', $meta_query_sql = '') + { + } + /** + * Assemble the ORDER BY clause of a get() SQL statement. + * + * Used by BP_Notifications_Notification::get() to create its ORDER BY + * clause. + * + * @since 1.9.0 + * + * @param array $args See {@link BP_Notifications_Notification::get()} + * for more details. + * @return string ORDER BY clause. + */ + protected static function get_order_by_sql($args = array()) + { + } + /** + * Assemble the LIMIT clause of a get() SQL statement. + * + * Used by BP_Notifications_Notification::get() to create its LIMIT clause. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args See {@link BP_Notifications_Notification::get()} + * for more details. + * @return string $retval LIMIT clause. + */ + protected static function get_paged_sql($args = array()) + { + } + /** + * Assemble query clauses, based on arguments, to pass to $wpdb methods. + * + * The insert(), update(), and delete() methods of {@link wpdb} expect + * arguments of the following forms: + * + * - associative arrays whose key/value pairs are column => value, to + * be used in WHERE, SET, or VALUES clauses. + * - arrays of "formats", which tell $wpdb->prepare() which type of + * value to expect when sanitizing (eg, array( '%s', '%d' )) + * + * This utility method can be used to assemble both kinds of params, + * out of a single set of associative array arguments, such as: + * + * $args = array( + * 'user_id' => 4, + * 'component_name' => 'groups', + * ); + * + * This will be converted to: + * + * array( + * 'data' => array( + * 'user_id' => 4, + * 'component_name' => 'groups', + * ), + * 'format' => array( + * '%d', + * '%s', + * ), + * ) + * + * which can easily be passed as arguments to the $wpdb methods. + * + * @since 1.9.0 + * + * @param array $args Associative array of filter arguments. + * See {@BP_Notifications_Notification::get()} + * for a breakdown. + * @return array Associative array of 'data' and 'format' args. + */ + protected static function get_query_clauses($args = array()) + { + } + /** Public Static Methods *************************************************/ + /** + * Check that a specific notification is for a specific user. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user being checked. + * @param int $notification_id ID of the notification being checked. + * @return bool True if the notification belongs to the user, otherwise false. + */ + public static function check_access($user_id = 0, $notification_id = 0) + { + } + /** + * Parse notifications query arguments. + * + * @since 2.3.0 + * + * @param array|string $args Args to parse. + * @return array + */ + public static function parse_args($args = '') + { + } + /** + * Get notifications, based on provided filter parameters. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Associative array of arguments. All arguments but $page and + * $per_page can be treated as filter values for get_where_sql() + * and get_query_clauses(). All items are optional. + * @type int|array $id ID of notification being updated. Can be an + * array of IDs. + * @type int|array $user_id ID of user being queried. Can be an + * array of user IDs. + * @type int|array $item_id ID of associated item. Can be an array + * of multiple item IDs. + * @type int|array $secondary_item_id ID of secondary associated + * item. Can be an array of multiple IDs. + * @type string|array $component_name Name of the component to + * filter by. Can be an array of component names. + * @type string|array $component_action Name of the action to + * filter by. Can be an array of actions. + * @type bool $is_new Whether to limit to new notifications. True + * returns only new notifications, false returns only non-new + * notifications. 'both' returns all. Default: true. + * @type string $search_terms Term to match against component_name + * or component_action fields. + * @type string $order_by Database column to order notifications by. + * @type string $sort_order Either 'ASC' or 'DESC'. + * @type int $page Number of the current page of results. Default: + * false (no pagination - all items). + * @type int $per_page Number of items to show per page. Default: + * false (no pagination - all items). + * @type array $meta_query Array of meta_query conditions. See WP_Meta_Query::queries. + * @type array $date_query Array of date_query conditions. See first parameter of + * WP_Date_Query::__construct(). + * @type bool $update_meta_cache Whether to update meta cache. Default: true. + * } + * @return array Located notifications. + */ + public static function get($args = array()) + { + } + /** + * Get a count of total notifications matching a set of arguments. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array|string $args See {@link BP_Notifications_Notification::get()}. + * @return int Count of located items. + */ + public static function get_total_count($args) + { + } + /** + * Get the SQL for the 'meta_query' param in BP_Notifications_Notification::get(). + * + * We use WP_Meta_Query to do the heavy lifting of parsing the + * meta_query array and creating the necessary SQL clauses. However, + * since BP_Notifications_Notification::get() builds its SQL differently than + * WP_Query, we have to alter the return value (stripping the leading + * AND keyword from the 'where' clause). + * + * @since 2.3.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $meta_query An array of meta_query filters. See the + * documentation for WP_Meta_Query for details. + * @return array $sql_array 'join' and 'where' clauses. + */ + public static function get_meta_query_sql($meta_query = array()) + { + } + /** + * Get the SQL for the 'date_query' param in BP_Notifications_Notification::get(). + * + * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting + * of parsing the date_query array and creating the necessary SQL clauses. + * + * @since 2.3.0 + * + * @param array $date_query An array of date_query parameters. See the + * documentation for the first parameter of WP_Date_Query. + * @return string + */ + public static function get_date_query_sql($date_query = array()) + { + } + /** + * Update notifications. + * + * @since 1.9.0 + * + * @see BP_Notifications_Notification::get() for a description of + * accepted update/where arguments. + * + * @param array $update_args Associative array of fields to update, + * and the values to update them to. Of the format + * array( 'user_id' => 4, 'component_name' => 'groups', ). + * @param array $where_args Associative array of columns/values, to + * determine which rows should be updated. Of the format + * array( 'item_id' => 7, 'component_action' => 'members', ). + * @return int|false Number of rows updated on success, false on failure. + */ + public static function update($update_args = array(), $where_args = array()) + { + } + /** + * Update notifications using a list of ids/items_ids. + * + * @since 10.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param string $field The name of the db field of the items to update. + * Possible values are `id` or `item_id`. + * @param int[] $items The list of items to update. + * @param array $data Array of notification data to update. + * @param array $where The WHERE params to use to specify the item IDs to update. + * @return int|false The number of updated rows. False on error. + */ + public static function update_id_list($field, $items = array(), $data = array(), $where = array()) + { + } + /** + * Delete notifications. + * + * @since 1.9.0 + * + * @see BP_Notifications_Notification::get() for a description of + * accepted where arguments. + * + * @param array $args Associative array of columns/values, to determine + * which rows should be deleted. Of the format + * array( 'item_id' => 7, 'component_action' => 'members', ). + * @return int|false Number of rows deleted on success, false on failure. + */ + public static function delete($args = array()) + { + } + /** + * Delete notifications using a list of ids/items_ids. + * + * @since 10.0.0 + * + * @global wpdb $wpdb The WordPress database object. + * + * @param string $field The name of the db field of the items to delete. + * Possible values are `id` or `item_id`. + * @param int[] $items The list of items to delete. + * @param array $args The WHERE arguments to use to specify the item IDs to delete. + * @return int|false The number of deleted rows. False on error. + */ + public static function delete_by_id_list($field, $items = array(), $args = array()) + { + } + /** Convenience methods ***************************************************/ + /** + * Delete a single notification by ID. + * + * @since 1.9.0 + * + * @see BP_Notifications_Notification::delete() for explanation of + * return value. + * + * @param int $id ID of the notification item to be deleted. + * @return int|false True on success, false on failure. + */ + public static function delete_by_id($id) + { + } + /** + * Fetch all the notifications in the database for a specific user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being + * fetched. + * @param string $status Optional. Status of notifications to fetch. + * 'is_new' to get only unread items, 'all' to get all. + * @return array Associative array of notification items. + */ + public static function get_all_for_user($user_id, $status = 'is_new') + { + } + /** + * Fetch all the unread notifications in the database for a specific user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being + * fetched. + * @return array Associative array of unread notification items. + */ + public static function get_unread_for_user($user_id = 0) + { + } + /** + * Fetch all the read notifications in the database for a specific user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being + * fetched. + * @return array Associative array of unread notification items. + */ + public static function get_read_for_user($user_id = 0) + { + } + /** + * Get unread notifications for a user, in a pagination-friendly format. + * + * @since 1.9.0 + * + * @param array $args { + * Array of arguments. + * @type int $user_id ID of the user for whom the notifications are + * being fetched. Default: logged-in user ID. + * @type bool $is_new Whether to limit the query to unread + * notifications. Default: true. + * @type int $page Number of the page to return. Default: 1. + * @type int $per_page Number of results to display per page. + * Default: 10. + * @type string $search_terms Optional. A term to search against in + * the 'component_name' and 'component_action' columns. + * } + * @return array { + * @type array $notifications Array of notification results. + * @type int $total Count of all located notifications matching + * the query params. + * } + */ + public static function get_current_notifications_for_user($args = array()) + { + } + /** Mark ******************************************************************/ + /** + * Mark all user notifications as read. + * + * @since 1.9.0 + * + * @param int $user_id The ID of the user who the notifications are for. + * @param int $is_new Mark as read (1) or unread (0). + * @param int $item_id Item ID being acted on. + * @param string $component_name Name of component the notifications are for. + * @param string $component_action Name of the component action. + * @param int $secondary_item_id The ID of the secondary item. + * @return int|false False on failure to update. ID on success. + */ + public static function mark_all_for_user($user_id, $is_new = 0, $item_id = 0, $component_name = '', $component_action = '', $secondary_item_id = 0) + { + } + /** + * Mark all notifications from a user as read. + * + * @since 1.9.0 + * + * @param int $user_id The ID of the user who the notifications are from. + * @param int $is_new Mark as read (1) or unread (0). + * @param string $component_name Name of component the notifications are for. + * @param string $component_action Name of the component action. + * @param int $secondary_item_id The ID of the secondary item. + * @return int|false + */ + public static function mark_all_from_user($user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0) + { + } + /** + * Mark all notifications for all users as read by item id, and optional + * secondary item id, and component name and action. + * + * @since 1.9.0 + * + * @param int $item_id The ID of the item associated with the + * notifications. + * @param int $is_new Mark as read (1) or unread (0). + * @param string $component_name The component that the notifications + * are associated with. + * @param string $component_action The action that the notifications + * are associated with. + * @param int $secondary_item_id Optional. ID of the secondary + * associated item. + * @return int|false + */ + public static function mark_all_by_type($item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0) + { + } + /** + * Get a user's unread notifications, grouped by component and action. + * + * Multiple notifications of the same type (those that share the same component_name + * and component_action) are collapsed for formatting as "You have 5 pending + * friendship requests", etc. See bp_notifications_get_notifications_for_user(). + * For a full-fidelity list of user notifications, use + * bp_notifications_get_all_notifications_for_user(). + * + * @since 3.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose notifications are being fetched. + * @return array Notifications items for formatting into a list. + */ + public static function get_grouped_notifications_for_user($user_id) + { + } + } + /** + * The main notifications template loop class. + * + * Responsible for loading a group of notifications into a loop for display. + * + * @since 1.9.0 + */ + class BP_Notifications_Template + { + /** + * The loop iterator. + * + * @since 1.9.0 + * @var int + */ + public $current_notification = -1; + /** + * The number of notifications returned by the paged query. + * + * @since 1.9.0 + * @var int + */ + public $current_notification_count; + /** + * Total number of notifications matching the query. + * + * @since 1.9.0 + * @var int + */ + public $total_notification_count; + /** + * Array of notifications located by the query. + * + * @since 1.9.0 + * @var array + */ + public $notifications; + /** + * The notification object currently being iterated on. + * + * @since 1.9.0 + * @var object + */ + public $notification; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.9.0 + * @var bool + */ + public $in_the_loop; + /** + * The ID of the user to whom the displayed notifications belong. + * + * @since 1.9.0 + * @var int + */ + public $user_id; + /** + * The status of the notification. + * + * @since 1.9.0 + * @var bool + */ + public $is_new; + /** + * The total notification count. + * + * @since 1.9.0 + * @var int + */ + public $notification_count; + /** + * The page number being requested. + * + * @since 1.9.0 + * @var int + */ + public $pag_page; + /** + * The $_GET argument used in URLs for determining pagination. + * + * @since 1.9.0 + * @var int + */ + public $pag_arg; + /** + * The number of items to display per page of results. + * + * @since 1.9.0 + * @var int + */ + public $pag_num; + /** + * An HTML string containing pagination links. + * + * @since 1.9.0 + * @var string + */ + public $pag_links; + /** + * A string to match against. + * + * @since 1.9.0 + * @var string + */ + public $search_terms; + /** + * A database column to order the results by. + * + * @since 1.9.0 + * @var string + */ + public $order_by; + /** + * The direction to sort the results (ASC or DESC). + * + * @since 1.9.0 + * @var string + */ + public $sort_order; + /** + * Array of variables used in this notification query. + * + * @since 2.2.2 + * @var array + */ + public $query_vars; + /** + * Constructor method. + * + * @since 1.9.0 + * + * @param array $args { + * An array of arguments. See {@link bp_has_notifications()} + * for more details. + * } + */ + public function __construct($args = array()) + { + } + /** + * Whether there are notifications available in the loop. + * + * @since 1.9.0 + * + * @see bp_has_notifications() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_notifications() + { + } + /** + * Set up the next notification and iterate index. + * + * @since 1.9.0 + * + * @return object The next notification to iterate over. + */ + public function next_notification() + { + } + /** + * Rewind the blogs and reset blog index. + * + * @since 1.9.0 + */ + public function rewind_notifications() + { + } + /** + * Whether there are notifications left in the loop to iterate over. + * + * This method is used by {@link bp_notifications()} as part of the + * while loop that controls iteration inside the notifications loop, eg: + * while ( bp_notifications() ) { ... + * + * @since 1.9.0 + * + * @see bp_notifications() + * + * @return bool True if there are more notifications to show, + * otherwise false. + */ + public function notifications() + { + } + /** + * Set up the current notification inside the loop. + * + * Used by {@link bp_the_notification()} to set up the current + * notification data while looping, so that template tags used during + * that iteration make reference to the current notification. + * + * @since 1.9.0 + * + * @see bp_the_notification() + */ + public function the_notification() + { + } + } + /** + * Extends the component class to set up the Notifications component. + * + * @since 1.9.0 + */ + #[\AllowDynamicProperties] + class BP_Notifications_Component extends \BP_Component + { + /** + * Start the notifications component creation process. + * + * @since 1.9.0 + */ + public function __construct() + { + } + /** + * Include notifications component files. + * + * @since 1.9.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up component global data. + * + * @since 1.9.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @param array $args See BP_Component::setup_globals() for a description. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for + * description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up component navigation. + * + * @since 1.9.0 + * @since 12.0.0 Used to customize the main navigation name. + * + * @see `BP_Component::setup_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::setup_nav()` for + * description. + * @param array $sub_nav Optional. See `BP_Component::setup_nav()` for + * description. + */ + public function setup_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.9.0 + * + * @see BP_Component::setup_nav() for a description of the $wp_admin_nav + * parameter array. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a + * description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and <title>. + * + * @since 1.9.0 + */ + public function setup_title() + { + } + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + } + /** + * Class for generating the WHERE SQL clause for advanced activity fetching. + * + * This is notably used in {@link BP_Activity_Activity::get()} with the + * 'filter_query' parameter. + * + * @since 2.2.0 + */ + class BP_Activity_Query extends \BP_Recursive_Query + { + /** + * Array of activity queries. + * + * See {@see BP_Activity_Query::__construct()} for information on query arguments. + * + * @since 2.2.0 + * @var array + */ + public $queries = array(); + /** + * Table alias. + * + * @since 2.2.0 + * @var string + */ + public $table_alias = ''; + /** + * Supported DB columns. + * + * See the 'wp_bp_activity' DB table schema. + * + * @since 2.2.0 + * @var array + */ + public $db_columns = array('id', 'user_id', 'component', 'type', 'action', 'content', 'primary_link', 'item_id', 'secondary_item_id', 'hide_sitewide', 'is_spam'); + /** + * Constructor. + * + * @since 2.2.0 + * + * @param array $query { + * Array of query clauses. + * @type array { + * @type string $column Required. The column to query against. Basically, any DB column in the main + * 'wp_bp_activity' table. + * @type string $value Required. Value to filter by. + * @type string $compare Optional. The comparison operator. Default '='. + * Accepts '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'LIKE', + * 'NOT LIKE', BETWEEN', 'NOT BETWEEN', 'REGEXP', 'NOT REGEXP', 'RLIKE'. + * @type string $relation Optional. The boolean relationship between the activity queries. + * Accepts 'OR', 'AND'. Default 'AND'. + * @type array { + * Optional. Another fully-formed activity query. See parameters above. + * } + * } + * } + */ + public function __construct($query = array()) + { + } + /** + * Generates WHERE SQL clause to be appended to a main query. + * + * @since 2.2.0 + * + * @param string $alias An existing table alias that is compatible with the current query clause. + * Default: 'a'. BP_Activity_Activity::get() uses 'a', so we default to that. + * @return string SQL fragment to append to the main WHERE clause. + */ + public function get_sql($alias = 'a') + { + } + /** + * Generate WHERE clauses for a first-order clause. + * + * @since 2.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $clause Array of arguments belonging to the clause. + * @param array $parent_query Parent query to which the clause belongs. + * @return array { + * @type array $where Array of subclauses for the WHERE statement. + * @type array $join Empty array. Not used. + * } + */ + protected function get_sql_for_clause($clause, $parent_query) + { + } + /** + * Determine whether a clause is first-order. + * + * @since 2.2.0 + * + * @param array $query Clause to check. + * @return bool + */ + protected function is_first_order_clause($query) + { + } + /** + * Validates a column name parameter. + * + * Column names are checked against a list of known tables. + * See {@link BP_Activity_Query::db_tables}. + * + * @since 2.2.0 + * + * @param string $column The user-supplied column name. + * @return string A validated column name value. + */ + public function validate_column($column = '') + { + } + } + /** + * Create a RSS feed using the activity component. + * + * You should only construct a new feed when you've validated that you're on + * the appropriate screen. + * + * @since 1.8.0 + * + * See {@link bp_activity_action_sitewide_feed()} as an example. + * + * @param array $args { + * @type string $id Required. Internal id for the feed; should be alphanumeric only. + * @type string $title Optional. RSS feed title. + * @type string $link Optional. Relevant link for the RSS feed. + * @type string $description Optional. RSS feed description. + * @type string $ttl Optional. Time-to-live. (see inline doc in constructor) + * @type string $update_period Optional. Part of the syndication module. + * (see inline doc in constructor for more info) + * @type string $update_frequency Optional. Part of the syndication module. + * (see inline doc in constructor for more info) + * @type string $max Optional. Number of feed items to display. + * @type array $activity_args Optional. Arguments passed to {@link bp_has_activities()} + * } + */ + class BP_Activity_Feed + { + /** + * Holds our custom class properties. + * + * These variables are stored in a protected array that is magically + * updated using PHP 5.2+ methods. + * + * @see BP_Feed::__construct() This is where $data is added. + * + * @since 1.8.0 + * @var array + */ + protected $data; + /** + * Magic method for checking the existence of a certain data variable. + * + * @since 1.8.0 + * + * @param string $key Property to check. + * @return bool Whether or not data variable exists. + */ + public function __isset($key) + { + } + /** + * Magic method for getting a certain data variable. + * + * @since 1.8.0 + * + * @param string $key Property to get. + * @return mixed Data in variable if available or null. + */ + public function __get($key) + { + } + /** + * Magic method for setting a certain data variable. + * + * @since 2.4.0 + * + * @param string $key The property to set. + * @param mixed $value The value to set. + */ + public function __set($key, $value) + { + } + /** + * Constructor. + * + * @since 1.8.0 + * + * @global WP_Query $wp_query WordPress query object. + * + * @param array $args Optional. + */ + public function __construct($args = array()) + { + } + /** SETUP ****************************************************************/ + /** + * Setup and validate the class properties. + * + * @since 1.8.0 + */ + protected function setup_properties() + { + } + /** + * Setup some hooks that are used in the feed. + * + * Currently, these hooks are used to maintain backwards compatibility with + * the RSS feeds previous to BP 1.8. + * + * @since 1.8.0 + */ + protected function setup_hooks() + { + } + /** BACKPAT HOOKS ********************************************************/ + /** + * Fire a hook to ensure backward compatibility for RSS attributes. + * + * @since 1.8.0 + */ + public function backpat_rss_attributes() + { + } + /** + * Fire a hook to ensure backward compatibility for channel elements. + * + * @since 1.8.0 + */ + public function backpat_channel_elements() + { + } + /** + * Fire a hook to ensure backward compatibility for item elements. + * + * @since 1.8.0 + */ + public function backpat_item_elements() + { + } + /** HELPERS **************************************************************/ + /** + * Output the feed's item content. + * + * @since 1.8.0 + */ + protected function feed_content() + { + } + /** + * Sets various HTTP headers related to Content-Type and browser caching. + * + * Most of this class method is derived from {@link WP::send_headers()}. + * + * @since 1.9.0 + * + * @global WP_Query $wp_query WordPress query object. + */ + protected function http_headers() + { + } + /** OUTPUT ***************************************************************/ + /** + * Output the RSS feed. + * + * @since 1.8.0 + */ + protected function output() + { + } + } + /** + * Activity endpoints. + * + * @since 5.0.0 + */ + class BP_REST_Activity_Endpoint extends \WP_REST_Controller + { + /** + * User favorites. + * + * @since 5.0.0 + * + * @var array|null + */ + protected $user_favorites = \null; + /** + * Constructor. + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Register the component routes. + * + * @since 5.0.0 + */ + public function register_routes() + { + } + /** + * Retrieve activities. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response List of activities response data. + */ + public function get_items($request) + { + } + /** + * Check if a given request has access to activity items. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_items_permissions_check($request) + { + } + /** + * Retrieve an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function get_item($request) + { + } + /** + * Check if a given request has access to get information about a specific activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return true|WP_Error + */ + public function get_item_permissions_check($request) + { + } + /** + * Create an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full data about the request. + * @return WP_REST_Response|WP_Error + */ + public function create_item($request) + { + } + /** + * Checks if a given request has access to create an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function create_item_permissions_check($request) + { + } + /** + * Update an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_item($request) + { + } + /** + * Check if a given request has access to update an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_item_permissions_check($request) + { + } + /** + * Delete activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function delete_item($request) + { + } + /** + * Check if a given request has access to delete an activity. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function delete_item_permissions_check($request) + { + } + /** + * Gets the current user's favorites. + * + * @since 5.0.0 + * + * @return array Array of activity IDs. + */ + public function get_user_favorites() + { + } + /** + * Adds or removes the activity from the current user's favorites. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response|WP_Error + */ + public function update_favorite($request) + { + } + /** + * Check if a given request has access to update user favorites. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return true|WP_Error + */ + public function update_favorite_permissions_check($request) + { + } + /** + * Renders the content of an activity. + * + * @since 5.0.0 + * + * @param BP_Activity_Activity $activity Activity data. + * @return string The rendered activity content. + */ + public function render_item($activity) + { + } + /** + * Prepares activity data for return as an object. + * + * @since 5.0.0 + * + * @param BP_Activity_Activity $activity Activity object. + * @param WP_REST_Request $request Full details about the request. + * @return WP_REST_Response + */ + public function prepare_item_for_response($activity, $request) + { + } + /** + * Prepare activity comments. + * + * @since 5.0.0 + * + * @param array $comments Array of comments. + * @param WP_REST_Request $request Full details about the request. + * @return array An array of activity comments. + */ + protected function prepare_activity_comments($comments, $request) + { + } + /** + * Prepare an activity for create or update. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return stdClass|WP_Error Object or WP_Error. + */ + protected function prepare_item_for_database($request) + { + } + /** + * Prepare links for the request. + * + * @since 5.0.0 + * + * @param BP_Activity_Activity $activity Activity object. + * @return array + */ + protected function prepare_links($activity) + { + } + /** + * Can this user see the activity? + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return boolean + */ + protected function can_see($request) + { + } + /** + * Show hidden activity? + * + * @since 5.0.0 + * + * @param string $component The component the activity is from. + * @param int $item_id The activity item ID. + * @return boolean + */ + protected function show_hidden($component, $item_id) + { + } + /** + * Get activity object. + * + * @since 5.0.0 + * + * @param WP_REST_Request $request Full details about the request. + * @return BP_Activity_Activity|string An activity object. + */ + public function get_activity_object($request) + { + } + /** + * Edit the type of the some properties for the CREATABLE & EDITABLE methods. + * + * @since 5.0.0 + * + * @param string $method Optional. HTTP method of the request. + * @return array Endpoint arguments. + */ + public function get_endpoint_args_for_item_schema($method = \WP_REST_Server::CREATABLE) + { + } + /** + * Get the plugin schema, conforming to JSON Schema. + * + * @since 5.0.0 + * + * @return array + */ + public function get_item_schema() + { + } + /** + * Get the query params for collections of plugins. + * + * @since 5.0.0 + * + * @return array + */ + public function get_collection_params() + { + } + } + /** + * Akismet support for the Activity component. + * + * @since 1.6.0 + * @since 2.3.0 We only support Akismet 3+. + */ + class BP_Akismet + { + /** + * The activity last marked as spam. + * + * @since 1.6.0 + * @var BP_Activity_Activity + */ + protected $last_activity = \null; + /** + * Constructor. + * + * @since 1.6.0 + */ + public function __construct() + { + } + /** + * Hook Akismet into the activity stream. + * + * @since 1.6.0 + */ + protected function setup_actions() + { + } + /** + * Add a history item to the hover links in an activity's row. + * + * This function lifted with love from the Akismet WordPress plugin's + * akismet_comment_row_action() function. Thanks! + * + * @since 1.6.0 + * + * @param array $actions The hover links. + * @param array $activity The activity for the current row being processed. + * @return array The hover links. + */ + function comment_row_action($actions, $activity) + { + } + /** + * Generate nonces for activity forms. + * + * These nonces appear in the member profile status form, as well as in + * the reply form of each activity item. The nonces are, in turn, used + * by Akismet to help detect spam activity. + * + * @since 1.6.0 + * + * @see https://plugins.trac.wordpress.org/ticket/1232 + */ + public function add_activity_stream_nonce() + { + } + /** + * Clean up the bp_latest_update usermeta in case of spamming. + * + * Run just after an update is posted, this method check to see whether + * the newly created update has been marked as spam by Akismet. If so, + * the cached update is cleared from the user's 'bp_latest_update' + * usermeta, ensuring that it won't appear in the member header and + * elsewhere in the theme. + * + * This can't be done in BP_Akismet::check_activity() due to the + * default AJAX implementation; see bp_dtheme_post_update(). + * + * @since 1.6.0 + * + * @see bp_dtheme_post_update() + * + * @param string $content Activity update text. + * @param int $user_id User ID. + * @param int $activity_id Activity ID. + */ + public function check_member_activity_update($content, $user_id, $activity_id) + { + } + /** + * Adds a "mark as spam" button to each activity item for site admins. + * + * This function is intended to be used inside the activity stream loop. + * + * @since 1.6.0 + */ + public function add_activity_spam_button() + { + } + /** + * Adds a "mark as spam" button to each activity COMMENT item for site admins. + * + * This function is intended to be used inside the activity stream loop. + * + * @since 1.6.0 + */ + public function add_activity_comment_spam_button() + { + } + /** + * Get a filterable list of activity types that Akismet should automatically check for spam. + * + * @since 1.6.0 + * + * @static + * + * @return array $value List of activity types. + */ + public static function get_activity_types() + { + } + /** + * Mark activity item as spam. + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity Activity item being spammed. + * @param string $source Either "by_a_person" (e.g. a person has + * manually marked the activity as spam) or + * "by_akismet" (automatically spammed). + */ + public function mark_as_spam($activity, $source) + { + } + /** + * Mark activity item as ham. + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity Activity item being hammed. + * @param string $source Either "by_a_person" (e.g. a person has + * manually marked the activity as ham) or + * "by_akismet" (automatically hammed). + */ + public function mark_as_ham($activity, $source) + { + } + /** + * Build a data package for the Akismet service to inspect. + * + * @since 1.6.0 + * + * @see http://akismet.com/development/api/#comment-check + * @static + * + * @param BP_Activity_Activity $activity Activity item data. + * @return array $activity_data + */ + public static function build_akismet_data_package($activity) + { + } + /** + * Check if the activity item is spam or ham. + * + * @since 1.6.0 + * + * @see http://akismet.com/development/api/ + * @todo Spam counter? + * @todo Auto-delete old spam? + * + * @param BP_Activity_Activity $activity The activity item to check. + */ + public function check_activity($activity) + { + } + /** + * Update activity meta after a manual spam change (user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_spam_meta($activity) + { + } + /** + * Update activity meta after a manual ham change (user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_ham_meta($activity) + { + } + /** + * Update activity meta after an automatic spam check (not user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_akismet_meta($activity) + { + } + /** + * Contact Akismet to check if this is spam or ham. + * + * Props to WordPress core Akismet plugin for a lot of this. + * + * @since 1.6.0 + * + * @param array $activity_data Packet of information to submit to Akismet. + * @param string $check "check" or "submit". + * @param string $spam "spam" or "ham". + * @return array $activity_data Activity data, with Akismet data added. + */ + public function send_akismet_request($activity_data, $check = 'check', $spam = 'spam') + { + } + /** + * Filters user agent when sending to Akismet to add BuddyPress info. + * + * @since 1.6.0 + * + * @param string $user_agent User agent string, as generated by Akismet. + * @return string $user_agent Modified user agent string. + */ + public function buddypress_ua($user_agent) + { + } + /** + * Adds a "History" meta box to the activity edit screen. + * + * @since 1.6.0 + * + * @param string $screen_action The type of screen that has been requested. + */ + function add_history_metabox($screen_action) + { + } + /** + * History meta box for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @see https://buddypress.trac.wordpress.org/ticket/3907 + * @todo Update activity meta to allow >1 record with the same key (iterate through $history). + * + * @param object $item Activity item. + */ + function history_metabox($item) + { + } + /** + * Update an activity item's Akismet history. + * + * @since 1.6.0 + * + * @param int $activity_id Activity item ID. + * @param string $message Human-readable description of what's changed. + * @param string $event The type of check we were carrying out. + */ + public function update_activity_history($activity_id = 0, $message = '', $event = '') + { + } + /** + * Get an activity item's Akismet history. + * + * @since 1.6.0 + * + * @param int $activity_id Activity item ID. + * @return array The activity item's Akismet history. + */ + public function get_activity_history($activity_id = 0) + { + } + } + /** + * Database interaction class for the BuddyPress activity component. + * Instance methods are available for creating/editing an activity, + * static methods for querying activities. + * + * @since 1.0.0 + */ + #[\AllowDynamicProperties] + class BP_Activity_Activity + { + /** Properties ************************************************************/ + /** + * ID of the activity item. + * + * @since 1.0.0 + * @var int + */ + var $id; + /** + * ID of the associated item. + * + * @since 1.0.0 + * @var int + */ + var $item_id; + /** + * ID of the associated secondary item. + * + * @since 1.0.0 + * @var int + */ + var $secondary_item_id; + /** + * ID of user associated with the activity item. + * + * @since 1.0.0 + * @var int + */ + var $user_id; + /** + * The primary URL for the activity in RSS feeds. + * + * @since 1.0.0 + * @var string + */ + var $primary_link = ''; + /** + * BuddyPress component the activity item relates to. + * + * @since 1.2.0 + * @var string + */ + var $component = ''; + /** + * Activity type, eg 'new_blog_post'. + * + * @since 1.2.0 + * @var string + */ + var $type = ''; + /** + * Description of the activity, eg 'Alex updated his profile.'. + * + * @since 1.2.0 + * @var string + */ + var $action = ''; + /** + * The content of the activity item. + * + * @since 1.2.0 + * @var string + */ + var $content = ''; + /** + * The date the activity item was recorded, in 'Y-m-d h:i:s' format. + * + * @since 1.0.0 + * @var string + */ + var $date_recorded = ''; + /** + * Whether the item should be hidden in sitewide streams. + * + * @since 1.1.0 + * @var int + */ + var $hide_sitewide = 0; + /** + * Node boundary start for activity or activity comment. + * + * @since 1.5.0 + * @var int + */ + var $mptt_left; + /** + * Node boundary end for activity or activity comment. + * + * @since 1.5.0 + * @var int + */ + var $mptt_right; + /** + * Whether this item is marked as spam. + * + * @since 1.6.0 + * @var int + */ + var $is_spam; + /** + * Error holder. + * + * @since 2.6.0 + * + * @var WP_Error + */ + public $errors; + /** + * Error type to return. Either 'bool' or 'wp_error'. + * + * @since 2.6.0 + * + * @var string + */ + public $error_type = 'bool'; + /** + * Constructor method. + * + * @since 1.5.0 + * + * @param int|bool $id Optional. The ID of a specific activity item. + */ + public function __construct($id = \false) + { + } + /** + * Populate the object with data about the specific activity item. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + public function populate() + { + } + /** + * Save the activity item to the database. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return WP_Error|bool True on success. + */ + public function save() + { + } + /** Static Methods ***************************************************/ + /** + * Get activity items, as specified by parameters. + * + * @since 1.2.0 + * @since 2.4.0 Introduced the `$fields` parameter. + * @since 2.9.0 Introduced the `$order_by` parameter. + * @since 10.0.0 Introduced the `$count_total_only` parameter. + * @since 11.0.0 Introduced the `$user_id__in` and `$user_id__not_in` parameters. + * + * @see BP_Activity_Activity::get_filter_sql() for a description of the + * 'filter' parameter. + * @see WP_Meta_Query::queries for a description of the 'meta_query' + * parameter format. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * An array of arguments. All items are optional. + * @type int $page Which page of results to fetch. Using page=1 without per_page will result + * in no pagination. Default: 1. + * @type int|bool $per_page Number of results per page. Default: 25. + * @type int|bool $max Maximum number of results to return. Default: false (unlimited). + * @type string $fields Activity fields to return. Pass 'ids' to get only the activity IDs. + * 'all' returns full activity objects. + * @type string $sort ASC or DESC. Default: 'DESC'. + * @type string $order_by Column to order results by. + * @type array $exclude Array of activity IDs to exclude. Default: false. + * @type array $in Array of ids to limit query by (IN). Default: false. + * @type array $meta_query Array of meta_query conditions. See WP_Meta_Query::queries. + * @type array $date_query Array of date_query conditions. See first parameter of + * WP_Date_Query::__construct(). + * @type array $filter_query Array of advanced query conditions. See BP_Activity_Query::__construct(). + * @type string|array $scope Pre-determined set of activity arguments. + * @type array $filter See BP_Activity_Activity::get_filter_sql(). + * @type array $user_id__in An array of user ids to include. Activity posted by users matching one of these + * user ids will be included in results. Default empty array. + * @type array $user_id__not_in An array of user ids to exclude. Activity posted by users matching one of these + * user ids will not be included in results. Default empty array. + * @type string $search_terms Limit results by a search term. Default: false. + * @type bool $display_comments Whether to include activity comments. Default: false. + * @type bool $show_hidden Whether to show items marked hide_sitewide. Default: false. + * @type string $spam Spam status. Default: 'ham_only'. + * @type bool $update_meta_cache Whether to pre-fetch metadata for queried activity items. Default: true. + * @type string|bool $count_total If true, an additional DB query is run to count the total activity items + * for the query. Default: false. + * @type bool $count_total_only If true, only the DB query to count the total activity items is run. + * Default: false. + * } + * @return array The array returned has two keys: + * - 'total' is the count of located activities + * - 'activities' is an array of the located activities + */ + public static function get($args = array()) + { + } + /** + * Convert activity IDs to activity objects, as expected in template loop. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $activity_ids Array of activity IDs. + * @return array + */ + protected static function get_activity_data($activity_ids = array()) + { + } + /** + * Append xProfile fullnames to an activity array. + * + * @since 2.0.0 + * + * @param array $activities Activities array. + * @return array + */ + protected static function append_user_fullnames($activities) + { + } + /** + * Pre-fetch data for objects associated with activity items. + * + * Activity items are associated with users, and often with other + * BuddyPress data objects. Here, we pre-fetch data about these + * associated objects, so that inline lookups - done primarily when + * building action strings - do not result in excess database queries. + * + * The only object data required for activity component activity types + * (activity_update and activity_comment) is related to users, and that + * info is fetched separately in BP_Activity_Activity::get_activity_data(). + * So this method contains nothing but a filter that allows other + * components, such as bp-friends and bp-groups, to hook in and prime + * their own caches at the beginning of an activity loop. + * + * @since 2.0.0 + * + * @param array $activities Array of activities. + * @return array $activities Array of activities. + */ + protected static function prefetch_object_data($activities) + { + } + /** + * Generate action strings for the activities located in BP_Activity_Activity::get(). + * + * If no string can be dynamically generated for a given item + * (typically because the activity type has not been properly + * registered), the static 'action' value pulled from the database will + * be left in place. + * + * @since 2.0.0 + * + * @param array $activities Array of activities. + * @return array + */ + protected static function generate_action_strings($activities) + { + } + /** + * Get the SQL for the 'meta_query' param in BP_Activity_Activity::get(). + * + * We use WP_Meta_Query to do the heavy lifting of parsing the + * meta_query array and creating the necessary SQL clauses. However, + * since BP_Activity_Activity::get() builds its SQL differently than + * WP_Query, we have to alter the return value (stripping the leading + * AND keyword from the 'where' clause). + * + * @since 1.8.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $meta_query An array of meta_query filters. See the + * documentation for WP_Meta_Query for details. + * @return array $sql_array 'join' and 'where' clauses. + */ + public static function get_meta_query_sql($meta_query = array()) + { + } + /** + * Get the SQL for the 'date_query' param in BP_Activity_Activity::get(). + * + * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting + * of parsing the date_query array and creating the necessary SQL clauses. + * + * @since 2.1.0 + * + * @param array $date_query An array of date_query parameters. See the + * documentation for the first parameter of WP_Date_Query. + * @return string + */ + public static function get_date_query_sql($date_query = array()) + { + } + /** + * Get the SQL for the 'scope' param in BP_Activity_Activity::get(). + * + * A scope is a predetermined set of activity arguments. This method is used + * to grab these activity arguments and override any existing args if needed. + * + * Can handle multiple scopes. + * + * @since 2.2.0 + * + * @param mixed $scope The activity scope. Accepts string or array of scopes. + * @param array $r Current activity arguments. Same as those of BP_Activity_Activity::get(), + * but merged with defaults. + * @return false|array 'sql' WHERE SQL string and 'override' activity args. + */ + public static function get_scope_query_sql($scope = \false, $r = array()) + { + } + /** + * In BuddyPress 1.2.x, this was used to retrieve specific activity stream items (for example, on an activity's permalink page). + * + * As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead. + * + * @since 1.2.0 + * + * @deprecated 1.5 + * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead. + * + * @param mixed $activity_ids Array or comma-separated string of activity IDs to retrieve. + * @param int|bool $max Maximum number of results to return. (Optional; default is no maximum). + * @param int $page The set of results that the user is viewing. Used in pagination. (Optional; default is 1). + * @param int $per_page Specifies how many results per page. Used in pagination. (Optional; default is 25). + * @param string $sort MySQL column sort; ASC or DESC. (Optional; default is DESC). + * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false). + * @return array + */ + public static function get_specific($activity_ids, $max = \false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = \false) + { + } + /** + * Get the first activity ID that matches a set of criteria. + * + * @since 1.2.0 + * @since 10.0.0 Parameters were made optional. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * An array of arguments. All items are optional. + * @type int $user_id User ID to filter by. + * @type string $component Component to filter by. + * @type string $type Activity type to filter by. + * @type int $item_id Associated item to filter by. + * @type int $secondary_item_id Secondary associated item to filter by. + * @type string $action Action to filter by. + * @type string $content Content to filter by. + * @type string $date_recorded Date to filter by. + * } + * @return int|false Activity ID on success, false if none is found. + */ + public static function get_id($args = array()) + { + } + /** + * Delete activity items from the database. + * + * To delete a specific activity item, pass an 'id' parameter. + * Otherwise use the filters. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * @int $id Optional. The ID of a specific item to delete. + * @string $action Optional. The action to filter by. + * @string $content Optional. The content to filter by. + * @string $component Optional. The component name to filter by. + * @string $type Optional. The activity type to filter by. + * @string $primary_link Optional. The primary URL to filter by. + * @int $user_id Optional. The user ID to filter by. + * @int $item_id Optional. The associated item ID to filter by. + * @int $secondary_item_id Optional. The secondary associated item ID to filter by. + * @string $date_recorded Optional. The date to filter by. + * @int $hide_sitewide Optional. Default: false. + * } + * @return array|bool An array of deleted activity IDs on success, false on failure. + */ + public static function delete($args = array()) + { + } + /** + * Delete the comments associated with a set of activity items. + * + * This method is no longer used by BuddyPress, and it is recommended not to + * use it going forward, and use BP_Activity_Activity::delete() instead. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @deprecated 2.3.0 + * + * @param array $activity_ids Activity IDs whose comments should be deleted. + * @param bool $delete_meta Should we delete the activity meta items for these comments. + * @return bool + */ + public static function delete_activity_item_comments($activity_ids = array(), $delete_meta = \true) + { + } + /** + * Delete the meta entries associated with a set of activity items. + * + * @since 1.2.0 + * + * @param array $activity_ids Activity IDs whose meta should be deleted. + * @return bool + */ + public static function delete_activity_meta_entries($activity_ids = array()) + { + } + /** + * Append activity comments to their associated activity items. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $activities Activities to fetch comments for. + * @param string $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. + * @return array The updated activities with nested comments. + */ + public static function append_comments($activities, $spam = 'ham_only') + { + } + /** + * Get activity comments that are associated with a specific activity ID. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $activity_id Activity ID to fetch comments for. + * @param int $left Left-most node boundary. + * @param int $right Right-most node boundary. + * @param string $spam Optional. 'ham_only' (default), 'spam_only' or 'all'. + * @param int $top_level_parent_id Optional. The id of the root-level parent activity item. + * @return array The updated activities with nested comments. + */ + public static function get_activity_comments($activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0) + { + } + /** + * Rebuild nested comment tree under an activity or activity comment. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $parent_id ID of an activity or activity comment. + * @param int $left Node boundary start for activity or activity comment. + * @return int Right Node boundary of activity or activity comment. + */ + public static function rebuild_activity_comment_tree($parent_id, $left = 1) + { + } + /** + * Get child comments of an activity or activity comment. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $parent_id ID of an activity or activity comment. + * @return object Numerically indexed array of child comments. + */ + public static function get_child_comments($parent_id) + { + } + /** + * Get a list of components that have recorded activity associated with them. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param bool $skip_last_activity If true, components will not be + * included if the only activity type associated with them is + * 'last_activity'. (Since 2.0.0, 'last_activity' is stored in + * the activity table, but these items are not full-fledged + * activity items.) Default: true. + * @return array List of component names. + */ + public static function get_recorded_components($skip_last_activity = \true) + { + } + /** + * Get sitewide activity items for use in an RSS feed. + * + * @since 1.0.0 + * + * @param int $limit Optional. Number of items to fetch. Default: 35. + * @return array $activity_feed List of activity items, with RSS data added. + */ + public static function get_sitewide_items_for_feed($limit = 35) + { + } + /** + * Create SQL IN clause for filter queries. + * + * @since 1.5.0 + * + * @see BP_Activity_Activity::get_filter_sql() + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $field The database field. + * @param array|bool $items The values for the IN clause, or false when none are found. + * @return string|false + */ + public static function get_in_operator_sql($field, $items) + { + } + /** + * Create filter SQL clauses. + * + * @since 1.5.0 + * + * @param array $filter_array { + * Fields and values to filter by. + * + * @type array|string|int $user_id User ID(s). + * @type array|string $object Corresponds to the 'component' + * column in the database. + * @type array|string $action Corresponds to the 'type' column + * in the database. + * @type array|string|int $primary_id Corresponds to the 'item_id' + * column in the database. + * @type array|string|int $secondary_id Corresponds to the + * 'secondary_item_id' column in the database. + * @type int $offset Return only those items with an ID greater + * than the offset value. + * @type int $offset_lower Return only those items with an ID lower + * than the offset value. + * @type string $since Return only those items that have a + * date_recorded value greater than a + * given MySQL-formatted date. + * } + * @return string The filter clause, for use in a SQL query. + */ + public static function get_filter_sql($filter_array) + { + } + /** + * Get the date/time of last recorded activity. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return string ISO timestamp. + */ + public static function get_last_updated() + { + } + /** + * Get favorite count for a given user. + * + * @since 1.2.0 + * + * @param int $user_id The ID of the user whose favorites you're counting. + * @return int $value A count of the user's favorites. + */ + public static function total_favorite_count($user_id) + { + } + /** + * Check whether an activity item exists with a given string content. + * + * @since 1.1.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $content The content to filter by. + * @return int|false The ID of the first matching item if found, otherwise false. + */ + public static function check_exists_by_content($content) + { + } + /** + * Hide all activity for a given user. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the user whose activity you want to mark hidden. + * @return mixed + */ + public static function hide_all_for_user($user_id) + { + } + } + /** + * The main activity template loop class. + * + * This is responsible for loading a group of activity items and displaying them. + * + * @since 1.0.0 + */ + class BP_Activity_Template + { + /** + * The loop iterator. + * + * @since 1.0.0 + * @var int + */ + public $current_activity = -1; + /** + * The activity count. + * + * @since 1.0.0 + * @var int + */ + public $activity_count; + /** + * The total activity count. + * + * @since 1.0.0 + * @var int + */ + public $total_activity_count; + /** + * Array of activities located by the query. + * + * @since 1.0.0 + * @var array + */ + public $activities; + /** + * The activity object currently being iterated on. + * + * @since 1.0.0 + * @var object + */ + public $activity; + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.0.0 + * @var bool + */ + public $in_the_loop; + /** + * URL parameter key for activity pagination. Default: 'acpage'. + * + * @since 2.1.0 + * @var string + */ + public $pag_arg; + /** + * The page number being requested. + * + * @since 1.0.0 + * @var int + */ + public $pag_page; + /** + * The number of items being requested per page. + * + * @since 1.0.0 + * @var int + */ + public $pag_num; + /** + * An HTML string containing pagination links. + * + * @since 1.0.0 + * @var string + */ + public $pag_links; + /** + * The displayed user's full name. + * + * @since 1.0.0 + * @var string + */ + public $full_name; + /** + * Check if post/comment replies are disabled. + * + * @since 1.0.0 + * @var bool + */ + public $disable_blogforum_replies; + /** + * If more items are available. + * + * @since 1.0.0 + * @var bool + */ + public $has_more_items; + /** + * An array of the logged in user's favorite activities. + * + * @since 1.0.0 + * @var array + */ + public $my_favs; + /** + * An array of parent activities. + * + * @since 1.0.0 + * @var array + */ + public $activity_parents; + /** + * Constructor method. + * + * The arguments passed to this class constructor are of the same + * format as {@link BP_Activity_Activity::get()}. + * + * @since 1.5.0 + * + * @see BP_Activity_Activity::get() for a description of the argument + * structure, as well as default values. + * + * @param array $args { + * Array of arguments. Supports all arguments from + * BP_Activity_Activity::get(), as well as 'page_arg' and + * 'include'. Default values for 'per_page' and 'display_comments' + * differ from the originating function, and are described below. + * @type string $page_arg The string used as a query parameter in + * pagination links. Default: 'acpage'. + * @type array|bool $include Pass an array of activity IDs to + * retrieve only those items, or false to noop the 'include' + * parameter. 'include' differs from 'in' in that 'in' forms + * an IN clause that works in conjunction with other filters + * passed to the function, while 'include' is interpreted as + * an exact list of items to retrieve, which skips all other + * filter-related parameters. Default: false. + * @type int|bool $per_page Default: 20. + * @type string|bool $display_comments Default: 'threaded'. + * } + */ + public function __construct($args) + { + } + /** + * Whether there are activity items available in the loop. + * + * @since 1.0.0 + * + * @see bp_has_activities() + * + * @return bool True if there are items in the loop, otherwise false. + */ + function has_activities() + { + } + /** + * Set up the next activity item and iterate index. + * + * @since 1.0.0 + * + * @return object The next activity item to iterate over. + */ + public function next_activity() + { + } + /** + * Rewind the posts and reset post index. + * + * @since 1.0.0 + */ + public function rewind_activities() + { + } + /** + * Whether there are activity items left in the loop to iterate over. + * + * This method is used by {@link bp_activities()} as part of the while loop + * that controls iteration inside the activities loop, eg: + * while ( bp_activities() ) { ... + * + * @since 1.0.0 + * + * @see bp_activities() + * + * @return bool True if there are more activity items to show, + * otherwise false. + */ + public function user_activities() + { + } + /** + * Set up the current activity item inside the loop. + * + * Used by {@link bp_the_activity()} to set up the current activity item + * data while looping, so that template tags used during that iteration + * make reference to the current activity item. + * + * @since 1.0.0 + * + * @see bp_the_activity() + */ + public function the_activity() + { + } + } + /** + * Main Activity Class. + * + * @since 1.5.0 + */ + #[\AllowDynamicProperties] + class BP_Activity_Component extends \BP_Component + { + /** + * Start the activity component setup process. + * + * @since 1.5.0 + */ + public function __construct() + { + } + /** + * Include component files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes($includes = array()) + { + } + /** + * Late includes method. + * + * Only load up certain code when on specific pages. + * + * @since 3.0.0 + */ + public function late_includes() + { + } + /** + * Set up component global variables. + * + * The BP_ACTIVITY_SLUG constant is deprecated. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @param array $args See BP_Component::setup_globals() for a description. + */ + public function setup_globals($args = array()) + { + } + /** + * Register component navigation. + * + * @since 12.0.0 + * + * @see `BP_Component::register_nav()` for a description of arguments. + * + * @param array $main_nav Optional. See `BP_Component::register_nav()` for description. + * @param array $sub_nav Optional. See `BP_Component::register_nav()` for description. + */ + public function register_nav($main_nav = array(), $sub_nav = array()) + { + } + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_nav() for a description of the $wp_admin_nav + * parameter array. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a + * description. + */ + public function setup_admin_bar($wp_admin_nav = array()) + { + } + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + * + */ + public function setup_title() + { + } + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() + { + } + /** + * Parse the WP_Query and eventually display the component's directory or single item. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. See BP_Component::parse_query() for + * description. + */ + public function parse_query($query) + { + } + /** + * Init the BP REST API. + * + * @since 5.0.0 + * + * @param array $controllers Optional. See BP_Component::rest_api_init() for + * description. + */ + public function rest_api_init($controllers = array()) + { + } + /** + * Register the BP Activity Blocks. + * + * @since 7.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks Optional. See BP_Component::blocks_init() for + * description. + */ + public function blocks_init($blocks = array()) + { + } + } + /** + * oEmbed handler to respond and render single activity items. + * + * @since 2.6.0 + */ + class BP_Activity_oEmbed_Extension extends \BP_Core_oEmbed_Extension + { + /** + * Custom oEmbed slug endpoint. + * + * @since 2.6.0 + * + * @var string + */ + public $slug_endpoint = 'activity'; + /** + * Custom hooks. + * + * @since 2.6.0 + */ + protected function custom_hooks() + { + } + /** + * Add custom endpoint arguments. + * + * Currently, includes 'hide_media'. + * + * @since 2.6.0 + * + * @return array + */ + protected function set_route_args() + { + } + /** + * Output our custom embed template part. + * + * @since 2.6.0 + */ + protected function content() + { + } + /** + * Check if we're on our single activity page. + * + * @since 2.6.0 + * + * @return bool + */ + protected function is_page() + { + } + /** + * Validates the URL to determine if the activity item is valid. + * + * @since 2.6.0 + * + * @param string $url The URL to check. + * @return int|bool Activity ID on success; boolean false on failure. + */ + protected function validate_url_to_item_id($url) + { + } + /** + * Sets the oEmbed response data for our activity item. + * + * @since 2.6.0 + * + * @param int $item_id The activity ID. + * @return array + */ + protected function set_oembed_response_data($item_id) + { + } + /** + * Sets a custom <blockquote> for our oEmbed fallback HTML. + * + * @since 2.6.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param int $item_id The activity ID. + * @return string + */ + protected function set_fallback_html($item_id) + { + } + /** + * Sets a custom <iframe> title for our oEmbed item. + * + * @since 2.6.0 + * + * @param int $item_id The activity ID + * @return string + */ + protected function set_iframe_title($item_id) + { + } + /** + * Use our custom <iframe> sandbox attribute in our oEmbed response. + * + * WordPress sets the <iframe> sandbox attribute to 'allow-scripts' regardless + * of whatever the oEmbed response is in {@link wp_filter_oembed_result()}. We + * need to add back our custom sandbox value so links will work. + * + * @since 2.6.0 + * + * @see BP_Activity_Component::modify_iframe() where our custom sandbox value is set. + * + * @param string $result The oEmbed HTML result. + * @param object $data A data object result from an oEmbed provider. + * @param string $url The URL of the content to be embedded. + * @return string + */ + public function use_custom_iframe_sandbox_attribute($result, $data, $url) + { + } + /** + * Modify various IFRAME-related items if embeds are allowed. + * + * HTML modified: + * - Add sandbox="allow-top-navigation" attribute. This allows links to work + * within the iframe sandbox attribute. + * + * JS modified: + * - Remove IFRAME height restriction of 1000px. Fixes long embed items being + * truncated. + * + * @since 2.6.0 + * + * @param string $retval Current embed HTML. + * @return string + */ + public function modify_iframe($retval) + { + } + /** + * Do stuff when our oEmbed activity header template part is loading. + * + * Currently, removes wpautop() from the bp_activity_action() function. + * + * @since 2.6.0 + * + * @param string $slug Template part slug requested. + * @param string $name Template part name requested. + */ + public function on_activity_header($slug, $name) + { + } + /** + * Prints the markup for the activity embed comments button. + * + * Basically a copy of {@link print_embed_comments_button()}, but modified for + * the BP activity component. + * + * @since 2.6.0 + */ + public function embed_comments_button() + { + } + } + /** + * List table class for the Activity component admin page. + * + * @since 1.6.0 + */ + class BP_Activity_List_Table extends \WP_List_Table + { + /** + * What type of view is being displayed? + * + * E.g. "all", "pending", "approved", "spam"... + * + * @since 1.6.0 + * @var string $view + */ + public $view = 'all'; + /** + * How many activity items have been marked as spam. + * + * @since 1.6.0 + * @var int $spam_count + */ + public $spam_count = 0; + /** + * Total number of activities. + * + * @since 6.0.0 + * @var int $all_count + */ + public $all_count = 0; + /** + * Store activity-to-user-ID mappings for use in the In Response To column. + * + * @since 1.6.0 + * @var array $activity_user_id + */ + protected $activity_user_id = array(); + /** + * If users can comment on post and comment activity items. + * + * @link https://buddypress.trac.wordpress.org/ticket/6277 + * + * @since 2.2.2 + * @var bool $disable_blogforum_comments + */ + public $disable_blogforum_comments = \false; + /** + * Constructor. + * + * @since 1.6.0 + */ + public function __construct() + { + } + /** + * Handle filtering of data, sorting, pagination, and any other data manipulation prior to rendering. + * + * @since 1.6.0 + */ + function prepare_items() + { + } + /** + * Get an array of all the columns on the page. + * + * @since 1.6.0 + * + * @return array Column headers. + */ + function get_column_info() + { + } + /** + * Get name of default primary column + * + * @since 2.3.3 + * + * @return string + */ + protected function get_default_primary_column_name() + { + } + /** + * Display a message on screen when no items are found (e.g. no search matches). + * + * @since 1.6.0 + */ + function no_items() + { + } + /** + * Output the Activity data table. + * + * @since 1.6.0 + */ + function display() + { + } + /** + * Generate content for a single row of the table. + * + * @since 1.6.0 + * + * @param object $item The current item. + */ + function single_row($item) + { + } + /** + * Get the list of views available on this table (e.g. "all", "spam"). + * + * @since 1.6.0 + */ + function get_views() + { + } + /** + * Get bulk actions. + * + * @since 1.6.0 + * + * @return array Key/value pairs for the bulk actions dropdown. + */ + public function get_bulk_actions() + { + } + /** + * Get the table column titles. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @return array The columns to appear in the Activity list table. + */ + function get_columns() + { + } + /** + * Get the column names for sortable columns. + * + * @since 1.6.0 + * + * @return array The columns that can be sorted on the Activity screen. + */ + public function get_sortable_columns() + { + } + /** + * Markup for the "filter" part of the form (i.e. which activity type to display). + * + * @since 1.6.0 + * + * @param string $which 'top' or 'bottom'. + */ + function extra_tablenav($which) + { + } + /** + * Override WP_List_Table::row_actions(). + * + * Basically a duplicate of the row_actions() method, but removes the + * unnecessary <button> addition. + * + * @since 2.3.3 + * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. + * + * @param array $actions The list of actions. + * @param bool $always_visible Whether the actions should be always visible. + * @return string + */ + public function row_actions($actions, $always_visible = \false) + { + } + /** + * Checkbox column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_cb($item) + { + } + /** + * Author column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_author($item) + { + } + /** + * Action column markup. + * + * @since 2.0.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_action($item) + { + } + /** + * Content column, and "quick admin" rollover actions. + * + * Called "comment" in the CSS so we can re-use some WP core CSS. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_comment($item) + { + } + /** + * "In response to" column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_response($item) + { + } + /** + * Allow plugins to add their custom column. + * + * @since 2.4.0 + * + * @param array $item Information about the current row. + * @param string $column_name The column name. + * @return string + */ + public function column_default($item = array(), $column_name = '') + { + } + /** + * Get the user id associated with a given activity item. + * + * Wraps bp_activity_get_specific(), with some additional logic for + * avoiding duplicate queries. + * + * @since 1.6.0 + * + * @param int $activity_id Activity ID to retrieve User ID for. + * @return int User ID of the activity item in question. + */ + protected function get_activity_user_id($activity_id) + { + } + /** + * Checks if an activity item can be replied to. + * + * This method merges functionality from {@link bp_activity_can_comment()} and + * {@link bp_blogs_disable_activity_commenting()}. This is done because the activity + * list table doesn't use a BuddyPress activity loop, which prevents those + * functions from working as intended. + * + * @since 2.0.0 + * @since 2.5.0 Include Post type activities types + * + * @param array $item An array version of the BP_Activity_Activity object. + * @return bool $can_comment + */ + protected function can_comment($item) + { + } + /** + * Flatten the activity array. + * + * In some cases, BuddyPress gives us a structured tree of activity + * items plus their comments. This method converts it to a flat array. + * + * @since 1.6.0 + * + * @param array $tree Source array. + * @return array Flattened array. + */ + public static function flatten_activity_array($tree) + { + } + } + /** + * The main theme compat class for BuddyPress Activity. + * + * This class sets up the necessary theme compatibility actions to safely output + * activity template parts to the_title and the_content areas of a theme. + * + * @since 1.7.0 + */ + class BP_Activity_Theme_Compat + { + /** + * Set up the activity component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() + { + } + /** + * Set up the theme compatibility hooks, if we're looking at an activity page. + * + * @since 1.7.0 + */ + public function is_activity() + { + } + /** Directory *************************************************************/ + /** + * Add template hierarchy to theme compat for the activity directory page. + * + * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function directory_template_hierarchy($templates) + { + } + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() + { + } + /** + * Filter the_content with the groups index template part. + * + * @since 1.7.0 + */ + public function directory_content() + { + } + /** Single ****************************************************************/ + /** + * Add custom template hierarchy to theme compat for activity permalink pages. + * + * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @param string $templates The templates from bp_get_theme_compat_templates(). + * @return array $templates Array of custom templates to look for. + */ + public function single_template_hierarchy($templates) + { + } + /** + * Update the global $post with the displayed user's data. + * + * @since 1.7.0 + */ + public function single_dummy_post() + { + } + /** + * Filter the_content with the members' activity permalink template part. + * + * @since 1.7.0 + */ + public function single_dummy_content() + { + } + } +} +namespace { + // Required PHP version. + \define('BP_REQUIRED_PHP_VERSION', '5.6.0'); + /** + * The main function responsible for returning the one true BuddyPress Instance to functions everywhere. + * + * Use this function like you would a global variable, except without needing + * to declare the global. + * + * Example: <?php $bp = buddypress(); ?> + * + * @return BuddyPress|null The one true BuddyPress Instance. + */ + function buddypress() + { + } + /** + * Adds an admin notice to installations that don't meet BP's minimum PHP requirement. + * + * @since 2.8.0 + */ + function bp_php_requirements_notice() + { + } + /** + * Output the blogs component slug. + * + * @since 1.5.0 + * + */ + function bp_blogs_slug() + { + } + /** + * Return the blogs component slug. + * + * @since 1.5.0 + * + * @return string The 'blogs' slug. + */ + function bp_get_blogs_slug() + { + } + /** + * Output the blogs component root slug. + * + * @since 1.5.0 + * + */ + function bp_blogs_root_slug() + { + } + /** + * Return the blogs component root slug. + * + * @since 1.5.0 + * + * @return string The 'blogs' root slug. + */ + function bp_get_blogs_root_slug() + { + } + /** + * Output Blogs directory's URL. + * + * @since 12.0.0 + */ + function bp_blogs_directory_url() + { + } + /** + * Returns the Blogs directory's URL. + * + * @since 12.0.0 + * + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type int $create_single_item `1` to get the Blogs create link. + * } + * @return string The URL built for the BP Rewrites URL parser. + */ + function bp_get_blogs_directory_url($path_chunks = array()) + { + } + /** + * Rewind the blogs and reset blog index. + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + */ + function bp_rewind_blogs() + { + } + /** + * Initialize the blogs loop. + * + * Based on the $args passed, bp_has_blogs() populates the $blogs_template + * global, enabling the use of BuddyPress templates and template functions to + * display a list of blogs. + * + * @since 1.0.0 + * @since 1.2.0 Added $type, $page, $search_terms parameters + * @since 1.6.0 Added $page_arg parameter + * @since 2.0.0 Added $include_blog_ids, $update_meta_cache parameters + * @since 10.0.0 Added $date_query parameter + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @param array|string $args { + * Arguments for limiting the contents of the blogs loop. Most arguments + * are in the same format as {@link BP_Blogs_Blog::get()}. However, because + * the format of the arguments accepted here differs in a number of ways, + * and because bp_has_blogs() determines some default arguments in a + * dynamic fashion, we list all accepted arguments here as well. + * + * @type int $page Which page of results to fetch. Using page=1 without + * per_page will result in no pagination. Default: 1. + * @type int|bool $per_page Number of results per page. Default: 20. + * @type string $page_arg The string used as a query parameter in + * pagination links. Default: 'bpage'. + * @type int|bool $max Maximum number of results to return. + * Default: false (unlimited). + * @type string $type The order in which results should be fetched. + * 'active', 'alphabetical', 'newest', or 'random'. + * @type array $include_blog_ids Array of blog IDs to limit results to. + * @type string $search_terms Limit results by a search term. Default: the value of `$_REQUEST['s']` or + * `$_REQUEST['sites_search']`, if present. + * @type int $user_id The ID of the user whose blogs should be retrieved. + * When viewing a user profile page, 'user_id' defaults to the + * ID of the displayed user. Otherwise the default is false. + * @type array $date_query Filter results by site last activity date. See first parameter of + * {@link WP_Date_Query::__construct()} for syntax. Only applicable if + * $type is either 'newest' or 'active'. + * } + * @return bool Returns true when blogs are found, otherwise false. + */ + function bp_has_blogs($args = '') + { + } + /** + * Determine if there are still blogs left in the loop. + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return bool Returns true when blogs are found. + */ + function bp_blogs() + { + } + /** + * Get the current blog object in the loop. + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return object The current blog within the loop. + */ + function bp_the_blog() + { + } + /** + * Output the blogs pagination count. + * + * @since 1.0.0 + */ + function bp_blogs_pagination_count() + { + } + /** + * Get the blogs pagination count. + * + * @since 2.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return string + */ + function bp_get_blogs_pagination_count() + { + } + /** + * Output the blogs pagination links. + */ + function bp_blogs_pagination_links() + { + } + /** + * Return the blogs pagination links. + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return string HTML pagination links. + */ + function bp_get_blogs_pagination_links() + { + } + /** + * Output a blog's avatar. + * + * @see bp_get_blog_avatar() for description of arguments. + * + * @param array|string $args See {@link bp_get_blog_avatar()}. + */ + function bp_blog_avatar($args = '') + { + } + /** + * Get a blog's avatar. + * + * At the moment, unless the blog has a site icon, the blog's avatar defaults + * to the /bp-core/images/mystery-blog.png image or the Blog's Admin user avatar + * if the `admin_user_id` argument contains the Blog's Admin user ID. + * + * @since 2.4.0 Introduced `$title` argument. + * @since 6.0.0 Introduced the `$blog_id`, `$admin_user_id` and `html` arguments. + * @since 7.0.0 Introduced the Blog's default avatar {@see bp_blogs_default_avatar()}. + * Removed the `'bp_get_blog_avatar_' . $blog_id` filter (it was deprecated since 1.5). + * + * @see bp_core_fetch_avatar() For a description of arguments and + * return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $alt Default: 'Profile picture of site author [user name]'. + * @type string $class Default: 'avatar'. + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type bool $id Currently unused. + * @type bool $no_grav Default: false. + * @type int $blog_id The blog ID. Default: O. + * @type int $admin_user_id The Blog Admin user ID. Default: 0. + * @type bool $html Default: true. + * } + * @return string User avatar string. + */ + function bp_get_blog_avatar($args = '') + { + } + function bp_blog_permalink() + { + } + function bp_get_blog_permalink() + { + } + /** + * Output the name of the current blog in the loop. + */ + function bp_blog_name() + { + } + /** + * Return the name of the current blog in the loop. + * + * @return string The name of the current blog in the loop. + */ + function bp_get_blog_name() + { + } + /** + * Output the ID of the current blog in the loop. + * + * @since 1.7.0 + */ + function bp_blog_id() + { + } + /** + * Return the ID of the current blog in the loop. + * + * @since 1.7.0 + * + * @return int ID of the current blog in the loop. + */ + function bp_get_blog_id() + { + } + /** + * Output the description of the current blog in the loop. + */ + function bp_blog_description() + { + } + /** + * Return the description of the current blog in the loop. + * + * @return string Description of the current blog in the loop. + */ + function bp_get_blog_description() + { + } + /** + * Output the row class of the current blog in the loop. + * + * @since 1.7.0 + * + * @param array $classes Array of custom classes. + */ + function bp_blog_class($classes = array()) + { + } + /** + * Return the row class of the current blog in the loop. + * + * @since 1.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @param array $classes Array of custom classes. + * @return string Row class of the site. + */ + function bp_get_blog_class($classes = array()) + { + } + /** + * Output the last active date of the current blog in the loop. + * + * @param array $args See {@link bp_get_blog_last_active()}. + */ + function bp_blog_last_active($args = array()) + { + } + /** + * Return the last active date of the current blog in the loop. + * + * @param array $args { + * Array of optional arguments. + * @type bool $active_format If true, formatted "Active 5 minutes ago". + * If false, formatted "5 minutes ago". + * Default: true. + * } + * @return string Last active date. + */ + function bp_get_blog_last_active($args = array()) + { + } + /** + * Output the latest post from the current blog in the loop. + * + * @param array $args See {@link bp_get_blog_latest_post()}. + */ + function bp_blog_latest_post($args = array()) + { + } + /** + * Return the latest post from the current blog in the loop. + * + * @param array $args { + * Array of optional arguments. + * @type bool $latest_format If true, formatted "Latest post: [link to post]". + * If false, formatted "[link to post]". + * Default: true. + * } + * @return string $retval String of the form 'Latest Post: [link to post]'. + */ + function bp_get_blog_latest_post($args = array()) + { + } + /** + * Output the title of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @see bp_get_blog_latest_post_title() + */ + function bp_blog_latest_post_title() + { + } + /** + * Return the title of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return string Post title. + */ + function bp_get_blog_latest_post_title() + { + } + /** + * Output the permalink of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @see bp_get_blog_latest_post_title() + */ + function bp_blog_latest_post_permalink() + { + } + /** + * Return the permalink of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return string URL of the blog's latest post. + */ + function bp_get_blog_latest_post_permalink() + { + } + /** + * Output the content of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + */ + function bp_blog_latest_post_content() + { + } + /** + * Return the content of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @return string Content of the blog's latest post. + */ + function bp_get_blog_latest_post_content() + { + } + /** + * Output the featured image of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @see bp_get_blog_latest_post_content() For description of parameters. + * + * @param string $size See {@link bp_get_blog_latest_post_featured_image()}. + */ + function bp_blog_latest_post_featured_image($size = 'thumbnail') + { + } + /** + * Return the featured image of the latest post on the current blog in the loop. + * + * @since 1.7.0 + * + * @global BP_Blogs_Template $blogs_template The main blog template loop class. + * + * @param string $size Image version to return. 'thumbnail', 'medium', + * 'large', or 'post-thumbnail'. Default: 'thumbnail'. + * @return string URL of the image. + */ + function bp_get_blog_latest_post_featured_image($size = 'thumbnail') + { + } + /** + * Does the latest blog post have a featured image? + * + * @since 1.7.0 + * + * @param string $thumbnail Image version to return. 'thumbnail', 'medium', 'large', + * or 'post-thumbnail'. Default: 'thumbnail'. + * @return bool True if the latest blog post from the current blog has a + * featured image of the given size. + */ + function bp_blog_latest_post_has_featured_image($thumbnail = 'thumbnail') + { + } + /** + * Output hidden fields to help with form submissions in Sites directory. + * + * This function detects whether 's', 'letter', or 'blogs_search' requests are + * currently being made (as in a URL parameter), and creates corresponding + * hidden fields. + */ + function bp_blog_hidden_fields() + { + } + /** + * Output the total number of blogs on the site. + */ + function bp_total_blog_count() + { + } + /** + * Return the total number of blogs on the site. + * + * @return int Total number of blogs. + */ + function bp_get_total_blog_count() + { + } + /** + * Output the total number of blogs for a given user. + * + * @param int $user_id ID of the user. + */ + function bp_total_blog_count_for_user($user_id = 0) + { + } + /** + * Return the total number of blogs for a given user. + * + * @param int $user_id ID of the user. + * @return int Total number of blogs for the user. + */ + function bp_get_total_blog_count_for_user($user_id = 0) + { + } + /** Blog Registration ********************************************************/ + /** + * Output the wrapper markup for the blog signup form. + * + * @since 1.0.0 + * + * @param string $blogname Optional. The default blog name (path or domain). + * @param string $blog_title Optional. The default blog title. + * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous + * submission attempt. + */ + function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') + { + } + /** + * Output the input fields for the blog creation form. + * + * @since 1.0.0 + * + * @param string $blogname Optional. The default blog name (path or domain). + * @param string $blog_title Optional. The default blog title. + * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous + * submission attempt. + */ + function bp_blogs_signup_blog($blogname = '', $blog_title = '', $errors = '') + { + } + /** + * Process a blog registration submission. + * + * Passes submitted values to {@link wpmu_create_blog()}. + * + * @since 1.0.0 + * + * @return bool|int|WP_Error False if not a form submission, the Blog ID on success, a WP_Error object on failure. + */ + function bp_blogs_validate_blog_signup() + { + } + /** + * Display a message after successful blog registration. + * + * @since 1.0.0 + * @since 2.6.0 Introduced `$blog_id` parameter. + * + * @param string $domain The new blog's domain. + * @param string $path The new blog's path. + * @param string $blog_title The new blog's title. + * @param string $user_name The user name of the user who created the blog. Unused. + * @param string $user_email The email of the user who created the blog. Unused. + * @param string|array $meta Meta values associated with the new blog. Unused. + * @param int|null $blog_id ID of the newly created blog. + */ + function bp_blogs_confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '', $blog_id = \null) + { + } + /** + * Output a "Create a Site" link for users viewing their own profiles. + * + * This function is not used by BuddyPress as of 1.2, but is kept here for older + * themes that may still be using it. + */ + function bp_create_blog_link() + { + } + /** + * Output the blog directory search form. + * + * @since 1.9.0 + */ + function bp_directory_blogs_search_form() + { + } + /** + * Output the Create a Site button. + * + * @since 2.0.0 + */ + function bp_blog_create_button() + { + } + /** + * Get the Create a Site button. + * + * @since 2.0.0 + * + * @return false|string + */ + function bp_get_blog_create_button() + { + } + /** + * Output the Create a Site nav item. + * + * @since 2.2.0 + */ + function bp_blog_create_nav_item() + { + } + /** + * Get the Create a Site nav item. + * + * @since 2.2.0 + * + * @return string + */ + function bp_get_blog_create_nav_item() + { + } + /** + * Checks if a specific theme is still filtering the Blogs directory title + * if so, transform the title button into a Blogs directory nav item. + * + * @since 2.2.0 + */ + function bp_blog_backcompat_create_nav_item() + { + } + /** + * Output button for visiting a blog in a loop. + * + * @see bp_get_blogs_visit_blog_button_args() for description of arguments. + * + * @param array|string $args See {@link bp_get_blogs_visit_blog_button_args()}. + */ + function bp_blogs_visit_blog_button($args = '') + { + } + /** + * Return the arguments of the button for visiting a blog in a loop. + * + * @see BP_Button for a complete description of arguments and return + * value. + * + * @since 11.0.0 + * + * @param array|string $args { + * Arguments are listed below, with their default values. For a + * complete description of arguments, see {@link BP_Button}. + * @type string $id Default: 'visit_blog'. + * @type string $component Default: 'blogs'. + * @type bool $must_be_logged_in Default: false. + * @type bool $block_self Default: false. + * @type string $wrapper_class Default: 'blog-button visit'. + * @type string $link_href Permalink of the current blog in the loop. + * @type string $link_class Default: 'blog-button visit'. + * @type string $link_text Default: 'Visit Site'. + * @type string $link_title Default: 'Visit Site'. + * } + * @return array Thhe arguments of the button for visiting a blog in a loop. + */ + function bp_get_blogs_visit_blog_button_args($args = '') + { + } + /** + * Return button for visiting a blog in a loop. + * + * @see BP_Button for a complete description of arguments and return + * value. + * + * @see bp_get_blogs_visit_blog_button_args() for description of arguments. + * + * @param array|string $args See {@link bp_get_blogs_visit_blog_button_args()}. + * @return string The HTML for the Visit button. + */ + function bp_get_blogs_visit_blog_button($args = '') + { + } + /** Stats **********************************************************************/ + /** + * Display the number of blogs in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args Before|after|user_id. + */ + function bp_blogs_profile_stats($args = '') + { + } + /** + * Return the number of blogs in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args Before|after|user_id. + * @return string HTML for stats output. + */ + function bp_blogs_get_profile_stats($args = '') + { + } + /** + * Check whether the $bp global lists an activity directory page. + * + * @since 1.5.0 + * + * @return bool True if set, false if empty. + */ + function bp_blogs_has_directory() + { + } + /** + * Retrieve a set of blogs. + * + * @since 1.2.0 + * @since 2.0.0 Added $include_blog_ids, $update_meta_cache parameters + * @since 10.0.0 Added $date_query parameter + * + * @see BP_Blogs_Blog::get() for a description of arguments and return value. + * + * @param array|string $args { + * Arguments are listed here with their default values. For more + * information about the arguments, see {@link BP_Blogs_Blog::get()}. + * @type string $type Default: 'active'. + * @type int|bool $user_id Default: false. + * @type array $include_blog_ids Default: false. + * @type string|bool $search_terms Default: false. + * @type int $per_page Default: 20. + * @type int $page Default: 1. + * @type array $date_query Default: false. + * @type bool $update_meta_cache Whether to pre-fetch blogmeta. Default: true. + * } + * @return array See {@link BP_Blogs_Blog::get()}. + */ + function bp_blogs_get_blogs($args = '') + { + } + /** + * Populate the BP blogs table with existing blogs. + * + * Warning: By default, this will remove all existing records from the BP + * blogs and blogmeta tables before re-populating the tables. + * + * @since 1.0.0 + * @since 2.6.0 Accepts $args as a parameter. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of arguments. + * @type int $offset The offset to use. + * @type int $limit The number of blogs to record at one time. + * @type array $blog_ids Blog IDs to record. If empty, all blogs will be recorded. + * @type array $site_id The network site ID to use. + * } + * @return bool + */ + function bp_blogs_record_existing_blogs($args = array()) + { + } + /** + * Check whether a given blog should be recorded in activity streams. + * + * If $user_id is provided, you can restrict site from being recordable + * only to particular users. + * + * @since 1.7.0 + * + * @param int $blog_id ID of the blog being checked. + * @param int $user_id Optional. ID of the user for whom access is being checked. + * @return bool True if blog is recordable, otherwise false. + */ + function bp_blogs_is_blog_recordable($blog_id, $user_id = 0) + { + } + /** + * Check whether a given blog should be tracked by the Blogs component. + * + * If $user_id is provided, the developer can restrict site from + * being trackable only to particular users. + * + * @since 1.7.0 + * + * @param int $blog_id ID of the blog being checked. + * @param int $user_id Optional. ID of the user for whom access is being checked. + * @return bool True if blog is trackable, otherwise false. + */ + function bp_blogs_is_blog_trackable($blog_id, $user_id = 0) + { + } + /** + * Make BuddyPress aware of a new site so that it can track its activity. + * + * @since 1.0.0 + * + * @param int $blog_id ID of the blog being recorded. + * @param int $user_id ID of the user for whom the blog is being recorded. + * @param bool $no_activity Optional. Whether to skip recording an activity + * item about this blog creation. Default: false. + */ + function bp_blogs_record_blog($blog_id, $user_id, $no_activity = \false) + { + } + /** + * Update blog name in BuddyPress blogmeta table. + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_blogname($oldvalue, $newvalue) + { + } + /** + * Update blog description in BuddyPress blogmeta table. + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_blogdescription($oldvalue, $newvalue) + { + } + /** + * Update "Close comments for old posts" option in BuddyPress blogmeta table. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_close_comments_for_old_posts($oldvalue, $newvalue) + { + } + /** + * Update "Close comments after days old" option in BuddyPress blogmeta table. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_close_comments_days_old($oldvalue, $newvalue) + { + } + /** + * When toggling threaded comments, update thread depth in blogmeta table. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_thread_comments($oldvalue, $newvalue) + { + } + /** + * When updating comment depth, update thread depth in blogmeta table. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $oldvalue Value before save. Passed by do_action() but + * unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_thread_comments_depth($oldvalue, $newvalue) + { + } + /** + * When updating comment moderation, mirror value in blogmeta table. + * + * @since 3.0.0 + * + * @param string $oldvalue Value before save. Passed by do_action() but unused here. + * @param string $newvalue Value to change meta to. + */ + function bp_blogs_update_option_comment_moderation($oldvalue, $newvalue) + { + } + /** + * Syncs site icon URLs to blogmeta. + * + * @since 2.7.0 + * + * @param int|string $old_value Old value + * @param int|string $new_value New value + */ + function bp_blogs_update_option_site_icon($old_value, $new_value) + { + } + /** + * Deletes the 'url' blogmeta for a site. + * + * Fires when a site's details are updated, which generally happens when + * editing a site under "Network Admin > Sites". + * + * @since 2.3.0 + * + * @param int $site_id The site ID. + */ + function bp_blogs_delete_url_blogmeta($site_id = 0) + { + } + /** + * Record activity metadata about a published blog post. + * + * @since 2.2.0 + * + * @param int $activity_id ID of the activity item. + * @param WP_Post $post Post object. + * @param array $args Array of arguments. + */ + function bp_blogs_publish_post_activity_meta($activity_id, $post, $args) + { + } + /** + * Updates a blog post's activity meta entry during a post edit. + * + * @since 2.2.0 + * @since 2.5.0 Add the post type tracking args object parameter + * + * @param WP_Post $post Post object. + * @param BP_Activity_Activity $activity Activity object. + * @param object $activity_post_object The post type tracking args object. + */ + function bp_blogs_update_post_activity_meta($post, $activity, $activity_post_object) + { + } + /** + * Update Activity and blogs meta and eventually sync comment with activity comment + * + * @since 2.5.0 + * + * @param int|bool $activity_id ID of recorded activity, or false if sync is active. + * @param WP_Comment|null $comment The comment object. + * @param array $activity_args Array of activity arguments. + * @param object|null $activity_post_object The post type tracking args object. + */ + function bp_blogs_comment_sync_activity_comment(&$activity_id, $comment = \null, $activity_args = array(), $activity_post_object = \null) + { + } + /** + * Record a user's association with a blog. + * + * This function is hooked to several WordPress actions where blog roles are + * set/changed ('add_user_to_blog', 'profile_update', 'user_register'). It + * parses the changes, and records them as necessary in the BP blog tracker. + * + * BuddyPress does not track blogs for users with the 'subscriber' role by + * default, though as of 2.1.0 you can filter 'bp_blogs_get_allowed_roles' to + * modify this behavior. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the user. + * @param string|bool $role User's WordPress role for this blog ID. + * @param int $blog_id Blog ID user is being added to. + */ + function bp_blogs_add_user_to_blog($user_id, $role = \false, $blog_id = 0) + { + } + /** + * The allowed blog roles a member must have to be recorded into the + * `bp_user_blogs` pointer table. + * + * This added and was made filterable in BuddyPress 2.1.0 to make it easier + * to extend the functionality of the Blogs component. + * + * @since 2.1.0 + * + * @return array + */ + function bp_blogs_get_allowed_roles() + { + } + /** + * Remove a blog-user pair from BP's blog tracker. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose blog is being removed. + * @param int $blog_id Optional. ID of the blog being removed. Default: current blog ID. + */ + function bp_blogs_remove_user_from_blog($user_id, $blog_id = 0) + { + } + /** + * Rehook WP's maybe_add_existing_user_to_blog with a later priority. + * + * WordPress catches add-user-to-blog requests at init:10. In some cases, this + * can precede BP's Blogs component. This function bumps the priority of the + * core function, so that we can be sure that the Blogs component is loaded + * first. See https://buddypress.trac.wordpress.org/ticket/3916. + * + * @since 1.6.0 + */ + function bp_blogs_maybe_add_user_to_blog() + { + } + /** + * Remove the "blog created" item from the BP blogs tracker and activity stream. + * + * @param int $blog_id ID of the blog being removed. + */ + function bp_blogs_remove_blog($blog_id) + { + } + /** + * Remove a blog from the tracker for a specific user. + * + * @param int $user_id ID of the user for whom the blog is being removed. + * @param int $blog_id ID of the blog being removed. + */ + function bp_blogs_remove_blog_for_user($user_id, $blog_id) + { + } + /** + * Remove a synced activity comment from the activity stream. + * + * @since 2.5.0 + * + * @param bool $deleted True when a comment post type activity was successfully removed. + * @param int $comment_id ID of the comment to be removed. + * @param object $activity_post_object The post type tracking args object. + * @param string $activity_type The post type comment activity type. + */ + function bp_blogs_post_type_remove_comment($deleted, $comment_id, $activity_post_object, $activity_type = '') + { + } + /** + * Removes blog comments that are associated with activity comments. + * + * @since 2.0.0 + * + * @see bp_blogs_remove_synced_comment() + * @see bp_blogs_sync_delete_from_activity_comment() + * + * @param array $activity_ids The activity IDs to check association with blog + * comments. + * @param bool $force_delete Whether to force delete the comments. If false, + * comments are trashed instead. + */ + function bp_blogs_remove_associated_blog_comments($activity_ids = array(), $force_delete = \true) + { + } + /** + * Get the total number of blogs being tracked by BuddyPress. + * + * @return int $count Total blog count. + */ + function bp_blogs_total_blogs() + { + } + /** + * Get the total number of blogs being tracked by BP for a specific user. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user being queried. Default: on a user page, + * the displayed user. Otherwise, the logged-in user. + * @return int $count Total blog count for the user. + */ + function bp_blogs_total_blogs_for_user($user_id = 0) + { + } + /** + * Remove the all data related to a given blog from the BP blogs tracker and activity stream. + * + * @param int $blog_id The ID of the blog to expunge. + */ + function bp_blogs_remove_data_for_blog($blog_id) + { + } + /** + * Get all of a user's blogs, as tracked by BuddyPress. + * + * @see BP_Blogs_Blog::get_blogs_for_user() for a description of parameters + * and return values. + * + * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}. + * @param bool $show_hidden See {@BP_Blogs_Blog::get_blogs_for_user()}. + * @return array See {@BP_Blogs_Blog::get_blogs_for_user()}. + */ + function bp_blogs_get_blogs_for_user($user_id, $show_hidden = \false) + { + } + /** + * Retrieve a list of all blogs. + * + * @see BP_Blogs_Blog::get_all() for a description of parameters and return values. + * + * @param int|null $limit See {@BP_Blogs_Blog::get_all()}. + * @param int|null $page See {@BP_Blogs_Blog::get_all()}. + * @return array See {@BP_Blogs_Blog::get_all()}. + */ + function bp_blogs_get_all_blogs($limit = \null, $page = \null) + { + } + /** + * Retrieve a random list of blogs. + * + * @see BP_Blogs_Blog::get() for a description of parameters and return values. + * + * @param int|null $per_page See {@BP_Blogs_Blog::get()}. + * @param int|null $page See {@BP_Blogs_Blog::get()}. + * @return array See {@BP_Blogs_Blog::get()}. + */ + function bp_blogs_get_random_blogs($per_page = \null, $page = \null) + { + } + /** + * Check whether a given blog is hidden. + * + * @see BP_Blogs_Blog::is_hidden() for a description of parameters and return values. + * + * @param int $blog_id See {@BP_Blogs_Blog::is_hidden()}. + * @return bool See {@BP_Blogs_Blog::is_hidden()}. + */ + function bp_blogs_is_blog_hidden($blog_id) + { + } + /* + * Blog meta functions + * + * These functions are used to store specific blogmeta in one global table, + * rather than in each blog's options table. Significantly speeds up global blog + * queries. By default each blog's name, description and last updated time are + * stored and synced here. + */ + /** + * Delete a metadata from the DB for a blog. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $blog_id ID of the blog whose metadata is being deleted. + * @param string|bool $meta_key Optional. The key of the metadata being deleted. If + * omitted, all BP metadata associated with the blog will + * be deleted. + * @param string|bool $meta_value Optional. If present, the metadata will only be + * deleted if the meta_value matches this parameter. + * @param bool $delete_all Optional. If true, delete matching metadata entries for + * all objects, ignoring the specified blog_id. Otherwise, only + * delete matching metadata entries for the specified blog. + * Default: false. + * @return bool + */ + function bp_blogs_delete_blogmeta($blog_id, $meta_key = \false, $meta_value = \false, $delete_all = \false) + { + } + /** + * Get metadata for a given blog. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $blog_id ID of the blog whose metadata is being requested. + * @param string $meta_key Optional. If present, only the metadata matching + * that meta key will be returned. Otherwise, all + * metadata for the blog will be fetched. + * @param bool $single Optional. If true, return only the first value of the + * specified meta_key. This parameter has no effect if + * meta_key is not specified. Default: true. + * @return mixed The meta value(s) being requested. + */ + function bp_blogs_get_blogmeta($blog_id, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of blog meta. + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $blog_id ID of the blog whose metadata is being updated. + * @param string $meta_key Key of the metadata being updated. + * @param mixed $meta_value Value to be set. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise, update all entries. + * @return bool|int Returns false on failure. On successful update of existing + * metadata, returns true. On successful creation of new metadata, + * returns the integer ID of the new metadata row. + */ + function bp_blogs_update_blogmeta($blog_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of blog metadata. + * + * @since 2.0.0 + * + * @param int $blog_id ID of the blog. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @param bool $unique Optional. Whether to enforce a single metadata value + * for the given key. If true, and the object already has a value for + * the key, no change will be made. Default: false. + * @return int|bool The meta ID on successful update, false on failure. + */ + function bp_blogs_add_blogmeta($blog_id, $meta_key, $meta_value, $unique = \false) + { + } + /** + * Remove all blog associations for a given user. + * + * @param int $user_id ID whose blog data should be removed. + */ + function bp_blogs_remove_data($user_id) + { + } + /** + * Deletes user XProfile data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_blogs_remove_data_on_delete_user($user_id) + { + } + /** + * Restore all blog associations for a given user. + * + * @since 2.2.0 + * + * @param int $user_id ID whose blog data should be restored. + */ + function bp_blogs_restore_data($user_id = 0) + { + } + /** + * Checks whether blog creation is enabled. + * + * Returns true when blog creation is enabled for logged-in users only, or + * when it's enabled for new registrations. + * + * @since 1.0.0 + * @since 7.0.0 The function has been moved into `bp-blogs/bp-blogs-functions.php`. + * + * @return bool True if blog registration is enabled. + */ + function bp_blog_signup_enabled() + { + } + /** + * Returns the Blog signup's submitted vars. + * + * @since 7.0.0 + * + * @return array An associative array containing the Blog signup's submitted vars. + */ + function bp_blogs_get_signup_form_submitted_vars() + { + } + /** + * Validate a blog creation submission. + * + * Essentially, a wrapper for {@link wpmu_validate_blog_signup()}. + * + * @since 1.0.0 + * @since 7.0.0 Add the blog_name and blog_title parameters. + * The function has been moved into `bp-blogs/bp-blogs-functions.php`. + * + * @return array Contains the new site data and error messages. + */ + function bp_blogs_validate_blog_form($blog_name = '', $blog_title = '') + { + } + /** + * Gets the site icon URL even when BuddyPress is not network activated. + * + * @since 7.0.0 + * + * @param integer $blog_id The ID of the blog to get the site icon URL for. + * @param integer $size The size of the site icon. + * @return string The site icon URL + */ + function bp_blogs_get_site_icon_url($blog_id = 0, $size = 512) + { + } + /** + * Slurp up blogmeta for a specified set of blogs. + * + * It grabs all blogmeta associated with all of the blogs passed + * in $blog_ids and adds it to the WP cache. This improves efficiency when + * using querying blogmeta inline. + * + * @param int|string|array|bool $blog_ids Accepts a single blog ID, or a comma- + * separated list or array of blog IDs. + */ + function bp_blogs_update_meta_cache($blog_ids = \false) + { + } + /** + * Clear the blog object cache. + * + * @since 1.0.0 + * + * @param int $blog_id ID of the current blog. + * @param int $user_id ID of the user whose blog cache should be cleared. + */ + function bp_blogs_clear_blog_object_cache($blog_id = 0, $user_id = 0) + { + } + /** + * Callback function to render the Recent Posts Block. + * + * @since 9.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_blogs_render_recent_posts_block($attributes = array()) + { + } + /** + * Set up the bp-blogs component. + * + * @since 1.5.0 + */ + function bp_setup_blogs() + { + } + /** + * Register activity actions for the blogs component. + * + * @since 1.0.0 + */ + function bp_blogs_register_activity_actions() + { + } + /** + * Set up the tracking arguments for the 'post' post type. + * + * @since 2.5.0 This was moved out of the BP_Blogs_Component class. + * + * @see bp_activity_get_post_type_tracking_args() for information on parameters. + * + * @param object|null $params Tracking arguments. + * @param string|int $post_type Post type to track. + * @return object|null + */ + function bp_blogs_register_post_tracking_args($params = \null, $post_type = 0) + { + } + /** + * Returns the blog URL and name which relates to a post or comment activity. + * + * @since 11.0.0 + * + * @param BP_Activity_Activity $activity The activity object. + * @return array The blog URL and name which relates to a post or comment activity. + */ + function bp_blogs_activity_get_site_link_meta($activity = \null) + { + } + /** + * Format 'new_blog' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string Constructed activity action. + */ + function bp_blogs_format_activity_action_new_blog($action, $activity) + { + } + /** + * Format 'new_blog_post' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string Constructed activity action. + */ + function bp_blogs_format_activity_action_new_blog_post($action, $activity) + { + } + /** + * Format 'new_blog_comment' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string Constructed activity action. + */ + function bp_blogs_format_activity_action_new_blog_comment($action, $activity) + { + } + /** + * Fetch data related to blogs at the beginning of an activity loop. + * + * This reduces database overhead during the activity loop. + * + * @since 2.0.0 + * + * @param array $activities Array of activity items. + * @return array + */ + function bp_blogs_prefetch_activity_object_data($activities) + { + } + /** + * Record blog-related activity to the activity stream. + * + * @since 1.0.0 + * + * @see bp_activity_add() for description of parameters. + * + * @param array|string $args { + * See {@link bp_activity_add()} for complete description of arguments. + * The arguments listed here have different default values from + * bp_activity_add(). + * @type string $component Default: 'blogs'. + * } + * @return WP_Error|bool|int On success, returns the activity ID. False on failure. + */ + function bp_blogs_record_activity($args = '') + { + } + /** + * Delete a blog-related activity stream item. + * + * @since 1.0.0 + * + * @see bp_activity_delete() for description of parameters. + * + * @param array|string $args { + * See {@link bp_activity_delete()} for complete description of arguments. + * The arguments listed here have different default values from + * bp_activity_add(). + * @type string $component Default: 'blogs'. + * } + * @return bool + */ + function bp_blogs_delete_activity($args = '') + { + } + /** + * Check if a blog post's activity item should be closed from commenting. + * + * This mirrors the {@link comments_open()} and {@link _close_comments_for_old_post()} + * functions, but for use with the BuddyPress activity stream to be as + * lightweight as possible. + * + * By lightweight, we actually mirror a few of the blog's commenting settings + * to blogmeta and checks the values in blogmeta instead. This is to prevent + * multiple {@link switch_to_blog()} calls in the activity stream. + * + * @since 2.0.0 + * + * @param object $activity The BP_Activity_Activity object. + * @return bool + */ + function bp_blogs_comments_open($activity) + { + } + /** SITE TRACKING *******************************************************/ + /** + * Add an activity entry for a newly-created site. + * + * Hooked to the 'bp_blogs_new_blog' action. + * + * @since 2.6.0 + * + * @param BP_Blogs_Blog $recorded_blog Current site being recorded. Passed by reference. + * @param bool $is_private Whether the current site being recorded is private. + * @param bool $is_recorded Whether the current site was recorded. + */ + function bp_blogs_record_activity_on_site_creation($recorded_blog, $is_private, $is_recorded, $no_activity) + { + } + /** + * Deletes the 'new_blog' activity entry when a site is deleted. + * + * @since 2.6.0 + * + * @param int $blog_id Site ID. + */ + function bp_blogs_delete_new_blog_activity_for_site($blog_id, $user_id = 0) + { + } + /** + * Delete all 'blogs' activity items for a site when the site is deleted. + * + * @since 2.6.0 + * + * @param int $blog_id Site ID. + */ + function bp_blogs_delete_activity_for_site($blog_id) + { + } + /** + * Remove a blog post activity item from the activity stream. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $post_id ID of the post to be removed. + * @param int $blog_id Optional. Defaults to current blog ID. + * @param int $user_id Optional. Defaults to the logged-in user ID. This param + * is currently unused in the function (but is passed to hooks). + */ + function bp_blogs_remove_post($post_id, $blog_id = 0, $user_id = 0) + { + } + /** POST COMMENT SYNCHRONIZATION ****************************************/ + /** + * Syncs activity comments and posts them back as blog comments. + * + * Note: This is only a one-way sync - activity comments -> blog comment. + * + * For blog post -> activity comment, see {@link bp_activity_post_type_comment()}. + * + * @since 2.0.0 + * @since 2.5.0 Allow custom post types to sync their comments with activity ones + * + * @param int $comment_id The activity ID for the posted activity comment. + * @param array $params Parameters for the activity comment. + * @param object $parent_activity Parameters of the parent activity item (in this case, the blog post). + */ + function bp_blogs_sync_add_from_activity_comment($comment_id, $params, $parent_activity) + { + } + /** + * Deletes the blog comment when the associated activity comment is deleted. + * + * Note: This is hooked on the 'bp_activity_delete_comment_pre' filter instead + * of the 'bp_activity_delete_comment' action because we need to fetch the + * activity comment children before they are deleted. + * + * @since 2.0.0 + * @since 2.5.0 Add the $delected parameter + * + * @param bool $retval Whether BuddyPress should continue or not. + * @param int $parent_activity_id The parent activity ID for the activity comment. + * @param int $activity_id The activity ID for the pending deleted activity comment. + * @param bool $deleted Whether the comment was deleted or not. + * @return bool + */ + function bp_blogs_sync_delete_from_activity_comment($retval, $parent_activity_id, $activity_id, &$deleted) + { + } + /** + * Updates the blog comment when the associated activity comment is edited. + * + * @since 2.0.0 + * + * @param BP_Activity_Activity $activity The activity object. + */ + function bp_blogs_sync_activity_edit_to_post_comment(\BP_Activity_Activity $activity) + { + } + /** + * When a post is trashed, remove each comment's associated activity meta. + * + * When a post is trashed and later untrashed, we currently don't reinstate + * activity items for these comments since their activity entries are already + * deleted when initially trashed. + * + * Since these activity entries are deleted, we need to remove the deleted + * activity comment IDs from each comment's meta when a post is trashed. + * + * @since 2.0.0 + * + * @param int $post_id The post ID. + * @param array $comments Array of comment statuses. The key is comment ID, the + * value is the $comment->comment_approved value. + */ + function bp_blogs_remove_activity_meta_for_trashed_comments($post_id = 0, $comments = array()) + { + } + /** + * Filter 'new_blog_comment' bp_has_activities() loop to include new- and old-style blog activity comment items. + * + * In BuddyPress 2.0, the schema for storing activity items related to blog + * posts changed. Instead creating new top-level 'new_blog_comment' activity + * items, blog comments are recorded in the activity stream as comments on the + * 'new_blog_post' activity items corresponding to the parent post. This filter + * ensures that the 'new_blog_comment' filter in bp_has_activities() (which + * powers the 'Comments' filter in the activity directory dropdown) includes + * both old-style and new-style activity comments. + * + * @since 2.1.0 + * @since 2.5.0 Used for any synced Post type comments, in wp-admin or front-end contexts. + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args Arguments passed from bp_parse_args() in bp_has_activities(). + * @return array $args + */ + function bp_blogs_new_blog_comment_query_backpat($args) + { + } + /** + * Utility function to set up some variables for use in the activity loop. + * + * Grabs the blog's comment depth and the post's open comment status options + * for later use in the activity and activity comment loops. + * + * This is to prevent having to requery these items later on. + * + * @since 2.0.0 + * + * @see bp_blogs_disable_activity_commenting() + * @see bp_blogs_setup_comment_loop_globals_on_ajax() + * + * @param object $activity The BP_Activity_Activity object. + */ + function bp_blogs_setup_activity_loop_globals($activity) + { + } + /** + * Set up some globals used in the activity comment loop when AJAX is used. + * + * @since 2.0.0 + * + * @see bp_blogs_setup_activity_loop_globals() + */ + function bp_blogs_setup_comment_loop_globals_on_ajax() + { + } + /** + * Disable activity commenting for blog posts based on certain criteria. + * + * If activity commenting is enabled for blog posts, we still need to disable + * commenting if: + * - comments are disabled for the WP blog post from the admin dashboard + * - the WP blog post is supposed to be automatically closed from comments + * based on a certain age + * - the activity entry is a 'new_blog_comment' type + * + * @since 2.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template object. + * + * @param bool $retval Is activity commenting enabled for this activity entry. + * @return bool + */ + function bp_blogs_disable_activity_commenting($retval) + { + } + /** + * Limit the display of post type synced comments. + * + * @since 2.5.0 + * + * When viewing the synced comments in stream mode, this prevents comments to + * be displayed twice, and avoids a Javascript error as the form to add replies + * is not available. + * + * @param int $retval The comment count for the activity. + * @return int The comment count, or 0 to hide activity comment replies. + */ + function bp_blogs_post_type_comments_avoid_duplicates($retval) + { + } + /** + * Check if an activity comment associated with a blog post can be replied to. + * + * By default, disables replying to activity comments if the corresponding WP + * blog post no longer accepts comments. + * + * This check uses a locally-cached value set in {@link bp_blogs_disable_activity_commenting()} + * via {@link bp_blogs_setup_activity_loop_globals()}. + * + * @since 2.0.0 + * + * @param bool $retval Are replies allowed for this activity reply. + * @param object|array $comment The activity comment object. + * + * @return bool + */ + function bp_blogs_can_comment_reply($retval, $comment) + { + } + /** + * Changes activity comment permalinks to use the blog comment permalink + * instead of the activity permalink. + * + * This is only done if activity commenting is allowed and whether the parent + * activity item is a 'new_blog_post' entry. + * + * @since 2.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template object. + * + * @param string $retval The activity comment permalink. + * @return string + */ + function bp_blogs_activity_comment_permalink($retval = '') + { + } + /** + * Changes single activity comment entries to use the blog comment permalink. + * + * This is only done if the activity comment is associated with a blog comment. + * + * @since 2.0.1 + * + * @param string $retval The activity permalink. + * @param BP_Activity_Activity $activity Activity object. + * @return string + */ + function bp_blogs_activity_comment_single_permalink($retval, $activity) + { + } + /** + * Formats single activity comment entries to use the blog comment action. + * + * This is only done if the activity comment is associated with a blog comment. + * + * @since 2.0.1 + * + * @param string $retval The activity action. + * @param BP_Activity_Activity $activity Activity object. + * @return string + */ + function bp_blogs_activity_comment_single_action($retval, $activity) + { + } + /** + * Blogs: User's "Sites" screen handler + * + * @package BuddyPress + * @subpackage BlogsScreens + * @since 3.0.0 + */ + /** + * Load the "My Blogs" screen. + * + * @since 1.0.0 + */ + function bp_blogs_screen_my_blogs() + { + } + /** + * Blogs: Create screen handler + * + * @package BuddyPress + * @subpackage BlogsScreens + * @since 3.0.0 + */ + /** + * Load the "Create a Blog" screen. + * + * @since 1.0.0 + */ + function bp_blogs_screen_create_a_blog() + { + } + /** + * Blogs: Directory screen handler + * + * @package BuddyPress + * @subpackage BlogsScreens + * @since 3.0.0 + */ + /** + * Load the top-level Blogs directory. + * + * @since 1.0.0 + */ + function bp_blogs_screen_index() + { + } + /** + * Ensure that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup. + * + * @since 1.6.0 + * + * @param string $url The original URL (points to wp-signup.php by default). + * @return string The new URL. + */ + function bp_blogs_creation_location($url) + { + } + /** + * Only select comments by ID instead of all fields when using get_comments(). + * + * @since 2.1.0 + * + * @see bp_blogs_update_post_activity_meta() + * + * @param array $retval Current SQL clauses in array format. + * @return array + */ + function bp_blogs_comments_clauses_select_by_id($retval) + { + } + /** + * Check whether the current activity about a post or a comment can be published. + * + * Abstracted from the deprecated `bp_blogs_record_post()`. + * + * @since 2.2.0 + * + * @param bool $return Whether the post should be published. + * @param int $blog_id ID of the blog. + * @param int $post_id ID of the post. + * @param int $user_id ID of the post author. + * @return bool True to authorize the post to be published, otherwise false. + */ + function bp_blogs_post_pre_publish($return = \true, $blog_id = 0, $post_id = 0, $user_id = 0) + { + } + /** + * Registers our custom thumb size with WP's Site Icon feature. + * + * @since 2.7.0 + * + * @param array $sizes Current array of custom site icon sizes. + * @return array + */ + function bp_blogs_register_custom_site_icon_size($sizes) + { + } + /** + * Use the mystery blog avatar for blogs. + * + * @since 7.0.0 + * + * @param string $avatar Current avatar src. + * @param array $params Avatar params. + * @return string + */ + function bp_blogs_default_avatar($avatar, $params) + { + } + /** + * Filters the column name during blog metadata queries. + * + * This filters 'sanitize_key', which is used during various core metadata + * API functions: {@link https://core.trac.wordpress.org/browser/branches/4.9/src/wp-includes/meta.php?lines=47,160,324}. + * Due to how we are passing our meta type, we need to ensure that the correct + * DB column is referenced during blogmeta queries. + * + * @since 4.0.0 + * + * @see bp_blogs_delete_blogmeta() + * @see bp_blogs_get_blogmeta() + * @see bp_blogs_update_blogmeta() + * @see bp_blogs_add_blogmeta() + * + * @param string $retval + * + * @return string + */ + function bp_blogs_filter_meta_column_name($retval) + { + } + /** + * Blogs: Random blog action handler + * + * @package BuddyPress + * @subpackage BlogsActions + * @since 3.0.0 + */ + /** + * Redirect to a random blog in the multisite network. + * + * @since 1.0.0 + */ + function bp_blogs_redirect_to_random_blog() + { + } + /** + * Notification formatting callback for bp-members notifications. + * + * @since 8.0.0 + * + * @param string $action The kind of notification being rendered. + * @param int $item_id The primary item ID. + * @param int $secondary_item_id The secondary item ID. + * @param int $total_items The total number of members-related notifications + * waiting for the user. + * @param string $format 'string' for BuddyBar-compatible notifications; + * 'array' for WP Toolbar. Default: 'string'. + * @return array|string + */ + function members_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string') + { + } + /** + * Notify one use that another user has accepted their site membership invitation. + * + * @since 8.0.0 + * + * @param BP_Invitation $invite Invitation that was accepted. + * @param WP_user $new_user User who accepted the membership invite. + * @param int $inviter_id ID of the user who invited this user to the site. + */ + function bp_members_invitations_accepted_invitation_notification($invite, $new_user, $inviter_id) + { + } + /** + * Mark accepted invitation notifications as read when user visits new user profile. + * + * @since 8.0.0 + */ + function bp_members_mark_read_accepted_invitation_notification() + { + } + /** + * Mark new membership request notifications as read when user visits Manage BP Signups screen. + * + * @since 10.0.0 + */ + function bp_members_mark_read_submitted_membership_request_notification() + { + } + /** + * Add Members-related settings to the Settings > Notifications page. + * + * @since 8.0.0 + */ + function members_screen_notification_settings() + { + } + /** + * Registers the script to manage the dynamic part of the Dynamic Members widget/block. + * + * @since 9.0.0 + * @since 12.0.0 Uses the `@wordpress/scripts` `index.asset.php` generated file to get dependencies. + * + * @param array $scripts Data about the scripts to register. + * @return array Data about the scripts to register. + */ + function bp_members_register_scripts($scripts = array()) + { + } + /** + * Pre-fetch member type data when initializing a Members loop. + * + * @since 2.2.0 + * + * @param BP_User_Query $bp_user_query BP_User_Query object. + */ + function bp_members_prefetch_member_type($bp_user_query) + { + } + /** + * Clear the member_type cache for a user. + * + * Called when the user is deleted or marked as spam. + * + * @since 2.2.0 + * + * @param int $user_id ID of the deleted user. + */ + function bp_members_clear_member_type_cache($user_id) + { + } + /** + * Invalidate activity caches when a user's last_activity value is changed. + * + * @since 2.7.0 + * + * @return bool + */ + function bp_members_reset_activity_cache_incrementor() + { + } + /** + * Bust signup caches when editing or deleting. + * + * @since 10.0.0 + * + * @param int $signup_id The ID of the signup affected. + */ + function bp_members_delete_signup_cache($signup_id = 0) + { + } + /** + * Bust signup caches for arrays of signup IDs. + * + * @since 10.0.0 + * + * @param array $signup_ids The IDs of the signups affected. + */ + function bp_members_delete_signup_cache_multiples($signup_ids = array()) + { + } + /** + * Reset cache incrementor for BP_Signups. + * + * This function invalidates all cached results of BP_Signup queries, + * whenever one of the following events takes place: + * - A record is created or updated. + * - A record is deleted. + * + * @since 10.0.0 + * + * @return bool + */ + function bp_members_reset_signup_cache_incrementor() + { + } + /** + * When a user joins the network via an invitation, skip sending the activation email. + * + * @since 8.0.0 + * + * @param bool $send Whether or not to send the activation key. + * @param int $user_id User ID to send activation key to. + * @param string $user_email User email to send activation key to. + * + * @return bool Whether or not to send the activation key. + */ + function bp_members_invitations_cancel_activation_email($send, $user_id = 0, $user_email = '') + { + } + /** + * When a user joins the network via an invitation: + * - mark all invitations and requests as accepted + * - activate the user upon signup + * + * @since 8.0.0 + * + * @param bool|WP_Error $user_id True on success, WP_Error on failure. + */ + function bp_members_invitations_complete_signup($user_id) + { + } + /** + * Delete site membership invitations when an opt-out request is saved. + * + * @since 8.0.0 + * + * @param BP_Optout $optout Characteristics of the opt-out just saved. + */ + function bp_members_invitations_delete_optedout_invites($optout) + { + } + /** + * If a user submits a site membership request, but there's a + * sent invitation to her, bypass the manual approval of the request. + * + * @since 10.0.0 + * + * @param bool $send Whether or not this membership request should be approved + * immediately and the activation email sent. + * Default is `false` meaning that the request should be + * manually approved by a site admin. + * @param array $details The details of the request. + */ + function bp_members_invitations_maybe_bypass_request_approval($send, $details) + { + } + /** + * Whether a user can access invitations screens. + * Referred to by BP_Members_Invitations_Component::register_nav(). + * + * @since 12.0.0 + * + * @param bool $access Whether the user can view member invitations screens. + */ + function bp_members_invitations_user_can_view_screens() + { + } + /** + * Whether a user can access the send invitations member screen. + * Referred to by BP_Members_Invitations_Component::register_nav(). + * + * @since 12.0.0 + * + * @param bool $access Whether the user can view member invitations send screen. + */ + function bp_members_invitations_user_can_view_send_screen() + { + } + /** + * Single site: When a user creates a membership request, + * prevent the sending of the activation email so that + * the site admins can send it manually. + * + * @since 10.0.0 + * + * @param bool $send Whether or not to send the activation key. + * @param int $user_id User ID to send activation key to. + * @param string $user_email User email to send activation key to. + * @param string $activation_key Activation key to be sent. + * @param array $usermeta Miscellaneous metadata about the user (blog-specific + * signup data, xprofile data, etc). + * @return bool Whether or not to send the activation key. + */ + function bp_members_membership_requests_cancel_activation_email($send, $user_id = 0, $user_email = '', $activation_key = '', $usermeta = array()) + { + } + /** + * WP Multisite: When a user creates a membership request, + * prevent the sending of the activation email so that + * the site admins can send it manually. + * + * @since 10.0.0 + * + * @param bool $send Whether or not to send the activation key. + * @param string $user_login User login name. + * @param string $user_email User email address. + * @param string $activation_key Activation key created in wpmu_signup_user(). + * @param bool $is_signup_resend Is the site admin sending this email? + * @return bool Whether or not to send the activation key. + */ + function bp_members_membership_requests_cancel_activation_email_multisite($send = \true, $user_login = '', $user_email = '', $activation_key = '', $is_signup_resend = \false) + { + } + /** + * Notifications + *********************************************************************/ + /** + * Notify site admins about a new membership request. + * + * @since 10.0.0 + * + * @param BP_Signup $signup The signup object that has been created. + */ + function bp_members_membership_requests_notify_site_admins($signup) + { + } + /** + * Send a message to the requesting user when his or her + * site membership request has been rejected. + * + * @since 10.0.0 + * + * @param array $signup_ids Array of pending IDs to delete. + */ + function bp_members_membership_requests_send_rejection_mail($signup_ids) + { + } + /** + * When a request is approved, activated or deleted, + * delete the associated notifications. + * + * @since 10.0.0 + * + * @param array $signup_ids Array of changing signup IDs. + */ + function bp_members_membership_requests_delete_notifications_on_change($signup_ids) + { + } + /** + * In the Nouveau template pack, when membership requests are required, + * change registration form submit button label to "Submit Request". + * + * @since 10.0.0 + * + * @return string $retval the HTML for the request membership link. + */ + function bp_members_membership_requests_filter_complete_signup_button($buttons) + { + } + /** + * Administration: Change certain behavior and labels + * on the WP Admin > Users > Manage Signups screen. + *********************************************************************/ + /** + * Filter the actions available on the signups list table. + * + * @since 10.0.0 + * + * @param array $actions Array of actions and corresponding links. + * @param object $signup_object The signup data object. + */ + function bp_members_membership_requests_filter_signup_row_actions($actions, $signup_object) + { + } + /** + * Filter the bulk actions available on the signups list table. + * + * @since 10.0.0 + * + * @param array $actions Array of actions and corresponding links. + * @return array List of actions and corresponding links. + */ + function bp_members_membership_requests_filter_signup_bulk_actions($actions) + { + } + /** + * Filter the "Last Sent" column header on the pending users table. + * + * @since 10.0.0 + * + * @param array $columns Array of columns to display. + * @return array List of columns to display. + */ + function bp_members_membership_requests_filter_signup_table_date_sent_header($columns) + { + } + /** + * Filter the "Last Sent" column message on the pending users table. + * + * @since 10.0.0 + * + * @param string $message "Not yet sent" message. + * @param object|null $signup Signup object instance. + * @return string "Not yet approved" message, if needed. Unchanged message otherwise. + */ + function bp_members_membership_requests_filter_signup_table_unsent_message($message, $signup) + { + } + /** + * Filter/add "Request Membership" links in the following locations: + * - BP login block widget, + * - Sidebar register link, + * - WP Toolbar, + * - WP login form. + *********************************************************************/ + /** + * Add "Request Membership" link to Block Widget login form. + * + * @since 10.0.0 + * + * @return string $retval the HTML for the request membership link. + */ + function bp_members_membership_requests_add_link_to_widget_login_form() + { + } + /** + * Filter the "Register" link from `wp_register()` as used in + * `sidebar.php` and the WP Core meta widget. + * + * @since 10.0.0 + * + * @param string $link The HTML code for the link to the Registration or Admin page. + * @return string An empty string or the HTML code for the link to the Membership request page. + */ + function bp_members_membership_requests_filter_sidebar_register_link($link) + { + } + /** + * Add a "Request Membership" link to the WP Toolbar. + * Priority 21 should place it just after the "Log In" link. + * + * @since 10.0.0 + * + * @param WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + */ + function bp_members_membership_requests_add_toolbar_link($wp_admin_bar) + { + } + /** + * Add a "Request Membership" link to the WP Login form. + * + * @since 10.0.0 + * + * @param string $link HTML link to the home URL of the current site. + * @return string HTML link to the home URL of the current site and the one to request a membership. + */ + function bp_members_membership_requests_add_link_wp_login($link) + { + } + /** + * Load additional sign-up sanitization filters on bp_loaded. + * + * These are used to prevent XSS in the BuddyPress sign-up process. You can + * unhook these to allow for customization of your registration fields; + * however, it is highly recommended that you leave these in place for the + * safety of your network. + * + * @since 1.5.0 + */ + function bp_members_signup_sanitization() + { + } + /** + * Make sure the username is not the blog slug in case of root profile & subdirectory blog. + * + * If BP_ENABLE_ROOT_PROFILES is defined & multisite config is set to subdirectories, + * then there is a chance site.url/username == site.url/blogslug. If so, user's profile + * is not reachable, instead the blog is displayed. This filter makes sure the signup username + * is not the same than the blog slug for this particular config. + * + * @since 2.1.0 + * + * @param array $illegal_names Array of illiegal names. + * @return array $illegal_names + */ + function bp_members_signup_with_subdirectory_blog($illegal_names = array()) + { + } + /** + * Filter the user profile URL to point to BuddyPress profile edit. + * + * @since 1.6.0 + * + * @param string $url WP profile edit URL. + * @param int $user_id ID of the user. + * @param string $scheme Scheme to use. + * @return string + */ + function bp_members_edit_profile_url($url, $user_id, $scheme = 'admin') + { + } + /** + * Filter the bp_user_can value to determine what the user can do in the members component. + * + * @since 8.0.0 + * + * @param bool $retval Whether or not the current user has the capability. + * @param int $user_id User ID. + * @param string $capability The capability being checked for. + * @param int $site_id Site ID. Defaults to the BP root blog. + * @param array $args Array of extra arguments passed. + * + * @return bool + */ + function bp_members_user_can_filter($retval, $user_id, $capability, $site_id, $args = array()) + { + } + /** + * Do not allow the new user to change the email address + * if they are accepting a community invitation. + * + * @since 8.0.0 + * + * @param array $attributes The field attributes. + * @param string $name The field name. + * + * @return array $attributes The field attributes. + */ + function bp_members_invitations_make_registration_email_input_readonly_if_invite($attributes, $name) + { + } + /** + * Provide a more-specific welcome message if the new user + * is accepting a network invitation. + * + * @since 8.0.0 + * + * @return string $message The message text. + */ + function bp_members_invitations_get_registration_welcome_message() + { + } + /** + * Provide a more-specific "registration is disabled" message + * if registration is available by invitation only. + * Also provide failure note if new user is trying to accept + * a network invitation but there's a problem. + * + * @since 8.0.0 + * + * @return string $message The message text. + */ + function bp_members_invitations_get_modified_registration_disabled_message() + { + } + /** + * Sanitize the invitation property output. + * + * @since 8.0.0 + * + * @param int|string $value The value for the requested property. + * @param string $property The name of the requested property. + * @param string $context Optional. The context of display. + * @return int|string The sanitized value. + */ + function bp_members_sanitize_invitation_property($value = '', $property = '', $context = 'html') + { + } + /** + * Members: Register screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 3.0.0 + */ + /** + * Handle the loading of the signup screen. + * + * @since 1.1.0 + */ + function bp_core_screen_signup() + { + } + /** + * Members: Change Cover Image screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 6.0.0 + */ + /** + * Handle the display of the profile Change Cover Image page by loading the correct template file. + * + * @since 6.0.0 + */ + function bp_members_screen_change_cover_image() + { + } + /** + * Catch and process the Send Invites page. + * + * @since 8.0.0 + */ + function members_screen_send_invites() + { + } + /** + * Catch and process the Pending Invites page. + * + * @since 8.0.0 + */ + function members_screen_list_sent_invites() + { + } + /** + * Members: Directory screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 3.0.0 + */ + /** + * Handle the display of the members directory index. + * + * @since 1.5.0 + */ + function bp_members_screen_index() + { + } + /** + * Members: Activate screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 3.0.0 + */ + /** + * Handle the loading of the Activate screen. + * + * @since 1.1.0 + */ + function bp_core_screen_activation() + { + } + /** + * Catches and processes account activation requests. + * + * @since 3.0.0 + */ + function bp_members_action_activate_account() + { + } + /** + * Members: Profile screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 3.0.0 + */ + /** + * Handle the display of the profile page by loading the correct template file. + * + * @since 1.5.0 + */ + function bp_members_screen_display_profile() + { + } + /** + * Members: Change Avatar screen handler + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 6.0.0 + */ + /** + * Handle the display of the profile Change Avatar page by loading the correct template file. + * + * @since 6.0.0 + */ + function bp_members_screen_change_avatar() + { + } + /** + * Check for the existence of a Members directory page. + * + * @since 1.5.0 + * + * @return bool True if found, otherwise false. + */ + function bp_members_has_directory() + { + } + /** + * Fetch an array of users based on the parameters passed. + * + * Since BuddyPress 1.7, bp_core_get_users() uses BP_User_Query. If you + * need backward compatibility with BP_Core_User::get_users(), filter the + * bp_use_legacy_user_query value, returning true. + * + * @since 1.2.0 + * @since 7.0.0 Added `xprofile_query` parameter. Added `user_ids` parameter. + * + * @param array|string $args { + * Array of arguments. All are optional. See {@link BP_User_Query} for + * a more complete description of arguments. + * @type string $type Sort order. Default: 'active'. + * @type int $user_id Limit results to friends of a user. Default: false. + * @type mixed $exclude IDs to exclude from results. Default: false. + * @type string $search_terms Limit to users matching search terms. Default: false. + * @type string $meta_key Limit to users with a meta_key. Default: false. + * @type string $meta_value Limit to users with a meta_value (with meta_key). Default: false. + * @type array|string $member_type Array or comma-separated string of member types. + * @type array|string $member_type__in Array or comma-separated string of member types. + * `$member_type` takes precedence over this parameter. + * @type array|string $member_type__not_in Array or comma-separated string of member types to be excluded. + * @type mixed $include Limit results by user IDs. Default: false. + * @type mixed $user_ids IDs corresponding to the users. Default: false. + * @type int $per_page Results per page. Default: 20. + * @type int $page Page of results. Default: 1. + * @type bool $populate_extras Fetch optional extras. Default: true. + * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile + * component. See {@see BP_XProfile_Query} for details. + * @type string|bool $count_total How to do total user count. Default: 'count_query'. + * } + * @return array + */ + function bp_core_get_users($args = '') + { + } + /** + * Get single Members item customized path chunks using an array of BP URL default slugs. + * + * @since 12.0.0 + * + * @param array $chunks An array of BP URL default slugs. + * @return array An associative array containing member's customized path chunks. + */ + function bp_members_get_path_chunks($chunks = array()) + { + } + /** + * Return the Members single item's URL. + * + * @since 12.0.0 + * + * @param integer $user_id The user ID. + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type string $single_item_component The component slug the action is relative to. + * @type string $single_item_action The slug of the action to perform. + * @type array $single_item_action_variables An array of additional informations about the action to perform. + * } + * @return string The URL built for the BP Rewrites URL parser. + */ + function bp_members_get_user_url($user_id = 0, $path_chunks = array()) + { + } + /** + * Fetch everything in the wp_users table for a user, without any usermeta. + * + * @since 1.2.0 + * + * @param int $user_id The ID of the user. + * @return array|bool Array of data on success, false on failure. + */ + function bp_core_get_core_userdata($user_id = 0) + { + } + /** + * Return the user ID based on a user's user_login. + * + * @since 1.0.0 + * + * @param string $username user_login to check. + * @return int|null The ID of the matched user on success, null on failure. + */ + function bp_core_get_userid($username = '') + { + } + /** + * Return the user ID based on a user's user_nicename. + * + * @since 1.2.3 + * + * @param string $user_nicename user_nicename to check. + * @return int|null The ID of the matched user on success, null on failure. + */ + function bp_core_get_userid_from_nicename($user_nicename = '') + { + } + /** + * Returns the members single item (member) slug. + * + * @since 12.0.0 + * + * @param integer $user_id The User ID. + * @return string The member slug. + */ + function bp_members_get_user_slug($user_id = 0) + { + } + /** + * Return the user_nicename for a user based on their user_id. + * + * This should be used for linking to user profiles and anywhere else a + * sanitized and unique slug to a user is needed. + * + * @since 1.5.0 + * + * @param int $user_id User ID to check. + * @return string The username of the matched user or an empty string if no user is found. + */ + function bp_members_get_user_nicename($user_id) + { + } + /** + * Return the email address for the user based on user ID. + * + * @since 1.0.0 + * + * @param int $user_id User ID to check. + * @return string The email for the matched user. Empty string if no user + * matches the $user_id. + */ + function bp_core_get_user_email($user_id) + { + } + /** + * Return a HTML formatted link for a user with the user's full name as the link text. + * + * Eg: <a href="http://andy.example.com/">Andy Peatling</a> + * + * Optional parameters will return just the name or just the URL. + * + * @since 1.0.0 + * + * @param int $user_id User ID to check. + * @param bool $no_anchor Disable URL and HTML and just return full name. + * Default: false. + * @param bool $just_link Disable full name and HTML and just return the URL + * text. Default false. + * @return string|false The link text based on passed parameters, or false on + * no match. + */ + function bp_core_get_userlink($user_id, $no_anchor = \false, $just_link = \false) + { + } + /** + * Fetch the display name for a group of users. + * + * Uses the 'Name' field in xprofile if available. Falls back on WP + * display_name, and then user_nicename. + * + * @since 2.0.0 + * + * @param array $user_ids Array of user IDs to get display names for. + * @return array Associative array of the format "id" => "displayname". + */ + function bp_core_get_user_displaynames($user_ids) + { + } + /** + * Fetch the display name for a user. + * + * @since 1.0.1 + * + * @param int|string|bool $user_id_or_username User ID or username. + * @return string|bool The display name for the user in question, or false if + * user not found. + */ + function bp_core_get_user_displayname($user_id_or_username) + { + } + /** + * Return the user link for the user based on user email address. + * + * @since 1.0.0 + * + * @param string $email The email address for the user. + * @return string The link to the users home base. False on no match. + */ + function bp_core_get_userlink_by_email($email) + { + } + /** + * Return the user link for the user based on the supplied identifier. + * + * @since 1.0.0 + * + * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, + * this should be user_login, otherwise it should + * be user_nicename. + * @return string|bool The link to the user's domain, false on no match. + */ + function bp_core_get_userlink_by_username($username) + { + } + /** + * Return the total number of members for the installation. + * + * Note that this is a raw count of non-spam, activated users. It does not + * account for users who have logged activity (last_active). See + * {@link bp_core_get_active_member_count()}. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return int The total number of members. + */ + function bp_core_get_total_member_count() + { + } + /** + * Return the total number of members, limited to those members with last_activity. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return int The number of active members. + */ + function bp_core_get_active_member_count() + { + } + /** + * Update the spam status of the member on multisite configs. + * + * @since 5.0.0 + * + * @param int $user_id The user ID to spam or ham. + * @param string $value '0' to mark the user as `ham`, '1' to mark as `spam`. + * @return bool True if the spam status of the member changed. + * False otherwise. + */ + function bp_core_update_member_status($user_id = 0, $value = 0) + { + } + /** + * Process a spammed or unspammed user. + * + * This function is called from three places: + * + * - in bp_settings_action_capabilities() (from the front-end) + * - by bp_core_mark_user_spam_admin() (from wp-admin) + * - bp_core_mark_user_ham_admin() (from wp-admin) + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id The ID of the user being spammed/hammed. + * @param string $status 'spam' if being marked as spam, 'ham' otherwise. + * @param bool $do_wp_cleanup Optional. True to force the cleanup of WordPress content + * and status, otherwise false. Generally, this should + * only be false if WordPress is expected to have + * performed this cleanup independently, as when hooked + * to 'make_spam_user'. + * @return bool + */ + function bp_core_process_spammer_status($user_id, $status, $do_wp_cleanup = \true) + { + } + /** + * Hook to WP's make_spam_user and run our custom BP spam functions. + * + * @since 1.6.0 + * + * @param int $user_id The user ID passed from the make_spam_user hook. + */ + function bp_core_mark_user_spam_admin($user_id) + { + } + /** + * Hook to WP's make_ham_user and run our custom BP spam functions. + * + * @since 1.6.0 + * + * @param int $user_id The user ID passed from the make_ham_user hook. + */ + function bp_core_mark_user_ham_admin($user_id) + { + } + /** + * Check whether a user has been marked as a spammer. + * + * @since 1.6.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $user_id The ID for the user. + * @return bool True if spammer, otherwise false. + */ + function bp_is_user_spammer($user_id = 0) + { + } + /** + * Check whether a user has been marked as deleted. + * + * @since 1.6.0 + * + * @param int $user_id The ID for the user. + * @return bool True if deleted, otherwise false. + */ + function bp_is_user_deleted($user_id = 0) + { + } + /** + * Check whether a user is "active", ie neither deleted nor spammer. + * + * @since 1.6.0 + * + * @param int $user_id Optional. The user ID to check. + * @return bool True if active, otherwise false. + */ + function bp_is_user_active($user_id = 0) + { + } + /** + * Check whether user is not active. + * + * @since 1.6.0 + * + * @param int $user_id Optional. The user ID to check. + * @return bool True if inactive, otherwise false. + */ + function bp_is_user_inactive($user_id = 0) + { + } + /** + * Update a user's last activity. + * + * @since 1.9.0 + * @since 7.0.0 Backward compatibility usermeta mirroring is only allowed if the + * legacy user query is enabled. + * + * @param int $user_id Optional. ID of the user being updated. + * @param string $time Optional. Time of last activity, in 'Y-m-d H:i:s' format. + * @return bool + */ + function bp_update_user_last_activity($user_id = 0, $time = '') + { + } + /** + * Backward compatibility for 'last_activity' usermeta fetching. + * + * In BuddyPress 2.0, user last_activity data was moved out of usermeta. For + * backward compatibility, we continue to mirror the data there. This function + * serves two purposes: it warns plugin authors of the change, and it returns + * the data from the proper location. + * + * @since 2.0.0 + * @since 2.9.3 Added the `$single` parameter. + * + * @access private For internal use only. + * + * @param null $retval Null retval value. + * @param int $object_id ID of the user. + * @param string $meta_key Meta key being fetched. + * @param bool $single Whether a single key is being fetched (vs an array). + * @return string|null + */ + function _bp_get_user_meta_last_activity_warning($retval, $object_id, $meta_key, $single) + { + } + /** + * Backward compatibility for 'last_activity' usermeta setting. + * + * In BuddyPress 2.0, user last_activity data was moved out of usermeta. For + * backward compatibility, we continue to mirror the data there. This function + * serves two purposes: it warns plugin authors of the change, and it updates + * the data in the proper location. + * + * @since 2.0.0 + * + * @access private For internal use only. + * + * @param int $meta_id ID of the just-set usermeta row. + * @param int $object_id ID of the user. + * @param string $meta_key Meta key being fetched. + * @param string $meta_value Active time. + */ + function _bp_update_user_meta_last_activity_warning($meta_id, $object_id, $meta_key, $meta_value) + { + } + /** + * Get the last activity for a given user. + * + * @since 1.9.0 + * + * @param int $user_id The ID of the user. + * @return string Time of last activity, in 'Y-m-d H:i:s' format, or an empty + * string if none is found. + */ + function bp_get_user_last_activity($user_id = 0) + { + } + /** + * Migrate last_activity data from the usermeta table to the activity table. + * + * Generally, this function is only run when BP is upgraded to 2.0. It can also + * be called directly from the BuddyPress Tools panel. + * + * @since 2.0.0 + * @global wpdb $wpdb WordPress database object. + * + * @return bool + */ + function bp_last_activity_migrate() + { + } + /** + * Process account deletion requests. + * + * Primarily used for self-deletions, as requested through Settings. + * + * @since 1.0.0 + * + * @param int $user_id Optional. ID of the user to be deleted. Default: the + * logged-in user. + * @return bool + */ + function bp_core_delete_account($user_id = 0) + { + } + /** + * Determines whether user data should be removed on the 'delete_user' hook. + * + * WordPress's 'delete_user' hook is ambiguous: on a standard installation, it means that a user + * account is being removed from the system, while on Multisite it simply means the user is + * being removed from a specific site (ie its roles are being revoked). As a rule, this means + * that BuddyPress should remove user data on the delete_user hook only on non-Multisite + * installations - only when the user account is being removed altogether. However, this behavior + * can be filtered in a global, per-user, or per-component fashion. + * + * @since 6.0.0 + * + * @param string $data_type Type of data to be removed. + * @param int $user_id ID of the user, as passed to 'delete_user'. + * @return bool + */ + function bp_remove_user_data_on_delete_user_hook($component, $user_id) + { + } + /** + * Delete a user's avatar when the user is deleted. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user who is about to be deleted. + * @return bool + */ + function bp_core_delete_avatar_on_user_delete($user_id) + { + } + /** + * Deletes last_activity data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_core_delete_avatar_on_delete_user($user_id) + { + } + /** + * Multibyte-safe ucfirst() support. + * + * Uses multibyte functions when available on the PHP build. + * + * @since 1.0.0 + * + * @param string $str String to be upper-cased. + * @return string + */ + function bp_core_ucfirst($str) + { + } + /** + * Prevent spammers from logging in. + * + * When a user logs in, check if they have been marked as a spammer. If yes + * then simply redirect them to the home page and stop them from logging in. + * + * @since 1.1.2 + * + * @param WP_User|WP_Error $user Either the WP_User object or the WP_Error + * object, as passed to the 'authenticate' filter. + * @return WP_User|WP_Error If the user is not a spammer, return the WP_User + * object. Otherwise a new WP_Error object. + */ + function bp_core_boot_spammer($user) + { + } + /** + * Delete last_activity data for the user when the user is deleted. + * + * @since 1.0.0 + * + * @param int $user_id The user ID for the user to delete usermeta for. + */ + function bp_core_remove_data($user_id) + { + } + /** + * Deletes last_activity data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_core_remove_data_on_delete_user($user_id) + { + } + /** + * Check whether the logged-in user can edit settings for the displayed user. + * + * @since 1.5.0 + * + * @return bool True if editing is allowed, otherwise false. + */ + function bp_core_can_edit_settings() + { + } + /** Sign-up *******************************************************************/ + /** + * Flush illegal names by getting and setting 'illegal_names' site option. + * + * @since 1.2.5 + */ + function bp_core_flush_illegal_names() + { + } + /** + * Add BuddyPress-specific items to the illegal_names array. + * + * @since 1.2.7 + * + * @param array|string $value Illegal names as being saved defined in + * Multisite settings. + * @return array Merged and unique array of illegal names. + */ + function bp_core_get_illegal_names($value = '') + { + } + /** + * Check that an email address is valid for use. + * + * Performs the following checks: + * - Is the email address well-formed? + * - Is the email address already used? + * - If there are disallowed email domains, is the current domain among them? + * - If there's an email domain whitelist, is the current domain on it? + * + * @since 1.6.2 + * + * @param string $user_email The email being checked. + * @return bool|array True if the address passes all checks; otherwise an array + * of error codes. + */ + function bp_core_validate_email_address($user_email) + { + } + /** + * Add the appropriate errors to a WP_Error object, given results of a validation test. + * + * Functions like bp_core_validate_email_address() return a structured array + * of error codes. bp_core_add_validation_error_messages() takes this array and + * parses, adding the appropriate error messages to the WP_Error object. + * + * @since 1.7.0 + * + * @see bp_core_validate_email_address() + * + * @param WP_Error $errors WP_Error object. + * @param array $validation_results The return value of a validation function + * like bp_core_validate_email_address(). + */ + function bp_core_add_validation_error_messages(\WP_Error $errors, $validation_results) + { + } + /** + * Validate a user name and email address when creating a new user. + * + * @since 1.2.2 + * + * @param string $user_name Username to validate. + * @param string $user_email Email address to validate. + * @return array Results of user validation including errors, if any. + */ + function bp_core_validate_user_signup($user_name, $user_email) + { + } + /** + * Validate a user password. + * + * @since 7.0.0 + * + * @param string $pass The password. + * @param string $confirm_pass The confirmed password. + * @param null|WP_User $userdata Null or the userdata object when a member updates their password from front-end. + * @return WP_Error A WP error object possibly containing error messages. + */ + function bp_members_validate_user_password($pass, $confirm_pass, $userdata = \null) + { + } + /** + * Validate blog URL and title provided at signup. + * + * @since 1.2.2 + * + * @todo Why do we have this wrapper? + * + * @param string $blog_url Blog URL requested during registration. + * @param string $blog_title Blog title requested during registration. + * @return array + */ + function bp_core_validate_blog_signup($blog_url, $blog_title) + { + } + /** + * Process data submitted at user registration and convert to a signup object. + * + * @since 1.2.0 + * + * @todo There appears to be a bug in the return value on success. + * + * @param string $user_login Login name requested by the user. + * @param string $user_password Password requested by the user. + * @param string $user_email Email address entered by the user. + * @param array $usermeta Miscellaneous metadata about the user (blog-specific + * signup data, xprofile data, etc). + * @return int|false True on success, WP_Error on failure. + */ + function bp_core_signup_user($user_login, $user_password, $user_email, $usermeta) + { + } + /** + * Create a blog and user based on data supplied at user registration. + * + * @since 1.2.2 + * + * @param string $blog_domain Domain requested by user. + * @param string $blog_path Path requested by user. + * @param string $blog_title Title as entered by user. + * @param string $user_name user_login of requesting user. + * @param string $user_email Email address of requesting user. + * @param string $usermeta Miscellaneous metadata for the user. + * @return bool|null + */ + function bp_core_signup_blog($blog_domain, $blog_path, $blog_title, $user_name, $user_email, $usermeta) + { + } + /** + * Activate a signup, as identified by an activation key. + * + * @since 1.2.2 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $key Activation key. + * @return int|bool User ID on success, false on failure. + */ + function bp_core_activate_signup($key) + { + } + /** + * Add default WordPress role for new signups on the BP root blog. + * + * @since 3.0.0 + * + * @param int $user_id The user ID to add the default role for. + */ + function bp_members_add_role_after_activation($user_id) + { + } + /** + * Migrate signups from pre-2.0 configuration to wp_signups. + * + * @since 2.0.1 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_members_migrate_signups() + { + } + /** + * Map a user's WP display name to the XProfile fullname field, if necessary. + * + * This only happens when a user is registered in wp-admin by an administrator; + * during normal registration, XProfile data is provided directly by the user. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user. + * @return bool + */ + function bp_core_map_user_registration($user_id) + { + } + /** + * Get the avatar storage directory for use during registration. + * + * @since 1.1.0 + * + * @return string|bool Directory path on success, false on failure. + */ + function bp_core_signup_avatar_upload_dir() + { + } + /** + * Send activation email to a newly registered user. + * + * @since 1.2.2 + * @since 2.5.0 Add the $user_login parameter. + * @since 5.0.0 Change $user_login parameter to more general $salutation. + * + * @param int|bool $user_id ID of the new user, false if BP_SIGNUPS_SKIP_USER_CREATION is true. + * @param string $user_email Email address of the new user. + * @param string $key Activation key. + * @param string $salutation Optional. The name to be used as a salutation in the email. + */ + function bp_core_signup_send_validation_email($user_id, $user_email, $key, $salutation = '') + { + } + /** + * Display a "resend email" link when an unregistered user attempts to log in. + * + * @since 1.2.2 + * + * @param WP_User|WP_Error|null $user Either the WP_User or the WP_Error object. + * @param string $username The inputted, attempted username. + * @param string $password The inputted, attempted password. + * @return WP_User|WP_Error + */ + function bp_core_signup_disable_inactive($user = \null, $username = '', $password = '') + { + } + /** + * On the login screen, resends the activation email for a user. + * + * @since 2.0.0 + * + * @global string $error The error message. + * + * @see bp_core_signup_disable_inactive() + */ + function bp_members_login_resend_activation_email() + { + } + /** + * Redirect away from wp-signup.php if BP registration templates are present. + * + * @since 1.1.0 + */ + function bp_core_wpsignup_redirect() + { + } + /** + * Stop a logged-in user who is marked as a spammer. + * + * When an admin marks a live user as a spammer, that user can still surf + * around and cause havoc on the site until that person is logged out. + * + * This code checks to see if a logged-in user is marked as a spammer. If so, + * we redirect the user back to wp-login.php with the 'reauth' parameter. + * + * This clears the logged-in spammer's cookies and will ask the spammer to + * reauthenticate. + * + * Note: A spammer cannot log back in - {@see bp_core_boot_spammer()}. + * + * Runs on 'bp_init' at priority 5 so the members component globals are setup + * before we do our spammer checks. + * + * This is important as the $bp->loggedin_user object is setup at priority 4. + * + * @since 1.8.0 + */ + function bp_stop_live_spammer() + { + } + /** + * Show a custom error message when a logged-in user is marked as a spammer. + * + * @since 1.8.0 + * + * @global string $error The error message. + */ + function bp_live_spammer_login_error() + { + } + /** + * Get the displayed user Object + * + * @since 2.6.0 + * + * @return object The displayed user object, null otherwise. + */ + function bp_get_displayed_user() + { + } + /** Member Types *************************************************************/ + /** + * Output the slug of the member type taxonomy. + * + * @since 2.7.0 + */ + function bp_member_type_tax_name() + { + } + /** + * Return the slug of the member type taxonomy. + * + * @since 2.7.0 + * + * @return string The unique member taxonomy slug. + */ + function bp_get_member_type_tax_name() + { + } + /** + * Returns labels used by the member type taxonomy. + * + * @since 7.0.0 + * + * @return array + */ + function bp_get_member_type_tax_labels() + { + } + /** + * Returns arguments used by the Member type taxonomy. + * + * @since 7.0.0 + * + * @return array + */ + function bp_get_member_type_tax_args() + { + } + /** + * Extend generic Type metadata schema to match Member Type needs. + * + * @since 7.0.0 + * + * @param array $schema The generic Type metadata schema. + * @param string $taxonomy The taxonomy name the schema applies to. + * @return array The Member Type metadata schema. + */ + function bp_get_member_type_metadata_schema($schema = array(), $taxonomy = '') + { + } + /** + * Registers the Member type metadata. + * + * @since 7.0.0 + */ + function bp_register_member_type_metadata() + { + } + /** + * Register a member type. + * + * @since 2.2.0 + * + * @param string $member_type Unique string identifier for the member type. + * @param array $args { + * Array of arguments describing the member type. + * + * @type array $labels { + * Array of labels to use in various parts of the interface. + * + * @type string $name Default name. Should typically be plural. + * @type string $singular_name Singular name. + * } + * @type bool|string $has_directory Whether the member type should have its own type-specific directory. + * Pass `true` to use the `$member_type` string as the type's slug. + * Pass a string to customize the slug. Pass `false` to disable. + * Default: true. + * @type bool $show_in_list Whether this member type should be shown in lists rendered by + * bp_member_type_list(). Default: false. + * @type bool $code Whether this member type is registered using code. Default: true. + * @type int $db_id The member type term ID. Default: 0. + * } + * @return object|WP_Error Member type object on success, WP_Error object on failure. + */ + function bp_register_member_type($member_type, $args = array()) + { + } + /** + * Retrieve a member type object by name. + * + * @since 2.2.0 + * + * @param string $member_type The name of the member type. + * @return object|null A member type object or null if it doesn't exist. + */ + function bp_get_member_type_object($member_type) + { + } + /** + * Get a list of all registered member type objects. + * + * @since 2.2.0 + * + * @see bp_register_member_type() for accepted arguments. + * + * @param array|string $args Optional. An array of key => value arguments to match against + * the member type objects. Default empty array. + * @param string $output Optional. The type of output to return. Accepts 'names' + * or 'objects'. Default 'names'. + * @param string $operator Optional. The logical operation to perform. 'or' means only one + * element from the array needs to match; 'and' means all elements + * must match. Accepts 'or' or 'and'. Default 'and'. + * @return array A list of member type names or objects. + */ + function bp_get_member_types($args = array(), $output = 'names', $operator = 'and') + { + } + /** + * Only gets the member types registered by code. + * + * @since 7.0.0 + * + * @return array The member types registered by code. + */ + function bp_get_member_types_registered_by_code() + { + } + /** + * Generates missing metadata for a type registered by code. + * + * @since 7.0.0 + * + * @return array The member type metadata. + */ + function bp_set_registered_by_code_member_type_metadata($metadata = array(), $type = '') + { + } + /** + * Insert member types registered by code not yet saved into the database as WP Terms. + * + * @since 7.0.0 + */ + function bp_insert_member_types_registered_by_code() + { + } + /** + * Set type for a member. + * + * @since 2.2.0 + * @since 7.0.0 $member_type parameter also accepts an array of member type names. + * + * @param int $user_id ID of the user. + * @param string|array $member_type The member type name or an array of member type names. + * @param bool $append Optional. True to append this to existing types for user, + * false to replace. Default: false. + * @return bool|array $retval See {@see bp_set_object_terms()}. + */ + function bp_set_member_type($user_id, $member_type, $append = \false) + { + } + /** + * Remove type for a member. + * + * @since 2.3.0 + * + * @param int $user_id ID of the user. + * @param string $member_type Member Type. + * @return bool|WP_Error + */ + function bp_remove_member_type($user_id, $member_type) + { + } + /** + * Get type for a member. + * + * @since 2.2.0 + * @since 7.0.0 Adds the `$use_db` parameter. + * + * @param int $user_id ID of the user. + * @param bool $single Optional. Whether to return a single type string. If multiple types are found + * for the user, the oldest one will be returned. Default: true. + * @param bool $use_db Optional. Whether to request all member types or only the ones registered by code. + * Default: true. + * @return string|array|bool On success, returns a single member type (if $single is true) or an array of member + * types (if $single is false). Returns false on failure. + */ + function bp_get_member_type($user_id, $single = \true, $use_db = \true) + { + } + /** + * Check whether the given user has a certain member type. + * + * @since 2.3.0 + * + * @param int $user_id $user_id ID of the user. + * @param string $member_type Member Type. + * @return bool Whether the user has the given member type. + */ + function bp_has_member_type($user_id, $member_type) + { + } + /** + * Delete a user's member type when the user when the user is deleted. + * + * @since 2.2.0 + * + * @param int $user_id ID of the user. + * @return bool|array $value See {@see bp_set_member_type()}. + */ + function bp_remove_member_type_on_user_delete($user_id) + { + } + /** + * Deletes user member type on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_remove_member_type_on_delete_user($user_id) + { + } + /** + * Get the "current" member type, if one is provided, in member directories. + * + * @since 2.3.0 + * + * @return string + */ + function bp_get_current_member_type() + { + } + /** + * Setup the avatar upload directory for a user. + * + * @since 6.0.0 + * + * @param string $directory The root directory name. Optional. + * @param int $user_id The user ID. Optional. + * @return array Array containing the path, URL, and other helpful settings. + */ + function bp_members_avatar_upload_dir($directory = 'avatars', $user_id = 0) + { + } + /** + * Send welcome email on successful user activation. + * + * @since 8.0.0 + * + * @param int $user_id The new user's ID. + */ + function bp_send_welcome_email($user_id = 0) + { + } + /** + * Get invitations to the BP community filtered by arguments. + * + * @since 8.0.0 + * + * @param array $args Invitation arguments. See BP_Invitation::get() for list. + * @return array $invites Matching BP_Invitation objects. + */ + function bp_members_invitations_get_invites($args = array()) + { + } + /** + * Check whether a user has sent any community invitations. + * + * @since 8.0.0 + * + * @param int $user_id ID of user to check for invitations sent by. + * Defaults to the current user's ID. + * + * @return bool $invites True if user has sent invites. + */ + function bp_members_invitations_user_has_sent_invites($user_id = 0) + { + } + /** + * Invite a user to a BP community. + * + * @since 8.0.0 + * + * @param array|string $args { + * Array of arguments. + * @type int $invitee_email Email address of the user being invited. + * @type int $network_id ID of the network to which the user is being invited. + * @type int $inviter_id Optional. ID of the inviting user. Default: + * ID of the logged-in user. + * @type string $date_modified Optional. Modified date for the invitation. + * Default: current date/time. + * @type string $content Optional. Message to invitee. + * @type bool $send_invite Optional. Whether the invitation should be + * sent now. Default: false. + * } + * @return bool + */ + function bp_members_invitations_invite_user($args = array()) + { + } + /** + * Resend a membership invitation email by id. + * + * @since 8.0.0 + * + * @param int $id ID of the invitation to resend. + * @return bool + */ + function bp_members_invitation_resend_by_id($id = 0) + { + } + /** + * Delete a membership invitation by id. + * + * @since 8.0.0 + * + * @param int $id ID of the invitation to delete. + * @return int|bool Number of rows deleted on success, false on failure. + */ + function bp_members_invitations_delete_by_id($id = 0) + { + } + /** + * Delete a membership invitation. + * + * @since 8.0.0 + * + * @param intring $args { + * Array of arguments. + * @type int|array $id Id(s) of the invitation(s) to remove. + * @type int $invitee_email Email address of the user being invited. + * @type int $network_id ID of the network to which the user is being invited. + * @type int $inviter_id ID of the inviting user. + * @type int $accepted Whether the invitation has been accepted yet. + * @type int $invite_sent Whether the invitation has been sent yet. + * } + * @return bool True if all were deleted. + */ + function bp_members_invitations_delete_invites($args = array()) + { + } + /** + * Get hash based on details of a membership invitation and the inviter. + * + * @since 8.0.0 + * + * @param BP_Invitation $invitation Invitation to create hash from. + * + * @return string $hash Calculated sha1 hash. + */ + function bp_members_invitations_get_hash($invitation) + { + } + /** + * Get the current invitation specified by the $_GET parameters. + * + * @since 8.0.0 + * + * @return BP_Invitation $invite Invitation specified by the $_GET parameters. + */ + function bp_get_members_invitation_from_request() + { + } + /** + * Get WP_User object corresponding to a record in the signups table. + * + * @since 10.0.0 + * + * @param string $field Which fields to search by. Possible values are + * activation_key, user_email, id. + * @param string $value Value to search by. + * @return bool|BP_Signup $signup Found signup, returns first found + * if more than one is found. + */ + function bp_members_get_signup_by($field = 'activation_key', $value = '') + { + } + /** + * Are site creation requests currently enabled? + * + * @since 10.0.0 + * + * @return bool Whether site requests are currently enabled. + */ + function bp_members_site_requests_enabled() + { + } + /** + * Returns the strength score a password needs to have to be used by a member. + * + * Score => Allowed Strength. + * 0 => any passwords. + * 1 => at least short passwords. + * 2 => at least weak passwords. + * 3 => at least good passwords. + * 4 => at least strong passwords. + * + * @since 10.0.0 + * + * @return int the strength score a password needs to have to be used by a member. + */ + function bp_members_user_pass_required_strength() + { + } + /** + * Is the Admin User's community profile enabled? + * + * @since 10.0.0 + * + * @return bool True if enabled. False otherwise. + */ + function bp_members_is_community_profile_enabled() + { + } + /** + * Create Users submenu to manage BuddyPress types. + * + * @since 7.0.0 + */ + function bp_members_type_admin_menu() + { + } + /** + * Checks whether a member type already exists. + * + * @since 7.0.0 + * + * @param boolean $exists True if the member type already exists. False otherwise. + * @param string $type_id The member type identifier. + * @return bool True if the member type already exists. False otherwise. + */ + function bp_members_type_admin_type_exists($exists = \false, $type_id = '') + { + } + /** + * Set the feedback messages for the Member Types Admin actions. + * + * @since 7.0.0 + * + * @param array $messages The feedback messages. + * @return array The feedback messages including the ones for the Member Types Admin actions. + */ + function bp_members_type_admin_updated_messages($messages = array()) + { + } + /** + * Formats xprofile field data about a signup/membership request for display. + * + * Operates recursively on arrays, which are then imploded with commas. + * + * @since 10.0.0 + * + * @param string|array $value Field value. + */ + function bp_members_admin_format_xprofile_field_for_display($value) + { + } + /** + * Outputs Informations about a signup/membership request into a modal inside the Signups Admin Screen. + * + * @since 10.0.0 + * + * @param array $signup_field_labels The Signup field labels. + * @param object|null $signup_object The signup data object. + */ + function bp_members_admin_preview_signup_profile_info($signup_field_labels = array(), $signup_object = \null) + { + } + /** + * Member Invitations: Bulk-manage action handler + * + * @package BuddyPress + * @subpackage MembersActions + * @since 8.0.0 + */ + /** + * Handles bulk management (resend, cancellation) of invitations. + * + * @since 8.0.0 + * + * @return bool + */ + function bp_members_invitations_action_bulk_manage() + { + } + /** + * Members: Random member action handler + * + * @package BuddyPress + * @subpackage MembersActions + * @since 3.0.0 + */ + /** + * Redirect to a random member page when visiting a ?random-member URL. + * + * @since 1.0.0 + */ + function bp_core_get_random_member() + { + } + /** + * Members: Avatar deletion action handler + * + * @package BuddyPress + * @subpackage MembersActions + * @since 6.0.0 + */ + /** + * This function runs when an action is set for a screen: + * example.com/members/andy/profile/change-avatar/ [delete-avatar] + * + * The function will delete the active avatar for a user. + * + * @since 6.0.0 + */ + function bp_members_action_delete_avatar() + { + } + /** + * Set up the bp-members component. + * + * @since 1.6.0 + */ + function bp_setup_members() + { + } + /** + * Set up the bp-members-invitations component. + * + * @since 12.0.0 + */ + function bp_setup_members_invitations() + { + } + /** + * Callback function to render the BP Member Block. + * + * @since 6.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_members_render_member_block($attributes = array()) + { + } + /** + * Callback function to render the BP Members Block. + * + * @since 7.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_members_render_members_block($attributes = array()) + { + } + /** + * Adds specific script data for the BP Members blocks. + * + * Only used for the BP Dynamic Members block. + * + * @since 9.0.0 + */ + function bp_members_blocks_add_script_data() + { + } + /** + * Callback function to render the Dynamic Members Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_members_render_dynamic_members_block($attributes = array()) + { + } + /** + * Common function to render the Recently Active & Online Members Blocks. + * + * @since 9.0.0 + * + * @param array $block_args { + * Optional. An array of Block arguments. + * + * @type string $title The title of the Block. + * @type int $maxMembers The maximum number of members to show. Defaults to `0`. + * @type string $noMembers The string to output when there are no members to show. + * @type string $classname The name of the CSS class to use. + * @type string $type The type of filter to perform. Possible values are `online`, `active`, + * `newest`, `alphabetical`, `random` or `popular`. + * } + * @return string HTML output. + */ + function bp_members_render_members_avatars_block($block_args = array()) + { + } + /** + * Callback function to render the Online Members Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_members_render_online_members_block($attributes = array()) + { + } + /** + * Callback function to render the Recently Active Members Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_members_render_active_members_block($attributes = array()) + { + } + /** + * Register the 'new member' activity type. + * + * @since 2.2.0 + */ + function bp_members_register_activity_actions() + { + } + /** + * Format 'new_member' activity actions. + * + * @since 2.2.0 + * + * @param string $action Static activity action. + * @param object $activity Activity object. + * @return string $action + */ + function bp_members_format_activity_action_new_member($action, $activity) + { + } + /** + * Format 'new_avatar' activity actions. + * + * @since 8.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity object. + * @return string + */ + function bp_members_format_activity_action_new_avatar($action, $activity) + { + } + /** + * Create a "became a registered user" activity item when a user activates his account. + * + * @since 1.2.2 + * + * @param array $user Array of userdata passed to bp_core_activated_user hook. + * @return bool + */ + function bp_core_new_user_activity($user) + { + } + /** + * Adds an activity stream item when a user has uploaded a new avatar. + * + * @since 8.0.0 + * @since 10.0.0 Adds the `$type`, `$crop_data` and `$cropped_avatar` parameters. + * + * @param int $user_id The user id the avatar was set for. + * @param string $type The way the avatar was set ('camera' or `crop`). + * @param array $crop_data Array of parameters passed to the crop handler. + * @param array $cropped_avatar Array containing the full, thumb avatar and the timestamp. + */ + function bp_members_new_avatar_activity($user_id = 0, $type = '', $crop_data = array(), $cropped_avatar = array()) + { + } + /** + * Remove the `new_avatar` activity corresponding to the deleted previous avatar. + * + * @since 10.0.0 + * + * @param int $user_id The user ID. + * @param int $timestamp The timestamp when the activity was created. + * @return bool False otherwise. + */ + function bp_members_remove_previous_avatar_activity($user_id = 0, $timestamp = 0) + { + } + /** + * Output the profile component slug. + * + * @since 2.4.0 + */ + function bp_profile_slug() + { + } + /** + * Return the profile component slug. + * + * @since 2.4.0 + * + * @return string + */ + function bp_get_profile_slug() + { + } + /** + * Output the members component slug. + * + * @since 1.5.0 + */ + function bp_members_slug() + { + } + /** + * Return the members component slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_members_slug() + { + } + /** + * Output the members component root slug. + * + * @since 1.5.0 + */ + function bp_members_root_slug() + { + } + /** + * Return the members component root slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_members_root_slug() + { + } + /** + * Output the member type base slug. + * + * @since 2.5.0 + */ + function bp_members_member_type_base() + { + } + /** + * Get the member type URL base. + * + * The base slug is the string used as the base prefix when generating member type directory URLs. + * For example, in example.com/members/type/foo/, 'foo' is the member type and 'type' is the + * base slug. + * + * @since 2.5.0 + * + * @return string + */ + function bp_get_members_member_type_base() + { + } + /** + * Output member directory permalink. + * + * @since 1.5.0 + */ + function bp_members_directory_permalink() + { + } + /** + * Return member directory permalink. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_members_directory_permalink() + { + } + /** + * Output member type directory permalink. + * + * @since 2.5.0 + * + * @param string $member_type Optional. Member type. Defaults to current member type. + */ + function bp_member_type_directory_permalink($member_type = '') + { + } + /** + * Return member type directory permalink. + * + * @since 2.5.0 + * + * @param string $member_type Optional. Member type. Defaults to current member type. + * @return string Member type directory URL on success, an empty string on failure. + */ + function bp_get_member_type_directory_permalink($member_type = '') + { + } + /** + * Output the sign-up slug. + * + * @since 1.5.0 + */ + function bp_signup_slug() + { + } + /** + * Return the sign-up slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_signup_slug() + { + } + /** + * Output the activation slug. + * + * @since 1.5.0 + */ + function bp_activate_slug() + { + } + /** + * Return the activation slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_activate_slug() + { + } + /** + * Output the members invitation pane slug. + * + * @since 8.0.0 + */ + function bp_members_invitations_slug() + { + } + /** + * Return the members invitations root slug. + * + * @since 8.0.0 + * + * @return string + */ + function bp_get_members_invitations_slug() + { + } + /** + * Initialize the members loop. + * + * Based on the $args passed, bp_has_members() populates the $members_template + * global, enabling the use of BuddyPress templates and template functions to + * display a list of members. + * + * @since 1.2.0 + * @since 7.0.0 Added `xprofile_query` parameter. Added `user_ids` parameter. + * @since 10.0.0 Added `date_query` parameter. + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array|string $args { + * Arguments for limiting the contents of the members loop. Most arguments + * are in the same format as {@link BP_User_Query}. However, because + * the format of the arguments accepted here differs in a number of ways, + * and because bp_has_members() determines some default arguments in a + * dynamic fashion, we list all accepted arguments here as well. + * + * Arguments can be passed as an associative array, or as a URL query + * string (eg, 'user_id=4&per_page=3'). + * + * @type int $type Sort order. Accepts 'active', 'random', 'newest', 'popular', + * 'online', 'alphabetical'. Default: 'active'. + * @type int|bool $page Page of results to display. Default: 1. + * @type int|bool $per_page Number of results per page. Default: 20. + * @type int|bool $max Maximum number of results to return. Default: false (unlimited). + * @type string $page_arg The string used as a query parameter in pagination links. + * Default: 'bpage'. + * @type array|int|string|bool $include Limit results by a list of user IDs. Accepts an array, a + * single integer, a comma-separated list of IDs, or false (to + * disable this limiting). Accepts 'active', 'alphabetical', + * 'newest', or 'random'. Default: false. + * @type array|int|string|bool $exclude Exclude users from results by ID. Accepts an array, a single + * integer, a comma-separated list of IDs, or false (to disable + * this limiting). Default: false. + * @type array|string|bool $user_ids An array or comma-separated list of IDs, or false (to + * disable this limiting). Default: false. + * @type int $user_id If provided, results are limited to the friends of the specified + * user. When on a user's Friends page, defaults to the ID of the + * displayed user. Otherwise defaults to 0. + * @type string|array $member_type Array or comma-separated list of member types to limit + * results to. + * @type string|array $member_type__in Array or comma-separated list of member types to limit + * results to. + * @type string|array $member_type__not_in Array or comma-separated list of member types to exclude + * from results. + * @type string $search_terms Limit results by a search term. Default: value of + * `$_REQUEST['members_search']` or `$_REQUEST['s']`, if present. + * Otherwise false. + * @type string $meta_key Limit results by the presence of a usermeta key. + * Default: false. + * @type mixed $meta_value When used with meta_key, limits results by the a matching + * usermeta value. Default: false. + * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile + * component. See {@see BP_XProfile_Query} for details. + * @type array $date_query Filter results by member last activity date. See first parameter of + * {@link WP_Date_Query::__construct()} for syntax. Only applicable if + * $type is either 'active', 'random', 'newest', or 'online'. + * @type bool $populate_extras Whether to fetch optional data, such as friend counts. + * Default: true. + * } + * @return bool Returns true when blogs are found, otherwise false. + */ + function bp_has_members($args = '') + { + } + /** + * Set up the current member inside the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return object + */ + function bp_the_member() + { + } + /** + * Check whether there are more members to iterate over. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return bool + */ + function bp_members() + { + } + /** + * Output the members pagination count. + * + * @since 1.2.0 + */ + function bp_members_pagination_count() + { + } + /** + * Generate the members pagination count. + * + * @since 1.5.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string + */ + function bp_get_members_pagination_count() + { + } + /** + * Output the members pagination links. + * + * @since 1.2.0 + */ + function bp_members_pagination_links() + { + } + /** + * Fetch the members pagination links. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string + */ + function bp_get_members_pagination_links() + { + } + /** + * Output the ID of the current member in the loop. + * + * @since 1.2.0 + */ + function bp_member_user_id() + { + } + /** + * Get the ID of the current member in the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return int Member ID. + */ + function bp_get_member_user_id() + { + } + /** + * Output the row class of the current member in the loop. + * + * @since 1.7.0 + * + * @param array $classes Array of custom classes. + */ + function bp_member_class($classes = array()) + { + } + /** + * Return the row class of the current member in the loop. + * + * @since 1.7.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array $classes Array of custom classes. + * + * @return string Row class of the member + */ + function bp_get_member_class($classes = array()) + { + } + /** + * Output nicename of current member in the loop. + * + * @since 1.2.5 + */ + function bp_member_user_nicename() + { + } + /** + * Get the nicename of the current member in the loop. + * + * @since 1.2.5 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string Members nicename. + */ + function bp_get_member_user_nicename() + { + } + /** + * Output login for current member in the loop. + * + * @since 1.2.5 + */ + function bp_member_user_login() + { + } + /** + * Get the login of the current member in the loop. + * + * @since 1.2.5 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string Member's login. + */ + function bp_get_member_user_login() + { + } + /** + * Output the email address for the current member in the loop. + * + * @since 1.2.5 + */ + function bp_member_user_email() + { + } + /** + * Get the email address of the current member in the loop. + * + * @since 1.2.5 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string Member's email address. + */ + function bp_get_member_user_email() + { + } + /** + * Check whether the current member in the loop is the logged-in user. + * + * @since 1.2.5 + * @since 10.0.0 Updated to get member ID from `bp_get_member_user_id`. + * + * @return bool + */ + function bp_member_is_loggedin_user() + { + } + /** + * Output a member's avatar. + * + * @since 1.2.0 + * + * @see bp_get_member_avatar() for description of arguments. + * + * @param array|string $args See {@link bp_get_member_avatar()}. + */ + function bp_member_avatar($args = '') + { + } + /** + * Get a member's avatar. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @see bp_core_fetch_avatar() For a description of arguments and + * return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $alt Default: 'Profile picture of [user name]'. + * @type string $class Default: 'avatar'. + * @type string $type Default: 'thumb'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type bool $no_grav Default: false. + * @type bool $id Currently unused. + * } + * @return string User avatar string. + */ + function bp_get_member_avatar($args = '') + { + } + /** + * Output the permalink for the current member in the loop. + * + * @since 1.2.0 + */ + function bp_member_permalink() + { + } + /** + * Get the permalink for the current member in the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string + */ + function bp_get_member_permalink() + { + } + /** + * Alias of {@link bp_member_permalink()}. + * + * @since 1.2.0 + */ + function bp_member_link() + { + } + /** + * Alias of {@link bp_get_member_permalink()}. + * + * @since 1.2.0 + */ + function bp_get_member_link() + { + } + /** + * Output display name of current member in the loop. + * + * @since 1.2.0 + */ + function bp_member_name() + { + } + /** + * Get the display name of the current member in the loop. + * + * Full name is, by default, pulled from xprofile's Full Name field. + * When this field is empty, we try to get an alternative name from the + * WP users table, in the following order of preference: display_name, + * user_nicename, user_login. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string The user's fullname for display. + */ + function bp_get_member_name() + { + } + /** + * Output the current member's last active time. + * + * @since 1.2.0 + * + * @param array $args {@see bp_get_member_last_active()}. + */ + function bp_member_last_active($args = array()) + { + } + /** + * Return the current member's last active time. + * + * @since 1.2.0 + * @since 2.7.0 Added 'relative' as a parameter to $args. + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array $args { + * Array of optional arguments. + * @type mixed $active_format If true, formatted "active 5 minutes ago". If false, formatted "5 minutes + * ago". If string, should be sprintf'able like 'last seen %s ago'. + * @type bool $relative If true, will return relative time "5 minutes ago". If false, will return + * date from database. Default: true. + * } + * @return string + */ + function bp_get_member_last_active($args = array()) + { + } + /** + * Output the latest update of the current member in the loop. + * + * @since 1.2.0 + * + * @param array|string $args {@see bp_get_member_latest_update()}. + */ + function bp_member_latest_update($args = '') + { + } + /** + * Get the latest update from the current member in the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array|string $args { + * Array of optional arguments. + * @type int $length Truncation length. Default: 225. + * @type bool $view_link Whether to provide a 'View' link for + * truncated entries. Default: false. + * } + * @return string + */ + function bp_get_member_latest_update($args = '') + { + } + /** + * Output a piece of user profile data. + * + * @since 1.2.0 + * + * @see bp_get_member_profile_data() for a description of params. + * + * @param array|string $args See {@link bp_get_member_profile_data()}. + */ + function bp_member_profile_data($args = '') + { + } + /** + * Get a piece of user profile data. + * + * When used in a bp_has_members() loop, this function will attempt + * to fetch profile data cached in the template global. It is also safe + * to use outside of the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array|string $args { + * Array of config parameters. + * @type string $field Name of the profile field. + * @type int $user_id ID of the user whose data is being fetched. + * Defaults to the current member in the loop, or if not + * present, to the currently displayed user. + * } + * @return string|bool Profile data if found, otherwise false. + */ + function bp_get_member_profile_data($args = '') + { + } + /** + * Output the 'registered [x days ago]' string for the current member. + * + * @since 1.2.0 + * @since 2.7.0 Added $args as a parameter. + * + * @param array $args Optional. {@see bp_get_member_registered()}. + */ + function bp_member_registered($args = array()) + { + } + /** + * Get the 'registered [x days ago]' string for the current member. + * + * @since 1.2.0 + * @since 2.7.0 Added `$args` as a parameter. + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param array $args { + * Array of optional parameters. + * @type bool $relative Optional. If true, returns relative registered date. eg. registered 5 months ago. + * If false, returns registered date value from database. + * } + * @return string + */ + function bp_get_member_registered($args = array()) + { + } + /** + * Output a random piece of profile data for the current member in the loop. + * + * @since 1.2.0 + * @since 10.0.0 Updated to get member ID using `bp_get_member_user_id`. + */ + function bp_member_random_profile_data() + { + } + /** + * Output hidden input for preserving member search params on form submit. + * + * @since 1.2.0 + */ + function bp_member_hidden_fields() + { + } + /** + * Output the Members directory search form. + * + * @since 1.0.0 + */ + function bp_directory_members_search_form() + { + } + /** + * Output the total member count. + * + * @since 1.2.0 + */ + function bp_total_site_member_count() + { + } + /** + * Get the total site member count. + * + * @since 1.2.0 + * + * @return string + */ + function bp_get_total_site_member_count() + { + } + /** Navigation and other misc template tags ***********************************/ + /** + * Render the navigation markup for the logged-in user. + * + * Each component adds to this navigation array within its own + * [component_name]setup_nav() function. + * + * This navigation array is the top level navigation, so it contains items such as: + * [Blog, Profile, Messages, Groups, Friends] ... + * + * The function will also analyze the current component the user is in, to + * determine whether or not to highlight a particular nav item. + * + * @since 1.1.0 + * + * @todo Move to a back-compat file? + * @deprecated Does not seem to be called anywhere in BP core. + */ + function bp_get_loggedin_user_nav() + { + } + /** + * Output the contents of the current user's home page. + * + * @since 2.6.0 + */ + function bp_displayed_user_front_template_part() + { + } + /** + * Locate a custom user front template if it exists. + * + * @since 2.6.0 + * + * @param object|null $displayed_user Optional. Falls back to current user if not passed. + * @return string|bool Path to front template on success; boolean false on failure. + */ + function bp_displayed_user_get_front_template($displayed_user = \null) + { + } + /** + * Check if the displayed user has a custom front template. + * + * @since 2.6.0 + */ + function bp_displayed_user_has_front_template() + { + } + /** + * Render the navigation markup for the displayed user. + * + * @since 1.1.0 + */ + function bp_get_displayed_user_nav() + { + } + /** Cover image ***************************************************************/ + /** + * Should we use the cover image header + * + * @since 2.4.0 + * + * @return bool True if the displayed user has a cover image, + * False otherwise + */ + function bp_displayed_user_use_cover_image_header() + { + } + /** Avatars *******************************************************************/ + /** + * Output the logged-in user's avatar. + * + * @since 1.1.0 + * + * @see bp_get_loggedin_user_avatar() for a description of params. + * + * @param array|string $args {@see bp_get_loggedin_user_avatar()}. + */ + function bp_loggedin_user_avatar($args = '') + { + } + /** + * Get the logged-in user's avatar. + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For a description of arguments and + * return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $alt Default: 'Profile picture of [user name]'. + * @type bool $html Default: true. + * @type string $type Default: 'thumb'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * } + * @return string User avatar string. + */ + function bp_get_loggedin_user_avatar($args = '') + { + } + /** + * Output the displayed user's avatar. + * + * @since 1.1.0 + * + * @see bp_get_displayed_user_avatar() for a description of params. + * + * @param array|string $args {@see bp_get_displayed_user_avatar()}. + */ + function bp_displayed_user_avatar($args = '') + { + } + /** + * Get the displayed user's avatar. + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For a description of arguments and + * return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $alt Default: 'Profile picture of [user name]'. + * @type bool $html Default: true. + * @type string $type Default: 'thumb'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * } + * @return string User avatar string. + */ + function bp_get_displayed_user_avatar($args = '') + { + } + /** + * Output the email address of the displayed user. + * + * @since 1.5.0 + */ + function bp_displayed_user_email() + { + } + /** + * Get the email address of the displayed user. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_displayed_user_email() + { + } + /** + * Output the "active [x days ago]" string for a user. + * + * @since 1.0.0 + * + * @see bp_get_last_activity() for a description of parameters. + * + * @param int $user_id See {@link bp_get_last_activity()}. + */ + function bp_last_activity($user_id = 0) + { + } + /** + * Get the "active [x days ago]" string for a user. + * + * @since 1.5.0 + * + * @param int $user_id ID of the user. Default: displayed user ID. + * @return string + */ + function bp_get_last_activity($user_id = 0) + { + } + /** + * Output the calculated first name of the displayed or logged-in user. + * + * @since 1.2.0 + */ + function bp_user_firstname() + { + } + /** + * Output the first name of a user. + * + * Simply takes all the characters before the first space in a name. + * + * @since 1.2.0 + * + * @param string|bool $name Full name to use when generating first name. + * Defaults to displayed user's first name, or to + * logged-in user's first name if it's unavailable. + * @return string + */ + function bp_get_user_firstname($name = \false) + { + } + /** + * Alias of {@link bp_displayed_user_id()}. + * + * @since 1.0.0 + */ + function bp_current_user_id() + { + } + /** + * Output the link for the displayed user's profile. + * + * @since 1.2.4 + * @since 12.0.0 Introduced the `$chunk` argument. + * + * @param array $chunk A list of slugs to append to the URL. + */ + function bp_displayed_user_link($chunks = array()) + { + } + /** + * Builds the logged-in user's profile URL. + * + * @since 12.0.0 + * + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type string $single_item_component The component slug the action is relative to. + * @type string $single_item_action The slug of the action to perform. + * @type array $single_item_action_variables An array of additional informations about the action to perform. + * } + * @return string The logged-in user's profile URL. + */ + function bp_displayed_user_url($path_chunks = array()) + { + } + /** + * Generate the link for the displayed user's profile. + * + * @since 1.0.0 + * @since 12.0.0 This function is now an alias of `bp_displayed_user_url()`. + * You should only use it to get the "home" URL of the displayed + * user's profile page. If you need to build an URL to reach another + * page, we strongly advise you to use `bp_displayed_user_url()`. + * + * @todo Deprecating this function would be safer. + * @return string + */ + function bp_displayed_user_domain() + { + } + /** + * Output the link for the logged-in user's profile. + * + * @since 1.2.4 + * @since 12.0.0 Introduced the `$chunk` argument. + * + * @param array $chunk A list of slugs to append to the URL. + */ + function bp_loggedin_user_link($chunks = array()) + { + } + /** + * Builds the logged-in user's profile URL. + * + * @since 12.0.0 + * + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type string $single_item_component The component slug the action is relative to. + * @type string $single_item_action The slug of the action to perform. + * @type array $single_item_action_variables An array of additional informations about the action to perform. + * } + * @return string The logged-in user's profile URL. + */ + function bp_loggedin_user_url($path_chunks = array()) + { + } + /** + * Generate the link for the logged-in user's profile. + * + * @since 1.0.0 + * @since 12.0.0 This function is now an alias of `bp_loggedin_user_url()`. + * You should only use it to get the "home" URL of the logged-in + * user's profile page. If you need to build an URL to reach another + * page, we strongly advise you to use `bp_loggedin_user_url()`. + * + * @todo Deprecating this function would be safer. + * @return string + */ + function bp_loggedin_user_domain() + { + } + /** + * Output the displayed user's display name. + * + * @since 1.0.0 + */ + function bp_displayed_user_fullname() + { + } + /** + * Get the displayed user's display name. + * + * @since 1.2.0 + * + * @return string + */ + function bp_get_displayed_user_fullname() + { + } + /** + * Alias of {@link bp_get_displayed_user_fullname()}. + * + * @since 1.0.0 + */ + function bp_user_fullname() + { + } + /** + * Output the logged-in user's display name. + * + * @since 1.0.0 + */ + function bp_loggedin_user_fullname() + { + } + /** + * Get the logged-in user's display name. + * + * @since 1.0.0 + * + * @return string + */ + function bp_get_loggedin_user_fullname() + { + } + /** + * Output the username of the displayed user. + * + * @since 1.2.0 + */ + function bp_displayed_user_username() + { + } + /** + * Get the username of the displayed user. + * + * @since 1.2.0 + * + * @return string + */ + function bp_get_displayed_user_username() + { + } + /** + * Output the username of the logged-in user. + * + * @since 1.2.0 + */ + function bp_loggedin_user_username() + { + } + /** + * Get the username of the logged-in user. + * + * @since 1.2.0 + * + * @return string + */ + function bp_get_loggedin_user_username() + { + } + /** + * Echo the current member type message. + * + * @since 2.3.0 + */ + function bp_current_member_type_message() + { + } + /** + * Generate the current member type message. + * + * @since 2.3.0 + * + * @return string + */ + function bp_get_current_member_type_message() + { + } + /** + * Output member type directory link. + * + * @since 7.0.0 + * + * @param string $member_type Unique member type identifier as used in bp_register_member_type(). + */ + function bp_member_type_directory_link($member_type = '') + { + } + /** + * Return member type directory link. + * + * @since 7.0.0 + * + * @param string $member_type Unique member type identifier as used in bp_register_member_type(). + * @return string + */ + function bp_get_member_type_directory_link($member_type = '') + { + } + /** + * Output a comma-delimited list of member types. + * + * @since 7.0.0 + * + * @see bp_get_member_type_list() For additional information on default arguments. + * + * @param int $user_id User ID. + * @param array $r Optional. Member type list arguments. Default empty array. + */ + function bp_member_type_list($user_id = 0, $r = array()) + { + } + /** + * Return a comma-delimited list of member types. + * + * @since 7.0.0 + * + * @param int $user_id User ID. Defaults to displayed user ID if on a member page. + * @param array|string $r { + * Array of parameters. All items are optional. + * @type string $parent_element Element to wrap around the list. Defaults to 'p'. + * @type array $parent_attr Element attributes for parent element. Defaults to + * array( 'class' => 'bp-member-type-list' ). + * @type array $label Plural and singular labels to use before the list. Defaults to + * array( 'plural' => 'Member Types:', 'singular' => 'Member Type:' ). + * @type string $label_element Element to wrap around the label. Defaults to 'strong'. + * @type array $label_attr Element attributes for label element. Defaults to array(). + * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If + * 'false', only shows member types with the 'show_in_list' parameter set to + * true. See bp_register_member_type() for more info. + * @type string $list_element Element to wrap around the comma separated list of membet types. Defaults to ''. + * @type string $list_element_attr Element attributes for list element. Defaults to array(). + * } + * @return string + */ + function bp_get_member_type_list($user_id = 0, $r = array()) + { + } + /** Signup Form ***************************************************************/ + /** + * Do we have a working custom sign up page? + * + * @since 1.5.0 + * + * @return bool True if page and template exist, false if not. + */ + function bp_has_custom_signup_page() + { + } + /** + * Output the URL to the signup page. + * + * @since 1.0.0 + */ + function bp_signup_page() + { + } + /** + * Get the URL to the signup page. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_signup_page() + { + } + /** + * Do we have a working custom activation page? + * + * @since 1.5.0 + * + * @return bool True if page and template exist, false if not. + */ + function bp_has_custom_activation_page() + { + } + /** + * Output the URL of the activation page. + * + * @since 1.0.0 + */ + function bp_activation_page() + { + } + /** + * Get the URL of the activation page. + * + * @since 1.2.0 + * + * @return string + */ + function bp_get_activation_page() + { + } + /** + * Get the activation key from the current request URL. + * + * @since 3.0.0 + * + * @return string + */ + function bp_get_current_activation_key() + { + } + /** + * Output the username submitted during signup. + * + * @since 1.1.0 + */ + function bp_signup_username_value() + { + } + /** + * Get the username submitted during signup. + * + * @since 1.1.0 + * + * @todo This should be properly escaped. + * + * @return string + */ + function bp_get_signup_username_value() + { + } + /** + * Output the user email address submitted during signup. + * + * @since 1.1.0 + */ + function bp_signup_email_value() + { + } + /** + * Get the email address submitted during signup. + * + * @since 1.1.0 + * + * @todo This should be properly escaped. + * + * @return string + */ + function bp_get_signup_email_value() + { + } + /** + * Output the 'signup_with_blog' value submitted during signup. + * + * @since 1.1.0 + */ + function bp_signup_with_blog_value() + { + } + /** + * Get the 'signup_with_blog' value submitted during signup. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_signup_with_blog_value() + { + } + /** + * Output the 'signup_blog_url' value submitted at signup. + * + * @since 1.1.0 + */ + function bp_signup_blog_url_value() + { + } + /** + * Get the 'signup_blog_url' value submitted at signup. + * + * @since 1.1.0 + * + * @todo Should be properly escaped. + * + * @return string + */ + function bp_get_signup_blog_url_value() + { + } + /** + * Output the base URL for subdomain installations of WordPress Multisite. + * + * @since 2.1.0 + */ + function bp_signup_subdomain_base() + { + } + /** + * Return the base URL for subdomain installations of WordPress Multisite. + * + * Replaces bp_blogs_get_subdomain_base() + * + * @since 2.1.0 + * + * @global WP_Network $current_site + * + * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com. + */ + function bp_signup_get_subdomain_base() + { + } + /** + * Output the 'signup_blog_titl' value submitted at signup. + * + * @since 1.1.0 + */ + function bp_signup_blog_title_value() + { + } + /** + * Get the 'signup_blog_title' value submitted at signup. + * + * @since 1.1.0 + * + * @todo Should be properly escaped. + * + * @return string + */ + function bp_get_signup_blog_title_value() + { + } + /** + * Output the 'signup_blog_privacy' value submitted at signup. + * + * @since 1.1.0 + */ + function bp_signup_blog_privacy_value() + { + } + /** + * Get the 'signup_blog_privacy' value submitted at signup. + * + * @since 1.1.0 + * + * @todo Should be properly escaped. + * + * @return string + */ + function bp_get_signup_blog_privacy_value() + { + } + /** + * Output the avatar dir used during signup. + * + * @since 1.1.0 + */ + function bp_signup_avatar_dir_value() + { + } + /** + * Get the avatar dir used during signup. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_signup_avatar_dir_value() + { + } + /** + * Determines whether privacy policy acceptance is required for registration. + * + * @since 4.0.0 + * + * @return bool + */ + function bp_signup_requires_privacy_policy_acceptance() + { + } + /** + * Output the current signup step. + * + * @since 1.1.0 + */ + function bp_current_signup_step() + { + } + /** + * Get the current signup step. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_current_signup_step() + { + } + /** + * Output the user avatar during signup. + * + * @since 1.1.0 + * + * @see bp_get_signup_avatar() for description of arguments. + * + * @param array|string $args See {@link bp_get_signup_avatar(}. + */ + function bp_signup_avatar($args = '') + { + } + /** + * Get the user avatar during signup. + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() for description of arguments. + * + * @param array|string $args { + * Array of optional arguments. + * @type int $size Height/weight in pixels. Default: value of + * bp_core_avatar_full_width(). + * @type string $class CSS class. Default: 'avatar'. + * @type string $alt HTML 'alt' attribute. Default: 'Your Avatar'. + * } + * @return string + */ + function bp_get_signup_avatar($args = '') + { + } + /** + * Output whether signup is allowed. + * + * @since 1.1.0 + * + * @todo Remove this function. Echoing a bool is pointless. + */ + function bp_signup_allowed() + { + } + /** + * Is user signup allowed? + * + * @since 1.1.0 + * + * @return bool + */ + function bp_get_signup_allowed() + { + } + /** + * Are users allowed to invite users to join this site? + * + * @since 8.0.0 + * + * @return bool + */ + function bp_get_members_invitations_allowed() + { + } + /** + * Are membership requests required for joining this site? + * + * @since 10.0.0 + * + * @param bool $context "raw" to fetch value from database, + * "site" to take "anyone can register" setting into account. + * @return bool + */ + function bp_get_membership_requests_required($context = 'site') + { + } + /** + * Should the system create and allow access + * to the Register and Activate pages? + * + * @since 10.0.0 + * + * @return bool + */ + function bp_allow_access_to_registration_pages() + { + } + /** + * Hook member activity feed to <head>. + * + * @since 1.5.0 + */ + function bp_members_activity_feed() + { + } + /** + * Output a link to a members component subpage. + * + * @since 1.5.0 + * + * @see bp_get_members_component_link() for description of parameters. + * + * @param string $component See {@bp_get_members_component_link()}. + * @param string $action See {@bp_get_members_component_link()}. + * @param string $query_args See {@bp_get_members_component_link()}. + * @param string|bool $nonce See {@bp_get_members_component_link()}. + */ + function bp_members_component_link($component, $action = '', $query_args = '', $nonce = \false) + { + } + /** + * Generate a link to a members component subpage. + * + * @since 1.5.0 + * + * @param string $component ID of the component (eg 'friends'). + * @param string $action Optional. 'action' slug (eg 'invites'). + * @param array|string $query_args Optional. Array of URL params to add to the + * URL. See {@link add_query_arg()} for format. + * @param array|bool $nonce Optional. If provided, the URL will be passed + * through wp_nonce_url() with $nonce as the + * action string. + * @return string + */ + function bp_get_members_component_link($component, $action = '', $query_args = '', $nonce = \false) + { + } + /** + * Render an avatar delete link. + * + * @since 1.1.0 + * @since 6.0.0 Moved from /bp-xprofile/bp-xprofile-template.php to this file. + */ + function bp_avatar_delete_link() + { + } + /** + * Return an avatar delete link. + * + * @since 1.1.0 + * @since 6.0.0 Moved from /bp-xprofile/bp-xprofile-template.php to this file. + * + * @return string + */ + function bp_get_avatar_delete_link() + { + } + /** The Members Invitations Loop ******************************************************************/ + /** + * Initialize the community invitations loop. + * + * Based on the $args passed, bp_has_invitations() populates + * buddypress()->invitations->query_loop global, enabling the use of BP + * templates and template functions to display a list of invitations. + * + * @since 8.0.0 + * + * @param array|string $args { + * Arguments for limiting the contents of the invitations loop. Can be + * passed as an associative array, or as a URL query string. + * + * See {@link BP_Invitations_Invitation::get()} for detailed + * information on the arguments. In addition, also supports: + * + * @type int $max Optional. Max items to display. Default: false. + * @type string $page_arg URL argument to use for pagination. + * Default: 'ipage'. + * } + * @return bool + */ + function bp_has_members_invitations($args = '') + { + } + /** + * Get the network invitations returned by the template loop. + * + * @since 8.0.0 + * + * @return array List of network invitations. + */ + function bp_the_members_invitations() + { + } + /** + * Get the current network invitation object in the loop. + * + * @since 8.0.0 + * + * @return object The current network invitation within the loop. + */ + function bp_the_members_invitation() + { + } + /** + * Output the pagination count for the current network invitations loop. + * + * @since 8.0.0 + */ + function bp_members_invitations_pagination_count() + { + } + /** + * Return the pagination count for the current network invitation loop. + * + * @since 8.0.0 + * + * @return string HTML for the pagination count. + */ + function bp_get_members_invitations_pagination_count() + { + } + /** + * Output the pagination links for the current network invitation loop. + * + * @since 8.0.0 + */ + function bp_members_invitations_pagination_links() + { + } + /** + * Return the pagination links for the current network invitations loop. + * + * @since 8.0.0 + * + * @return string HTML for the pagination links. + */ + function bp_get_members_invitations_pagination_links() + { + } + /** + * Output the requested property of the invitation currently being iterated on. + * + * @since 8.0.0 + * + * @param string $property The name of the property to display. + * @param string $context The context of display. + * Possible values are 'attribute' and 'html'. + */ + function bp_the_members_invitation_property($property = '', $context = 'html') + { + } + /** + * Return the value for a property of the network invitation currently being iterated on. + * + * @since 8.0.0 + * + * @return int ID of the current network invitation. + */ + function bp_get_the_members_invitation_property($property = 'id') + { + } + /** + * Output the action links for the current invitation. + * + * @since 8.0.0 + * + * @param array|string $args Array of arguments. + */ + function bp_the_members_invitation_action_links($args = '') + { + } + /** + * Return the action links for the current invitation. + * + * @since 8.0.0 + * + * @param array|string $args { + * @type string $before HTML before the links. + * @type string $after HTML after the links. + * @type string $sep HTML between the links. + * @type array $links Array of links to implode by 'sep'. + * @type int $user_id User ID to fetch action links for. Defaults to displayed user ID. + * } + * @return string HTML links for actions to take on single notifications. + */ + function bp_get_the_members_invitation_action_links($args = '') + { + } + /** + * Output the resend link for the current invitation. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_the_members_invitations_resend_link($user_id = 0) + { + } + /** + * Return the resend link for the current notification. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_members_invitation_resend_link($user_id = 0) + { + } + /** + * Output the URL used for resending a single invitation. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_the_members_invitations_resend_url($user_id = 0) + { + } + /** + * Return the URL used for resending a single invitation. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_members_invitations_resend_url($user_id = 0) + { + } + /** + * Output the delete link for the current invitation. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_the_members_invitations_delete_link($user_id = 0) + { + } + /** + * Return the delete link for the current invitation. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_members_invitation_delete_link($user_id = 0) + { + } + /** + * Output the URL used for deleting a single invitation. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_the_members_invitations_delete_url($user_id = 0) + { + } + /** + * Return the URL used for deleting a single invitation. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_members_invitations_delete_url($user_id = 0) + { + } + /** + * Output the members invitations list permalink for a user. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_members_invitations_list_invites_permalink($user_id = 0) + { + } + /** + * Return the members invitations list permalink for a user. + * + * @since 8.0.0 + * + * @return string Members invitations list permalink for a user. + */ + function bp_get_members_invitations_list_invites_permalink($user_id = 0) + { + } + /** + * Output the send invitation permalink for a user. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + */ + function bp_members_invitations_send_invites_permalink($user_id = 0) + { + } + /** + * Return the send invitations permalink. + * + * @since 8.0.0 + * + * @param int $user_id The user ID. + * @return string The send invitations permalink. + */ + function bp_get_members_invitations_send_invites_permalink($user_id = 0) + { + } + /** + * Output the dropdown for bulk management of invitations. + * + * @since 8.0.0 + */ + function bp_members_invitations_bulk_management_dropdown() + { + } + /** + * Add the "My Account" menu and all submenus. + * + * @since 1.6.0 + * + * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + */ + function bp_members_admin_bar_my_account_menu() + { + } + /** + * Add the User Admin top-level menu to user pages. + * + * @since 1.5.0 + * + * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + */ + function bp_members_admin_bar_user_admin_menu() + { + } + /** + * Build the "Notifications" dropdown. + * + * @since 11.4.0 + */ + function bp_members_admin_bar_notifications_dropdown($notifications = array(), $menu_link = '', $type = 'members') + { + } + /** + * Build the Admin or Members "Notifications" dropdown. + * + * @since 1.5.0 + * + * @return bool + */ + function bp_members_admin_bar_notifications_menu() + { + } + /** + * Keep the Notification toolbar menu at the left of the "My Account" one. + * + * @since 12.6.0 + */ + function bp_members_admin_bar_notifications_menu_priority() + { + } + /** + * Remove rogue WP core Edit menu when viewing a single user. + * + * @since 1.6.0 + */ + function bp_members_remove_edit_page_menu() + { + } + /** + * Create a new friendship. + * + * @since 1.0.0 + * + * @param int $initiator_userid ID of the "initiator" user (the user who is + * sending the friendship request). + * @param int $friend_userid ID of the "friend" user (the user whose friendship + * is being requested). + * @param bool $force_accept Optional. Whether to force acceptance. When false, + * running friends_add_friend() will result in a friendship request. + * When true, running friends_add_friend() will result in an accepted + * friendship, with no notifications being sent. Default: false. + * @return bool + */ + function friends_add_friend($initiator_userid, $friend_userid, $force_accept = \false) + { + } + /** + * Remove a friendship. + * + * Will also delete the related "friendship_accepted" activity item. + * + * @since 1.0.0 + * + * @param int $initiator_userid ID of the friendship initiator. + * @param int $friend_userid ID of the friend user. + * @return bool + */ + function friends_remove_friend($initiator_userid, $friend_userid) + { + } + /** + * Mark a friendship request as accepted. + * + * Also initiates a "friendship_accepted" activity item. + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the pending friendship object. + * @return bool + */ + function friends_accept_friendship($friendship_id) + { + } + /** + * Mark a friendship request as rejected. + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the pending friendship object. + * @return bool + */ + function friends_reject_friendship($friendship_id) + { + } + /** + * Withdraw a friendship request. + * + * @since 1.6.0 + * + * @param int $initiator_userid ID of the friendship initiator - this is the + * user who requested the friendship, and is doing the withdrawing. + * @param int $friend_userid ID of the requested friend. + * @return bool + */ + function friends_withdraw_friendship($initiator_userid, $friend_userid) + { + } + /** + * Check whether two users are friends. + * + * @since 1.0.0 + * + * @param int $user_id ID of the first user. + * @param int $possible_friend_id ID of the other user. + * @return bool Returns true if the two users are friends, otherwise false. + */ + function friends_check_friendship($user_id, $possible_friend_id) + { + } + /** + * Get the friendship status of two friends. + * + * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @param int $user_id ID of the first user. + * @param int $possible_friend_id ID of the other user. + * @return string Friend status of the two users. + */ + function friends_check_friendship_status($user_id, $possible_friend_id) + { + } + /** + * Get the friend count of a given user. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose friends are being counted. + * @return int Friend count of the user. + */ + function friends_get_total_friend_count($user_id = 0) + { + } + /** + * Check whether a given user has any friends. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friends are being checked. + * @return bool True if the user has friends, otherwise false. + */ + function friends_check_user_has_friends($user_id) + { + } + /** + * Get the ID of two users' friendship, if it exists. + * + * @since 1.2.0 + * + * @param int $initiator_user_id ID of the first user. + * @param int $friend_user_id ID of the second user. + * @return int|null ID of the friendship if found, otherwise null. + */ + function friends_get_friendship_id($initiator_user_id, $friend_user_id) + { + } + /** + * Get the IDs of a given user's friends. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param bool $friend_requests_only Optional. Whether to fetch unaccepted + * requests only. Default: false. + * @param bool $assoc_arr Optional. True to receive an array of arrays keyed as + * 'user_id' => $user_id; false to get a one-dimensional + * array of user IDs. Default: false. + * @return array + */ + function friends_get_friend_user_ids($user_id, $friend_requests_only = \false, $assoc_arr = \false) + { + } + /** + * Search the friends of a user by a search string. + * + * @since 1.0.0 + * + * @param string $search_terms The search string, matched against xprofile fields (if + * available), or usermeta 'nickname' field. + * @param int $user_id ID of the user whose friends are being searched. + * @param int $pag_num Optional. Max number of friends to return. + * @param int $pag_page Optional. The page of results to return. Default: null (no + * pagination - return all results). + * @return array|bool On success, an array: { + * @type array $friends IDs of friends returned by the query. + * @type int $count Total number of friends (disregarding + * pagination) who match the search. + * }. Returns false on failure. + */ + function friends_search_friends($search_terms, $user_id, $pag_num = 10, $pag_page = 1) + { + } + /** + * Get a list of IDs of users who have requested friendship of a given user. + * + * @since 1.2.0 + * + * @param int $user_id The ID of the user who has received the friendship requests. + * @return array|bool An array of user IDs, or false if none are found. + */ + function friends_get_friendship_request_user_ids($user_id) + { + } + /** + * Get a user's most recently active friends. + * + * @since 1.0.0 + * + * @see bp_core_get_users() for a description of return value. + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param int $per_page Optional. Number of results to return per page. + * Default: 0 (no pagination; show all results). + * @param int $page Optional. Number of the page of results to return. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. + * @return array See {@link BP_Core_User::get_users()}. + */ + function friends_get_recently_active($user_id, $per_page = 0, $page = 0, $filter = '') + { + } + /** + * Get a user's friends, in alphabetical order. + * + * @since 1.0.0 + * + * @see bp_core_get_users() for a description of return value. + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param int $per_page Optional. Number of results to return per page. + * Default: 0 (no pagination; show all results). + * @param int $page Optional. Number of the page of results to return. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. + * @return array See {@link BP_Core_User::get_users()}. + */ + function friends_get_alphabetically($user_id, $per_page = 0, $page = 0, $filter = '') + { + } + /** + * Get a user's friends, in the order in which they joined the site. + * + * @since 1.0.0 + * + * @see bp_core_get_users() for a description of return value. + * + * @param int $user_id ID of the user whose friends are being retrieved. + * @param int $per_page Optional. Number of results to return per page. + * Default: 0 (no pagination; show all results). + * @param int $page Optional. Number of the page of results to return. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. + * @return array See {@link BP_Core_User::get_users()}. + */ + function friends_get_newest($user_id, $per_page = 0, $page = 0, $filter = '') + { + } + /** + * Get the last active date of many users at once. + * + * @since 1.0.0 + * + * @see BP_Friends_Friendship::get_bulk_last_active() for a description of + * arguments and return value. + * + * @param array $friend_ids See BP_Friends_Friendship::get_bulk_last_active(). + * @return array See BP_Friends_Friendship::get_bulk_last_active(). + */ + function friends_get_bulk_last_active($friend_ids) + { + } + /** + * Get a list of friends that a user can invite into this group. + * + * Excludes friends that are already in the group, and banned friends if the + * user is not a group admin. + * + * @since 1.0.0 + * + * @param int $user_id User ID whose friends to see can be invited. Default: + * ID of the logged-in user. + * @param int $group_id Group to check possible invitations against. + * @return mixed False if no friends, array of users if friends. + */ + function friends_get_friends_invite_list($user_id = 0, $group_id = 0) + { + } + /** + * Get a count of a user's friends who can be invited to a given group. + * + * Users can invite any of their friends except: + * + * - users who are already in the group + * - users who have a pending invite to the group + * - users who have been banned from the group + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friends are being counted. + * @param int $group_id ID of the group friends are being invited to. + * @return int Eligible friend count. + */ + function friends_count_invitable_friends($user_id, $group_id) + { + } + /** + * Get a total friend count for a given user. + * + * @since 1.0.0 + * + * @param int $user_id Optional. ID of the user whose friendships you are + * counting. Default: displayed user (if any), otherwise logged-in user. + * @return int Friend count for the user. + */ + function friends_get_friend_count_for_user($user_id) + { + } + /** + * Return a list of a user's friends, filtered by a search term. + * + * @since 1.0.0 + * + * @param string $search_terms Search term to filter on. + * @param int $user_id ID of the user whose friends are being searched. + * @param int $pag_num Number of results to return per page. Default: 0 (no + * pagination - show all results). + * @param int $pag_page Number of the page being requested. Default: 0 (no + * pagination - show all results). + * @return array Array of BP_Core_User objects corresponding to friends. + */ + function friends_search_users($search_terms, $user_id, $pag_num = 0, $pag_page = 0) + { + } + /** + * Has a friendship been confirmed (accepted)? + * + * @since 1.0.0 + * + * @param int $friendship_id The ID of the friendship being checked. + * @return bool True if the friendship is confirmed, otherwise false. + */ + function friends_is_friendship_confirmed($friendship_id) + { + } + /** + * Update user friend counts. + * + * Friend counts are cached in usermeta for performance reasons. After a + * friendship event (acceptance, deletion), call this function to regenerate + * the cached values. + * + * @since 1.0.0 + * + * @param int $initiator_user_id ID of the first user. + * @param int $friend_user_id ID of the second user. + * @param string $status Optional. The friendship event that's been triggered. + * 'add' will ++ each user's friend counts, while any other string + * will --. + */ + function friends_update_friend_totals($initiator_user_id, $friend_user_id, $status = 'add') + { + } + /** + * Remove all friends-related data concerning a given user. + * + * Removes the following: + * + * - Friendships of which the user is a member. + * - Cached friend count for the user. + * - Notifications of friendship requests sent by the user. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose friend data is being removed. + */ + function friends_remove_data($user_id) + { + } + /** + * Deletes user Friends data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_friends_remove_data_on_delete_user($user_id) + { + } + /** + * Used by the Activity component's @mentions to print a JSON list of the current user's friends. + * + * This is intended to speed up @mentions lookups for a majority of use cases. + * + * @since 2.1.0 + * + * @see bp_activity_mentions_script() + */ + function bp_friends_prime_mentions_results() + { + } + /** Emails ********************************************************************/ + /** + * Send notifications related to a new friendship request. + * + * When a friendship is requested, an email and a BP notification are sent to + * the user of whom friendship has been requested ($friend_id). + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the friendship object. + * @param int $initiator_id ID of the user who initiated the request. + * @param int $friend_id ID of the request recipient. + */ + function friends_notification_new_request($friendship_id, $initiator_id, $friend_id) + { + } + /** + * Send notifications related to the acceptance of a friendship request. + * + * When a friendship request is accepted, an email and a BP notification are + * sent to the user who requested the friendship ($initiator_id). + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the friendship object. + * @param int $initiator_id ID of the user who initiated the request. + * @param int $friend_id ID of the request recipient. + */ + function friends_notification_accepted_request($friendship_id, $initiator_id, $friend_id) + { + } + /** + * Finds and exports friendship data associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_friends_personal_data_exporter($email_address, $page) + { + } + /** + * Finds and exports pending sent friendship request data associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_friends_pending_sent_requests_personal_data_exporter($email_address, $page) + { + } + /** + * Finds and exports pending received friendship request data associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_friends_pending_received_requests_personal_data_exporter($email_address, $page) + { + } + /** + * Output the friends component slug. + * + * @since 1.5.0 + */ + function bp_friends_slug() + { + } + /** + * Return the friends component slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_friends_slug() + { + } + /** + * Output the friends component root slug. + * + * @since 1.5.0 + */ + function bp_friends_root_slug() + { + } + /** + * Return the friends component root slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_friends_root_slug() + { + } + /** + * Output the "Add Friend" button in the member loop. + * + * @since 1.2.6 + */ + function bp_member_add_friend_button() + { + } + /** + * Output the friend count for the current member in the loop. + * + * @since 1.2.0 + */ + function bp_member_total_friend_count() + { + } + /** + * Return the friend count for the current member in the loop. + * + * Return value is a string of the form "x friends". + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string A string of the form "x friends". + */ + function bp_get_member_total_friend_count() + { + } + /** + * Output the ID of the current user in the friend request loop. + * + * @since 1.2.6 + * + * @see bp_get_potential_friend_id() for a description of arguments. + * + * @param int $user_id See {@link bp_get_potential_friend_id()}. + */ + function bp_potential_friend_id($user_id = 0) + { + } + /** + * Return the ID of current user in the friend request loop. + * + * @since 1.2.6 + * + * @global object $friends_template + * + * @param int $user_id Optional. If provided, the function will simply + * return this value. + * @return int ID of potential friend. + */ + function bp_get_potential_friend_id($user_id = 0) + { + } + /** + * Check whether a given user is a friend of the logged-in user. + * + * Returns - 'is_friend', 'not_friends', 'pending'. + * + * @since 1.2.6 + * + * @param int $user_id ID of the potential friend. Default: the value of + * {@link bp_get_potential_friend_id()}. + * @return bool|string 'is_friend', 'not_friends', or 'pending'. + */ + function bp_is_friend($user_id = 0) + { + } + /** + * Output the Add Friend button. + * + * @since 1.0.0 + * + * @see bp_get_add_friend_button() for information on arguments. + * + * @param int $potential_friend_id See {@link bp_get_add_friend_button()}. + * @param int|bool $friend_status See {@link bp_get_add_friend_button()}. + */ + function bp_add_friend_button($potential_friend_id = 0, $friend_status = \false) + { + } + /** + * Build friend button arguments. + * + * @since 11.0.0 + * + * @param int $potential_friend_id The user ID of the potential friend. + * @return array The friend button arguments. + */ + function bp_get_add_friend_button_args($potential_friend_id = 0) + { + } + /** + * Create the Add Friend button. + * + * @since 1.1.0 + * @since 11.0.0 uses `bp_get_add_friend_button_args()`. + * + * @param int $potential_friend_id ID of the user to whom the button + * applies. Default: value of {@link bp_get_potential_friend_id()}. + * @param bool $friend_status Not currently used. + * @return bool|string HTML for the Add Friend button. False if already friends. + */ + function bp_get_add_friend_button($potential_friend_id = 0, $friend_status = \false) + { + } + /** + * Get a comma-separated list of IDs of a user's friends. + * + * @since 1.2.0 + * + * @param int $user_id Optional. Default: the displayed user's ID, or the + * logged-in user's ID. + * @return bool|string A comma-separated list of friend IDs if any are found, + * otherwise false. + */ + function bp_get_friend_ids($user_id = 0) + { + } + /** + * Get a user's friendship requests. + * + * Note that we return a 0 if no pending requests are found. This is necessary + * because of the structure of the $include parameter in bp_has_members(). + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose requests are being retrieved. + * Defaults to displayed user. + * @return array|int An array of user IDs if found, or a 0 if none are found. + */ + function bp_get_friendship_requests($user_id = 0) + { + } + /** + * Output the ID of the friendship between the logged-in user and the current user in the loop. + * + * @since 1.2.0 + */ + function bp_friend_friendship_id() + { + } + /** + * Return the ID of the friendship between the logged-in user and the current user in the loop. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return int ID of the friendship. + */ + function bp_get_friend_friendship_id() + { + } + /** + * Output the URL for accepting the current friendship request in the loop. + * + * @since 1.0.0 + */ + function bp_friend_accept_request_link() + { + } + /** + * Return the URL for accepting the current friendship request in the loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string accept-friendship URL. + */ + function bp_get_friend_accept_request_link() + { + } + /** + * Output the URL for rejecting the current friendship request in the loop. + * + * @since 1.0.0 + */ + function bp_friend_reject_request_link() + { + } + /** + * Return the URL for rejecting the current friendship request in the loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The main member template loop class. + * + * @return string reject-friendship URL. + */ + function bp_get_friend_reject_request_link() + { + } + /** + * Output the total friend count for a given user. + * + * @since 1.2.0 + * + * @param int $user_id See {@link friends_get_total_friend_count()}. + */ + function bp_total_friend_count($user_id = 0) + { + } + /** + * Return the total friend count for a given user. + * + * @since 1.2.0 + * + * @param int $user_id See {@link friends_get_total_friend_count()}. + * @return int Total friend count. + */ + function bp_get_total_friend_count($user_id = 0) + { + } + /** + * Output the total friendship request count for a given user. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose requests are being counted. + * Default: ID of the logged-in user. + */ + function bp_friend_total_requests_count($user_id = 0) + { + } + /** + * Return the total friendship request count for a given user. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose requests are being counted. + * Default: ID of the logged-in user. + * @return int Friend count. + */ + function bp_friend_get_total_requests_count($user_id = 0) + { + } + /** Stats **********************************************************************/ + /** + * Display the number of friends in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args before|after|user_id. + */ + function bp_friends_profile_stats($args = '') + { + } + /** + * Return the number of friends in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args before|after|user_id. + * @return string HTML for stats output. + */ + function bp_friends_get_profile_stats($args = '') + { + } + /** + * Adds specific script data for the BP Friends blocks. + * + * Only used for the BP Friends block. + * + * @since 9.0.0 + */ + function bp_friends_blocks_add_script_data() + { + } + /** + * Callback function to render the BP Friends Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_friends_render_friends_block($attributes = array()) + { + } + /** + * Set up the bp-friends component. + * + * @since 1.6.0 + */ + function bp_setup_friends() + { + } + /** + * Record an activity item related to the Friends component. + * + * A wrapper for {@link bp_activity_add()} that provides some Friends-specific + * defaults. + * + * @since 1.0.0 + * + * @see bp_activity_add() for more detailed description of parameters and + * return values. + * + * @param array|string $args { + * An array of arguments for the new activity item. Accepts all parameters + * of {@link bp_activity_add()}. The one difference is the following + * argument, which has a different default here: + * @type string $component Default: the id of your Friends component + * (usually 'friends'). + * } + * @return WP_Error|bool|int See {@link bp_activity_add()}. + */ + function friends_record_activity($args = '') + { + } + /** + * Delete an activity item related to the Friends component. + * + * @since 1.0.0 + * + * @param array $args { + * An array of arguments for the item to delete. + * @type int $item_id ID of the 'item' associated with the activity item. + * For Friends activity items, this is usually the user ID of one + * of the friends. + * @type string $type The 'type' of the activity item (eg + * 'friendship_accepted'). + * @type int $user_id ID of the user associated with the activity item. + * } + */ + function friends_delete_activity($args) + { + } + /** + * Register the activity actions for bp-friends. + * + * @since 1.1.0 + * + * @return bool False if activity component is not active. + */ + function friends_register_activity_actions() + { + } + /** + * Format 'friendship_accepted' activity actions. + * + * @since 2.0.0 + * + * @param string $action Activity action string. + * @param object $activity Activity data. + * @return string Formatted activity action. + */ + function bp_friends_format_activity_action_friendship_accepted($action, $activity) + { + } + /** + * Format 'friendship_created' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data. + * @return string Formatted activity action. + */ + function bp_friends_format_activity_action_friendship_created($action, $activity) + { + } + /** + * Fetch data related to friended users at the beginning of an activity loop. + * + * This reduces database overhead during the activity loop. + * + * @since 2.0.0 + * + * @param array $activities Array of activity items. + * @return array + */ + function bp_friends_prefetch_activity_object_data($activities) + { + } + /** + * Set up activity arguments for use with the 'friends' scope. + * + * For details on the syntax, see {@link BP_Activity_Query}. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array + */ + function bp_friends_filter_activity_scope($retval = array(), $filter = array()) + { + } + /** + * Set up activity arguments for use with the 'just-me' scope. + * + * For details on the syntax, see {@link BP_Activity_Query}. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array + */ + function bp_friends_filter_activity_just_me_scope($retval = array(), $filter = array()) + { + } + /** + * Add activity stream items when one members accepts another members request + * for virtual friendship. + * + * @since 1.9.0 + * + * @param int $friendship_id ID of the friendship. + * @param int $initiator_user_id ID of friendship initiator. + * @param int $friend_user_id ID of user whose friendship is requested. + */ + function bp_friends_friendship_accepted_activity($friendship_id, $initiator_user_id, $friend_user_id) + { + } + /** + * Deletes friendship activity items when a user is deleted. + * + * @since 2.5.0 + * + * @param int $user_id The ID of the user being deleted. + */ + function bp_friends_delete_activity_on_user_delete($user_id = 0) + { + } + /** + * Remove friendship activity item when a friendship is deleted. + * + * @since 3.2.0 + * + * @param int $friendship_id ID of the friendship. + */ + function bp_friends_delete_activity_on_friendship_delete($friendship_id) + { + } + /** + * Friends: User's "Friends > Requests" screen handler + * + * @package BuddyPress + * @subpackage FriendsScreens + * @since 3.0.0 + */ + /** + * Catch and process the Requests page. + * + * @since 1.0.0 + */ + function friends_screen_requests() + { + } + /** + * Friends: User's "Friends" screen handler + * + * @package BuddyPress + * @subpackage FriendsScreens + * @since 3.0.0 + */ + /** + * Catch and process the My Friends page. + * + * @since 1.0.0 + */ + function friends_screen_my_friends() + { + } + /** + * Filter BP_User_Query::populate_extras to add confirmed friendship status. + * + * Each member in the user query is checked for confirmed friendship status + * against the logged-in user. + * + * @since 1.7.0 + * + * @param BP_User_Query $user_query The BP_User_Query object. + * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra + * data for, as determined by BP_User_Query. + */ + function bp_friends_filter_user_query_populate_extras($user_query, $user_ids_sql) + { + } + /** + * Registers Friends personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_friends_register_personal_data_exporters($exporters) + { + } + /** + * Friends: Remove action. + * + * @package BuddyPress + * @subpackage FriendsActions + * @since 3.0.0 + */ + /** + * Catch and process Remove Friendship requests. + * + * @since 1.0.1 + */ + function friends_action_remove_friend() + { + } + /** + * Friends: Add action. + * + * @package BuddyPress + * @subpackage FriendsActions + * @since 3.0.0 + */ + /** + * Catch and process friendship requests. + * + * @since 1.0.1 + */ + function friends_action_add_friend() + { + } + /** + * Notification formatting callback for bp-friends notifications. + * + * @since 1.0.0 + * + * @param string $action The kind of notification being rendered. + * @param int $item_id The primary item ID. + * @param int $secondary_item_id The secondary item ID. + * @param int $total_items The total number of messaging-related notifications + * waiting for the user. + * @param string $format 'string' for BuddyBar-compatible notifications; + * 'array' for WP Toolbar. Default: 'string'. + * @return array|string + */ + function friends_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string') + { + } + /** + * Clear friend-related notifications when ?new=1 + * + * @since 1.2.0 + */ + function friends_clear_friend_notifications() + { + } + /** + * Delete any friendship request notifications for the logged in user. + * + * @since 1.9.0 + */ + function bp_friends_mark_friendship_request_notifications_by_type() + { + } + /** + * Delete any friendship acceptance notifications for the logged in user. + * + * @since 1.9.0 + */ + function bp_friends_mark_friendship_accepted_notifications_by_type() + { + } + /** + * Notify one use that another user has requested their virtual friendship. + * + * @since 1.9.0 + * + * @param int $friendship_id The unique ID of the friendship. + * @param int $initiator_user_id The friendship initiator user ID. + * @param int $friend_user_id The friendship request receiver user ID. + */ + function bp_friends_friendship_requested_notification($friendship_id, $initiator_user_id, $friend_user_id) + { + } + /** + * Remove friend request notice when a member rejects another members + * + * @since 1.9.0 + * + * @param int $friendship_id Friendship ID (not used). + * @param BP_Friends_Friendship $friendship The friendship object. + */ + function bp_friends_mark_friendship_rejected_notifications_by_item_id($friendship_id, $friendship) + { + } + /** + * Notify a member when another member accepts their virtual friendship request. + * + * @since 1.9.0 + * + * @param int $friendship_id The unique ID of the friendship. + * @param int $initiator_user_id The friendship initiator user ID. + * @param int $friend_user_id The friendship request receiver user ID. + */ + function bp_friends_add_friendship_accepted_notification($friendship_id, $initiator_user_id, $friend_user_id) + { + } + /** + * Remove friend request notice when a member withdraws their friend request. + * + * @since 1.9.0 + * + * @param int $friendship_id Friendship ID (not used). + * @param BP_Friends_Friendship $friendship The friendship object. + */ + function bp_friends_mark_friendship_withdrawn_notifications_by_item_id($friendship_id, $friendship) + { + } + /** + * Remove friendship requests FROM user, used primarily when a user is deleted. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are removed. + */ + function bp_friends_remove_notifications_data($user_id = 0) + { + } + /** + * Add Friends-related settings to the Settings > Notifications page. + * + * @since 1.0.0 + */ + function friends_screen_notification_settings() + { + } + /** + * Registers the script to manage the dynamic part of the Friends widget/block. + * + * @since 9.0.0 + * @since 12.0.0 Uses the `@wordpress/scripts` `index.asset.php` generated file to get dependencies. + * + * @param array $scripts Data about the scripts to register. + * @return array Data about the scripts to register. + */ + function bp_friends_register_scripts($scripts = array()) + { + } + /** + * Clear friends-related cache for members of a specific friendship. + * + * @since 1.0.0 + * + * @param int $friendship_id ID of the friendship whose two members should + * have their friends cache busted. + * @return bool + */ + function friends_clear_friend_object_cache($friendship_id) + { + } + /** + * Clear friendship caches on friendship changes. + * + * @since 2.7.0 + * + * @param int $friendship_id ID of the friendship that has changed. + * @param int $initiator_user_id ID of the first user. + * @param int $friend_user_id ID of the second user. + */ + function bp_friends_clear_bp_friends_friendships_cache($friendship_id, $initiator_user_id, $friend_user_id) + { + } + /** + * Clear friendship caches on friendship changes. + * + * @since 2.7.0 + * + * @param int $friendship_id The friendship ID. + * @param BP_Friends_Friendship $friendship The friendship object. + */ + function bp_friends_clear_bp_friends_friendships_cache_remove($friendship_id, $friendship) + { + } + /** + * Clear the friend request cache for the user not initiating the friendship. + * + * @since 2.0.0 + * + * @param int $friend_user_id The user ID not initiating the friendship. + */ + function bp_friends_clear_request_cache($friend_user_id) + { + } + /** + * Clear the friend request cache when a friendship is saved. + * + * A friendship is deemed saved when a friendship is requested or accepted. + * + * @since 2.0.0 + * + * @param int $friendship_id The friendship ID. + * @param int $initiator_user_id The user ID initiating the friendship. + * @param int $friend_user_id The user ID not initiating the friendship. + */ + function bp_friends_clear_request_cache_on_save($friendship_id, $initiator_user_id, $friend_user_id) + { + } + /** + * Clear the friend request cache when a friendship is removed. + * + * A friendship is deemed removed when a friendship is withdrawn or rejected. + * + * @since 2.0.0 + * + * @param int $friendship_id The friendship ID. + * @param BP_Friends_Friendship $friendship The friendship object. + */ + function bp_friends_clear_request_cache_on_remove($friendship_id, $friendship) + { + } + /** + * Delete individual friendships from the cache when they are changed. + * + * @since 3.0.0 + * + * @param BP_Friends_Friendship $friendship The friendship object. + */ + function bp_friends_delete_cached_friendships_on_friendship_save($friendship) + { + } + /** + * PHPUnit bootstrap file for BuddyPress + */ + // Get codebase versions. + $bp_version = \getenv('BP_VERSION') ? \getenv('BP_VERSION') : 'latest'; + /** + * Load BuddyPress. + */ + function _manually_load_buddypress() + { + } + /** + * Query all profile fields and their visibility data for display in settings. + * + * @since 2.0.0 + * + * @param array|string $args Array of args for the settings fields. + * @return bool + */ + function bp_xprofile_get_settings_fields($args = '') + { + } + /** + * Adds feedback messages when successfully saving profile field settings. + * + * @since 2.0.0 + */ + function bp_xprofile_settings_add_feedback_message() + { + } + /** + * Sanitize each field option name for saving to the database. + * + * @since 2.3.0 + * + * @param mixed $field_options Options to sanitize. + * @return mixed + */ + function bp_xprofile_sanitize_field_options($field_options = '') + { + } + /** + * Sanitize each field option default for saving to the database. + * + * @since 2.3.0 + * + * @param mixed $field_default Field defaults to sanitize. + * @return array|int + */ + function bp_xprofile_sanitize_field_default($field_default = '') + { + } + /** + * Run profile field values through kses with filterable allowed tags. + * + * @since 1.5.0 + * @since 2.1.0 Added `$data_obj` parameter. + * @since 5.0.0 Added `$field_id` parameter. + * + * @param string $content Content to filter. + * @param BP_XProfile_ProfileData|null $data_obj Optional. The BP_XProfile_ProfileData object. + * @param int|null $field_id Optional. The ID of the profile field. + * @return string $content + */ + function xprofile_filter_kses($content, $data_obj = \null, $field_id = \null) + { + } + /** + * Filters profile field values for allowed HTML. + * + * @since 5.0.0 + * + * @param string $value Field value. + * @param string $type Field type. + * @param int $field_id Field ID. + */ + function xprofile_sanitize_data_value_before_display($value, $type, $field_id) + { + } + /** + * Filters profile field values for allowed HTML, when coming from xprofile_get_field_data(). + * + * @since 5.0.0 + * + * @param string $value Field value. + * @param int $field_id Field ID. + */ + function xprofile_sanitize_data_value_before_display_from_get_field_data($value, $field_id) + { + } + /** + * Safely runs profile field data through kses and force_balance_tags. + * + * @since 1.2.6 + * + * @param string $field_value Field value being sanitized. + * @param int $field_id Field ID being sanitized. + * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true. + * @param object|null $data_obj The BP_XProfile_ProfileData object. + * @return string + */ + function xprofile_sanitize_data_value_before_save($field_value, $field_id = 0, $reserialize = \true, $data_obj = \null) + { + } + /** + * Runs stripslashes on XProfile fields. + * + * @since 1.0.0 + * + * @param string $field_value XProfile field_value to be filtered. + * @param string $field_type XProfile field_type to be filtered. + * @return false|string $field_value Filtered XProfile field_value. False on failure. + */ + function xprofile_filter_format_field_value($field_value, $field_type = '') + { + } + /** + * Apply display_filter() filters as defined by BP_XProfile_Field_Type classes, when inside a bp_has_profile() loop. + * + * @since 2.1.0 + * @since 2.4.0 Added `$field_id` parameter. + * + * @param mixed $field_value Field value. + * @param string $field_type Field type. + * @param string|int $field_id Optional. ID of the field. + * @return mixed + */ + function xprofile_filter_format_field_value_by_type($field_value, $field_type = '', $field_id = '') + { + } + /** + * Apply display_filter() filters as defined by the BP_XProfile_Field_Type classes, when fetched + * by xprofile_get_field_data(). + * + * @since 2.1.0 + * + * @param mixed $field_value Field value. + * @param int $field_id Field type. + * @return string + */ + function xprofile_filter_format_field_value_by_field_id($field_value, $field_id) + { + } + /** + * Apply pre_validate_filter() filters as defined by the BP_XProfile_Field_Type classes before validating. + * + * @since 2.1.0 + * + * @param mixed $value Value passed to the bp_xprofile_set_field_data_pre_validate filter. + * @param BP_XProfile_Field $field Field object. + * @param BP_XProfile_Field_Type $field_type_obj Field type object. + * @return mixed + */ + function xprofile_filter_pre_validate_value_by_field_type($value, $field, $field_type_obj) + { + } + /** + * Escape field value for display. + * + * Most field values are simply run through esc_html(). Those that support rich text (by default, `textarea` only) + * are sanitized using kses, which allows HTML tags from a controlled list. + * + * @since 2.4.0 + * + * @param string $value Field value. + * @param string $field_type Field type. + * @param int $field_id Field ID. + * @return string + */ + function bp_xprofile_escape_field_data($value, $field_type, $field_id) + { + } + /** + * Filter an Extended Profile field value, and attempt to make clickable links + * to members search results out of them. + * + * - Not run on datebox field types. + * - Not run on values without commas with less than 5 words. + * - URL's are made clickable. + * + * To disable globally: + * remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 3 ); + * + * To disable for a single field, use the 'Autolink' settings in Dashboard > Users > Profile Fields. + * + * @since 1.1.0 + * + * @param string $field_value Profile field data value. + * @param string $field_type Profile field type. + * @return string|array + */ + function xprofile_filter_link_profile_data($field_value, $field_type = 'textbox') + { + } + /** + * Ensures that BP data appears in comments array. + * + * This filter loops through the comments return by a normal WordPress request + * and swaps out user data with BP xprofile data, where available. + * + * @since 1.2.0 + * + * @param array $comments Comments to filter in. + * @param int $post_id Post ID the comments are for. + * @return array $comments + */ + function xprofile_filter_comments($comments, $post_id = 0) + { + } + /** + * Filter BP_User_Query::populate_extras to override each queries users fullname. + * + * @since 1.7.0 + * + * @param BP_User_Query $user_query User query to filter. + * @param string $user_ids_sql SQL statement to use. + */ + function bp_xprofile_filter_user_query_populate_extras(\BP_User_Query $user_query, $user_ids_sql = '') + { + } + /** + * Parse 'xprofile_query' argument passed to BP_User_Query. + * + * @since 2.2.0 + * + * @param BP_User_Query $q User query object. + */ + function bp_xprofile_add_xprofile_query_to_user_query(\BP_User_Query $q) + { + } + /** + * Filter meta queries to modify for the xprofile data schema. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @access private Do not use. + * + * @param string $q SQL query. + * @return string + */ + function bp_xprofile_filter_meta_query($q) + { + } + /** + * Register XProfile personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_xprofile_register_personal_data_exporter($exporters) + { + } + /** + * Used to edit the field input name inside the xProfile Admin Screen + * + * @see bp_xprofile_admin_get_signup_field() + * + * @since 8.0.0 + * + * @param string $field_selector The text to use as the input name/id attribute. + * @return string The text to use as the input name/id attribute. + */ + function bp_get_the_profile_signup_field_input_name($field_selector = '') + { + } + /** + * Provides Signup fields argument back compatibility for template overrides. + * + * @since 8.0.0 + * @access private + * + * @param array $args The xProfile loop's signup arguments. + * @return array The xProfile loop's signup arguments. + */ + function _bp_xprofile_signup_do_backcompat($args = array()) + { + } + /** + * Checks whether back compatibility is needed about xProfile loop's signup arguments. + * + * @since 8.0.0 + * @access private + * + * @param string $template The located path for registration template. + * @param string $template_name The needed template name. + */ + function _bp_xprofile_signup_check_backcompat($template = '', $template_name = '') + { + } + /** + * Starts Signup fields back compatibility process only on the signup's page. + * + * @since 8.0.0 + * @access private + */ + function _bp_xprofile_signup_start_backcompat() + { + } + /** + * Enqueue the CSS for XProfile admin styling. + * + * @since 1.1.0 + */ + function xprofile_add_admin_css() + { + } + /** + * Enqueue the jQuery libraries for handling drag/drop/sort. + * + * @since 1.5.0 + */ + function xprofile_add_admin_js() + { + } + /** + * Maps XProfile caps to built in WordPress caps. + * + * @since 1.6.0 + * + * @param array $caps Capabilities for meta capability. + * @param string $cap Capability name. + * @param int $user_id User id. + * @param mixed $args Arguments. + * + * @return array Actual capabilities for meta capability. + */ + function bp_xprofile_map_meta_caps($caps, $cap, $user_id, $args) + { + } + /** + * Grant the 'bp_xprofile_change_field_visibility' cap to logged-out users. + * + * @since 2.7.1 + * + * @param bool $user_can + * @param int $user_id + * @param string $capability + * @return bool + */ + function bp_xprofile_grant_bp_xprofile_change_field_visibility_for_logged_out_users($user_can, $user_id, $capability) + { + } + /** + * Determine which xprofile fields do not have cached values for a user. + * + * @since 2.2.0 + * + * @param int $user_id User ID to check. + * @param array $field_ids XProfile field IDs. + * @return array + */ + function bp_xprofile_get_non_cached_field_ids($user_id = 0, $field_ids = array()) + { + } + /** + * Slurp up xprofilemeta for a specified set of profile objects. + * + * We do not use bp_update_meta_cache() for the xprofile component. This is + * because the xprofile component has three separate object types (group, + * field, and data) and three corresponding cache groups. Using the technique + * in bp_update_meta_cache(), pre-fetching would take three separate database + * queries. By grouping them together, we can reduce the required queries to + * one. + * + * This function is called within a bp_has_profile() loop. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $object_ids Multi-dimensional array of object_ids, keyed by + * object type ('group', 'field', 'data'). + * @return bool + */ + function bp_xprofile_update_meta_cache($object_ids = array()) + { + } + /** + * Clear cached XProfile field group data. + * + * @since 2.1.0 + * + * @param object $group_obj Group object to clear. + */ + function xprofile_clear_profile_groups_object_cache($group_obj) + { + } + /** + * Clear caches when a field object is modified. + * + * @since 2.0.0 + * + * @param BP_XProfile_Field $field_obj Field object cache to delete. + */ + function xprofile_clear_profile_field_object_cache($field_obj) + { + } + /** + * Clears member_type cache when a field's member types are updated. + * + * @since 2.4.0 + */ + function bp_xprofile_clear_member_type_cache() + { + } + /** + * Clear caches when a user's updates a field data object. + * + * @since 2.0.0 + * + * @param BP_XProfile_ProfileData $data_obj Field data object to delete. + */ + function xprofile_clear_profiledata_object_cache($data_obj) + { + } + /** + * Clear fullname_field_id cache when bp-xprofile-fullname-field-name is updated. + * + * Note for future developers: Dating from an early version of BuddyPress where + * the fullname field (field #1) did not have a title that was editable in the + * normal Profile Fields admin interface, we have the bp-xprofile-fullname-field-name + * option. In many places throughout BuddyPress, the ID of the fullname field + * is queried using this setting. However, this is no longer strictly necessary, + * because we essentially hardcode (in the xprofile admin save routine, as well + * as the xprofile schema definition) that the fullname field will be 1. The + * presence of the non-hardcoded versions (and thus this bit of cache + * invalidation) is thus for backward compatibility only. + * + * @since 2.0.0 + */ + function xprofile_clear_fullname_field_id_cache() + { + } + /** + * Clear a field's caches. + * + * @since 2.4.0 + * + * @param int|BP_XProfile_Field $field A field ID or a field object. + * @return bool False on failure. + */ + function bp_xprofile_clear_field_cache($field) + { + } + /** + * Clear the field-name cache. + * + * @since 2.8.0 + */ + function bp_xprofile_reset_fields_by_name_cache_incrementor() + { + } + /** + * Resets all incremented bp_xprofile_groups caches. + * + * @since 5.0.0 + */ + function bp_xprofile_reset_groups_cache_incrementor() + { + } + /** + * Resets the User Metadata ids cache. + * + * @since 8.0.0 + * + * @param integer $user_id The user ID. + */ + function bp_xprofile_reset_user_mid_cache($user_id) + { + } + /** + * Resets the signup field IDs cache. + * + * @since 8.0.0 + */ + function bp_xprofile_reset_signup_field_cache() + { + } + /*** Field Group Management **************************************************/ + /** + * Fetch a set of field groups, populated with fields and field data. + * + * Procedural wrapper for BP_XProfile_Group::get() method. + * + * @since 2.1.0 + * + * @param array $args See {@link BP_XProfile_Group::get()} for description of arguments. + * @return array $groups + */ + function bp_xprofile_get_groups($args = array()) + { + } + /** + * Insert a new profile field group. + * + * @since 1.0.0 + * + * @param array|string $args { + * Array of arguments for field group insertion. + * + * @type int|bool $field_group_id ID of the field group to insert into. + * @type string|bool $name Name of the group. + * @type string $description Field group description. + * @type bool $can_delete Whether or not the field group can be deleted. + * } + * @return bool + */ + function xprofile_insert_field_group($args = '') + { + } + /** + * Get a specific profile field group. + * + * @since 1.0.0 + * + * @param int $field_group_id Field group ID to fetch. + * @return false|BP_XProfile_Group + */ + function xprofile_get_field_group($field_group_id = 0) + { + } + /** + * Delete a specific profile field group. + * + * @since 1.0.0 + * + * @param int $field_group_id Field group ID to delete. + * @return bool + */ + function xprofile_delete_field_group($field_group_id = 0) + { + } + /** + * Update the position of a specific profile field group. + * + * @since 1.0.0 + * + * @param int $field_group_id Field group ID to update. + * @param int $position Field group position to update to. + * @return bool + */ + function xprofile_update_field_group_position($field_group_id = 0, $position = 0) + { + } + /*** Field Management *********************************************************/ + /** + * Get details of all xprofile field types. + * + * @since 2.0.0 + * + * @return array Key/value pairs (field type => class name). + */ + function bp_xprofile_get_field_types() + { + } + /** + * Creates the specified field type object; used for validation and templating. + * + * @since 2.0.0 + * + * @param string $type Type of profile field to create. See {@link bp_xprofile_get_field_types()} for default core values. + * @return object $value If field type unknown, returns BP_XProfile_Field_Type_Textarea. + * Otherwise returns an instance of the relevant child class of BP_XProfile_Field_Type. + */ + function bp_xprofile_create_field_type($type) + { + } + /** + * Insert or update an xprofile field. + * + * @since 1.1.0 + * + * @param array|string $args { + * Array of arguments. + * @type int $field_id Optional. Pass the ID of an existing field to edit that field. + * @type int $field_group_id ID of the associated field group. + * @type int $parent_id Optional. ID of the parent field. + * @type string $type Field type. Checked against a list of allowed field_types. + * @type string $name Name of the new field. + * @type string $description Optional. Descriptive text for the field. + * @type bool $is_required Optional. Whether users must provide a value for the field. Default: false. + * @type bool $can_delete Optional. Whether admins can delete this field in the Dashboard interface. + * Generally this is false only for the Name field, which is required throughout BP. + * Default: true. + * @type string $order_by Optional. For field types that support options (such as 'radio'), this flag + * determines whether the sort order of the options will be 'default' + * (order created) or 'custom'. + * @type bool $is_default_option Optional. For the 'option' field type, setting this value to true means that + * it'll be the default value for the parent field when the user has not yet + * overridden. Default: true. + * @type int $option_order Optional. For the 'option' field type, this determines the order in which the + * options appear. + * } + * @return bool|int False on failure, ID of new field on success. + */ + function xprofile_insert_field($args = '') + { + } + /** + * Get a profile field object. + * + * @since 1.1.0 + * @since 2.8.0 Added `$user_id` and `$get_data` parameters. + * + * @param int|object $field ID of the field or object representing field data. + * @param int|null $user_id Optional. ID of the user associated with the field. + * Ignored if `$get_data` is false. If `$get_data` is + * true, but no `$user_id` is provided, defaults to + * logged-in user ID. + * @param bool $get_data Whether to fetch data for the specified `$user_id`. + * @return BP_XProfile_Field|null Field object if found, otherwise null. + */ + function xprofile_get_field($field, $user_id = \null, $get_data = \true) + { + } + /** + * Get a profile Field Type object. + * + * @since 8.0.0 + * + * @param int $field_id ID of the field. + * @return BP_XProfile_Field_Type|null Field Type object if found, otherwise null. + */ + function bp_xprofile_get_field_type($field_id) + { + } + /** + * Delete a profile field object. + * + * @since 1.1.0 + * + * @param int|object $field_id ID of the field or object representing field data. + * @return bool Whether or not the field was deleted. + */ + function xprofile_delete_field($field_id) + { + } + /*** Field Data Management *****************************************************/ + /** + * Fetches profile data for a specific field for the user. + * + * When the field value is serialized, this function unserializes and filters + * each item in the array. + * + * @since 1.0.0 + * + * @param mixed $field The ID of the field, or the $name of the field. + * @param int $user_id The ID of the user. + * @param string $multi_format How should array data be returned? 'comma' if you want a + * comma-separated string; 'array' if you want an array. + * @return mixed The profile field data. + */ + function xprofile_get_field_data($field, $user_id = 0, $multi_format = 'array') + { + } + /** + * A simple function to set profile data for a specific field for a specific user. + * + * @since 1.0.0 + * + * @param int|string $field The ID of the field, or the $name of the field. + * @param int $user_id The ID of the user. + * @param mixed $value The value for the field you want to set for the user. + * @param bool $is_required Whether or not the field is required. + * @return bool + */ + function xprofile_set_field_data($field, $user_id, $value, $is_required = \false) + { + } + /** + * Set the visibility level for this field. + * + * @since 1.6.0 + * + * @param int $field_id The ID of the xprofile field. + * @param int $user_id The ID of the user to whom the data belongs. + * @param string $visibility_level What the visibility setting should be. + * @return bool + */ + function xprofile_set_field_visibility_level($field_id = 0, $user_id = 0, $visibility_level = '') + { + } + /** + * Get the visibility level for a field. + * + * @since 2.0.0 + * + * @param int $field_id The ID of the xprofile field. + * @param int $user_id The ID of the user to whom the data belongs. + * @return string + */ + function xprofile_get_field_visibility_level($field_id = 0, $user_id = 0) + { + } + /** + * Delete XProfile field data. + * + * @since 1.1.0 + * + * @param string $field Field to delete. + * @param int $user_id User ID to delete field from. + * @return bool Whether or not the field was deleted. + */ + function xprofile_delete_field_data($field = '', $user_id = 0) + { + } + /** + * Check if field is a required field. + * + * @since 1.1.0 + * + * @param int $field_id ID of the field to check for. + * @return bool Whether or not field is required. + */ + function xprofile_check_is_required_field($field_id) + { + } + /** + * Returns the ID for the field based on the field name. + * + * @since 1.0.0 + * + * @param string $field_name The name of the field to get the ID for. + * @return int|null $field_id on success, false on failure. + */ + function xprofile_get_field_id_from_name($field_name) + { + } + /** + * Fetches a random piece of profile data for the user. + * + * @since 1.0.0 + * + * @param int $user_id User ID of the user to get random data for. + * @param bool $exclude_fullname Optional; whether or not to exclude the full name field as random data. + * Defaults to true. + * @return string|bool The fetched random data for the user, or false if no data or no match. + */ + function xprofile_get_random_profile_data($user_id, $exclude_fullname = \true) + { + } + /** + * Formats a profile field according to its type. [ TODO: Should really be moved to filters ] + * + * @since 1.0.0 + * + * @param string $field_type The type of field: datebox, selectbox, textbox etc. + * @param string $field_value The actual value. + * @return string|bool The formatted value, or false if value is empty. + */ + function xprofile_format_profile_field($field_type, $field_value) + { + } + /** + * Update the field position for a provided field. + * + * @since 1.1.0 + * + * @param int $field_id ID of the field to update. + * @param int $position Position to update the field to. + * @param int $field_group_id Group ID for group the field is in. + * @return bool + */ + function xprofile_update_field_position($field_id, $position, $field_group_id) + { + } + /** + * Replace the displayed and logged-in users fullnames with the xprofile name, if required. + * + * The Members component uses the logged-in user's display_name to set the + * value of buddypress()->loggedin_user->fullname. However, in cases where + * profile sync is disabled, display_name may diverge from the xprofile + * fullname field value, and the xprofile field should take precedence. + * + * Runs at bp_setup_globals:100 to ensure that all components have loaded their + * globals before attempting any overrides. + * + * @since 2.0.0 + */ + function xprofile_override_user_fullnames() + { + } + /** + * When search_terms are passed to BP_User_Query, search against xprofile fields. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $sql Clauses in the user_id SQL query. + * @param BP_User_Query $query User query object. + * @return array + */ + function bp_xprofile_bp_user_query_search($sql, \BP_User_Query $query) + { + } + /** + * Syncs Xprofile data to the standard built in WordPress profile data. + * + * @since 1.0.0 + * @since 9.2.0 Adds the $args arguments to catch hook's additional arguments. + * + * @param int $user_id ID of the user to sync. + * @param array $args Hook's additional arguments. + * @return bool + */ + function xprofile_sync_wp_profile($user_id = 0, ...$args) + { + } + /** + * Syncs the standard built in WordPress profile data to XProfile. + * + * @since 1.2.4 + * + * @param object $errors Array of errors. Passed by reference. + * @param bool $update Whether or not being updated. + * @param object $user User object whose profile is being synced. Passed by reference. + */ + function xprofile_sync_bp_profile(&$errors, $update, &$user) + { + } + /** + * Update the WP display, last, and first name fields when the xprofile display name field is updated. + * + * @since 3.0.0 + * + * @param BP_XProfile_ProfileData $data Current instance of the profile data being saved. + */ + function xprofile_sync_wp_profile_on_single_field_set($data) + { + } + /** + * When a user is deleted, we need to clean up the database and remove all the + * profile data from each table. Also we need to clean anything up in the + * usermeta table that this component uses. + * + * @since 1.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function xprofile_remove_data($user_id) + { + } + /** + * Deletes user XProfile data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function xprofile_remove_data_on_delete_user($user_id) + { + } + /*** XProfile Meta ****************************************************/ + /** + * Delete a piece of xprofile metadata. + * + * @since 1.5.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $object_id ID of the object the metadata belongs to. + * @param string $object_type Type of object. 'group', 'field', or 'data'. + * @param string|bool $meta_key Key of the metadata being deleted. If omitted, all + * metadata for the object will be deleted. + * @param mixed $meta_value Optional. If provided, only metadata that matches + * the value will be permitted. + * @param bool $delete_all Optional. If true, delete matching metadata entries + * for all objects, ignoring the specified object_id. Otherwise, only + * delete matching metadata entries for the specified object. + * Default: false. + * @return bool + */ + function bp_xprofile_delete_meta($object_id, $object_type, $meta_key = \false, $meta_value = \false, $delete_all = \false) + { + } + /** + * Get a piece of xprofile metadata. + * + * Note that the default value of $single is true, unlike in the case of the + * underlying get_metadata() function. This is for backward compatibility. + * + * @since 1.5.0 + * + * @param int $object_id ID of the object the metadata belongs to. + * @param string $object_type Type of object. 'group', 'field', or 'data'. + * @param string $meta_key Key of the metadata being fetched. If omitted, all + * metadata for the object will be retrieved. + * @param bool $single Optional. If true, return only the first value of the + * specified meta_key. This parameter has no effect if meta_key is not + * specified. Default: true. + * @return mixed An array of values if `$single` is false. + * The value of the meta field if `$single` is true. + * False for an invalid `$object_type` (one of `group`, `field`, `data`). + * False for an invalid `$object_id` (non-numeric, zero, or negative value), + * or if `$meta_type` is not specified. + * An empty string if a valid but non-existing object ID is passed. + */ + function bp_xprofile_get_meta($object_id, $object_type, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of xprofile metadata. + * + * @since 1.5.0 + * + * @param int $object_id ID of the object the metadata belongs to. + * @param string $object_type Type of object. 'group', 'field', or 'data'. + * @param string $meta_key Key of the metadata being updated. + * @param string $meta_value Value of the metadata being updated. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise update all entries. + * @return bool|int Returns false on failure. On successful update of existing + * metadata, returns true. On successful creation of new metadata, + * returns the integer ID of the new metadata row. + */ + function bp_xprofile_update_meta($object_id, $object_type, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of xprofile metadata. + * + * @since 2.0.0 + * + * @param int $object_id ID of the object the metadata belongs to. + * @param string $object_type Type of object. 'group', 'field', or 'data'. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @param bool $unique Optional. Whether to enforce a single metadata value + * for the given key. If true, and the object already + * has a value for the key, no change will be made. + * Default false. + * @return int|bool The meta ID on successful update, false on failure. + */ + function bp_xprofile_add_meta($object_id, $object_type, $meta_key, $meta_value, $unique = \false) + { + } + /** + * Updates the fieldgroup metadata. + * + * @since 1.5.0 + * + * @param int $field_group_id Group ID for the group field belongs to. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ + function bp_xprofile_update_fieldgroup_meta($field_group_id, $meta_key, $meta_value) + { + } + /** + * Updates the field metadata. + * + * @since 1.5.0 + * + * @param int $field_id Field ID to update. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ + function bp_xprofile_update_field_meta($field_id, $meta_key, $meta_value) + { + } + /** + * Updates the fielddata metadata. + * + * @since 1.5.0 + * + * @param int $field_data_id Field ID to update. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ + function bp_xprofile_update_fielddata_meta($field_data_id, $meta_key, $meta_value) + { + } + /** + * Return the field ID for the Full Name xprofile field. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return int Field ID. + */ + function bp_xprofile_fullname_field_id() + { + } + /** + * Return the field name for the Full Name xprofile field. + * + * @since 1.5.0 + * + * @return string The field name. + */ + function bp_xprofile_fullname_field_name() + { + } + /** + * Is rich text enabled for this profile field? + * + * By default, rich text is enabled for textarea fields and disabled for all other field types. + * + * @since 2.4.0 + * + * @param int|null $field_id Optional. Default current field ID. + * @return bool + */ + function bp_xprofile_is_richtext_enabled_for_field($field_id = \null) + { + } + /** + * Get visibility levels out of the $bp global. + * + * @since 1.6.0 + * + * @return array + */ + function bp_xprofile_get_visibility_levels() + { + } + /** + * Get the ids of fields that are hidden for this displayed/loggedin user pair. + * + * This is the function primarily responsible for profile field visibility. It works by determining + * the relationship between the displayed_user (ie the profile owner) and the current_user (ie the + * profile viewer). Then, based on that relationship, we query for the set of fields that should + * be excluded from the profile loop. + * + * @since 1.6.0 + * + * @see BP_XProfile_Group::get() + * or if you have added your own custom levels. + * + * @param int $displayed_user_id The id of the user the profile fields belong to. + * @param int $current_user_id The id of the user viewing the profile. + * @return array An array of field ids that should be excluded from the profile query + */ + function bp_xprofile_get_hidden_fields_for_user($displayed_user_id = 0, $current_user_id = 0) + { + } + /** + * Get the visibility levels that should be hidden for this user pair. + * + * Field visibility is determined based on the relationship between the + * logged-in user, the displayed user, and the visibility setting for the + * current field. (See bp_xprofile_get_hidden_fields_for_user().) This + * utility function speeds up this matching by fetching the visibility levels + * that should be hidden for the current user pair. + * + * @since 1.8.2 + * + * @see bp_xprofile_get_hidden_fields_for_user() + * + * @param int $displayed_user_id The id of the user the profile fields belong to. + * @param int $current_user_id The id of the user viewing the profile. + * @return array An array of visibility levels hidden to the current user. + */ + function bp_xprofile_get_hidden_field_types_for_user($displayed_user_id = 0, $current_user_id = 0) + { + } + /** + * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels. + * + * @since 1.6.0 + * + * @see bp_xprofile_get_hidden_fields_for_user() + * + * @param int $user_id The id of the profile owner. + * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', 'adminsonly' etc) to be + * checked against. + * @return array $field_ids The fields that match the requested visibility levels for the given user. + */ + function bp_xprofile_get_fields_by_visibility_levels($user_id, $levels = array()) + { + } + /** + * Formats datebox field values passed through a POST request. + * + * This function only changes the global $_POST that should contain + * the datebox data. + * + * @since 2.8.0 + * + * @param int $field_id The id of the current field being looped through. + */ + function bp_xprofile_maybe_format_datebox_post_data($field_id) + { + } + /** + * Finds and exports personal data associated with an email address from the XProfile tables. + * + * @since 4.0.0 + * + * @param string $email_address The users email address. + * @return array An array of personal data. + */ + function bp_xprofile_personal_data_exporter($email_address) + { + } + /** + * Returns the list of supported WordPress field meta keys. + * + * @since 8.0.0 + * + * @return string[] List of supported WordPress user keys. + */ + function bp_xprofile_get_wp_user_keys() + { + } + /** + * Returns the signup field IDs. + * + * @since 8.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return int[] The signup field IDs. + */ + function bp_xprofile_get_signup_field_ids() + { + } + /** + * Returns xProfile loop's signup arguments. + * + * @since 8.0.0 + * + * @param array $extra Optional extra arguments. + * @return array The xProfile loop's signup arguments. + */ + function bp_xprofile_signup_args($extra = array()) + { + } + /** + * XProfile: User's "Profile" screen handler + * + * @package BuddyPress + * @subpackage XProfileScreens + * @since 3.0.0 + */ + /** + * Handles the display of the profile page by loading the correct template file. + * + * @since 1.0.0 + * + */ + function xprofile_screen_display_profile() + { + } + /** + * XProfile: User's "Profile > Edit" screen handler + * + * @package BuddyPress + * @subpackage XProfileScreens + * @since 3.0.0 + */ + /** + * Handles the display of the profile edit page by loading the correct template file. + * Also checks to make sure this can only be accessed for the logged in users profile. + * + * @since 1.0.0 + */ + function xprofile_screen_edit_profile() + { + } + /** + * XProfile: User's "Settings > Profile Visibility" screen handler + * + * @package BuddyPress + * @subpackage XProfileScreens + * @since 3.0.0 + */ + /** + * Show the xprofile settings template. + * + * @since 2.0.0 + */ + function bp_xprofile_screen_settings() + { + } + /** + * Handles the saving of xprofile field visibilities. + * + * @since 1.9.0 + */ + function bp_xprofile_action_settings() + { + } + /** + * Register the activity actions for the Extended Profile component. + * + * @since 1.0.0 + * + */ + function xprofile_register_activity_actions() + { + } + /** + * Format 'updated_profile' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity object. + * @return string + */ + function bp_xprofile_format_activity_action_updated_profile($action, $activity) + { + } + /** + * Records activity for the logged in user within the profile component so that + * it will show in the users activity stream (if installed). + * + * @since 1.0.0 + * + * @param array|string $args String containing all variables used after bp_parse_args() call. + * @return WP_Error|bool|int + */ + function xprofile_record_activity($args = '') + { + } + /** + * Deletes activity for a user within the profile component so that it will be + * removed from the users activity stream and sitewide stream (if installed). + * + * @since 1.0.0 + * + * for a specific activity. + * + * @param array|string $args Containing all variables used after bp_parse_args() call. + * @return bool + */ + function xprofile_delete_activity($args = '') + { + } + /** + * Register an activity action for the Extended Profiles component. + * + * @since 1.0.0 + * + * @param string $key Key. + * @param string $value Value. + * @return bool + */ + function xprofile_register_activity_action($key, $value) + { + } + /** + * Add an activity item when a user has updated his profile. + * + * @since 2.0.0 + * + * @param int $user_id ID of the user who has updated his profile. + * @param array $field_ids IDs of the fields submitted. + * @param bool $errors True if validation or saving errors occurred, otherwise false. + * @param array $old_values Pre-save xprofile field values and visibility levels. + * @param array $new_values Post-save xprofile field values and visibility levels. + * @return bool + */ + function bp_xprofile_updated_profile_activity($user_id, $field_ids = array(), $errors = \false, $old_values = array(), $new_values = array()) + { + } + /** + * Add filters for xprofile activity types to Show dropdowns. + * + * @since 2.0.0 + * @todo Mark as deprecated + */ + function xprofile_activity_filter_options() + { + } + /** + * Creates the administration interface menus and checks to see if the DB + * tables are set up. + * + * @since 1.0.0 + * + * @return bool + */ + function xprofile_add_admin_menu() + { + } + /** + * Handles all actions for the admin area for creating, editing and deleting + * profile groups and fields. + * + * @since 1.0.0 + * + * @param string $message Message to display. + * @param string $type Type of action to be displayed. + */ + function xprofile_admin($message = '', $type = 'error') + { + } + /** + * Output the main XProfile management screen. + * + * @since 2.3.0 + * + * @param string $message Feedback message. + * @param string $type Feedback type. + * + * @todo Improve error message output + */ + function xprofile_admin_screen($message = '', $type = 'error') + { + } + /** + * Handles the adding or editing of groups. + * + * @since 1.0.0 + * + * @global string $message The feedback message to show. + * @global string $type The type of feedback message to show. + * + * @param int|null $group_id Group ID to manage. + */ + function xprofile_admin_manage_group($group_id = \null) + { + } + /** + * Handles the deletion of profile data groups. + * + * @since 1.0.0 + * + * @global string $message The feedback message to show. + * @global string $type The type of feedback message to show. + * + * @param int $group_id ID of the group to delete. + */ + function xprofile_admin_delete_group($group_id) + { + } + /** + * Display the delete confirmation screen of profile data groups. + * + * @since 7.0.0 + */ + function xprofile_admin_delete_group_screen($group_id) + { + } + /** + * Handles the adding or editing of profile field data for a user. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * @global string $message The feedback message to show. + * @global array $groups The list of matching xProfile field groups. + * + * @param int $group_id ID of the group. + * @param int|null $field_id ID of the field being managed. + */ + function xprofile_admin_manage_field($group_id, $field_id = \null) + { + } + /** + * Handles the deletion of a profile field (or field option). + * + * @since 1.0.0 + * + * @global string $message The feedback message to show. + * @global string $type The type of feedback message to show. + * + * @param int $field_id The field to delete. + * @param string $field_type The type of field being deleted. + * @param bool $delete_data Should the field data be deleted too. + */ + function xprofile_admin_delete_field($field_id, $field_type = 'field', $delete_data = \false) + { + } + /** + * Display the delete confirmation screen of xprofile field/option. + * + * @since 7.0.0 + */ + function xprofile_admin_delete_field_screen($field_id, $field_type) + { + } + /** + * Handles the ajax reordering of fields within a group. + * + * @since 1.0.0 + * @since 8.0.0 Returns a JSON object. + */ + function xprofile_ajax_reorder_fields() + { + } + /** + * Removes a field from signup fields. + * + * @since 8.0.0 + */ + function bp_xprofile_ajax_remove_signup_field() + { + } + /** + * Handles the reordering of field groups. + * + * @since 1.5.0 + */ + function xprofile_ajax_reorder_field_groups() + { + } + /** + * Handles the WYSIWYG display of each profile field on the edit screen. + * + * @since 1.5.0 + * @since 8.0.0 Adds the `$is_signup` parameter. + * + * @global BP_XProfile_Field $field The Admin field. + * + * @param BP_XProfile_Field $admin_field Admin field. + * @param object $admin_group Admin group object. + * @param string $class Classes to append to output. + * @param bool $is_signup Whether the admin field output is made inside the signup group. + */ + function xprofile_admin_field($admin_field, $admin_group, $class = '', $is_signup = \false) + { + } + /** + * Handles the WYSIWYG display of signup profile fields on the edit screen. + * + * @since 8.0.0 + * + * @param BP_XProfile_Field $signup_field The field to use into the signup form. + * @param object $field_group The real field group object. + * @param string $class Classes to append to output. + * @param bool $echo Whether to return or display the HTML output. + * @return string The HTML output. + */ + function bp_xprofile_admin_get_signup_field($signup_field, $field_group = \null, $class = '', $echo = \false) + { + } + /** + * Print <option> elements containing the xprofile field types. + * + * @since 2.0.0 + * + * @param string $select_field_type The name of the field type that should be selected. + * Will defaults to "textbox" if NULL is passed. + */ + function bp_xprofile_admin_form_field_types($select_field_type) + { + } + /** + * Set up the bp-xprofile component. + * + * @since 1.6.0 + */ + function bp_setup_xprofile() + { + } + /** + * Query for XProfile groups and fields. + * + * @since 1.0.0 + * @since 2.4.0 Introduced `$member_type` argument. + * @since 8.0.0 Introduced `$hide_field_types` & `$signup_fields_only` arguments. + * @since 11.0.0 `$profile_group_id` accepts an array of profile group ids. + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * @see BP_XProfile_Group::get() for full description of `$args` array. + * + * @param array|string $args { + * Array of arguments. See BP_XProfile_Group::get() for full description. Those arguments whose defaults differ + * from that method are described here: + * @type int $user_id Default: ID of the displayed user. + * @type string|array $member_type Default: 'any'. + * @type int|int[]|bool $profile_group_id Default: false. + * @type bool $hide_empty_groups Default: true. + * @type bool $hide_empty_fields Defaults to true on the Dashboard, on a user's Edit Profile page, + * or during registration. Otherwise false. + * @type bool $fetch_fields Default: true. + * @type bool $fetch_field_data Default: true. + * @type bool $fetch_visibility_level Defaults to true when an admin is viewing a profile, or when a user is + * viewing her own profile, or during registration. Otherwise false. + * @type int[]|bool $exclude_groups Default: false. + * @type int[]|bool $exclude_fields Default: false. + * @type string[] $hide_field_types Default: empty array. + * @type bool $signup_fields_only Default: false. + * @type bool $update_meta_cache Default: true. + * } + * @return bool + */ + function bp_has_profile($args = '') + { + } + /** + * Start off the profile groups. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_profile_groups() + { + } + /** + * Set up the profile groups. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_the_profile_group() + { + } + /** + * Whether or not the group has fields to display. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_profile_group_has_fields() + { + } + /** + * Output the class attribute for a field. + * + * @since 1.0.0 + * + * @param mixed $class Extra classes to append to class attribute. + * Pass multiple class names as an array or + * space-delimited string. + */ + function bp_field_css_class($class = \false) + { + } + /** + * Return the class attribute for a field. + * + * @since 1.1.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @param string|bool $class Extra classes to append to class attribute. + * @return string + */ + function bp_get_field_css_class($class = \false) + { + } + /** + * Whether or not the XProfile field has data to display. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_field_has_data() + { + } + /** + * Whether or not the XProfile field has public data to display. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return bool + */ + function bp_field_has_public_data() + { + } + /** + * Output the XProfile group ID. + * + * @since 1.0.0 + */ + function bp_the_profile_group_id() + { + } + /** + * Return the XProfile group ID. + * + * @since 1.1.0 + * + * @global object $group Current group of profile fields. + * + * @return int + */ + function bp_get_the_profile_group_id() + { + } + /** + * Output the XProfile group name. + * + * @since 1.0.0 + */ + function bp_the_profile_group_name() + { + } + /** + * Return the XProfile group name. + * + * @since 1.0.0 + * + * @global object $group Current group of profile fields. + * + * @return string + */ + function bp_get_the_profile_group_name() + { + } + /** + * Output the XProfile group slug. + * + * @since 1.1.0 + */ + function bp_the_profile_group_slug() + { + } + /** + * Return the XProfile group slug. + * + * @since 1.1.0 + * + * @global object $group Current group of profile fields. + * + * @return string + */ + function bp_get_the_profile_group_slug() + { + } + /** + * Output the XProfile group description. + * + * @since 1.0.0 + */ + function bp_the_profile_group_description() + { + } + /** + * Return the XProfile group description. + * + * @since 1.0.0 + * + * @global object $group Current group of profile fields. + * + * @return string + */ + function bp_get_the_profile_group_description() + { + } + /** + * Output the XProfile group edit form action. + * + * @since 1.1.0 + */ + function bp_the_profile_group_edit_form_action() + { + } + /** + * Return the XProfile group edit form action. + * + * @since 1.1.0 + * + * @global object $group Current group of profile fields. + * + * @return string + */ + function bp_get_the_profile_group_edit_form_action() + { + } + /** + * Output the XProfile group field IDs. + * + * @since 1.1.0 + */ + function bp_the_profile_group_field_ids() + { + } + /** + * Return the XProfile group field IDs. + * + * @since 1.1.0 + * + * @global object $group Current group of profile fields. + * + * @return string + */ + function bp_get_the_profile_group_field_ids() + { + } + /** + * Output a comma-separated list of field IDs that are to be submitted on profile edit. + * + * @since 2.1.0 + */ + function bp_the_profile_field_ids() + { + } + /** + * Generate a comma-separated list of field IDs that are to be submitted on profile edit. + * + * @since 2.1.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return string + */ + function bp_get_the_profile_field_ids() + { + } + /** + * Return the XProfile fields. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_profile_fields() + { + } + /** + * Sets up the XProfile field. + * + * @since 1.0.0 + * + * @global BP_XProfile_Data_Template $profile_template Profile data template object. + * + * @return mixed + */ + function bp_the_profile_field() + { + } + /** + * Output the XProfile field ID. + * + * @since 1.1.0 + */ + function bp_the_profile_field_id() + { + } + /** + * Return the XProfile field ID. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return int + */ + function bp_get_the_profile_field_id() + { + } + /** + * Outputs the XProfile field name. + * + * @since 1.0.0 + */ + function bp_the_profile_field_name() + { + } + /** + * Returns the XProfile field name. + * + * @since 1.0.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_name() + { + } + /** + * Outputs the XProfile field value. + * + * @since 1.0.0 + */ + function bp_the_profile_field_value() + { + } + /** + * Returns the XProfile field value. + * + * @since 1.0.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_value() + { + } + /** + * Outputs the XProfile field edit value. + * + * @since 1.1.0 + */ + function bp_the_profile_field_edit_value() + { + } + /** + * Returns the XProfile field edit value. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_edit_value() + { + } + /** + * Outputs the XProfile field type. + * + * @since 1.1.0 + */ + function bp_the_profile_field_type() + { + } + /** + * Returns the XProfile field type. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_type() + { + } + /** + * Outputs the XProfile field description. + * + * @since 1.1.0 + */ + function bp_the_profile_field_description() + { + } + /** + * Returns the XProfile field description. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_description() + { + } + /** + * Outputs the XProfile field input name. + * + * @since 1.1.0 + */ + function bp_the_profile_field_input_name() + { + } + /** + * Returns the XProfile field input name. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_input_name() + { + } + /** + * Returns the action name for any signup errors related to this profile field. + * + * In the registration templates, signup errors are pulled from the global + * object and rendered at actions that look like 'bp_field_12_errors'. This + * function allows the action name to be easily concatenated and called in the + * following fashion: + * do_action( bp_get_the_profile_field_errors_action() ); + * + * @since 1.8.0 + * + * @global object $field Current profile field. + * + * @return string The _errors action name corresponding to this profile field. + */ + function bp_get_the_profile_field_errors_action() + { + } + /** + * Displays field options HTML for field types of 'selectbox', 'multiselectbox', + * 'radio', 'checkbox', and 'datebox'. + * + * @since 1.1.0 + * + * @param array $args Specify type for datebox. Allowed 'day', 'month', 'year'. + */ + function bp_the_profile_field_options($args = array()) + { + } + /** + * Retrieves field options HTML for field types of 'selectbox', 'multiselectbox', 'radio', 'checkbox', and 'datebox'. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @param array $args { + * Array of optional arguments. + * @type string|bool $type Type of datebox. False if it's not a + * datebox, otherwise 'day, 'month', or 'year'. Default: false. + * @type int $user_id ID of the user whose profile values should be + * used when rendering options. Default: displayed user. + * } + * + * @return string $vaue Field options markup. + */ + function bp_get_the_profile_field_options($args = array()) + { + } + /** + * Render whether or not a profile field is required. + * + * @todo deprecate (not used internaly) + it doesn't make much sense to output a boolean. + * + * @since 1.1.0 + */ + function bp_the_profile_field_is_required() + { + } + /** + * Return whether or not a profile field is required. + * + * @since 1.1.0 + * + * @global object $field Current profile field. + * + * @return bool + */ + function bp_get_the_profile_field_is_required() + { + } + /** + * Output the visibility level of this field. + * + * @since 1.6.0 + */ + function bp_the_profile_field_visibility_level() + { + } + /** + * Return the visibility level of this field. + * + * @since 1.6.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_visibility_level() + { + } + /** + * Echo the visibility level label of this field. + * + * @since 1.6.0 + */ + function bp_the_profile_field_visibility_level_label() + { + } + /** + * Return the visibility level label of this field. + * + * @since 1.6.0 + * + * @global object $field Current profile field. + * + * @return string + */ + function bp_get_the_profile_field_visibility_level_label() + { + } + /** + * Return unserialized profile field data, and combine any array items into a + * comma-separated string. + * + * @since 1.0.0 + * + * @param string $value Content to maybe unserialize. + * @return string + */ + function bp_unserialize_profile_field($value) + { + } + /** + * Output XProfile field data. + * + * @since 1.2.0 + * + * @param string|array $args Array of arguments for field data. See {@link bp_get_profile_field_data} + */ + function bp_profile_field_data($args = '') + { + } + /** + * Return XProfile field data. + * + * @since 1.2.0 + * + * @param string|array $args { + * Array of arguments for field data. + * + * @type string|int|bool $field Field identifier. + * @type int $user_id ID of the user to get field data for. + * } + * @return mixed + */ + function bp_get_profile_field_data($args = '') + { + } + /** + * Get all profile field groups. + * + * @since 2.1.0 + * + * @return array $groups + */ + function bp_profile_get_field_groups() + { + } + /** + * Check if there is more than one group of fields for the profile being edited. + * + * @since 2.1.0 + * + * @return bool True if there is more than one profile field group. + */ + function bp_profile_has_multiple_groups() + { + } + /** + * Output the tabs to switch between profile field groups. + * + * @since 1.0.0 + */ + function bp_profile_group_tabs() + { + } + /** + * Return the XProfile group tabs. + * + * @since 2.3.0 + * + * @return string + */ + function bp_get_profile_group_tabs() + { + } + /** + * Output the XProfile group name. + * + * @since 1.0.0 + * + * @param bool $deprecated Deprecated boolean parameter. + * + * @return string|null + */ + function bp_profile_group_name($deprecated = \true) + { + } + /** + * Return the XProfile group name. + * + * @since 1.0.0 + * + * @return string + */ + function bp_get_profile_group_name() + { + } + /** + * Render a formatted string displaying when a profile was last updated. + * + * @since 1.0.0 + */ + function bp_profile_last_updated() + { + } + /** + * Return a formatted string displaying when a profile was last updated. + * + * @since 1.0.0 + * + * @return bool|string + */ + function bp_get_profile_last_updated() + { + } + /** + * Display the current profile group ID. + * + * @since 1.1.0 + */ + function bp_current_profile_group_id() + { + } + /** + * Return the current profile group ID. + * + * @since 1.1.0 + * + * @return int + */ + function bp_get_current_profile_group_id() + { + } + /** + * Render an edit profile button. + * + * @since 1.0.0 + */ + function bp_edit_profile_button() + { + } + /** Visibility ****************************************************************/ + /** + * Echo the field visibility radio buttons. + * + * @since 1.6.0 + * + * @param array|string $args Args for the radio buttons. See {@link bp_profile_get_visibility_radio_buttons} + */ + function bp_profile_visibility_radio_buttons($args = '') + { + } + /** + * Return the field visibility radio buttons. + * + * @since 1.6.0 + * + * @param array|string $args { + * Args for the radio buttons. + * + * @type int $field_id ID of the field to render. + * @type string $before Markup to render before the field. + * @type string $after Markup to render after the field. + * @type string $before_radio Markup to render before the radio button. + * @type string $after_radio Markup to render after the radio button. + * @type string $class Class to apply to the field markup. + * } + * @return string $retval + */ + function bp_profile_get_visibility_radio_buttons($args = '') + { + } + /** + * Output the XProfile field visibility select list for settings. + * + * @since 2.0.0 + * + * @param array|string $args Args for the select list. See {@link bp_profile_get_settings_visibility_select} + */ + function bp_profile_settings_visibility_select($args = '') + { + } + /** + * Return the XProfile field visibility select list for settings. + * + * @since 2.0.0 + * + * @param array|string $args { + * Args for the select list. + * + * @type int $field_id ID of the field to render. + * @type string $before Markup to render before the field. + * @type string $before_controls markup before form controls. + * @type string $after Markup to render after the field. + * @type string $after_controls Markup after the form controls. + * @type string $class Class to apply to the field markup. + * @type string $label_class Class to apply for the label element. + * @type string $notoggle_tag Markup element to use for notoggle tag. + * @type string $notoggle_class Class to apply to the notoggle element. + * } + * @return string $retval + */ + function bp_profile_get_settings_visibility_select($args = '') + { + } + /** + * Output the 'required' markup in extended profile field labels. + * + * @since 2.4.0 + */ + function bp_the_profile_field_required_label() + { + } + /** + * Return the 'required' markup in extended profile field labels. + * + * @since 2.4.0 + * + * @return string HTML for the required label. + */ + function bp_get_the_profile_field_required_label() + { + } + /** + * BuddyPress XProfile Notifications. + * + * @package BuddyPress + * @subpackage XProfileSettings + * @since 1.0.0 + */ + /** Notifications *************************************************************/ + /** + * Format notifications for the extended profile (Xprofile) component. + * + * @since 2.4.0 + * + * @param string $action The kind of notification being rendered. + * @param int $item_id The primary item ID. + * @param int $secondary_item_id The secondary item ID. + * @param int $total_items The total number of messaging-related notifications + * waiting for the user. + * @param string $format 'string' for notification HTML link or 'array' for separate link and text. + * @return string + */ + function xprofile_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string') + { + } + /** + * Output the groups component slug. + * + * @since 1.5.0 + */ + function bp_groups_slug() + { + } + /** + * Return the groups component slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_groups_slug() + { + } + /** + * Output the groups component root slug. + * + * @since 1.5.0 + */ + function bp_groups_root_slug() + { + } + /** + * Return the groups component root slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_groups_root_slug() + { + } + /** + * Output the group type base slug. + * + * @since 2.7.0 + */ + function bp_groups_group_type_base() + { + } + /** + * Get the group type base slug. + * + * The base slug is the string used as the base prefix when generating group + * type directory URLs. For example, in example.com/groups/type/foo/, 'foo' is + * the group type and 'type' is the base slug. + * + * @since 2.7.0 + * + * @return string + */ + function bp_get_groups_group_type_base() + { + } + /** + * Output Groups directory's URL. + * + * @since 12.0.0 + */ + function bp_groups_directory_url() + { + } + /** + * Returns the Groups directory's URL. + * + * @since 12.0.0 + * + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type int $create_single_item `1` to get the create a group URL. + * @type array $directory_type The group type slug. + * } + * @return string The URL built for the BP Rewrites URL parser. + */ + function bp_get_groups_directory_url($path_chunks = array()) + { + } + /** + * Returns a group create URL accoding to requested path chunks. + * + * @since 12.0.0 + * + * @param array $chunks array A list of create action variables. + * @return string The group create URL. + */ + function bp_groups_get_create_url($action_variables = array()) + { + } + /** + * Output group type directory permalink. + * + * @since 2.7.0 + * + * @param string $group_type Optional. Group type. + */ + function bp_group_type_directory_permalink($group_type = '') + { + } + /** + * Return group type directory permalink. + * + * @since 2.7.0 + * + * @param string $group_type Optional. Group type. Defaults to current group type. + * @return string Group type directory URL on success, an empty string on failure. + */ + function bp_get_group_type_directory_permalink($group_type = '') + { + } + /** + * Output group type directory link. + * + * @since 2.7.0 + * + * @param string $group_type Unique group type identifier as used in bp_groups_register_group_type(). + */ + function bp_group_type_directory_link($group_type = '') + { + } + /** + * Return group type directory link. + * + * @since 2.7.0 + * + * @param string $group_type Unique group type identifier as used in bp_groups_register_group_type(). + * @return string + */ + function bp_get_group_type_directory_link($group_type = '') + { + } + /** + * Output a comma-delimited list of group types. + * + * @since 2.7.0 + * @see bp_get_group_type_list() for parameter documentation. + * + * @param integer $group_id The group ID. + * @param array $r List parameters. + */ + function bp_group_type_list($group_id = 0, $r = array()) + { + } + /** + * Return a comma-delimited list of group types. + * + * @since 2.7.0 + * @since 7.0.0 The `$r['label']` argument now also accept an array containing the + * plural & singular labels to use according to the Group's number of + * group types it is assigned to. + * + * @param int $group_id Group ID. Defaults to current group ID if on a group page. + * @param array|string $r { + * Array of parameters. All items are optional. + * @type string $parent_element Element to wrap around the list. Defaults to 'p'. + * @type array $parent_attr Element attributes for parent element. Defaults to + * array( 'class' => 'bp-group-type-list' ). + * @type string|array $label Plural and singular labels to add before the list. Defaults to + * array( 'plural' => 'Group Types:', 'singular' => 'Group Type:' ). + * @type string $label_element Element to wrap around the label. Defaults to 'strong'. + * @type array $label_attr Element attributes for label element. Defaults to array(). + * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If + * 'false', only shows group types with the 'show_in_list' parameter set to + * true. See bp_groups_register_group_type() for more info. + * } + * @return string + */ + function bp_get_group_type_list($group_id = 0, $r = array()) + { + } + /** + * Start the Groups Template Loop. + * + * @since 1.0.0 + * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters. + * @since 2.7.0 Added `$update_admin_cache` parameter. + * @since 7.0.0 Added `$status` parameter. + * @since 10.0.0 Added `$date_query` parameter. + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param array|string $args { + * Array of parameters. All items are optional. + * @type string $type Shorthand for certain orderby/order combinations. 'newest', 'active', + * 'popular', 'alphabetical', 'random'. When present, will override + * orderby and order params. Default: null. + * @type string $order Sort order. 'ASC' or 'DESC'. Default: 'DESC'. + * @type string $orderby Property to sort by. 'date_created', 'last_activity', + * 'total_member_count', 'name', 'random'. Default: 'last_activity'. + * @type int $page Page offset of results to return. Default: 1 (first page of results). + * @type int $per_page Number of items to return per page of results. Default: 20. + * @type int $max Does NOT affect query. May change the reported number of total groups + * found, but not the actual number of found groups. Default: false. + * @type bool $show_hidden Whether to include hidden groups in results. Default: false. + * @type string $page_arg Query argument used for pagination. Default: 'grpage'. + * @type int $user_id If provided, results will be limited to groups of which the specified + * user is a member. Default: value of bp_displayed_user_id(). + * @type string $slug If provided, only the group with the matching slug will be returned. + * Default: false. + * @type string $search_terms If provided, only groups whose names or descriptions match the search + * terms will be returned. Default: value of `$_REQUEST['groups_search']` or + * `$_REQUEST['s']`, if present. Otherwise false. + * @type array|string $group_type Array or comma-separated list of group types to limit results to. + * @type array|string $group_type__in Array or comma-separated list of group types to limit results to. + * @type array|string $group_type__not_in Array or comma-separated list of group types that will be + * excluded from results. + * @type array|string $status Array or comma-separated list of group statuses to limit results to. + * @type array $meta_query An array of meta_query conditions. + * See {@link WP_Meta_Query::queries} for description. + * @type array $date_query Filter results by group last activity date. See first parameter of + * {@link WP_Date_Query::__construct()} for syntax. Only applicable if + * $type is either 'newest' or 'active'. + * @type array|string $include Array or comma-separated list of group IDs. Results will be limited + * to groups within the list. Default: false. + * @type array|string $exclude Array or comma-separated list of group IDs. Results will exclude + * the listed groups. Default: false. + * @type array|string $parent_id Array or comma-separated list of group IDs. Results will include only + * child groups of the listed groups. Default: null. + * @type bool $update_meta_cache Whether to fetch groupmeta for queried groups. Default: true. + * @type bool $update_admin_cache Whether to pre-fetch group admins for queried groups. + * Defaults to true when on a group directory, where this + * information is needed in the loop. Otherwise false. + * } + * @return bool True if there are groups to display that match the params + */ + function bp_has_groups($args = '') + { + } + /** + * Check whether there are more groups to iterate over. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @return bool + */ + function bp_groups() + { + } + /** + * Set up the current group inside the loop. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @return BP_Groups_Group + */ + function bp_the_group() + { + } + /** + * Is the group accessible to a user? + * Despite the name of the function, it has historically checked + * whether a user has access to a group. + * In BP 2.9, a property was added to the BP_Groups_Group class, + * `is_visible`, that describes whether a user can know the group exists. + * If you wish to check that property, use the check: + * bp_current_user_can( 'groups_see_group' ). + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group` and added the `$user_id` parameter. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param int $user_id ID of the User. + * Default: current logged in user ID. + * @return bool True if the Group is accessible to the user. False otherwise. + */ + function bp_group_is_visible($group = \false, $user_id = 0) + { + } + /** + * Output the ID of the group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_id($group = \false) + { + } + /** + * Get the ID of the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return int + */ + function bp_get_group_id($group = \false) + { + } + /** + * Output the row class of the current group in the loop. + * + * @since 1.7.0 + * + * @param array $classes Array of custom classes. + */ + function bp_group_class($classes = array()) + { + } + /** + * Get the row class of the current group in the loop. + * + * @since 1.7.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param array $classes Array of custom classes. + * @return string Row class of the group. + */ + function bp_get_group_class($classes = array()) + { + } + /** + * Output the name of the group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_name($group = \false) + { + } + /** + * Get the name of the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: current group in loop. + * @return string + */ + function bp_get_group_name($group = \false) + { + } + /** + * Output the type of the group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_type($group = \false) + { + } + /** + * Get the type of the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_type($group = \false) + { + } + /** + * Output the status of the group. + * + * @since 1.1.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_status($group = \false) + { + } + /** + * Get the status of the group. + * + * @since 1.1.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_status($group = \false) + { + } + /** + * Output the group avatar. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` parameter. + * + * @param array|string $args { + * See {@link bp_get_group_avatar()} for description of arguments. + * } + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_avatar($args = '', $group = \false) + { + } + /** + * Get a group's avatar. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` parameter. + * + * @see bp_core_fetch_avatar() For a description of arguments and return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see {@link bp_core_fetch_avatar()}. + * + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type string $class Default: 'avatar'. + * @type bool $no_grav Default: false. + * @type bool $html Default: true. + * @type string|bool $id Passed to `$css_id` parameter. Default: false. + * @type string $alt Default: 'Group logo of [group name]'. + * } + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string|bool HTML output for the Group Avatar. or false if avatar uploads is disabled. + */ + function bp_get_group_avatar($args = '', $group = \false) + { + } + /** + * Output the group avatar thumbnail. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_avatar_thumb($group = \false) + { + } + /** + * Return the group avatar thumbnail. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string HTML output for the Group Avatar. + */ + function bp_get_group_avatar_thumb($group = \false) + { + } + /** + * Output the miniature group avatar thumbnail. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_avatar_mini($group = \false) + { + } + /** + * Return the miniature group avatar thumbnail. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string HTML output for the Group Avatar. + */ + function bp_get_group_avatar_mini($group = \false) + { + } + /** + * Output the group avatar URL. + * + * @since 10.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param string $type Optional. The type of the avatar ('full' or 'thumb'). + * Default 'full'. + */ + function bp_group_avatar_url($group = \false, $type = 'full') + { + } + /** + * Returns the group avatar URL. + * + * @since 5.0.0 + * @since 10.0.0 Updated to use `bp_get_group_avatar`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param string $type Optional. The type of the avatar ('full' or 'thumb'). + * Default 'full'. + * @return string + */ + function bp_get_group_avatar_url($group = \false, $type = 'full') + { + } + /** Group cover image *********************************************************/ + /** + * Check if the group's cover image header enabled/active. + * + * @since 2.4.0 + * + * @return bool True if the cover image header is enabled, false otherwise. + */ + function bp_group_use_cover_image_header() + { + } + /** + * Returns the group cover image URL. + * + * @since 5.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string The cover image URL or empty string if not found. + */ + function bp_get_group_cover_url($group = \false) + { + } + /** + * Output the 'last active' string for the group. + * + * @since 1.0.0 + * @since 2.7.0 Added `$args` as a parameter. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array|string $args Optional. {@see bp_get_group_last_active()}. + */ + function bp_group_last_active($group = \false, $args = array()) + { + } + /** + * Return the 'last active' string for the group. + * + * @since 1.0.0 + * @since 2.7.0 Added `$args` as a parameter. + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array|string $args { + * Array of optional parameters. + * + * @type bool $relative Optional. If true, returns relative activity date. eg. active 5 months ago. + * If false, returns active date value from database. Default: true. + * } + * @return string + */ + function bp_get_group_last_active($group = \false, $args = array()) + { + } + /** + * Output the URL for the group. + * + * @since 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array $chunk (Optional) A list of slugs to append to the URL. + */ + function bp_group_url($group = \false, $chunks = array()) + { + } + /** + * Returns the Groups single item's URL. + * + * @since 12.0.0 + * + * @param integer|BP_Groups_Group $group The group ID or the Group object. + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type string $single_item_action The slug of the action to perform. + * @type array $single_item_action_variables An array of additional informations about the action to perform. + * } + * @return string The URL built for the BP Rewrites URL parser. + */ + function bp_get_group_url($group = 0, $path_chunks = array()) + { + } + /** + * Output an HTML-formatted link for the group. + * + * @since 2.9.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_link($group = \false) + { + } + /** + * Return an HTML-formatted link for the group. + * + * @since 2.9.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_link($group = \false) + { + } + /** + * Outputs the requested group's manage URL. + * + * @since 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array $chunks (Optional) A list of slugs to append to the URL. + */ + function bp_group_manage_url($group = \false, $chunks = array()) + { + } + /** + * Gets the requested group's manage URL. + * + * @since 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array $path_chunks { + * An array of arguments. Optional. + * + * @type array $single_item_action_variables An array of additional informations about the action to perform. + * } + * @return string The requested group's manage URL. + */ + function bp_get_group_manage_url($group = \false, $path_chunks = array()) + { + } + /** + * Output the slug for the group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_slug($group = \false) + { + } + /** + * Return the slug for the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_slug($group = \false) + { + } + /** + * Output the description for the group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_description($group = \false) + { + } + /** + * Return the description for the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_description($group = \false) + { + } + /** + * Output the description for the group, for use in a textarea. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_description_editable($group = \false) + { + } + /** + * Return the permalink for the group, for use in a textarea. + * + * 'bp_get_group_description_editable' does not have the formatting + * filters that 'bp_get_group_description' has, which makes it + * appropriate for "raw" editing. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_description_editable($group = \false) + { + } + /** + * Output an excerpt of the group description. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default:false. + * @param int $length (Optional) Length of returned string, including ellipsis. + * Default: 225. + */ + function bp_group_description_excerpt($group = \false, $length = 225) + { + } + /** + * Get an excerpt of a group description. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param int $length (Optional) Length of returned string, including ellipsis. + * Default: 225. + * @return string + */ + function bp_get_group_description_excerpt($group = \false, $length = 225) + { + } + /** + * Output the created date of the group. + * + * @since 1.0.0 + * @since 2.7.0 Added `$args` as a parameter. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array|string $args {@see bp_get_group_date_created()}. + */ + function bp_group_date_created($group = \false, $args = array()) + { + } + /** + * Return the created date of the group. + * + * @since 1.0.0 + * @since 2.7.0 Added `$args` as a parameter. + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array|string $args { + * Array of optional parameters. + * + * @type bool $relative Optional. If true, returns relative created date. eg. active 5 months ago. + * If false, returns created date value from database. Default: true. + * } + * @return string + */ + function bp_get_group_date_created($group = \false, $args = array()) + { + } + /** + * Output the username of the creator of the group. + * + * @since 1.7.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_creator_username($group = \false) + { + } + /** + * Return the username of the creator of the group. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_creator_username($group = \false) + { + } + /** + * Output the user ID of the creator of the group. + * + * @since 1.7.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_creator_id($group = \false) + { + } + /** + * Return the user ID of the creator of the group. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return int + */ + function bp_get_group_creator_id($group = \false) + { + } + /** + * Output the permalink of the creator of the group. + * + * @since 1.7.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_creator_permalink($group = \false) + { + } + /** + * Return the permalink of the creator of the group. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_creator_permalink($group = \false) + { + } + /** + * Determine whether a user is the creator of the group. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param int $user_id ID of the user. + * Default: current logged in user. + * @return bool + */ + function bp_is_group_creator($group = \false, $user_id = 0) + { + } + /** + * Output the avatar of the creator of the group. + * + * @since 1.7.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array $args { + * Array of optional arguments. See {@link bp_get_group_creator_avatar()} + * for description. + * } + */ + function bp_group_creator_avatar($group = \false, $args = array()) + { + } + /** + * Return the avatar of the creator of the group. + * + * @since 1.7.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param array $args { + * Array of optional arguments. See {@link bp_core_fetch_avatar()} + * for detailed description of arguments. + * @type string $type Default: 'full'. + * @type int $width Default: false. + * @type int $height Default: false. + * @type int $class Default: 'avatar'. + * @type string $id Passed to 'css_id'. Default: false. + * @type string $alt Alt text. Default: 'Group creator profile + * photo of [user display name]'. + * } + * @return string + */ + function bp_get_group_creator_avatar($group = \false, $args = array()) + { + } + /** + * Determine whether the current user is the admin of the current group. + * + * Alias of {@link bp_is_item_admin()}. + * + * @since 1.1.0 + * + * @return bool + */ + function bp_group_is_admin() + { + } + /** + * Determine whether the current user is a mod of the current group. + * + * Alias of {@link bp_is_item_mod()}. + * + * @since 1.1.0 + * + * @return bool + */ + function bp_group_is_mod() + { + } + /** + * Output markup listing group admins. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_list_admins($group = \false) + { + } + /** + * Output markup listing group mod. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_list_mods($group = \false) + { + } + /** + * Return a list of user IDs for a group's admins. + * + * @since 1.5.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param string $format (Optional) 'string' to get a comma-separated string, + * 'array' to get an array. + * @return string|array|false A string or an array of user IDs, false if group does not exist. + */ + function bp_group_admin_ids($group = \false, $format = 'string') + { + } + /** + * Return a list of user IDs for a group's moderators. + * + * @since 1.5.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @param string $format (Optional) 'string' to get a comma-separated string, + * 'array' to get an array. + * @return string|array|false A string or an array of user IDs, false if group does not exist. + */ + function bp_group_mod_ids($group = \false, $format = 'string') + { + } + /** + * Output the pagination HTML for a group loop. + * + * @since 1.2.0 + */ + function bp_groups_pagination_links() + { + } + /** + * Get the pagination HTML for a group loop. + * + * @since 1.2.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @return string + */ + function bp_get_groups_pagination_links() + { + } + /** + * Output the "Viewing x-y of z groups" pagination message. + * + * @since 1.2.0 + */ + function bp_groups_pagination_count() + { + } + /** + * Generate the "Viewing x-y of z groups" pagination message. + * + * @since 1.5.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @return string + */ + function bp_get_groups_pagination_count() + { + } + /** + * Determine whether groups auto-join is enabled. + * + * "Auto-join" is the toggle that determines whether users are joined to a + * public group automatically when creating content in that group. + * + * @since 1.2.6 + * + * @return bool + */ + function bp_groups_auto_join() + { + } + /** + * Output the total member count for a group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_total_members($group = \false) + { + } + /** + * Get the total member count for a group. + * + * @since 1.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return int + */ + function bp_get_group_total_members($group = \false) + { + } + /** + * Output the "x members" count string for a group. + * + * @since 1.2.0 + * @since 7.0.0 Adds the `$group` optional parameter. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_member_count($group = \false) + { + } + /** + * Generate the "x members" count string for a group. + * + * @since 1.2.0 + * @since 7.0.0 Adds the `$group` optional parameter. + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_member_count($group = \false) + { + } + /** + * Output the URL of the Forum page of a group. + * + * @since 1.0.0 + * @since 10.0.0 Adds the `$group` optional parameter. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_forum_permalink($group = \false) + { + } + /** + * Generate the URL of the Forum page of a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_forum_permalink($group = \false) + { + } + /** + * Determine whether forums are enabled for a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return bool + */ + function bp_group_is_forum_enabled($group = \false) + { + } + /** + * Output the 'checked' attribute for the group forums settings UI. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_group_is_forum_enabled`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_show_forum_setting($group = \false) + { + } + /** + * Output the 'checked' attribute for a given status in the settings UI. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param string $setting Group status: 'public', 'private', 'hidden'. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_show_status_setting($setting, $group = \false) + { + } + /** + * Output the 'checked' value, if needed, for a given invite_status on the group create/admin screens + * + * @since 1.5.0 + * + * @param string $setting The setting you want to check against ('members', 'mods', or 'admins'). + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_show_invite_status_setting($setting, $group = \false) + { + } + /** + * Get the invite status of a group. + * + * 'invite_status' became part of BuddyPress in BP 1.5. In order to provide + * backward compatibility with earlier installations, groups without a status + * set will default to 'members', ie all members in a group can send + * invitations. Filter 'bp_group_invite_status_fallback' to change this + * fallback behavior. + * + * This function can be used either in or out of the loop. + * + * @since 1.5.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return bool|string Returns false when no group can be found. Otherwise + * returns the group invite status, from among 'members', + * 'mods', and 'admins'. + */ + function bp_group_get_invite_status($group = \false) + { + } + /** + * Can a user send invitations in the specified group? + * + * @since 1.5.0 + * @since 2.2.0 Added the $user_id parameter. + * + * @param int $group_id The group ID to check. + * @param int $user_id The user ID to check. + * @return bool + */ + function bp_groups_user_can_send_invites($group_id = 0, $user_id = 0) + { + } + /** + * Determine whether a group has moderators. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return array Info about group admins (user_id + date_modified). + */ + function bp_group_has_moderators($group = \false) + { + } + /** + * Output a URL for promoting a user to moderator. + * + * @since 1.1.0 + * + * @param array|string $args See {@link bp_get_group_member_promote_mod_link()}. + */ + function bp_group_member_promote_mod_link($args = '') + { + } + /** + * Generate a URL for promoting a user to moderator. + * + * @since 1.1.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args { + * @type int $user_id ID of the member to promote. Default: + * current member in a group member loop. + * @type object $group Group object. Default: current group. + * } + * @return string + */ + function bp_get_group_member_promote_mod_link($args = '') + { + } + /** + * Output a URL for promoting a user to admin. + * + * @since 1.1.0 + * + * @param array|string $args See {@link bp_get_group_member_promote_admin_link()}. + */ + function bp_group_member_promote_admin_link($args = '') + { + } + /** + * Generate a URL for promoting a user to admin. + * + * @since 1.1.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args { + * @type int $user_id ID of the member to promote. Default: + * current member in a group member loop. + * @type object $group Group object. Default: current group. + * } + * @return string + */ + function bp_get_group_member_promote_admin_link($args = '') + { + } + /** + * Output a URL for demoting a user to member. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param int $user_id ID of the member to demote. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_member_demote_link($user_id = 0, $group = \false) + { + } + /** + * Generate a URL for demoting a user to member. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $user_id ID of the member to demote. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_member_demote_link($user_id = 0, $group = \false) + { + } + /** + * Output a URL for banning a member from a group. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param int $user_id ID of the member. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_member_ban_link($user_id = 0, $group = \false) + { + } + /** + * Generate a URL for banning a member from a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $user_id ID of the member to ban. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_member_ban_link($user_id = 0, $group = \false) + { + } + /** + * Output a URL for unbanning a member from a group. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param int $user_id ID of the member to unban. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_member_unban_link($user_id = 0, $group = \false) + { + } + /** + * Generate a URL for unbanning a member from a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $user_id ID of the member to unban. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_member_unban_link($user_id = 0, $group = \false) + { + } + /** + * Output a URL for removing a member from a group. + * + * @since 1.2.6 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param int $user_id ID of the member to remove. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_member_remove_link($user_id = 0, $group = \false) + { + } + /** + * Generate a URL for removing a member from a group. + * + * @since 1.2.6 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $user_id ID of the member to remove. Default: 0. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_member_remove_link($user_id = 0, $group = \false) + { + } + /** + * HTML admin subnav items for group pages. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: current group in the loop. + */ + function bp_group_admin_tabs($group = \false) + { + } + /** + * BackCompat for plugins/themes directly hooking groups_admin_tabs + * without using the Groups Extension API. + * + * @since 2.2.0 + * + * @param string $subnav_output Subnav item output. + * @param string $subnav_item subnav item params. + * @param string $selected_item Surrent selected tab. + * @return string HTML output + */ + function bp_group_admin_tabs_backcompat($subnav_output = '', $subnav_item = '', $selected_item = '') + { + } + /** + * Output the group count for the displayed user. + * + * @since 1.1.0 + */ + function bp_group_total_for_member() + { + } + /** + * Get the group count for the displayed user. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_group_total_for_member() + { + } + /** + * Output the 'action' attribute for a group form. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param string $page Page slug. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_form_action($page, $group = \false) + { + } + /** + * Generate the 'action' attribute for a group form. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param string $page Page slug. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_form_action($page, $group = \false) + { + } + /** + * Output the 'action' attribute for a group admin form. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` paremeter. + * + * @param false|string|bool $page (Optional). Page slug. Default: false. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_admin_form_action($page = \false, $group = \false) + { + } + /** + * Generate the 'action' attribute for a group admin form. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|string|bool $page (Optional). Page slug. Default: false. + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_admin_form_action($page = \false, $group = \false) + { + } + /** + * Determine whether the logged-in user has requested membership to a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return bool + */ + function bp_group_has_requested_membership($group = \false) + { + } + /** + * Check if current user is member of a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group to check is_member. + * Default: current group in the loop. + * @return bool If user is member of group or not. + */ + function bp_group_is_member($group = \false) + { + } + /** + * Check whether the current user has an outstanding invite to the current group in the loop. + * + * @since 2.1.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param object|bool $group Optional. Group data object. + * Default: the current group in the groups loop. + * @return bool True if the user has an outstanding invite, otherwise false. + */ + function bp_group_is_invited($group = \false) + { + } + /** + * Check if a user is banned from a group. + * + * If this function is invoked inside the groups template loop, then we check + * $groups_template->group->is_banned instead of using {@link groups_is_user_banned()} + * and making another SQL query. + * + * In BuddyPress 2.1, to standardize this function, we are defaulting the + * return value to a boolean. In previous versions, using this function would + * return either a string of the integer (0 or 1) or null if a result couldn't + * be found from the database. If the logged-in user had the 'bp_moderate' + * capability, the return value would be boolean false. + * + * @since 1.5.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param BP_Groups_Group|bool $group Group to check if user is banned. + * @param int $user_id The user ID to check. + * @return bool True if user is banned. False if user isn't banned. + */ + function bp_group_is_user_banned($group = \false, $user_id = 0) + { + } + /** + * Output the URL for accepting an invitation to the current group in the loop. + * + * @since 1.0.0 + */ + function bp_group_accept_invite_link() + { + } + /** + * Generate the URL for accepting an invitation to a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: Current group in the loop. + * @return string + */ + function bp_get_group_accept_invite_link($group = \false) + { + } + /** + * Output the URL for accepting an invitation to the current group in the loop. + * + * @since 1.0.0 + */ + function bp_group_reject_invite_link() + { + } + /** + * Generate the URL for rejecting an invitation to a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: Current group in the loop. + * @return string + */ + function bp_get_group_reject_invite_link($group = \false) + { + } + /** + * Output the URL for confirming a request to leave a group. + * + * @since 1.0.0 + */ + function bp_group_leave_confirm_link() + { + } + /** + * Generate the URL for confirming a request to leave a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: Current group in the loop. + * @return string + */ + function bp_get_group_leave_confirm_link($group = \false) + { + } + /** + * Output the URL for rejecting a request to leave a group. + * + * @since 1.0.0 + */ + function bp_group_leave_reject_link() + { + } + /** + * Generate the URL for rejecting a request to leave a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: Current group in the loop. + * @return string + */ + function bp_get_group_leave_reject_link($group = \false) + { + } + /** + * Output the 'action' attribute for a group send invite form. + * + * @since 1.0.0 + */ + function bp_group_send_invite_form_action() + { + } + /** + * Output the 'action' attribute for a group send invite form. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: current group in the loop. + * @return string + */ + function bp_get_group_send_invite_form_action($group = \false) + { + } + /** + * Determine whether the current user has friends to invite to a group. + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Optional. Group object. + * Default: current group in the loop. + * @return bool + */ + function bp_has_friends_to_invite($group = \false) + { + } + /** + * Output button to join a group. + * + * @since 1.0.0 + * + * @param object|bool $group Single group object. + */ + function bp_group_join_button($group = \false) + { + } + /** + * Get the arguments for the Join button group + * + * @since 11.0.0 + * @since 14.0.0 Handles the case when a user has an invite to join a public group. + * + * @param BP_Groups_Group $group The group object. + * @return Array The arguments for the Join button group + */ + function bp_groups_get_group_join_button_args($group = \null) + { + } + /** + * Return button to join a group. + * + * @since 1.0.0 + * @since 11.0.0 uses `bp_groups_get_group_join_button_args()`. + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|bool $group Single group object. + * @return false|string + */ + function bp_get_group_join_button($group = \false) + { + } + /** + * Output the Create a Group button. + * + * @since 2.0.0 + */ + function bp_group_create_button() + { + } + /** + * Get the Create a Group button. + * + * @since 2.0.0 + * + * @return false|string + */ + function bp_get_group_create_button() + { + } + /** + * Output the Create a Group nav item. + * + * @since 2.2.0 + */ + function bp_group_create_nav_item() + { + } + /** + * Get the Create a Group nav item. + * + * @since 2.2.0 + * + * @return string + */ + function bp_get_group_create_nav_item() + { + } + /** + * Checks if a specific theme is still filtering the Groups directory title + * if so, transform the title button into a Groups directory nav item. + * + * @since 2.2.0 + * + * @return string|null HTML Output + */ + function bp_group_backcompat_create_nav_item() + { + } + /** + * Prints a message if the group is not visible to the current user (it is a + * hidden or private group, and the user does not have access). + * + * @since 1.0.0 + * + * @global BP_Groups_Template $groups_template The Groups template loop class. + * + * @param object|null $group Group to get status message for. Optional; defaults to current group. + */ + function bp_group_status_message($group = \null) + { + } + /** + * Output hidden form fields for group. + * + * This function is no longer used, but may still be used by older themes. + * + * @since 1.0.0 + */ + function bp_group_hidden_fields() + { + } + /** + * Output the total number of groups. + * + * @since 1.0.0 + */ + function bp_total_group_count() + { + } + /** + * Return the total number of groups. + * + * @since 1.0.0 + * + * @return int + */ + function bp_get_total_group_count() + { + } + /** + * Output the total number of groups a user belongs to. + * + * @since 1.0.0 + * + * @param int $user_id User ID to get group membership count. + */ + function bp_total_group_count_for_user($user_id = 0) + { + } + /** + * Return the total number of groups a user belongs to. + * + * Filtered by `bp_core_number_format()` by default + * + * @since 1.0.0 + * + * @param int $user_id User ID to get group membership count. + * @return string + */ + function bp_get_total_group_count_for_user($user_id = 0) + { + } + /* Group Members *************************************************************/ + /** + * Initialize a group member query loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args { + * An array of optional arguments. + * @type int $group_id ID of the group whose members are being queried. + * Default: current group ID. + * @type int $page Page of results to be queried. Default: 1. + * @type int $per_page Number of items to return per page of results. + * Default: 20. + * @type int $max Optional. Max number of items to return. + * @type array $exclude Optional. Array of user IDs to exclude. + * @type bool|int $exclude_admin_mods True (or 1) to exclude admins and mods from results. + * Default: 1. + * @type bool|int $exclude_banned True (or 1) to exclude banned users from results. + * Default: 1. + * @type array $group_role Optional. Array of group roles to include. + * @type string $type Optional. Sort order of results. 'last_joined', + * 'first_joined', or any of the $type params available in + * {@link BP_User_Query}. Default: 'last_joined'. + * @type string $search_terms Optional. Search terms to match. Pass an + * empty string to force-disable search, even in + * the presence of $_REQUEST['s']. Default: false. + * } + * + * @return bool + */ + function bp_group_has_members($args = '') + { + } + /** + * The list of group members. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return mixed + */ + function bp_group_members() + { + } + /** + * The current Member being iterated on. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return mixed + */ + function bp_group_the_member() + { + } + /** + * Output the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @param array|string $args {@see bp_core_fetch_avatar()}. + */ + function bp_group_member_avatar($args = '') + { + } + /** + * Return the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args {@see bp_core_fetch_avatar()}. + * @return string + */ + function bp_get_group_member_avatar($args = '') + { + } + /** + * Output the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @param array|string $args {@see bp_core_fetch_avatar()}. + */ + function bp_group_member_avatar_thumb($args = '') + { + } + /** + * Return the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args {@see bp_core_fetch_avatar()}. + * @return string + */ + function bp_get_group_member_avatar_thumb($args = '') + { + } + /** + * Output the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @param int $width Width of avatar to fetch. + * @param int $height Height of avatar to fetch. + */ + function bp_group_member_avatar_mini($width = 30, $height = 30) + { + } + /** + * Output the group member avatar while in the groups members loop. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param int $width Width of avatar to fetch. + * @param int $height Height of avatar to fetch. + * @return string + */ + function bp_get_group_member_avatar_mini($width = 30, $height = 30) + { + } + /** + * Outputs the group member name. + * + * @since 1.0.0 + */ + function bp_group_member_name() + { + } + /** + * Returns the group member's name. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string|null + */ + function bp_get_group_member_name() + { + } + /** + * Outputs the group member's URL. + * + * @since 1.0.0 + */ + function bp_group_member_url() + { + } + /** + * Returns the group member's URL. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string + */ + function bp_get_group_member_url() + { + } + /** + * Outputs the group member's link. + * + * @since 1.0.0 + */ + function bp_group_member_link() + { + } + /** + * Returns the group member's link. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string + */ + function bp_get_group_member_link() + { + } + /** + * Outputs the group member's domain. + * + * @since 1.2.0 + */ + function bp_group_member_domain() + { + } + /** + * Returns the group member's domain. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string + */ + function bp_get_group_member_domain() + { + } + /** + * Outputs the group member's friendship status with logged in user. + * + * @since 1.2.0 + */ + function bp_group_member_is_friend() + { + } + /** + * Retruns the group member's friendship status with logged in user. + * + * @since 1.2.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string + */ + function bp_get_group_member_is_friend() + { + } + /** + * Check whether the member is banned from the current group. + * + * @since 1.0.0 + */ + function bp_group_member_is_banned() + { + } + /** + * Check whether the member is banned from the current group. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return bool + */ + function bp_get_group_member_is_banned() + { + } + /** + * Output CSS if group member is banned. + * + * @since 1.2.6 + * @since 10.0.0 Updated to use `bp_get_group_member_is_banned`. + */ + function bp_group_member_css_class() + { + } + /** + * Output the joined date for the current member in the group member loop. + * + * @since 1.0.0 + * @since 2.7.0 Added $args as a parameter. + * + * @param array|string $args {@see bp_get_group_member_joined_since()} + * @return string|null + */ + function bp_group_member_joined_since($args = array()) + { + } + /** + * Return the joined date for the current member in the group member loop. + * + * @since 1.0.0 + * @since 2.7.0 Added $args as a parameter. + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @param array|string $args { + * Array of optional parameters. + * + * @type bool $relative Optional. If true, returns relative joined date. eg. joined 5 months ago. + * If false, returns joined date value from database. Default: true. + * } + * @return string + */ + function bp_get_group_member_joined_since($args = array()) + { + } + /** + * Get group member from current group. + * + * @since 1.0.0 + */ + function bp_group_member_id() + { + } + /** + * Get group member from current group. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return int + */ + function bp_get_group_member_id() + { + } + /** + * Do the list of group members needs a pagination? + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return bool + */ + function bp_group_member_needs_pagination() + { + } + /** + * @since 1.0.0 + */ + function bp_group_pag_id() + { + } + /** + * @since 1.0.0 + * + * @return string + */ + function bp_get_group_pag_id() + { + } + /** + * Outputs the group members list pagination links. + * + * @since 1.0.0 + */ + function bp_group_member_pagination() + { + } + /** + * Returns the group members list pagination links. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string|null + */ + function bp_get_group_member_pagination() + { + } + /** + * Outputs the group members list pagination count. + * + * @since 1.0.0 + */ + function bp_group_member_pagination_count() + { + } + /** + * Returns the group members list pagination count. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return string + */ + function bp_get_group_member_pagination_count() + { + } + /** + * Outputs the group members list pagination links inside the Group's Manage screen. + * + * @since 1.0.0 + */ + function bp_group_member_admin_pagination() + { + } + /** + * Returns the group members list pagination links inside the Group's Manage screen. + * + * @since 1.0.0 + * + * @global BP_Core_Members_Template $members_template The Members template loop class. + * + * @return mixed + */ + function bp_get_group_member_admin_pagination() + { + } + /** + * Output the contents of the current group's home page. + * + * You should only use this when on a single group page. + * + * @since 2.4.0 + */ + function bp_groups_front_template_part() + { + } + /** + * Locate a custom group front template if it exists. + * + * @since 2.4.0 + * @since 2.6.0 Adds the Group Type to the front template hierarchy. + * + * @param BP_Groups_Group|null $group Optional. Falls back to current group if not passed. + * @return string|bool Path to front template on success; boolean false on failure. + */ + function bp_groups_get_front_template($group = \null) + { + } + /** + * Output the Group members template + * + * @since 2.0.0 + */ + function bp_groups_members_template_part() + { + } + /** + * Output the Group members filters + * + * @since 2.0.0 + */ + function bp_groups_members_filter() + { + } + /* + * Group Creation Process Template Tags + */ + /** + * Determine if the current logged in user can create groups. + * + * @since 1.5.0 + * + * @return bool True if user can create groups. False otherwise. + */ + function bp_user_can_create_groups() + { + } + /** + * Outputs the Group creation tabs. + * + * @since 1.0.0 + */ + function bp_group_creation_tabs() + { + } + /** + * Output the group creation step's title. + * + * @since 1.0.0 + */ + function bp_group_creation_stage_title() + { + } + /** + * Output the group's creation form action URL. + * + * @since 1.1.0 + */ + function bp_group_creation_form_action() + { + } + /** + * Get the group's creation form action URL. + * + * @since 1.1.0 + * + * @return string The group's creation form action URL. + */ + function bp_get_group_creation_form_action() + { + } + /** + * Check the requested creation step is the current one. + * + * @since 1.1.0 + * + * @param string $step_slug The group creation step's slug. + * + * @return bool + */ + function bp_is_group_creation_step($step_slug) + { + } + /** + * Check the requested creation step is completed. + * + * @since 1.1.0 + * + * @param array $step_slugs The list of group creation step slugs. + * + * @return bool + */ + function bp_is_group_creation_step_complete($step_slugs) + { + } + /** + * Check previous steps compared to the requested creation step are completed. + * + * @since 1.1.0 + * + * @param string $step_slug The group creation step's slug. + * + * @return bool + */ + function bp_are_previous_group_creation_steps_complete($step_slug) + { + } + /** + * Outputs the new group ID. + * + * @since 1.1.0 + */ + function bp_new_group_id() + { + } + /** + * @since 1.1.0 + * + * @return int + */ + function bp_get_new_group_id() + { + } + /** + * Output the new group's name. + * + * @since 1.1.0 + */ + function bp_new_group_name() + { + } + /** + * Get the new group's name. + * + * @since 1.1.0 + * + * @return string The new group's name. + */ + function bp_get_new_group_name() + { + } + /** + * Output the new group's description. + * + * @since 1.1.0 + */ + function bp_new_group_description() + { + } + /** + * Get the new group's description. + * + * @since 1.1.0 + * + * @return string The new group's description. + */ + function bp_get_new_group_description() + { + } + /** + * Outputs 1 if the new group has a forum. + * + * @todo deprecate + * @since 1.1.0 + */ + function bp_new_group_enable_forum() + { + } + /** + * Checks whether a new group has a forum or not. + * + * @todo deprecate + * @since 1.1.0 + * + * @return int 1 if the new group has a forum. O otherwise. + */ + function bp_get_new_group_enable_forum() + { + } + /** + * Outputs the new group's status. + * + * @since 1.1.0 + */ + function bp_new_group_status() + { + } + /** + * Gets the new group's status. + * + * @since 1.1.0 + * + * @return string The new group's status. + */ + function bp_get_new_group_status() + { + } + /** + * Output the avatar for the group currently being created + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For more information on accepted arguments + * + * @param array|string $args See bp_core_fetch_avatar(). + */ + function bp_new_group_avatar($args = '') + { + } + /** + * Return the avatar for the group currently being created + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For a description of arguments and return values. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see {@link bp_core_fetch_avatar()}. + * + * @type string $alt Default: 'Group photo'. + * @type string $class Default: 'avatar'. + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type string $id Passed to $css_id parameter. Default: 'avatar-crop-preview'. + * } + * @return string The avatar for the group being created + */ + function bp_get_new_group_avatar($args = '') + { + } + /** + * Escape & output the URL to the previous group creation step + * + * @since 1.1.0 + */ + function bp_group_creation_previous_link() + { + } + /** + * Return the URL to the previous group creation step + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_group_creation_previous_link() + { + } + /** + * Echoes the current group creation step. + * + * @since 1.6.0 + */ + function bp_groups_current_create_step() + { + } + /** + * Returns the current group creation step. If none is found, returns an empty string. + * + * @since 1.6.0 + * + * + * @return string $current_create_step + */ + function bp_get_groups_current_create_step() + { + } + /** + * Is the user looking at the last step in the group creation process. + * + * @since 1.1.0 + * + * @param string $step Step to compare. + * @return bool True if yes, False if no + */ + function bp_is_last_group_creation_step($step = '') + { + } + /** + * Is the user looking at the first step in the group creation process + * + * @since 1.1.0 + * + * @param string $step Step to compare. + * @return bool True if yes, False if no + */ + function bp_is_first_group_creation_step($step = '') + { + } + /** + * Output a list of friends who can be invited to a group + * + * @since 1.0.0 + * + * @param array $args Array of arguments for friends list output. + */ + function bp_new_group_invite_friend_list($args = array()) + { + } + /** + * Return a list of friends who can be invited to a group + * + * @since 1.0.0 + * + * @param array $args Array of arguments for friends list output. + * @return false|string HTML list of checkboxes, or false + */ + function bp_get_new_group_invite_friend_list($args = array()) + { + } + /** + * Outputs a search form for the Groups directory. + * + * @since 1.0.0 + */ + function bp_directory_groups_search_form() + { + } + /** + * Echo the current group type message. + * + * @since 2.7.0 + */ + function bp_current_group_directory_type_message() + { + } + /** + * Generate the current group type message. + * + * @since 2.7.0 + * + * @return string + */ + function bp_get_current_group_directory_type_message() + { + } + /** + * Is the current page a specific group admin screen? + * + * @since 1.1.0 + * + * @param string $slug Admin screen slug. + * @return bool + */ + function bp_is_group_admin_screen($slug = '') + { + } + /** + * Echoes the current group admin tab slug. + * + * @since 1.6.0 + */ + function bp_group_current_admin_tab() + { + } + /** + * Returns the current group admin tab slug. + * + * @since 1.6.0 + * + * + * @return string $tab The current tab's slug. + */ + function bp_get_group_current_admin_tab() + { + } + /** Group Avatar Template Tags ************************************************/ + /** + * Outputs the current group avatar. + * + * @since 1.0.0 + * + * @param string $type Thumb or full. + */ + function bp_group_current_avatar($type = 'thumb') + { + } + /** + * Returns the current group avatar. + * + * @since 2.0.0 + * + * @param string $type Thumb or full. + * @return string $tab The current tab's slug. + */ + function bp_get_group_current_avatar($type = 'thumb') + { + } + /** + * Return whether a group has an avatar. + * + * @since 1.1.0 + * @since 10.0.0 Updated to use `bp_get_group_avatar` + * + * @param int|bool $group_id Group ID to check. + * @return bool + */ + function bp_get_group_has_avatar($group_id = \false) + { + } + /** + * Outputs the URL to delete a group avatar. + * + * @since 1.1.0 + */ + function bp_group_avatar_delete_link() + { + } + /** + * Gets the URL to delete a group avatar. + * + * @since 1.1.0 + * + * @return string The URL to delete a group avatar. + */ + function bp_get_group_avatar_delete_link() + { + } + /** + * Fires a hook to let 3rd party plugins add some html content to group's home page. + * + * @since 1.0.0 + */ + function bp_custom_group_boxes() + { + } + /** + * Fires a hook to let 3rd party plugins add custom group admin tabs. + * + * @todo deprecate. + * @since 1.0.0 + */ + function bp_custom_group_admin_tabs() + { + } + /** + * Fires a hook to let 3rd party plugins add custom group editable fields. + * + * @todo deprecate. + * @since 1.0.0 + */ + function bp_custom_group_fields_editable() + { + } + /** + * Fires a hook to let 3rd party plugins add custom group fields. + * + * @todo deprecate. + * @since 1.0.0 + */ + function bp_custom_group_fields() + { + } + /* Group Membership Requests *************************************************/ + /** + * Initialize a group membership request template loop. + * + * @since 1.0.0 + * + * @param array|string $args { + * @type int $group_id ID of the group. Defaults to current group. + * @type int $per_page Number of records to return per page. Default: 10. + * @type int $page Page of results to return. Default: 1. + * @type int $max Max number of items to return. Default: false. + * } + * @return bool True if there are requests, otherwise false. + */ + function bp_group_has_membership_requests($args = '') + { + } + /** + * @since 1.0.0 + * + * @return mixed + */ + function bp_group_membership_requests() + { + } + /** + * @since 1.0.0 + * + * @return mixed + */ + function bp_group_the_membership_request() + { + } + /** + * @since 1.0.0 + */ + function bp_group_request_user_avatar_thumb() + { + } + /** + * Outputs the URL to reject a group membership request. + * + * @since 1.0.0 + */ + function bp_group_request_reject_link() + { + } + /** + * Gets the URL to reject a group membership request. + * + * @since 1.2.6 + * + * @return string The URL to reject a group membership request. + */ + function bp_get_group_request_reject_link() + { + } + /** + * Outputs the URL to accept a group membership request. + * + * @since 1.0.0 + */ + function bp_group_request_accept_link() + { + } + /** + * Gets the URL to reject a group membership request. + * + * @since 1.2.6 + * + * @return string The URL to reject a group membership request. + */ + function bp_get_group_request_accept_link() + { + } + /** + * Outputs the link to reach the requesting user's profile page. + * + * @since 1.0.0 + */ + function bp_group_request_user_link() + { + } + /** + * Gets the link to reach the requesting user's profile page. + * + * @since 1.2.6 + * + * @return string HTML output. + */ + function bp_get_group_request_user_link() + { + } + /** + * Outputs the elapsed time since the group membership request was made. + * + * @since 1.0.0 + */ + function bp_group_request_time_since_requested() + { + } + /** + * Outputs the comment a member sent with their membership request. + * + * @since 1.0.0 + */ + function bp_group_request_comment() + { + } + /** + * Output pagination links for group membership requests. + * + * @since 2.0.0 + */ + function bp_group_requests_pagination_links() + { + } + /** + * Get pagination links for group membership requests. + * + * @since 2.0.0 + * + * @return string + */ + function bp_get_group_requests_pagination_links() + { + } + /** + * Output pagination count text for group membership requests. + * + * @since 2.0.0 + */ + function bp_group_requests_pagination_count() + { + } + /** + * Get pagination count text for group membership requests. + * + * @since 2.0.0 + * + * @return string + */ + function bp_get_group_requests_pagination_count() + { + } + /** Group Invitations *********************************************************/ + /** + * Whether or not there are invites. + * + * @since 1.1.0 + * + * @param string|array $args { + * @type int $group_id ID of the group. Defaults to current group. + * @type int $user_id ID of the user. Defaults to logged-in user. + * @type int $per_page Number of records to return per page. Default: 10. + * @type int $page Page of results to return. Default: 1. + * } + * @return bool + */ + function bp_group_has_invites($args = '') + { + } + /** + * @since 1.1.0 + * + * @return mixed + */ + function bp_group_invites() + { + } + /** + * @since 1.1.0 + * + * @return mixed + */ + function bp_group_the_invite() + { + } + /** + * @since 1.1.0 + */ + function bp_group_invite_item_id() + { + } + /** + * @since 1.1.0 + * + * @return string + */ + function bp_get_group_invite_item_id() + { + } + /** + * @since 1.1.0 + */ + function bp_group_invite_user_avatar() + { + } + /** + * @since 1.1.0 + * + * @return string|null + */ + function bp_get_group_invite_user_avatar() + { + } + /** + * @since 1.1.0 + */ + function bp_group_invite_user_link() + { + } + /** + * @since 1.1.0 + * + * @return string + */ + function bp_get_group_invite_user_link() + { + } + /** + * @since 1.1.0 + */ + function bp_group_invite_user_last_active() + { + } + /** + * @since 1.1.0 + * + * @return string|null + */ + function bp_get_group_invite_user_last_active() + { + } + /** + * @since 1.1.0 + */ + function bp_group_invite_user_remove_invite_url() + { + } + /** + * @since 1.1.0 + * + * @return string + */ + function bp_get_group_invite_user_remove_invite_url() + { + } + /** + * Output pagination links for group invitations. + * + * @since 2.0.0 + */ + function bp_group_invite_pagination_links() + { + } + /** + * Get pagination links for group invitations. + * + * @since 2.0.0 + * + * @return string + */ + function bp_get_group_invite_pagination_links() + { + } + /** + * Output pagination count text for group invitations. + * + * @since 2.0.0 + */ + function bp_group_invite_pagination_count() + { + } + /** + * Get pagination count text for group invitations. + * + * @since 2.0.0 + * + * @return string + */ + function bp_get_group_invite_pagination_count() + { + } + /** Group RSS *****************************************************************/ + /** + * Hook group activity feed to <head>. + * + * @since 1.5.0 + */ + function bp_groups_activity_feed() + { + } + /** + * Output the current group activity-stream RSS URL. + * + * @since 1.5.0 + */ + function bp_group_activity_feed_link() + { + } + /** + * Return the current group activity-stream RSS URL. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_group_activity_feed_link() + { + } + /** Current Group *************************************************************/ + /** + * Echoes the output of bp_get_current_group_id(). + * + * @since 1.5.0 + */ + function bp_current_group_id() + { + } + /** + * Returns the ID of the current group. + * + * @since 1.5.0 + * + * @return int $current_group_id The id of the current group, if there is one. + */ + function bp_get_current_group_id() + { + } + /** + * Echoes the output of bp_get_current_group_slug(). + * + * @since 1.5.0 + */ + function bp_current_group_slug() + { + } + /** + * Returns the slug of the current group. + * + * @since 1.5.0 + * + * @return string $current_group_slug The slug of the current group, if there is one. + */ + function bp_get_current_group_slug() + { + } + /** + * Echoes the output of bp_get_current_group_name(). + * + * @since 1.5.0 + */ + function bp_current_group_name() + { + } + /** + * Returns the name of the current group. + * + * @since 1.5.0 + * + * @return string The name of the current group, if there is one. + */ + function bp_get_current_group_name() + { + } + /** + * Echoes the output of bp_get_current_group_description(). + * + * @since 2.1.0 + */ + function bp_current_group_description() + { + } + /** + * Returns the description of the current group. + * + * @since 2.1.0 + * this output. + * + * @return string The description of the current group, if there is one. + */ + function bp_get_current_group_description() + { + } + /** + * Output a URL for a group component action. + * + * @since 1.2.0 + * + * @param string $action + * @param string $query_args + * @param bool $nonce + * @return string|null + */ + function bp_groups_action_link($action = '', $query_args = '', $nonce = \false) + { + } + /** + * Get a URL for a group component action. + * + * @since 1.2.0 + * + * @param string $action + * @param string $query_args + * @param bool $nonce + * @return string + */ + function bp_get_groups_action_link($action = '', $query_args = '', $nonce = \false) + { + } + /** Stats **********************************************************************/ + /** + * Display the number of groups in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args before|after|user_id + * + */ + function bp_groups_profile_stats($args = '') + { + } + /** + * Return the number of groups in user's profile. + * + * @since 2.0.0 + * + * @param array|string $args before|after|user_id + * @return string HTML for stats output. + */ + function bp_groups_get_profile_stats($args = '') + { + } + /** + * Check if the active template pack includes the Group Membership management UI templates. + * + * @since 5.0.0 + * + * @return bool True if the active template pack includes the Group Membership management UI templates. + * False otherwise. + */ + function bp_groups_has_manage_group_members_templates() + { + } + /** + * Prints the JS Templates to manage the Group's members. + * + * @since 10.0.0 + */ + function bp_groups_print_manage_group_members_templates() + { + } + /** + * Prints the HTML placeholders to manage the Group's members. + * + * @since 10.0.0 + */ + function bp_groups_print_manage_group_members_placeholders() + { + } + /** + * Outputs the Manage Group Members Backbone UI. + * + * @since 10.0.0 + * + * @param string $hook The hook to use to inject the JS Templates. + */ + function bp_groups_manage_group_members_interface($hook = 'wp_footer') + { + } + /** Emails ********************************************************************/ + /** + * Notify all group members when a group is updated. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @param BP_Groups_Group|null $old_group Group before new details were saved. + */ + function groups_notification_group_updated($group_id = 0, $old_group = \null) + { + } + /** + * Notify group admin about new membership request. + * + * @since 1.0.0 + * + * @param int $requesting_user_id ID of the user requesting group membership. + * @param int $admin_id ID of the group admin. + * @param int $group_id ID of the group. + * @param int $membership_id ID of the group membership object. + */ + function groups_notification_new_membership_request($requesting_user_id = 0, $admin_id = 0, $group_id = 0, $membership_id = 0) + { + } + /** + * Notify member about their group membership request. + * + * @since 1.0.0 + * + * @param int $requesting_user_id ID of the user requesting group membership. + * @param int $group_id ID of the group. + * @param bool $accepted Optional. Whether the membership request was accepted. + * Default: true. + */ + function groups_notification_membership_request_completed($requesting_user_id = 0, $group_id = 0, $accepted = \true) + { + } + /** + * Notify group member they have been promoted. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + */ + function groups_notification_promoted_member($user_id = 0, $group_id = 0) + { + } + /** + * Notify a member they have been invited to a group. + * + * @since 1.0.0 + * + * @param BP_Groups_Group $group Group object. + * @param BP_Groups_Member|int $member Member object or invited_user_id. + * @param int $inviter_user_id ID of the user who sent the invite. + */ + function groups_notification_group_invites(&$group, &$member, $inviter_user_id) + { + } + /** Notifications *************************************************************/ + /** + * Format notifications for the Groups component. + * + * @since 1.0.0 + * + * @param string $action The kind of notification being rendered. + * @param int $item_id The primary item ID. + * @param int $secondary_item_id The secondary item ID. + * @param int $total_items The total number of messaging-related notifications + * waiting for the user. + * @param string $format 'string' for notification HTML link or 'array' for separate link and text. + * for WP Toolbar. Default: 'string'. + * @return string + */ + function groups_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string') + { + } + /** + * Remove all notifications for any member belonging to a specific group. + * + * @since 1.9.0 + * + * @param int $group_id ID of the group. + */ + function bp_groups_delete_group_delete_all_notifications($group_id) + { + } + /** + * Remove Group invite notification when a user is uninvited. + * + * @since 5.0.0 + * + * @param int $group_id ID of the group being uninvited from. + * @param int $user_id ID of the user being uninvited. + */ + function bp_groups_uninvite_user_delete_group_invite_notification($group_id = 0, $user_id = 0) + { + } + /** + * When a demotion takes place, delete any corresponding promotion notifications. + * + * @since 2.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + */ + function bp_groups_delete_promotion_notifications($user_id = 0, $group_id = 0) + { + } + /** + * Mark notifications read when a member accepts a group invitation. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + */ + function bp_groups_accept_invite_mark_notifications($user_id, $group_id) + { + } + /** + * Mark notifications read when a member's group membership request is granted. + * + * @since 2.8.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + */ + function bp_groups_accept_request_mark_notifications($user_id, $group_id) + { + } + /** + * Mark notifications read when a member views their group memberships. + * + * @since 1.9.0 + */ + function bp_groups_screen_my_groups_mark_notifications() + { + } + /** + * Mark group invitation notifications read when a member views their invitations. + * + * @since 1.9.0 + */ + function bp_groups_screen_invites_mark_notifications() + { + } + /** + * Mark group join requests read when an admin or moderator visits the group administration area. + * + * @since 1.9.0 + */ + function bp_groups_screen_group_admin_requests_mark_notifications() + { + } + /** + * Delete new group membership notifications when a user is being deleted. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user. + */ + function bp_groups_remove_data_for_user_notifications($user_id) + { + } + /** + * Render the group settings fields on the Notification Settings page. + * + * @since 1.0.0 + */ + function groups_screen_notification_settings() + { + } + /** + * Notify member about their group membership request accepted/rejected by admin. + * + * @since 11.0.0 + * + * @param int $user_id ID of the user requesting group membership. + * @param int $group_id ID of the group. + */ + function groups_email_notification_membership_request_completed_by_admin($user_id, $group_id) + { + } + /** + * Add the Group Admin top-level menu when viewing group pages. + * + * @since 1.5.0 + * + * @todo Add dynamic menu items for group extensions. + * + * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + * + * @return false|null False if not on a group page, or if user does not have + * access to group admin options. + */ + function bp_groups_group_admin_menu() + { + } + /** + * Remove rogue WP core Edit menu when viewing a single group. + * + * @since 1.6.0 + */ + function bp_groups_remove_edit_page_menu() + { + } + /** + * Filter output of Group Description through WordPress's KSES API. + * + * @since 1.1.0 + * + * @param string $content Content to filter. + * @return string + */ + function bp_groups_filter_kses($content = '') + { + } + /** + * Should BuddyPress load the mentions scripts and related assets, including results to prime the + * mentions suggestions? + * + * @since 2.2.0 + * + * @param bool $load_mentions True to load mentions assets, false otherwise. + * @param bool $mentions_enabled True if mentions are enabled. + * @return bool True if mentions scripts should be loaded. + */ + function bp_groups_maybe_load_mentions_scripts($load_mentions, $mentions_enabled) + { + } + /** + * Disable at-mention notifications for users who are not a member of the non-public group where the activity appears. + * + * @since 2.5.0 + * + * @param bool $send Whether to send the notification. + * @param array $usernames Array of all usernames being notified. + * @param int $user_id ID of the user to be notified. + * @param BP_Activity_Activity $activity Activity object. + * @return bool + */ + function bp_groups_disable_at_mention_notification_for_non_public_groups($send, $usernames, $user_id, \BP_Activity_Activity $activity) + { + } + /** + * Use the mystery group avatar for groups. + * + * @since 2.6.0 + * + * @param string $avatar Current avatar src. + * @param array $params Avatar params. + * @return string + */ + function bp_groups_default_avatar($avatar, $params) + { + } + /** + * Filter the bp_user_can value to determine what the user can do + * with regards to a specific group. + * + * @since 3.0.0 + * + * @param bool $retval Whether or not the current user has the capability. + * @param int $user_id + * @param string $capability The capability being checked for. + * @param int $site_id Site ID. Defaults to the BP root blog. + * @param array $args Array of extra arguments passed. + * + * @return bool + */ + function bp_groups_user_can_filter($retval, $user_id, $capability, $site_id, $args) + { + } + /** + * Registers Groups personal data exporters. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_groups_register_personal_data_exporters($exporters) + { + } + /** + * Register the Groups component admin screen. + * + * @since 1.7.0 + */ + function bp_groups_add_admin_menu() + { + } + /** + * Redirects the user on the Goups network admin screen when BuddyPress is network activated. + * + * @since 7.0.0 + */ + function bp_group_site_admin_network_admin_redirect() + { + } + /** + * Create Groups submenu to manage BuddyPress types. + * + * @since 7.0.0 + */ + function bp_groups_admin_types_menu() + { + } + /** + * Add groups component to custom menus array. + * + * This ensures that the Groups menu item appears in the proper order on the + * main Dashboard menu. + * + * @since 1.7.0 + * + * @param array $custom_menus Array of BP top-level menu items. + * @return array Menu item array, with Groups added. + */ + function bp_groups_admin_menu_order($custom_menus = array()) + { + } + /** + * Set up the Groups admin page. + * + * Loaded before the page is rendered, this function does all initial setup, + * including: processing form requests, registering contextual help, and + * setting up screen options. + * + * @since 1.7.0 + * + * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table. + */ + function bp_groups_admin_load() + { + } + /** + * Select the appropriate Groups admin screen, and output it. + * + * @since 1.7.0 + */ + function bp_groups_admin() + { + } + /** + * Display the single groups edit screen. + * + * @since 1.7.0 + */ + function bp_groups_admin_edit() + { + } + /** + * Display the Group delete confirmation screen. + * + * We include a separate confirmation because group deletion is truly + * irreversible. + * + * @since 1.7.0 + */ + function bp_groups_admin_delete() + { + } + /** + * Display the Groups admin index screen. + * + * This screen contains a list of all BuddyPress groups. + * + * @since 1.7.0 + * + * @global BP_Groups_List_Table $bp_groups_list_table Group screen list table. + * @global string $plugin_page Currently viewed plugin page. + */ + function bp_groups_admin_index() + { + } + /** + * Markup for the single group's Settings metabox. + * + * @since 1.7.0 + * + * @param object $item Information about the current group. + */ + function bp_groups_admin_edit_metabox_settings($item) + { + } + /** + * Output the markup for a single group's Add New Members metabox. + * + * @since 1.7.0 + * + * @param BP_Groups_Group $item The BP_Groups_Group object for the current group. + */ + function bp_groups_admin_edit_metabox_add_new_members($item) + { + } + /** + * Renders the Members metabox on single group pages. + * + * @since 1.7.0 + * + * @param BP_Groups_Group $item The BP_Groups_Group object for the current group. + */ + function bp_groups_admin_edit_metabox_members($item) + { + } + /** + * Renders the Status metabox for the Groups admin edit screen. + * + * @since 1.7.0 + * + * @param object $item Information about the currently displayed group. + */ + function bp_groups_admin_edit_metabox_status($item) + { + } + /** + * Render the Group Type metabox. + * + * @since 2.6.0 + * + * @param BP_Groups_Group|null $group The BP_Groups_Group object corresponding to the group being edited. + */ + function bp_groups_admin_edit_metabox_group_type(\BP_Groups_Group $group = \null) + { + } + /** + * Process changes from the Group Type metabox. + * + * @since 2.6.0 + * + * @param int $group_id Group ID. + */ + function bp_groups_process_group_type_update($group_id) + { + } + /** + * Create pagination links out of a BP_Group_Member_Query. + * + * This function is intended to create pagination links for use under the + * Manage Members section of the Groups Admin Dashboard pages. It is a stopgap + * measure until a more general pagination solution is in place for BuddyPress. + * Plugin authors should not use this function, as it is likely to be + * deprecated soon. + * + * @since 1.8.0 + * + * @param BP_Group_Member_Query $query A BP_Group_Member_Query object. + * @param string $member_type member|mod|admin|banned. + * @return string Pagination links HTML. + */ + function bp_groups_admin_create_pagination_links(\BP_Group_Member_Query $query, $member_type) + { + } + /** + * Get a set of usernames corresponding to a set of user IDs. + * + * @since 1.7.0 + * + * @param array $user_ids Array of user IDs. + * @return array Array of user_logins corresponding to $user_ids. + */ + function bp_groups_admin_get_usernames_from_ids($user_ids = array()) + { + } + /** + * AJAX handler for group member autocomplete requests. + * + * @since 1.7.0 + */ + function bp_groups_admin_autocomplete_handler() + { + } + /** + * Process input from the Group Type bulk change select. + * + * @since 2.7.0 + * + * @param string $doaction Current $_GET action being performed in admin screen. + */ + function bp_groups_admin_process_group_type_bulk_changes($doaction) + { + } + /** + * Display an admin notice upon group type bulk update. + * + * @since 2.7.0 + */ + function bp_groups_admin_groups_type_change_notice() + { + } + /** + * Checks whether a group type already exists. + * + * @since 7.0.0 + * + * @param boolean $exists True if the group type already exists. False otherwise. + * @param string $type_id The group type identifier. + * @return bool True if the group type already exists. False otherwise. + */ + function bp_groups_type_admin_type_exists($exists = \false, $type_id = '') + { + } + /** + * Set the feedback messages for the Group Types Admin actions. + * + * @since 7.0.0 + * + * @param array $messages The feedback messages. + * @return array The feedback messages including the ones for the Group Types Admin actions. + */ + function bp_groups_type_admin_updated_messages($messages = array()) + { + } + /** + * Check whether there is a Groups directory page in the $bp global. + * + * @since 1.5.0 + * + * @return bool True if set, False if empty. + */ + function bp_groups_has_directory() + { + } + /** + * Fetch a single group object. + * + * When calling up a group object, you should always use this function instead + * of instantiating BP_Groups_Group directly, so that you will inherit cache + * support and pass through the groups_get_group filter. + * + * @since 1.2.0 + * @since 2.7.0 The function signature was changed to accept a group ID only, + * instead of an array containing the group ID. + * + * @param int $group_id ID of the group. + * @return BP_Groups_Group $group The group object. + */ + function groups_get_group($group_id) + { + } + /** + * Retrieve group by a given field. + * + * @since 10.0.0 + * + * @param string $field (Required) The field to use to retrieve the group. + * Possible values are `'id'` or `'slug'`. + * @param string|int $value (Required) A value for the $field. A Group ID or slug. + * @return BP_Groups_Group|bool The Group object if found, false otherwise. + */ + function bp_get_group_by($field, $value) + { + } + /** + * Retrieve a Group. + * + * When used into the context of a Groups loop built by the `BP_Groups_Template` class, it defaults to the + * Group being iterated on. + * + * @since 10.0.0 + * + * @global BP_Groups_Template $groups_template The main Groups template loop class. + * + * @param false|int|string|object|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return BP_Groups_Group|bool The Group object if found, false otherwise. + */ + function bp_get_group($group = \false) + { + } + /** Group Creation, Editing & Deletion ****************************************/ + /** + * Create a group. + * + * @since 1.0.0 + * + * @param array|string $args { + * An array of arguments. + * @type int|bool $group_id Pass a group ID to update an existing item, or + * 0 / false to create a new group. Default: 0. + * @type int $creator_id The user ID that creates the group. + * @type string $name The group name. + * @type string $description Optional. The group's description. + * @type string $slug The group slug. + * @type string $status The group's status. Accepts 'public', 'private' or + * 'hidden'. Defaults to 'public'. + * @type int $parent_id The ID of the parent group. Default: 0. + * @type int $enable_forum Optional. Whether the group has a forum enabled. + * If a bbPress forum is enabled for the group, + * set this to 1. Default: 0. + * @type string $date_created The GMT time, in Y-m-d h:i:s format, when the group + * was created. Defaults to the current time. + * } + * @return int|bool The ID of the group on success. False on error. + */ + function groups_create_group($args = '') + { + } + /** + * Edit the base details for a group. + * + * These are the settings that appear on the first page of the group's Admin + * section (Name, Description, and "Notify members..."). + * + * @since 1.0.0 + * + * @param array $args { + * An array of optional arguments. + * @type int $group_id ID of the group. + * @type string $name Name of the group. + * @type string $slug Slug of the group. + * @type string $description Description of the group. + * @type bool $notify_members Whether to send an email notification to group + * members about changes in these details. + * } + * @return bool + */ + function groups_edit_base_group_details($args = array()) + { + } + /** + * Edit the base details for a group. + * + * These are the settings that appear on the Settings page of the group's Admin + * section (privacy settings, "enable forum", invitation status). + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @param bool $enable_forum Whether to enable a forum for the group. + * @param string $status Group status. 'public', 'private', 'hidden'. + * @param string|bool $invite_status Optional. Who is allowed to send invitations + * to the group. 'members', 'mods', or 'admins'. + * @param int|bool $parent_id Parent group ID. + * @return bool + */ + function groups_edit_group_settings($group_id, $enable_forum, $status, $invite_status = \false, $parent_id = \false) + { + } + /** + * Delete a group and all of its associated metadata. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group to delete. + * @return bool + */ + function groups_delete_group($group_id) + { + } + /** + * Check a group status (eg 'private') against the list of registered statuses. + * + * @since 1.1.0 + * + * @param string $status Status to check. + * @return bool True if status is allowed, otherwise false. + */ + function groups_is_valid_status($status) + { + } + /** + * Provide a unique, sanitized version of a group slug. + * + * @since 1.0.0 + * + * @param string $slug Group slug to check. + * @return string $slug A unique and sanitized slug. + */ + function groups_check_slug($slug) + { + } + /** + * Get slug from a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param int|string|BP_Groups_Group $group The Group ID, the Group Slug or the Group object. + * @return bool|string The group's slug. False if group doesn't exist. + */ + function groups_get_slug($group) + { + } + /** + * Get a group ID by its slug. + * + * @since 1.6.0 + * + * @param string $group_slug The group's slug. + * @return int|null The group ID on success, null on failure. + */ + function groups_get_id($group_slug) + { + } + /** + * Get a group ID by checking against old (not currently active) slugs. + * + * @since 2.9.0 + * + * @param string $group_slug The group's slug. + * @return int|null The group ID on success, null on failure. + */ + function groups_get_id_by_previous_slug($group_slug) + { + } + /** User Actions **************************************************************/ + /** + * Remove a user from a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param int|string|BP_Groups_Group $group The Group ID, the Group Slug or the Group object. + * @param int $user_id Optional. ID of the user. Defaults to the currently + * logged-in user. + * @return bool + */ + function groups_leave_group($group, $user_id = 0) + { + } + /** + * Add a user to a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param int|string|BP_Groups_Group $group The Group ID, the Group Slug or the Group object. + * @param int $user_id Optional. ID of the user. Defaults to the currently + * logged-in user. + * @return bool + */ + function groups_join_group($group, $user_id = 0) + { + } + /** + * Update the last_activity meta value for a given group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param int|string|BP_Groups_Group $group The Group ID, the Group Slug or the Group object. + * Default: the current group's ID. + * @return bool False on failure. + */ + function groups_update_last_activity($group = 0) + { + } + /** General Group Functions ***************************************************/ + /** + * Get a list of group administrators. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @return array Info about group admins (user_id + date_modified). + */ + function groups_get_group_admins($group_id) + { + } + /** + * Get a list of group moderators. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @return array Info about group admins (user_id + date_modified). + */ + function groups_get_group_mods($group_id) + { + } + /** + * Fetch the members of a group. + * + * Since BuddyPress 1.8, a procedural wrapper for BP_Group_Member_Query. + * Previously called BP_Groups_Member::get_all_for_group(). + * + * To use the legacy query, filter 'bp_use_legacy_group_member_query', + * returning true. + * + * @since 1.0.0 + * @since 3.0.0 $group_id now supports multiple values. Only works if legacy query is not + * in use. + * + * @param array $args { + * An array of optional arguments. + * @type int|array|string $group_id ID of the group to limit results to. Also accepts multiple values + * either as an array or as a comma-delimited string. + * @type int $page Page of results to be queried. Default: 1. + * @type int $per_page Number of items to return per page of results. Default: 20. + * @type int $max Optional. Max number of items to return. + * @type array $exclude Optional. Array of user IDs to exclude. + * @type bool|int $exclude_admins_mods True (or 1) to exclude admins and mods from results. Default: 1. + * @type bool|int $exclude_banned True (or 1) to exclude banned users from results. Default: 1. + * @type array $group_role Optional. Array of group roles to include. + * @type string $search_terms Optional. Filter results by a search string. + * @type string $type Optional. Sort the order of results. 'last_joined', 'first_joined', or + * any of the $type params available in {@link BP_User_Query}. Default: + * 'last_joined'. + * } + * @return false|array Multi-d array of 'members' list and 'count'. + */ + function groups_get_group_members($args = array()) + { + } + /** + * Get the member count for a group. + * + * @since 1.2.3 + * @since 10.0.0 Updated to use `bp_get_group`. + * + * @param int|string|BP_Groups_Group $group The Group ID, the Group Slug or the Group object. + * @param bool $skip_cache Optional. Skip grabbing from cache. Defaults to false. + * @return int|bool Count of confirmed members for the group. False if group doesn't exist. + */ + function groups_get_total_member_count($group, $skip_cache = \false) + { + } + /** Group Fetching, Filtering & Searching ************************************/ + /** + * Get a collection of groups, based on the parameters passed. + * + * @since 1.2.0 + * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters. + * @since 2.7.0 Added `$update_admin_cache` and `$parent_id` parameters. + * @since 10.0.0 Added `$date_query` parameter. + * + * @param array|string $args { + * Array of arguments. Supports all arguments of + * {@link BP_Groups_Group::get()}. Where the default values differ, they + * have been described here. + * @type int $per_page Default: 20. + * @type int $page Default: 1. + * } + * @return array See {@link BP_Groups_Group::get()}. + */ + function groups_get_groups($args = '') + { + } + /** + * Get the total group count for the site. + * + * @since 1.2.0 + * @since 10.0.0 Added the `$skip_cache` parameter. + * + * @param bool $skip_cache Optional. Skip getting count from cache. + * Defaults to false. + * @return int + */ + function groups_get_total_group_count($skip_cache = \false) + { + } + /** + * Get the IDs of the groups of which a specified user is a member. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $pag_num Optional. Max number of results to return. + * Default: false (no limit). + * @param int $pag_page Optional. Page offset of results to return. + * Default: false (no limit). + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + function groups_get_user_groups($user_id = 0, $pag_num = 0, $pag_page = 0) + { + } + /** + * Get a list of groups of which the specified user is a member. + * + * Get a list of the groups to which this member belongs, + * filtered by group membership status and role. + * Usage examples: Used with no arguments specified, + * + * bp_get_user_groups( bp_loggedin_user_id() ); + * + * returns an array of the groups in which the logged-in user + * is an unpromoted member. To fetch an array of all groups that + * the current user belongs to, in any membership role, + * member, moderator or administrator, use + * + * bp_get_user_groups( $user_id, array( + * 'is_admin' => null, + * 'is_mod' => null, + * ) ); + * + * @since 2.6.0 + * + * @param int $user_id ID of the user. + * @param array $args { + * Array of optional args. + * @param bool|null $is_confirmed Whether to return only confirmed memberships. Pass `null` to disable this + * filter. Default: true. + * @param bool|null $is_banned Whether to return only banned memberships. Pass `null` to disable this filter. + * Default: false. + * @param bool|null $is_admin Whether to return only admin memberships. Pass `null` to disable this filter. + * Default: false. + * @param bool|null $is_mod Whether to return only mod memberships. Pass `null` to disable this filter. + * Default: false. + * @param bool|null $invite_sent Whether to return only memberships with 'invite_sent'. Pass `null` to disable + * this filter. Default: false. + * @param string $orderby Field to order by. Accepts 'id' (membership ID), 'group_id', 'date_modified'. + * Default: 'group_id'. + * @param string $order Sort order. Accepts 'ASC' or 'DESC'. Default: 'ASC'. + * } + * @return array Array of matching group memberships, keyed by group ID. + */ + function bp_get_user_groups($user_id, $args = array()) + { + } + /** + * Get the count of groups of which the specified user is a member. + * + * @since 1.0.0 + * + * @param int $user_id Optional. Default: ID of the displayed user. + * @return int Group count. + */ + function groups_total_groups_for_user($user_id = 0) + { + } + /** + * Get the BP_Groups_Group object corresponding to the current group. + * + * @since 1.5.0 + * + * @return BP_Groups_Group|bool The current group object or false. + */ + function groups_get_current_group() + { + } + /** + * Can the current user access to the current group? + * + * @since 12.0.0 + * + * @return bool True if the current user can access to the current group. + * False otherwise. + */ + function bp_groups_user_can_access_current_group() + { + } + /** Group Avatars *************************************************************/ + /** + * Generate the avatar upload directory path for a given group. + * + * @since 1.1.0 + * + * @param int $group_id Optional. ID of the group. Default: ID of the current group. + * @return string + */ + function groups_avatar_upload_dir($group_id = 0) + { + } + /** Group Member Status Checks ************************************************/ + /** + * Get the Group roles. + * + * @since 5.0.0 + * + * @return array The list of Group role objects. + */ + function bp_groups_get_group_roles() + { + } + /** + * Check whether a user is an admin of a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the membership if the user is admin, otherwise false. + */ + function groups_is_user_admin($user_id, $group_id) + { + } + /** + * Check whether a user is a mod of a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the membership if the user is mod, otherwise false. + */ + function groups_is_user_mod($user_id, $group_id) + { + } + /** + * Check whether a user is a member of a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the membership if the user is member, otherwise false. + */ + function groups_is_user_member($user_id, $group_id) + { + } + /** + * Check whether a user is banned from a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the membership if the user is banned, otherwise false. + */ + function groups_is_user_banned($user_id, $group_id) + { + } + /** + * Check whether a user has an outstanding invitation to a group. + * + * @since 2.6.0 + * @since 5.0.0 Added $type parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param string $type If 'sent', results are limited to those invitations + * that have actually been sent (non-draft). + * Possible values: 'sent', 'draft', or 'all' Default: 'sent'. + * @return int|bool ID of the membership if the user is invited, otherwise false. + */ + function groups_is_user_invited($user_id, $group_id, $type = 'sent') + { + } + /** + * Check whether a user has a pending membership request for a group. + * + * @since 2.6.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the membership if the user is pending, otherwise false. + */ + function groups_is_user_pending($user_id, $group_id) + { + } + /** + * Is the specified user the creator of the group? + * + * @since 1.2.6 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|null + */ + function groups_is_user_creator($user_id, $group_id) + { + } + /** Group Invitations *********************************************************/ + /** + * Get group objects for groups that a user is currently invited to. + * + * @since 1.0.0 + * + * @param int $user_id ID of the invited user. + * @param int|bool $limit Limit to restrict to. + * @param int|bool $page Optional. Page offset of results to return. + * @param string|array|bool $exclude Array of comma-separated list of group IDs + * to exclude from results. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + function groups_get_invites_for_user($user_id = 0, $limit = \false, $page = \false, $exclude = \false) + { + } + /** + * Get the total group invite count for a user. + * + * @since 2.0.0 + * + * @param int $user_id The user ID. + * @return int + */ + function groups_get_invite_count_for_user($user_id = 0) + { + } + /** + * Get an array of group IDs to which a user is invited. + * + * @since 5.0.0 + * + * @param int $user_id The user ID. + * + * @return array Array of group IDs. + */ + function groups_get_invited_to_group_ids($user_id = 0) + { + } + /** + * Invite a user to a group. + * + * @since 1.0.0 + * + * @param array|string $args { + * Array of arguments. + * @type int $user_id ID of the user being invited. + * @type int $group_id ID of the group to which the user is being invited. + * @type int $inviter_id Optional. ID of the inviting user. Default: + * ID of the logged-in user. + * @type string $date_modified Optional. Modified date for the invitation. + * Default: current date/time. + * @type string $content Optional. Message to invitee. + * @type bool $send_invite Optional. Whether the invitation should be + * sent now. Default: false. + * } + * @return bool + */ + function groups_invite_user($args = '') + { + } + /** + * Uninvite a user from a group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $inviter_id ID of the inviter. + * @return bool + */ + function groups_uninvite_user($user_id, $group_id, $inviter_id = \false) + { + } + /** + * Process the acceptance of a group invitation. + * + * Returns true if a user is already a member of the group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return bool True when the user is a member of the group, otherwise false. + */ + function groups_accept_invite($user_id, $group_id) + { + } + /** + * Reject a group invitation. + * + * @since 1.0.0 + * @since 5.0.0 The $inviter_id arg was added. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $inviter_id ID of the inviter. + * + * @return bool + */ + function groups_reject_invite($user_id, $group_id, $inviter_id = \false) + { + } + /** + * Delete a group invitation. + * + * @since 1.0.0 + * @since 5.0.0 The $inviter_id arg was added. + * + * @param int $user_id ID of the invited user. + * @param int $group_id ID of the group. + * @param int $inviter_id ID of the inviter. + * + * @return bool + */ + function groups_delete_invite($user_id, $group_id, $inviter_id = \false) + { + } + /** + * Send some or all pending invites by a single user to a specific group. + * + * @since 1.0.0 + * @since 5.0.0 Parameters changed to associative array. + * + * @param array $args { + * An array of optional arguments. + * @type int $user_id ID of the invited user. + * @type string $invitee_email Email address of the invited user, if not a member of the site. + * @type string $group_id ID of the group or an array of group IDs. + * @type string $inviter_id ID of the user extending the invitation. + * @type bool $force_resend Whether to resend the email & notification if one has already been sent. + * } + */ + function groups_send_invites(...$args) + { + } + /** + * Get IDs of users with outstanding invites to a given group. + * + * @since 1.0.0 + * @since 2.9.0 Added $sent as a parameter. + * + * @param int $user_id ID of the inviting user. + * @param int $group_id ID of the group. + * @param int|null $sent Query for a specific invite sent status. If 0, this will query for users + * that haven't had an invite sent to them yet. If 1, this will query for + * users that have had an invite sent to them. If null, no invite status will + * queried. Default: null. + * @return array IDs of users who have been invited to the group by the user but have not + * yet accepted. + */ + function groups_get_invites_for_group($user_id, $group_id, $sent = \null) + { + } + /** + * Get invitations to a given group filtered by arguments. + * + * @since 5.0.0 + * + * @param int $group_id ID of the group. + * @param array $args Invitation arguments. + * See BP_Invitation::get() for list. + * + * @return array $invites Matching BP_Invitation objects. + */ + function groups_get_invites($args = array()) + { + } + /** + * Check to see whether a user has already been invited to a group. + * + * By default, the function checks for invitations that have been sent. + * Entering 'all' as the $type parameter will return unsent invitations as + * well (useful to make sure AJAX requests are not duplicated). + * + * @since 1.0.0 + * + * @param int $user_id ID of potential group member. + * @param int $group_id ID of potential group. + * @param string $type Optional. Use 'sent' to check for sent invites, + * 'all' to check for all. Default: 'sent'. + * @return int|bool ID of the first found membership if found, otherwise false. + */ + function groups_check_user_has_invite($user_id, $group_id, $type = 'sent') + { + } + /** + * Check to see whether a user has already been invited to a group by a particular user. + * + * By default, the function checks for invitations that have been sent. + * Entering 'all' as the $type parameter will return unsent invitations as + * well (useful to make sure AJAX requests are not duplicated). + * + * @since 5.0.0 + * + * @param int $user_id ID of potential group member. + * @param int $group_id ID of potential group. + * @param string $inviter_id Optional. Use 'sent' to check for sent invites, + * 'all' to check for all. Default: 'sent'. + * @param string $type Optional. Specify a user ID to limit to only invited from that user. + * Default: 'false'. + * @return int|bool ID of the first found membership if found, otherwise false. + */ + function groups_check_has_invite_from_user($user_id, $group_id, $inviter_id = \false, $type = 'sent') + { + } + /** + * Delete all invitations to a given group. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group whose invitations are being deleted. + * @return int|null Number of rows records deleted on success, null on failure. + */ + function groups_delete_all_group_invites($group_id) + { + } + /** Group Promotion & Banning *************************************************/ + /** + * Promote a member to a new status within a group. + * + * @since 1.0.0 + * @since 14.0.0 Adds the `$group_admin_id` parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param string $status The new status. 'mod' or 'admin'. + * @param int $group_admin_id Optional. The group admin user ID. + * @return bool + */ + function groups_promote_member($user_id, $group_id, $status, $group_admin_id = 0) + { + } + /** + * Demote a user to 'member' status within a group. + * + * @since 1.0.0 + * @since 14.0.0 Adds the `$group_admin_id` parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $group_admin_id Optional. The group admin user ID. + * @return bool + */ + function groups_demote_member($user_id, $group_id, $group_admin_id = 0) + { + } + /** + * Ban a member from a group. + * + * @since 1.0.0 + * @since 14.0.0 Adds the `$group_admin_id` parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $group_admin_id Optional. The group admin user ID. + * @return bool + */ + function groups_ban_member($user_id, $group_id, $group_admin_id = 0) + { + } + /** + * Unban a member from a group. + * + * @since 1.0.0 + * @since 14.0.0 Adds the `$group_admin_id` parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $group_admin_id Optional. The group admin user ID. + * @return bool + */ + function groups_unban_member($user_id, $group_id, $group_admin_id = 0) + { + } + /** Group Removal *************************************************************/ + /** + * Remove a member from a group. + * + * @since 1.2.6 + * @since 14.0.0 Adds the `$group_admin_id` parameter. + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @param int $group_admin_id Optional. The group admin user ID. + * @return bool + */ + function groups_remove_member($user_id, $group_id, $group_admin_id = 0) + { + } + /** Group Membership **********************************************************/ + /** + * Create a group membership request. + * + * @since 1.0.0 + * + * @param array|string $args { + * Array of arguments. + * @type int $user_id ID of the user being invited. + * @type int $group_id ID of the group to which the user is being invited. + * @type string $content Optional. Message to invitee. + * @type string $date_modified Optional. Modified date for the invitation. + * Default: current date/time. + * } + * @return bool + */ + function groups_send_membership_request(...$args) + { + } + /** + * Accept a pending group membership request. + * + * @since 1.0.0 + * @since 5.0.0 Deprecated $membership_id argument. + * + * @param int $membership_id Deprecated 5.0.0. + * @param int $user_id Required. ID of the user who requested membership. + * Provide this value along with $group_id to override + * $membership_id. + * @param int $group_id Required. ID of the group to which membership is being + * requested. Provide this value along with $user_id to + * override $membership_id. + * @return bool + */ + function groups_accept_membership_request($membership_id, $user_id = 0, $group_id = 0) + { + } + /** + * Reject a pending group membership request. + * + * @since 1.0.0 + * + * @param int $membership_id Deprecated 5.0.0. + * @param int $user_id Optional. ID of the user who requested membership. + * Provide this value along with $group_id to override + * $membership_id. + * @param int $group_id Optional. ID of the group to which membership is being + * requested. Provide this value along with $user_id to + * override $membership_id. + * @return bool + */ + function groups_reject_membership_request($membership_id, $user_id = 0, $group_id = 0) + { + } + /** + * Delete a pending group membership request. + * + * @since 1.2.0 + * + * @param int $membership_id Deprecated 5.0.0. + * @param int $user_id Optional. ID of the user who requested membership. + * Provide this value along with $group_id to override + * $membership_id. + * @param int $group_id Optional. ID of the group to which membership is being + * requested. Provide this value along with $user_id to + * override $membership_id. + * @return false|BP_Groups_Member True on success, false on failure. + */ + function groups_delete_membership_request($membership_id, $user_id = 0, $group_id = 0) + { + } + /** + * Get group membership requests filtered by arguments. + * + * @since 5.0.0 + * + * @param int $group_id ID of the group. + * @param array $args Invitation arguments. + * See BP_Invitation::get() for list. + * + * @return array $requests Matching BP_Invitation objects. + */ + function groups_get_requests($args = array()) + { + } + /** + * Check whether a user has an outstanding membership request for a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * @return int|bool ID of the request if found, otherwise false. + */ + function groups_check_for_membership_request($user_id, $group_id) + { + } + /** + * Get an array of group IDs to which a user has requested membership. + * + * @since 5.0.0 + * + * @param int $user_id The user ID. + * + * @return array Array of group IDs. + */ + function groups_get_membership_requested_group_ids($user_id = 0) + { + } + /** + * Get an array of group IDs to which a user has requested membership. + * + * @since 5.0.0 + * + * @param int $user_id The user ID. + * + * @return array Array of group IDs. + */ + function groups_get_membership_requested_user_ids($group_id = 0) + { + } + /** + * Accept all pending membership requests to a group. + * + * @since 1.0.2 + * + * @param int $group_id ID of the group. + * @return bool + */ + function groups_accept_all_pending_membership_requests($group_id = 0) + { + } + /** Group Meta ****************************************************************/ + /** + * Delete metadata for a group. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $group_id ID of the group. + * @param string|bool $meta_key The key of the row to delete. + * @param string|bool $meta_value Optional. Metadata value. If specified, only delete + * metadata entries with this value. + * @param bool $delete_all Optional. If true, delete matching metadata entries + * for all groups. Otherwise, only delete matching + * metadata entries for the specified group. + * Default: false. + * @return bool + */ + function groups_delete_groupmeta($group_id, $meta_key = \false, $meta_value = \false, $delete_all = \false) + { + } + /** + * Get a piece of group metadata. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @param string $meta_key Metadata key. + * @param bool $single Optional. If true, return only the first value of the + * specified meta_key. This parameter has no effect if + * meta_key is empty. + * @return mixed Metadata value. + */ + function groups_get_groupmeta($group_id, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of group metadata. + * + * @since 1.0.0 + * + * @param int $group_id ID of the group. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Value to store. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise, update all entries. + * @return bool|int $retval Returns false on failure. On successful update of existing + * metadata, returns true. On successful creation of new metadata, + * returns the integer ID of the new metadata row. + */ + function groups_update_groupmeta($group_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of group metadata. + * + * @since 2.0.0 + * + * @param int $group_id ID of the group. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @param bool $unique Optional. Whether to enforce a single metadata value + * for the given key. If true, and the object already + * has a value for the key, no change will be made. + * Default: false. + * @return int|bool The meta ID on successful update, false on failure. + */ + function groups_add_groupmeta($group_id, $meta_key, $meta_value, $unique = \false) + { + } + /** Group Cleanup Functions ***************************************************/ + /** + * Delete all group membership information for the specified user. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + */ + function groups_remove_data_for_user($user_id) + { + } + /** + * Deletes user group data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_groups_remove_data_for_user_on_delete_user($user_id) + { + } + /** + * Update orphaned child groups when the parent is deleted. + * + * @since 2.7.0 + * + * @param BP_Groups_Group $group Instance of the group item being deleted. + */ + function bp_groups_update_orphaned_groups_on_group_delete($group) + { + } + /** Group Types ***************************************************************/ + /** + * Output the slug of the Group type taxonomy. + * + * @since 7.0.0 + */ + function bp_group_type_tax_name() + { + } + /** + * Return the slug of the Group type taxonomy. + * + * @since 7.0.0 + * + * @return string The unique Group taxonomy slug. + */ + function bp_get_group_type_tax_name() + { + } + /** + * Returns labels used by the Group type taxonomy. + * + * @since 7.0.0 + * + * @return array + */ + function bp_get_group_type_tax_labels() + { + } + /** + * Returns arguments used by the Group type taxonomy. + * + * @since 7.0.0 + * + * @return array + */ + function bp_get_group_type_tax_args() + { + } + /** + * Register the Group Types taxonomy. + * + * @since 7.0.0 + * + * @param array $taxonomies BuddyPress default taxonomies. + * @return array BuddyPress default taxonomies. + */ + function bp_groups_register_group_type_taxonomy($taxonomies = array()) + { + } + /** + * Fire the 'bp_groups_register_group_types' action. + * + * @since 2.6.0 + */ + function bp_groups_register_group_types() + { + } + /** + * Extend generic Type metadata schema to match Group Type needs. + * + * @since 7.0.0 + * + * @param array $schema The generic Type metadata schema. + * @param string $taxonomy The taxonomy name the schema applies to. + * @return array The Group Type metadata schema. + */ + function bp_get_group_type_metadata_schema($schema = array(), $taxonomy = '') + { + } + /** + * Registers the Group type metadata. + * + * @since 7.0.0 + */ + function bp_register_group_type_metadata() + { + } + /** + * Register a group type. + * + * @since 2.6.0 + * @since 2.7.0 Introduce $has_directory, $show_in_create_screen, $show_in_list, and + * $description, $create_screen_checked as $args parameters. + * + * @param string $group_type Unique string identifier for the group type. + * @param array $args { + * Array of arguments describing the group type. + * + * @type string|bool $has_directory Set the slug to be used for custom group directory page. eg. + * example.com/groups/type/MY_SLUG. Default: false. + * @type bool $show_in_create_screen Whether this group type is allowed to be selected on the group creation + * page. Default: false. + * @type bool|null $show_in_list Whether this group type should be shown in lists rendered by + * bp_group_type_list(). Default: null. If $show_in_create_screen is true, + * this will default to true, unless this is set explicitly to false. + * @type string $description A short descriptive summary of what the group type is. Currently shown + * on a group's "Manage > Settings" page when selecting group types. + * @type bool $create_screen_checked If $show_in_create_screen is true, whether we should have our group type + * checkbox checked by default. Handy if you want to imply that the group + * type should be enforced, but decision lies with the group creator. + * Default: false. + * @type array $labels { + * Array of labels to use in various parts of the interface. + * + * @type string $name Default name. Should typically be plural. + * @type string $singular_name Singular name. + * } + * } + * @return object|WP_Error Group type object on success, WP_Error object on failure. + */ + function bp_groups_register_group_type($group_type, $args = array()) + { + } + /** + * Get a list of all registered group type objects. + * + * @since 2.6.0 + * + * @see bp_groups_register_group_type() for accepted arguments. + * + * @param array|string $args Optional. An array of key => value arguments to match against + * the group type objects. Default empty array. + * @param string $output Optional. The type of output to return. Accepts 'names' + * or 'objects'. Default 'names'. + * @param string $operator Optional. The logical operation to perform. 'or' means only one + * element from the array needs to match; 'and' means all elements + * must match. Accepts 'or' or 'and'. Default 'and'. + * @return array $types A list of groups type names or objects. + */ + function bp_groups_get_group_types($args = array(), $output = 'names', $operator = 'and') + { + } + /** + * Retrieve a group type object by name. + * + * @since 2.6.0 + * + * @param string $group_type The name of the group type. + * @return object A group type object. + */ + function bp_groups_get_group_type_object($group_type) + { + } + /** + * Only gets the group types registered by code. + * + * @since 7.0.0 + * + * @return array The group types registered by code. + */ + function bp_get_group_types_registered_by_code() + { + } + /** + * Generates missing metadata for a type registered by code. + * + * @since 7.0.0 + * + * @return array The group type metadata. + */ + function bp_set_registered_by_code_group_type_metadata($metadata = array(), $type = '') + { + } + /** + * Insert group types registered by code not yet saved into the database as WP Terms. + * + * @since 7.0.0 + */ + function bp_insert_group_types_registered_by_code() + { + } + /** + * Set type for a group. + * + * @since 2.6.0 + * @since 2.7.0 $group_type parameter also accepts an array of group types now. + * + * @param int $group_id ID of the group. + * @param string|array $group_type Group type or array of group types to set. + * @param bool $append Optional. True to append this to existing types for group, + * false to replace. Default: false. + * @return false|array $retval See bp_set_object_terms(). + */ + function bp_groups_set_group_type($group_id, $group_type, $append = \false) + { + } + /** + * Get type for a group. + * + * @since 2.6.0 + * @since 7.0.0 Adds the `$use_db` parameter. + * + * @param int $group_id ID of the group. + * @param bool $single Optional. Whether to return a single type string. If multiple types are found + * for the group, the oldest one will be returned. Default: true. + * @param bool $use_db Optional. Whether to request all group types or only the ones registered by code. + * Default: true. + * @return string|array|bool On success, returns a single group type (if `$single` is true) or an array of group + * types (if `$single` is false). Returns false on failure. + */ + function bp_groups_get_group_type($group_id, $single = \true, $use_db = \true) + { + } + /** + * Remove type for a group. + * + * @since 2.6.0 + * + * @param int $group_id ID of the user. + * @param string $group_type Group type. + * @return bool|WP_Error $deleted True on success. False or WP_Error on failure. + */ + function bp_groups_remove_group_type($group_id, $group_type) + { + } + /** + * Check whether the given group has a certain group type. + * + * @since 2.6.0 + * + * @param int $group_id ID of the group. + * @param string $group_type Group type. + * @return bool Whether the group has the give group type. + */ + function bp_groups_has_group_type($group_id, $group_type) + { + } + /** + * Get the "current" group type, if one is provided, in group directories. + * + * @since 2.7.0 + * + * @return string + */ + function bp_get_current_group_directory_type() + { + } + /** + * Delete a group's type when the group is deleted. + * + * @since 2.6.0 + * + * @param int $group_id ID of the group. + * @return array|null $value See {@see bp_groups_set_group_type()}. + */ + function bp_remove_group_type_on_group_delete($group_id = 0) + { + } + /** + * Finds and exports group membership data associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_groups_memberships_personal_data_exporter($email_address, $page) + { + } + /** + * Finds and exports data on pending group membership requests associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_groups_pending_requests_personal_data_exporter($email_address, $page) + { + } + /** + * Finds and exports data on pending group invitations sent by a user associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_groups_pending_sent_invitations_personal_data_exporter($email_address, $page) + { + } + /** + * Finds and exports data on pending group invitations received by a user associated with an email address. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_groups_pending_received_invitations_personal_data_exporter($email_address, $page) + { + } + /** + * Migrate invitations and requests from pre-5.0 group_members table to invitations table. + * + * @since 5.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_groups_migrate_invitations() + { + } + /** + * Register a new Group Extension. + * + * @since 1.1.0 + * @since 10.0.0 The function was moved from the `/bp-groups/classes/class-bp-group-extension.php` file. + * It only registers Group Extensions if their corresponding class name has not been already + * registered. + * + * @param string $group_extension_class Name of the Extension class. + * @return bool Returns true on success, otherwise false. + */ + function bp_register_group_extension($group_extension_class = '') + { + } + /** + * Init Registered Group Extensions. + * + * @since 10.0.0 + */ + function bp_init_group_extensions() + { + } + /** + * Updates a group members count when a user joined or left the group. + * + * @since 10.3.0 + * + * @param BP_Groups_Member|int $groups_member The BP_Groups_Member object or the group member ID. + * @param int $group_id The group's ID. + */ + function bp_groups_update_group_members_count($groups_member, $group_id = 0) + { + } + /** + * Defers a group's counting to avoid updating it when batch adding/removing users to this group. + * + * @since 10.3.0 + * + * @param bool $defer True to defer, false otherwise. + * @param int $group_id The group's ID. + */ + function bp_groups_defer_group_members_count($defer = \true, $group_id = 0) + { + } + /** + * Returns the Group restricted screens. + * + * @since 12.0.0 + * + * @return array The list of the Group restricted screens. + */ + function bp_get_group_restricted_screens() + { + } + /** + * Returns all registered Group Extension front-end screens. + * + * @since 12.0.0 + * + * @param string $context The display context. Required. Defaults to `read`. + * @return array The list of registered Group Extension screens. + */ + function bp_get_group_extension_screens($context = 'read') + { + } + /** + * Returns all potential Group screens. + * + * @since 12.0.0 + * + * @param string $context The display context. Required. Defaults to `read`. + * Possible values are `read`, `manage` or `create`. + * @param boolean $built_in True to only get builtin screens. False otherwise. + * @return array The list of potential Group screens. + */ + function bp_get_group_screens($context = 'read', $built_in = \false) + { + } + /** + * Get single Groups item customized path chunks using an array of BP URL default slugs. + * + * @since 12.0.0 + * + * @param array $chunks An array of BP URL default slugs. + * @param string $context Whether to get chunks for the 'read', 'create' or 'manage' contexts. + * @return array An associative array containing group's customized path chunks. + */ + function bp_groups_get_path_chunks($chunks = array(), $context = 'read') + { + } + /** + * Register activity actions for the Groups component. + * + * @since 1.1.0 + * + * @return false|null False on failure. + */ + function groups_register_activity_actions() + { + } + /** + * Get the group object the activity belongs to. + * + * @since 5.0.0 + * + * @param integer $group_id The group ID the activity is linked to. + * @return BP_Groups_Group The group object the activity belongs to. + */ + function bp_groups_get_activity_group($group_id = 0) + { + } + /** + * Format 'created_group' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string + */ + function bp_groups_format_activity_action_created_group($action, $activity) + { + } + /** + * Format 'joined_group' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string + */ + function bp_groups_format_activity_action_joined_group($action, $activity) + { + } + /** + * Format 'group_details_updated' activity actions. + * + * @since 2.2.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string + */ + function bp_groups_format_activity_action_group_details_updated($action, $activity) + { + } + /** + * Format the action for activity updates posted in a Group. + * + * @since 5.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string The formatted action for activity updates posted in a Group. + */ + function bp_groups_format_activity_action_group_activity_update($action, $activity) + { + } + /** + * Fetch data related to groups at the beginning of an activity loop. + * + * This reduces database overhead during the activity loop. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $activities Array of activity items. + * @return array + */ + function bp_groups_prefetch_activity_object_data($activities) + { + } + /** + * Set up activity arguments for use with the 'groups' scope. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array + */ + function bp_groups_filter_activity_scope($retval = array(), $filter = array()) + { + } + /** + * Enforces group membership restrictions on activity favorite queries. + * + * @since 4.3.0 + * @param array $retval Query arguments. + * @param array $filter + * @return array + */ + function bp_groups_filter_activity_favorites_scope($retval, $filter) + { + } + /** + * Record an activity item related to the Groups component. + * + * A wrapper for {@link bp_activity_add()} that provides some Groups-specific + * defaults. + * + * @since 1.0.0 + * + * @see bp_activity_add() for more detailed description of parameters and + * return values. + * + * @param array|string $args { + * An array of arguments for the new activity item. Accepts all parameters + * of {@link bp_activity_add()}. However, this wrapper provides some + * additional defaults, as described below: + * @type string $component Default: the id of your Groups component + * (usually 'groups'). + * @type bool $hide_sitewide Default: True if the current group is not + * public, otherwise false. + * } + * @return WP_Error|bool|int See {@link bp_activity_add()}. + */ + function groups_record_activity($args = '') + { + } + /** + * Post an Activity status update affiliated with a group. + * + * @since 1.2.0 + * @since 2.6.0 Added 'error_type' parameter to $args. + * + * @param array|string $args { + * Array of arguments. + * @type string $content The content of the update. + * @type int $user_id Optional. ID of the user posting the update. Default: + * ID of the logged-in user. + * @type int $group_id Optional. ID of the group to be affiliated with the + * update. Default: ID of the current group. + * } + * @return WP_Error|bool|int Returns the ID of the new activity item on success, or false on failure. + */ + function groups_post_update($args = '') + { + } + /** + * Function used to determine if a user can delete a group activity item. + * + * Used as a filter callback to 'bp_activity_user_can_delete'. + * + * @since 6.0.0 + * + * @param bool $retval True if item can receive comments. + * @param object $activity Activity item being checked. + * @return bool + */ + function bp_groups_filter_activity_user_can_delete($retval, $activity) + { + } + /** + * Function used to determine if a user can comment on a group activity item. + * + * Used as a filter callback to 'bp_activity_can_comment'. + * + * @since 3.0.0 + * + * @param bool $retval True if item can receive comments. + * @param null|BP_Activity_Activity $activity Null by default. Pass an activity object to check against that instead. + * @return bool + */ + function bp_groups_filter_activity_can_comment($retval, $activity = \null) + { + } + /** + * Function used to determine if a user can reply on a group activity comment. + * + * Used as a filter callback to 'bp_activity_can_comment_reply'. + * + * @since 3.0.0 + * + * @param bool $retval True if activity comment can be replied to. + * @param object|bool $comment Current activity comment object. If empty, parameter is boolean false. + * @return bool + */ + function bp_groups_filter_activity_can_comment_reply($retval, $comment) + { + } + /** + * Add an activity stream item when a member joins a group. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user joining the group. + * @param int $group_id ID of the group. + * @return false|null False on failure. + */ + function bp_groups_membership_accepted_add_activity($user_id, $group_id) + { + } + /** + * Add an activity item when a group's details are updated. + * + * @since 2.2.0 + * + * @param int $group_id ID of the group. + * @param BP_Groups_Group $old_group Group object before the details had been changed. + * @param bool $notify_members True if the admin has opted to notify group members, otherwise false. + * @return null|WP_Error|bool|int The ID of the activity on success. False on error. + */ + function bp_groups_group_details_updated_add_activity($group_id, $old_group, $notify_members) + { + } + /** + * Delete all activity items related to a specific group. + * + * @since 1.9.0 + * + * @param int $group_id ID of the group. + */ + function bp_groups_delete_group_delete_all_activity($group_id) + { + } + /** + * Delete group member activity if they leave or are removed within 5 minutes of membership modification. + * + * If the user joined this group less than five minutes ago, remove the + * joined_group activity so users cannot flood the activity stream by + * joining/leaving the group in quick succession. + * + * @since 1.9.0 + * + * @param int $group_id ID of the group. + * @param int $user_id ID of the user leaving the group. + */ + function bp_groups_leave_group_delete_recent_activity($group_id, $user_id) + { + } + /** + * Groups: Single group "Members" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Members page. + * + * @since 1.0.0 + */ + function groups_screen_group_members() + { + } + /** + * Groups: Single group "Manage > Details" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's admin/edit-details page. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_edit_details() + { + } + /** + * Groups: Single group "Manage > Delete" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of the Delete Group page. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_delete_group() + { + } + /** + * Groups: Single group "Manage > Cover Image" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Change cover image page. + * + * @since 2.4.0 + */ + function groups_screen_group_admin_cover_image() + { + } + /** + * Groups: Single group "Manage > Settings" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's admin/group-settings page. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_settings() + { + } + /** + * Groups: Single group "Manage > Photo" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Change Avatar page. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_avatar() + { + } + /** + * Groups: Single group "Manage > Members" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * This function handles actions related to member management on the group admin. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_manage_members() + { + } + /** + * Groups: Single group "Manage > Requests" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of Admin > Membership Requests. + * + * @since 1.0.0 + */ + function groups_screen_group_admin_requests() + { + } + /** + * Groups: Single group "Home" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the loading of a single group's page. + * + * @since 1.0.0 + */ + function groups_screen_group_home() + { + } + /** + * Groups: Single group activity permalink screen handler + * + * Note - This has never worked. + * See {@link https://buddypress.trac.wordpress.org/ticket/2579} + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a single group activity item. + * + * @since 1.2.0 + */ + function groups_screen_group_activity_permalink() + { + } + /** + * Groups: Single group "Activity" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the loading of a single group's activity. + * + * @since 2.4.0 + */ + function groups_screen_group_activity() + { + } + /** + * Groups: Single group "Send Invites" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Send Invites page. + * + * @since 1.0.0 + */ + function groups_screen_group_invite() + { + } + /** + * Process group invitation removal requests. + * + * Note that this function is only used when JS is disabled. Normally, clicking + * Remove Invite removes the invitation via AJAX. + * + * @since 2.0.0 + */ + function groups_remove_group_invite() + { + } + /** + * Groups: Single group "Request Membership" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Request Membership page. + * + * @since 1.0.0 + */ + function groups_screen_group_request_membership() + { + } + /** + * Groups: Single group "Manage" screen handler + * + * @package BuddyPress + * @subpackage GroupsScreens + * @since 3.0.0 + */ + /** + * Handle the display of a group's Admin pages. + * + * @since 1.0.0 + */ + function groups_screen_group_admin() + { + } + /** + * Groups: User's "Groups" screen handler + * + * @package BuddyPress + * @subpackage GroupScreens + * @since 3.0.0 + */ + /** + * Handle the loading of the My Groups page. + * + * @since 1.0.0 + */ + function groups_screen_my_groups() + { + } + /** + * Groups: User's "Groups > Invites" screen handler + * + * @package BuddyPress + * @subpackage GroupScreens + * @since 3.0.0 + */ + /** + * Handle the loading of a user's Groups > Invites page. + * + * @since 1.0.0 + */ + function groups_screen_group_invites() + { + } + /** + * Groups: Directory screen handler + * + * @package BuddyPress + * @subpackage GroupScreens + * @since 3.0.0 + */ + /** + * Handle the display of the Groups directory index. + * + * @since 1.0.0 + */ + function groups_directory_groups_setup() + { + } + /** + * Groups: RSS feed action + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Load the activity feed for the current group. + * + * @since 1.2.0 + * + * @return false|null False on failure. + */ + function groups_action_group_feed() + { + } + /** + * Groups: Access protection action handler + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Protect access to single groups. + * + * @since 2.1.0 + */ + function bp_groups_group_access_protection() + { + } + /** + * Groups: Join action + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Catch and process "Join Group" button clicks. + * + * @since 1.0.0 + */ + function groups_action_join_group() + { + } + /** + * Groups: Leave action + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Catch and process "Leave Group" button clicks. + * + * When a group member clicks on the "Leave Group" button from a group's page, + * this function is run. + * + * Note: When leaving a group from the group directory, AJAX is used and + * another function handles this. See {@link bp_legacy_theme_ajax_joinleave_group()}. + * + * @since 1.2.4 + */ + function groups_action_leave_group() + { + } + /** + * Clean up requests/invites when a member leaves a group. + * + * @since 5.0.0 + */ + function groups_action_clean_up_invites_requests($user_id, $group_id) + { + } + /** + * Groups: Create action + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Catch and process group creation form submissions. + * + * @since 1.2.0 + */ + function groups_action_create_group() + { + } + /** + * Sort the group creation steps. + * + * @since 1.1.0 + * + * @return false|null False on failure. + */ + function groups_action_sort_creation_steps() + { + } + /** + * Groups: Random group action handler + * + * @package BuddyPress + * @subpackage GroupActions + * @since 3.0.0 + */ + /** + * Catch requests for a random group page (example.com/groups/?random-group) and redirect. + * + * @since 1.2.0 + */ + function groups_action_redirect_to_random_group() + { + } + /** + * Register Groups JavaScripts. + * + * @since 5.0.0 + */ + function bp_groups_register_scripts() + { + } + /** + * Get JavaScript data for the Manage Group Members UI. + * + * @since 5.0.0 + * + * @param integer $group_id Required. The Group ID whose members has to be managed. + * @return array The JavaScript data. + */ + function bp_groups_get_group_manage_members_script_data($group_id = 0) + { + } + /** + * Registers a new script to manage the dynamic part of the Dynamic groups widget/block. + * + * @since 9.0.0 + * @since 12.0.0 Uses the `@wordpress/scripts` `index.asset.php` generated file to get dependencies. + * + * @param array $scripts Data about the scripts to register. + * @return array Data about the scripts to register. + */ + function bp_groups_register_widget_block_scripts($scripts = array()) + { + } + /** + * Slurp up metadata for a set of groups. + * + * This function is called in two places in the BP_Groups_Group class: + * - in the populate() method, when single group objects are populated + * - in the get() method, when multiple groups are queried + * + * It grabs all groupmeta associated with all of the groups passed in + * $group_ids and adds it to WP cache. This improves efficiency when using + * groupmeta within a loop context. + * + * @since 1.6.0 + * + * @param int|string|array|bool $group_ids Accepts a single group_id, or a + * comma-separated list or array of + * group ids. + */ + function bp_groups_update_meta_cache($group_ids = \false) + { + } + /** + * Clear the cached group count. + * + * @since 1.0.0 + * + * @param int $group_id Not used. + */ + function groups_clear_group_object_cache($group_id) + { + } + /** + * Bust group caches when editing or deleting. + * + * @since 1.7.0 + * + * @param int $group_id The group being edited. + */ + function bp_groups_delete_group_cache($group_id = 0) + { + } + /** + * Bust group cache when modifying metadata. + * + * @since 2.0.0 + * + * @param int $meta_id Meta ID. + * @param int $group_id Group ID. + */ + function bp_groups_delete_group_cache_on_metadata_change($meta_id, $group_id) + { + } + /** + * Clear caches for the group creator when a group is created. + * + * @since 1.6.0 + * + * @param int $group_id ID of the group. + * @param BP_Groups_Group $group_obj Group object. + */ + function bp_groups_clear_group_creator_cache($group_id, $group_obj) + { + } + /** + * Clears caches for all members in a group when a group is deleted. + * + * @since 1.6.0 + * + * @param BP_Groups_Group $group_obj Group object. + * @param array $user_ids User IDs who were in this group. + */ + function bp_groups_clear_group_members_caches($group_obj, $user_ids) + { + } + /** + * Clear a user's cached total group invite count. + * + * Count is cleared when an invite is accepted, rejected or deleted. + * + * @since 2.0.0 + * + * @param int $user_id The user ID. + */ + function bp_groups_clear_invite_count_for_user($user_id) + { + } + /** + * Clear a user's cached total group invite count when a user is uninvited. + * + * Groan. Our API functions are not consistent. + * + * @since 2.0.0 + * + * @param int $group_id The group ID. Not used in this function. + * @param int $user_id The user ID. + */ + function bp_groups_clear_invite_count_on_uninvite($group_id, $user_id) + { + } + /** + * Clear a user's cached total group invite count when a new invite is sent. + * + * @since 2.0.0 + * + * @param int $group_id The group ID. Not used in this function. + * @param array $invited_users Array of invited user IDs. + */ + function bp_groups_clear_invite_count_on_send($group_id, $invited_users) + { + } + /** + * Clear a user's cached group count. + * + * @since 1.2.0 + * + * @param int $group_id The group ID. Not used in this function. + * @param int $user_id The user ID. + */ + function groups_clear_group_user_object_cache($group_id, $user_id) + { + } + /** + * Clear group administrator and moderator cache. + * + * @since 2.1.0 + * + * @param int $group_id The group ID. + */ + function groups_clear_group_administrator_cache($group_id) + { + } + /** + * Clear group administrator and moderator cache when a group member is saved. + * + * This accounts for situations where group admins or mods are added manually + * using {@link BP_Groups_Member::save()}. Usually via a plugin. + * + * @since 2.1.0 + * + * @param BP_Groups_Member $member Member object. + */ + function groups_clear_group_administrator_cache_on_member_save(\BP_Groups_Member $member) + { + } + /** + * Clear group administrator and moderator cache when a group member is deleted. + * + * @since 4.0.0 + * + * @param int $user_id User ID. + * @param int $group_id Group ID. + */ + function bp_groups_clear_group_administrator_cache_on_member_delete($user_id, $group_id) + { + } + /** + * Clear the group type cache for a group. + * + * Called when group is deleted. + * + * @since 2.6.0 + * + * @param int $group_id The group ID. + */ + function groups_clear_group_type_cache($group_id = 0) + { + } + /** + * Clear caches on membership save. + * + * @since 2.6.0 + * + * @param BP_Groups_Member $member BP Groups Member instance. + */ + function bp_groups_clear_user_group_cache_on_membership_save(\BP_Groups_Member $member) + { + } + /** + * Clear caches on saving a group invitation or request. + * The save action is called when inserting a new record or using the save() method + * to update an existing record. + * + * @since 5.0.0 + * + * @param BP_Invitation object $invitation Characteristics of the invitation just saved. + */ + function bp_groups_clear_user_group_cache_on_invitation_save(\BP_Invitation $invitation) + { + } + /** + * Clear caches on invitation deletion or update. + * This also catches changes like sending an invite or marking one as accepted. + * + * @since 5.0.0 + * + * @param array $args Associative array of columns/values describing invitations about to be deleted. + */ + function bp_groups_clear_user_group_cache_on_invitation_change($args) + { + } + /** + * Clear group memberships cache on miscellaneous actions not covered by the 'after_save' hook. + * + * @since 2.6.0 + * + * @param int $user_id Current user ID. + * @param int $group_id Current group ID. + */ + function bp_groups_clear_user_group_cache_on_other_events($user_id, $group_id) + { + } + /** + * Reset cache incrementor for the Groups component. + * + * This function invalidates all cached results of group queries, + * whenever one of the following events takes place: + * - A group is created or updated. + * - A group is deleted. + * - A group's metadata is modified. + * + * @since 2.7.0 + * + * @return bool + */ + function bp_groups_reset_cache_incrementor() + { + } + /** + * Reset cache incrementor for Groups component when a group's taxonomy terms change. + * + * We infer that a group is being affected by looking at the objects belonging + * to the taxonomy being affected. + * + * @since 2.7.0 + * + * @param int $object_id ID of the item whose terms are being modified. + * @param array $terms Array of object terms. + * @param array $tt_ids Array of term taxonomy IDs. + * @param string $taxonomy Taxonomy slug. + * @return bool + */ + function bp_groups_reset_cache_incrementor_on_group_term_change($object_id, $terms, $tt_ids, $taxonomy) + { + } + /** + * Reset cache incrementor for Groups component when a group's taxonomy terms are removed. + * + * We infer that a group is being affected by looking at the objects belonging + * to the taxonomy being affected. + * + * @since 2.7.0 + * + * @param int $object_id ID of the item whose terms are being modified. + * @param array $terms Array of object terms. + * @param string $taxonomy Taxonomy slug. + * @return bool + */ + function bp_groups_reset_cache_incrementor_on_group_term_remove($object_id, $terms, $taxonomy) + { + } + /** + * Callback function to render the BP Group Block. + * + * @since 6.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_groups_render_group_block($attributes = array()) + { + } + /** + * Callback function to render the BP Groups Block. + * + * @since 7.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_groups_render_groups_block($attributes = array()) + { + } + /** + * Adds specific script data for the BP Groups blocks. + * + * Only used for the BP Dynamic Groups block. + * + * @since 9.0.0 + */ + function bp_groups_blocks_add_script_data() + { + } + /** + * Callback function to render the Dynamic Groups Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_groups_render_dynamic_groups_block($attributes = array()) + { + } + /** + * Set up the bp-groups component. + * + * @since 1.5.0 + */ + function bp_setup_groups() + { + } + /** + * Retrieve private message threads for display in inbox/sentbox/notices. + * + * Similar to WordPress's have_posts() function, this function is responsible + * for querying the database and retrieving private messages for display inside + * the theme via individual template parts for a member's inbox/sentbox/notices. + * + * @since 1.0.0 + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param array|string $args { + * Array of arguments. All are optional. + * @type int $user_id ID of the user whose threads are being loaded. + * Default: ID of the logged-in user. + * @type string $box Current "box" view. If not provided here, the current + * view will be inferred from the URL. + * @type int $per_page Number of results to return per page. Default: 10. + * @type int $max Max results to return. Default: false. + * @type string $type Type of messages to return. Values: 'all', 'read', 'unread' + * Default: 'all' + * @type string $search_terms Terms to which to limit results. Default: + * the value of $_REQUEST['s']. + * @type string $page_arg URL argument used for the pagination param. + * Default: 'mpage'. + * @type array $meta_query Meta query arguments. Only applicable if $box is + * not 'notices'. See WP_Meta_Query more details. + * @type int|null $recipients_page Page of recipients being requested. Default to null, meaning all. + * @type int|null $recipients_per_page Recipients to return per page. Defaults to null, meaning all. + * @type int|null $messages_page Page of messages being requested. Default to null, meaning all. + * @type int|null $messages_per_page Messages to return per page. Defaults to null, meaning all + * } + * @return bool True if there are threads to display, otherwise false. + */ + function bp_has_message_threads($args = array()) + { + } + /** + * Check whether there are more threads to iterate over. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return bool + */ + function bp_message_threads() + { + } + /** + * Set up the current thread inside the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return BP_Messages_Thread + */ + function bp_message_thread() + { + } + /** + * Output the ID of the current thread in the loop. + */ + function bp_message_thread_id() + { + } + /** + * Get the ID of the current thread in the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return int + */ + function bp_get_message_thread_id() + { + } + /** + * Output the subject of the current thread in the loop. + */ + function bp_message_thread_subject() + { + } + /** + * Get the subject of the current thread in the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_thread_subject() + { + } + /** + * Output an excerpt from the current message in the loop. + */ + function bp_message_thread_excerpt() + { + } + /** + * Generate an excerpt from the current message in the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_thread_excerpt() + { + } + /** + * Output the thread's last message content. + * + * When viewing your Inbox, the last message is the most recent message in + * the thread of which you are *not* the author. + * + * When viewing your Sentbox, last message is the most recent message in + * the thread of which you *are* the member. + * + * @since 2.0.0 + */ + function bp_message_thread_content() + { + } + /** + * Return the thread's last message content. + * + * When viewing your Inbox, the last message is the most recent message in + * the thread of which you are *not* the author. + * + * When viewing your Sentbox, last message is the most recent message in + * the thread of which you *are* the member. + * + * @since 2.0.0 + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string The raw content of the last message in the thread. + */ + function bp_get_message_thread_content() + { + } + /** + * Output a link to the page of the current thread's last author. + */ + function bp_message_thread_from() + { + } + /** + * Get a link to the page of the current thread's last author. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_thread_from() + { + } + /** + * Output links to the pages of the current thread's recipients. + */ + function bp_message_thread_to() + { + } + /** + * Generate HTML links to the pages of the current thread's recipients. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_thread_to() + { + } + /** + * Output the permalink for a particular thread. + * + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int $thread_id Optional. ID of the thread. Default: current thread + * being iterated on in the loop. + * @param int $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + */ + function bp_message_thread_view_link($thread_id = 0, $user_id = \null) + { + } + /** + * Get the permalink of a particular thread. + * + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param int $thread_id Optional. ID of the thread. Default: current + * thread being iterated on in the loop. + * @param int $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + * @return string + */ + function bp_get_message_thread_view_link($thread_id = 0, $user_id = \null) + { + } + /** + * Output the URL for deleting the current thread. + * + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + */ + function bp_message_thread_delete_link($user_id = \null) + { + } + /** + * Generate the URL for deleting the current thread. + * + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + * @return string + */ + function bp_get_message_thread_delete_link($user_id = \null) + { + } + /** + * Output the URL used for marking a single message thread as unread. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 2.2.0 + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + */ + function bp_the_message_thread_mark_unread_url($user_id = \null) + { + } + /** + * Return the URL used for marking a single message thread as unread. + * + * @since 2.2.0 + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + * @return string + */ + function bp_get_the_message_thread_mark_unread_url($user_id = \null) + { + } + /** + * Output the URL used for marking a single message thread as read. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 2.2.0 + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + */ + function bp_the_message_thread_mark_read_url($user_id = \null) + { + } + /** + * Return the URL used for marking a single message thread as read. + * + * @since 2.2.0 + * @since 2.9.0 Introduced `$user_id` parameter. + * + * @param int|null $user_id Optional. ID of the user relative to whom the link + * should be generated. Default: ID of logged-in user. + * @return string + */ + function bp_get_the_message_thread_mark_read_url($user_id = \null) + { + } + /** + * Output the CSS class for the current thread. + */ + function bp_message_css_class() + { + } + /** + * Generate the CSS class for the current thread. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_css_class() + { + } + /** + * Check whether the current thread has unread items. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return bool True if there are unread items, otherwise false. + */ + function bp_message_thread_has_unread() + { + } + /** + * Output the current thread's unread count. + */ + function bp_message_thread_unread_count() + { + } + /** + * Get the current thread's unread count. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return int + */ + function bp_get_message_thread_unread_count() + { + } + /** + * Output a thread's total message count. + * + * @since 2.2.0 + * + * @param int $thread_id Optional. ID of the thread. Defaults to current thread ID. + */ + function bp_message_thread_total_count($thread_id = \false) + { + } + /** + * Get the current thread's total message count. + * + * @since 2.2.0 + * + * @param int|bool $thread_id Optional. ID of the thread. + * Defaults to current thread ID. + * @return int + */ + function bp_get_message_thread_total_count($thread_id = \false) + { + } + /** + * Output markup for the current thread's total and unread count. + * + * @since 2.2.0 + * + * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID. + */ + function bp_message_thread_total_and_unread_count($thread_id = \false) + { + } + /** + * Get markup for the current thread's total and unread count. + * + * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID. + * @return string Markup displaying the total and unread count for the thread. + */ + function bp_get_message_thread_total_and_unread_count($thread_id = \false) + { + } + /** + * Output the unformatted date of the last post in the current thread. + */ + function bp_message_thread_last_post_date_raw() + { + } + /** + * Get the unformatted date of the last post in the current thread. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_thread_last_post_date_raw() + { + } + /** + * Output the nicely formatted date of the last post in the current thread. + */ + function bp_message_thread_last_post_date() + { + } + /** + * Get the nicely formatted date of the last post in the current thread. + * + * @return string + */ + function bp_get_message_thread_last_post_date() + { + } + /** + * Output the avatar for the last sender in the current message thread. + * + * @see bp_get_message_thread_avatar() for a description of arguments. + * + * @param array|string $args See {@link bp_get_message_thread_avatar()}. + */ + function bp_message_thread_avatar($args = '') + { + } + /** + * Return the avatar for the last sender in the current message thread. + * + * @see bp_core_fetch_avatar() For a description of arguments and + * return values. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $type Default: 'thumb'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type string $class Default: 'avatar'. + * @type string|bool $id Default: false. + * @type string $alt Default: 'Profile picture of [display name]'. + * } + * @return string User avatar string. + */ + function bp_get_message_thread_avatar($args = '') + { + } + /** + * Output the unread messages count for the current inbox. + * + * @since 2.6.x Added the `$user_id` parameter. + * + * @param int $user_id The user ID. + */ + function bp_total_unread_messages_count($user_id = 0) + { + } + /** + * Get the unread messages count for the current inbox. + * + * @since 2.6.x Added the `$user_id` parameter. + * + * @param int $user_id The user ID. + * + * @return int $unread_count Total inbox unread count for user. + */ + function bp_get_total_unread_messages_count($user_id = 0) + { + } + /** + * Output the pagination HTML for the current thread loop. + */ + function bp_messages_pagination() + { + } + /** + * Get the pagination HTML for the current thread loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_messages_pagination() + { + } + /** + * Generate the "Viewing message x to y (of z messages)" string for a loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + */ + function bp_messages_pagination_count() + { + } + /** + * Output the Private Message search form. + * + * @todo Move markup to template part in: /members/single/messages/search.php + * @since 1.6.0 + */ + function bp_message_search_form() + { + } + /** + * Echo the form action for Messages HTML forms. + */ + function bp_messages_form_action() + { + } + /** + * Return the form action for Messages HTML forms. + * + * @return string The form action. + */ + function bp_get_messages_form_action() + { + } + /** + * Output the default username for the recipient box. + */ + function bp_messages_username_value() + { + } + /** + * Get the default username for the recipient box. + * + * @return string + */ + function bp_get_messages_username_value() + { + } + /** + * Output the default value for the Subject field. + */ + function bp_messages_subject_value() + { + } + /** + * Get the default value for the Subject field. + * + * Will get a value out of $_POST['subject'] if available (ie after a + * failed submission). + * + * @return string + */ + function bp_get_messages_subject_value() + { + } + /** + * Output the default value for the Compose content field. + */ + function bp_messages_content_value() + { + } + /** + * Get the default value for the Compose content field. + * + * Will get a value out of $_POST['content'] if available (ie after a + * failed submission). + * + * @return string + */ + function bp_get_messages_content_value() + { + } + /** + * Output the markup for the message type dropdown. + */ + function bp_messages_options() + { + } + /** + * Output the dropdown for bulk management of messages. + * + * @since 2.2.0 + */ + function bp_messages_bulk_management_dropdown() + { + } + /** + * Return whether or not the notice is currently active. + * + * @since 1.6.0 + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return bool + */ + function bp_messages_is_active_notice() + { + } + /** + * Output a string for the active notice. + * + * Since 1.6 this function has been deprecated in favor of text in the theme. + * + * @since 1.0.0 + * @deprecated 1.6.0 + */ + function bp_message_is_active_notice() + { + } + /** + * Returns a string for the active notice. + * + * Since 1.6 this function has been deprecated in favor of text in the + * theme. + * + * @since 1.0.0 + * @deprecated 1.6.0 + * @return string + */ + function bp_get_message_is_active_notice() + { + } + /** + * Output the ID of the current notice in the loop. + */ + function bp_message_notice_id() + { + } + /** + * Get the ID of the current notice in the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return int + */ + function bp_get_message_notice_id() + { + } + /** + * Output the post date of the current notice in the loop. + */ + function bp_message_notice_post_date() + { + } + /** + * Get the post date of the current notice in the loop. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_notice_post_date() + { + } + /** + * Output the subject of the current notice in the loop. + * + * @since 5.0.0 The $notice parameter has been added. + * + * @param BP_Messages_Notice $notice The notice object. + */ + function bp_message_notice_subject($notice = \null) + { + } + /** + * Get the subject of the current notice in the loop. + * + * @since 5.0.0 The $notice parameter has been added. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param BP_Messages_Notice|null $notice The notice object. + * @return string + */ + function bp_get_message_notice_subject($notice = \null) + { + } + /** + * Output the text of the current notice in the loop. + * + * @since 5.0.0 The $notice parameter has been added. + * + * @param BP_Messages_Notice $notice The notice object. + */ + function bp_message_notice_text($notice = \null) + { + } + /** + * Get the text of the current notice in the loop. + * + * @since 5.0.0 The $notice parameter has been added. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @param BP_Messages_Notice|null $notice The notice object. + * @return string + */ + function bp_get_message_notice_text($notice = \null) + { + } + /** + * Output the URL for deleting the current notice. + */ + function bp_message_notice_delete_link() + { + } + /** + * Get the URL for deleting the current notice. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string Delete URL. + */ + function bp_get_message_notice_delete_link() + { + } + /** + * Output the URL for deactivating the current notice. + */ + function bp_message_activate_deactivate_link() + { + } + /** + * Get the URL for deactivating the current notice. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_activate_deactivate_link() + { + } + /** + * Output the Deactivate/Activate text for the notice action link. + */ + function bp_message_activate_deactivate_text() + { + } + /** + * Generate the text ('Deactivate' or 'Activate') for the notice action link. + * + * @global BP_Messages_Box_Template $messages_template The message box template loop class. + * + * @return string + */ + function bp_get_message_activate_deactivate_text() + { + } + /** + * Output the URL for dismissing the current notice for the current user. + * + * @since 9.0.0 + */ + function bp_message_notice_dismiss_link() + { + } + /** + * Get the URL for dismissing the current notice for the current user. + * + * @since 9.0.0 + * @return string URL for dismissing the current notice for the current user. + */ + function bp_get_message_notice_dismiss_link() + { + } + /** + * Output the messages component slug. + * + * @since 1.5.0 + * + */ + function bp_messages_slug() + { + } + /** + * Return the messages component slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_messages_slug() + { + } + /** + * Generate markup for currently active notices. + */ + function bp_message_get_notices() + { + } + /** + * Output the URL for the Private Message link in member profile headers. + */ + function bp_send_private_message_link() + { + } + /** + * Generate the URL for the Private Message link in member profile headers. + * + * @return bool|string False on failure, otherwise the URL. + */ + function bp_get_send_private_message_link() + { + } + /** + * Output the 'Private Message' button for member profile headers. + * + * Explicitly named function to avoid confusion with public messages. + * + * @since 1.2.6 + * + */ + function bp_send_private_message_button() + { + } + /** + * Output the 'Private Message' button for member profile headers. + * + * @since 1.2.0 + * @since 3.0.0 Added `$args` parameter. + * + * @see bp_get_send_message_button_args() for description of parameters. + * + * @param array|string $args See {@link bp_get_send_message_button_args()}. + */ + function bp_send_message_button($args = '') + { + } + /** + * Get the arguments for the private message button. + * + * @since 11.0.0 + * + * @param array|string $args { + * All arguments are optional. See {@link BP_Button} for complete + * descriptions. + * @type string $id Default: 'private_message'. + * @type string $component Default: 'messages'. + * @type bool $must_be_logged_in Default: true. + * @type bool $block_self Default: true. + * @type string $wrapper_id Default: 'send-private-message'. + * @type string $link_href Default: the private message link for + * the current member in the loop. + * @type string $link_title Default: 'Send a private message to this member.'. + * @type string $link_text Default: 'Private Message'. + * @type string $link_class Default: 'send-message'. + * } + * @return array The arguments for the public message button. + */ + function bp_get_send_message_button_args($args = '') + { + } + /** + * Generate the 'Private Message' button for member profile headers. + * + * @since 1.2.0 + * @since 3.0.0 Added `$args` parameter. + * @since 11.0.0 uses `bp_get_send_message_button_args()`. + * + * @see bp_get_send_message_button_args() for description of parameters. + * + * @param array|string $args See {@link bp_get_send_message_button_args()}. + * @return string + */ + function bp_get_send_message_button($args = '') + { + } + /** + * Output the URL of the Messages AJAX loader gif. + */ + function bp_message_loading_image_src() + { + } + /** + * Get the URL of the Messages AJAX loader gif. + * + * @return string + */ + function bp_get_message_loading_image_src() + { + } + /** + * Output the markup for the message recipient tabs. + */ + function bp_message_get_recipient_tabs() + { + } + /** + * Output recipient usernames for prefilling the 'To' field on the Compose screen. + */ + function bp_message_get_recipient_usernames() + { + } + /** + * Get the recipient usernames for prefilling the 'To' field on the Compose screen. + * + * @return string + */ + function bp_get_message_get_recipient_usernames() + { + } + /** + * Initialize the messages template loop for a specific thread. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @param array|string $args { + * Array of arguments. All are optional. + * @type int $thread_id Optional. ID of the thread whose messages you are displaying. + * Default: if viewing a thread, the thread ID will be parsed from + * the URL (bp_action_variable( 0 )). + * @type string $order Optional. 'ASC' or 'DESC'. Default: 'ASC'. + * @type bool $update_meta_cache Optional. Whether to pre-fetch metadata for + * queried message items. Default: true. + * @type int|null $page Page of messages being requested. Default to null, meaning all. + * @type int|null $per_page Messages to return per page. Default to null, meaning all. + * } + * + * @return bool True if there are messages to display, otherwise false. + */ + function bp_thread_has_messages($args = '') + { + } + /** + * Output the 'ASC' or 'DESC' messages order string for this loop. + */ + function bp_thread_messages_order() + { + } + /** + * Get the 'ASC' or 'DESC' messages order string for this loop. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_thread_messages_order() + { + } + /** + * Check whether there are more messages to iterate over. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return bool + */ + function bp_thread_messages() + { + } + /** + * Set up the current thread inside the loop. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return BP_Messages_Message + */ + function bp_thread_the_message() + { + } + /** + * Output the ID of the thread that the current loop belongs to. + */ + function bp_the_thread_id() + { + } + /** + * Get the ID of the thread that the current loop belongs to. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return int + */ + function bp_get_the_thread_id() + { + } + /** + * Output the subject of the thread currently being iterated over. + */ + function bp_the_thread_subject() + { + } + /** + * Get the subject of the thread currently being iterated over. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_subject() + { + } + /** + * Get a list of thread recipients or a "x recipients" string. + * + * In BuddyPress 2.2.0, this parts of this functionality were moved into the + * members/single/messages/single.php template. This function is no longer used + * by BuddyPress. + * + * @return string + */ + function bp_get_the_thread_recipients() + { + } + /** + * Get the number of recipients in the current thread. + * + * @since 2.2.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return int + */ + function bp_get_thread_recipients_count() + { + } + /** + * Get the max number of recipients to list in the 'Conversation between...' gloss. + * + * @since 2.3.0 + * + * @return int + */ + function bp_get_max_thread_recipients_to_list() + { + } + /** + * Output HTML links to recipients in the current thread. + * + * @since 2.2.0 + */ + function bp_the_thread_recipients_list() + { + } + /** + * Generate HTML links to the profiles of recipients in the current thread. + * + * @since 2.2.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_thread_recipients_list() + { + } + /** + * Echo the ID of the current message in the thread. + * + * @since 1.9.0 + */ + function bp_the_thread_message_id() + { + } + /** + * Get the ID of the current message in the thread. + * + * @since 1.9.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return int + */ + function bp_get_the_thread_message_id() + { + } + /** + * Output the CSS classes for messages within a single thread. + * + * @since 2.1.0 + */ + function bp_the_thread_message_css_class() + { + } + /** + * Generate the CSS classes for messages within a single thread. + * + * @since 2.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_message_css_class() + { + } + /** + * Output the CSS class used for message zebra striping. + */ + function bp_the_thread_message_alt_class() + { + } + /** + * Get the CSS class used for message zebra striping. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_message_alt_class() + { + } + /** + * Output the ID for message sender within a single thread. + * + * @since 2.1.0 + */ + function bp_the_thread_message_sender_id() + { + } + /** + * Return the ID for message sender within a single thread. + * + * @since 2.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return int + */ + function bp_get_the_thread_message_sender_id() + { + } + /** + * Output the avatar for the current message sender. + * + * @param array|string $args See {@link bp_get_the_thread_message_sender_avatar_thumb()} + * for a description. + */ + function bp_the_thread_message_sender_avatar($args = '') + { + } + /** + * Get the avatar for the current message sender. + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @param array|string $args { + * Array of arguments. See {@link bp_core_fetch_avatar()} for more + * complete details. All arguments are optional. + * @type string $type Avatar type. Default: 'thumb'. + * @type int $width Avatar width. Default: default for your $type. + * @type int $height Avatar height. Default: default for your $type. + * } + * @return string <img> tag containing the avatar. + */ + function bp_get_the_thread_message_sender_avatar_thumb($args = '') + { + } + /** + * Output a link to the sender of the current message. + * + * @since 1.1.0 + */ + function bp_the_thread_message_sender_link() + { + } + /** + * Get a link to the sender of the current message. + * + * @since 1.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_message_sender_link() + { + } + /** + * Output the display name of the sender of the current message. + * + * @since 1.1.0 + */ + function bp_the_thread_message_sender_name() + { + } + /** + * Get the display name of the sender of the current message. + * + * @since 1.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_message_sender_name() + { + } + /** + * Output the URL for deleting the current thread. + * + * @since 1.5.0 + */ + function bp_the_thread_delete_link() + { + } + /** + * Get the URL for deleting the current thread. + * + * @since 1.5.0 + * + * @return string URL + */ + function bp_get_the_thread_delete_link() + { + } + /** + * Output the URL to exit the current thread. + * + * @since 10.0.0 + */ + function bp_the_thread_exit_link() + { + } + /** + * Get the URL to exit the current thread. + * + * @since 10.0.0 + * + * @return string URL + */ + function bp_get_the_thread_exit_link() + { + } + /** + * Output the 'Sent x hours ago' string for the current message. + * + * @since 1.1.0 + */ + function bp_the_thread_message_time_since() + { + } + /** + * Generate the 'Sent x hours ago' string for the current message. + * + * @since 1.1.0 + * + * @return string + */ + function bp_get_the_thread_message_time_since() + { + } + /** + * Output the timestamp for the current message. + * + * @since 2.1.0 + */ + function bp_the_thread_message_date_sent() + { + } + /** + * Generate the 'Sent x hours ago' string for the current message. + * + * @since 2.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return int + */ + function bp_get_the_thread_message_date_sent() + { + } + /** + * Output the content of the current message in the loop. + * + * @since 1.1.0 + */ + function bp_the_thread_message_content() + { + } + /** + * Get the content of the current message in the loop. + * + * @since 1.1.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + * + * @return string + */ + function bp_get_the_thread_message_content() + { + } + /** Embeds *******************************************************************/ + /** + * Enable oEmbed support for Messages. + * + * @since 1.5.0 + * + * @see BP_Embed + */ + function bp_messages_embed() + { + } + /** + * Fetch a private message item's cached embeds. + * + * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}. + * + * @since 2.2.0 + * + * @param string $cache An empty string passed by BP_Embed::parse_oembed() for + * functions like this one to filter. + * @param int $id The ID of the message item. + * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). + * @return mixed The cached embeds for this message item. + */ + function bp_embed_message_cache($cache, $id, $cachekey) + { + } + /** + * Set a private message item's embed cache. + * + * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}. + * + * @since 2.2.0 + * + * @param string $cache An empty string passed by BP_Embed::parse_oembed() for + * functions like this one to filter. + * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). + * @param int $id The ID of the message item. + */ + function bp_embed_message_save_cache($cache, $cachekey, $id) + { + } + /** + * Callback function to render the BP Sitewide Notices Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_messages_render_sitewide_notices_block($attributes = array()) + { + } + /** + * Set up the bp-messages component. + * + * @since 1.5.0 + */ + function bp_setup_messages() + { + } + /** + * Create a new message. + * + * @since 2.4.0 Added 'error_type' as an additional $args parameter. + * + * @param array|string $args { + * Array of arguments. + * @type int $sender_id Optional. ID of the user who is sending the + * message. Default: ID of the logged-in user. + * @type int $thread_id Optional. ID of the parent thread. Leave blank to + * create a new thread for the message. + * @type array $recipients IDs or usernames of message recipients. If this + * is an existing thread, it is unnecessary to pass a $recipients + * argument - existing thread recipients will be assumed. + * @type string $subject Optional. Subject line for the message. For + * existing threads, the existing subject will be used. For new + * threads, 'No Subject' will be used if no $subject is provided. + * @type string $content Content of the message. Cannot be empty. + * @type string $date_sent Date sent, in 'Y-m-d H:i:s' format. Default: current date/time. + * @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'. + * } + * + * @return int|bool|WP_Error ID of the message thread on success, false on failure. + */ + function messages_new_message($args = '') + { + } + /** + * Send a notice. + * + * @param string $subject Subject of the notice. + * @param string $message Content of the notice. + * @return bool + */ + function messages_send_notice($subject, $message) + { + } + /** + * Deletes message thread(s) for a given user. + * + * Note that "deleting" a thread for a user means removing it from the user's + * message boxes. A thread is not deleted from the database until it's been + * "deleted" by all recipients. + * + * @since 2.7.0 The $user_id parameter was added. Previously the current user + * was always assumed. + * + * @param int|array $thread_ids Thread ID or array of thread IDs. + * @param int $user_id ID of the user to delete the threads for. Defaults + * to the current logged-in user. + * @return bool + */ + function messages_delete_thread($thread_ids, $user_id = 0) + { + } + /** + * Check whether a user has access to a thread. + * + * @param int $thread_id ID of the thread. + * @param int $user_id Optional. ID of the user. Default: ID of the logged-in user. + * @return int|null Message ID if the user has access, otherwise null. + */ + function messages_check_thread_access($thread_id, $user_id = 0) + { + } + /** + * Mark a thread as read. + * + * Wrapper for {@link BP_Messages_Thread::mark_as_read()}. + * + * @since 9.0.0 Added the `user_id` parameter. + * + * @param int $thread_id The message thread ID. + * @param int $user_id Optional. The user the thread will be marked as read. + * + * @return false|int Number of threads marked as read or false on error. + */ + function messages_mark_thread_read($thread_id, $user_id = 0) + { + } + /** + * Mark a thread as unread. + * + * Wrapper for {@link BP_Messages_Thread::mark_as_unread()}. + * + * @since 9.0.0 Added the `user_id` parameter. + * + * @param int $thread_id The message thread ID. + * @param int $user_id Optional. The user the thread will be marked as unread. + * + * @return false|int Number of threads marked as unread or false on error. + */ + function messages_mark_thread_unread($thread_id, $user_id = 0) + { + } + /** + * Set messages-related cookies. + * + * Saves the 'bp_messages_send_to', 'bp_messages_subject', and + * 'bp_messages_content' cookies, which are used when setting up the default + * values on the messages page. + * + * @param string $recipients Comma-separated list of recipient usernames. + * @param string $subject Subject of the message. + * @param string $content Content of the message. + */ + function messages_add_callback_values($recipients, $subject, $content) + { + } + /** + * Unset messages-related cookies. + * + * @see messages_add_callback_values() + */ + function messages_remove_callback_values() + { + } + /** + * Get the unread messages count for a user. + * + * @param int $user_id Optional. ID of the user. Default: ID of the logged-in user. + * @return int + */ + function messages_get_unread_count($user_id = 0) + { + } + /** + * Check whether a user is the sender of a message. + * + * @param int $user_id ID of the user. + * @param int $message_id ID of the message. + * @return int|null Returns the ID of the message if the user is the + * sender, otherwise null. + */ + function messages_is_user_sender($user_id, $message_id) + { + } + /** + * Get the ID of the sender of a message. + * + * @param int $message_id ID of the message. + * @return int|null The ID of the sender if found, otherwise null. + */ + function messages_get_message_sender($message_id) + { + } + /** + * Check whether a message thread exists. + * + * @param int $thread_id ID of the thread. + * @return false|int|null The message thread ID on success, null on failure. + */ + function messages_is_valid_thread($thread_id) + { + } + /** + * Get the thread ID from a message ID. + * + * @since 2.3.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $message_id ID of the message. + * @return int The ID of the thread if found, otherwise 0. + */ + function messages_get_message_thread_id($message_id = 0) + { + } + /** Messages Meta *******************************************************/ + /** + * Delete metadata for a message. + * + * If $meta_key is false, this will delete all meta for the message ID. + * + * @since 2.2.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @see delete_metadata() for full documentation excluding $meta_type variable. + * + * @param int $message_id ID of the message to have meta deleted for. + * @param string|bool $meta_key Meta key to delete. Default false. + * @param string|bool $meta_value Meta value to delete. Default false. + * @param bool $delete_all Whether or not to delete all meta data. + * @return bool + */ + function bp_messages_delete_meta($message_id, $meta_key = \false, $meta_value = \false, $delete_all = \false) + { + } + /** + * Get a piece of message metadata. + * + * @since 2.2.0 + * + * @see get_metadata() for full documentation excluding $meta_type variable. + * + * @param int $message_id ID of the message to retrieve meta for. + * @param string $meta_key Meta key to retrieve. Default empty string. + * @param bool $single Whether or not to fetch all or a single value. + * @return mixed + */ + function bp_messages_get_meta($message_id, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of message metadata. + * + * @since 2.2.0 + * + * @see update_metadata() for full documentation excluding $meta_type variable. + * + * @param int $message_id ID of the message to have meta deleted for. + * @param string|bool $meta_key Meta key to update. + * @param string|bool $meta_value Meta value to update. + * @param string $prev_value If specified, only update existing metadata entries with + * the specified value. Otherwise, update all entries. + * @return mixed + */ + function bp_messages_update_meta($message_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of message metadata. + * + * @since 2.2.0 + * + * @see add_metadata() for full documentation excluding $meta_type variable. + * + * @param int $message_id ID of the message to have meta deleted for. + * @param string|bool $meta_key Meta key to update. + * @param string|bool $meta_value Meta value to update. + * @param bool $unique Whether the specified metadata key should be + * unique for the object. If true, and the object + * already has a value for the specified metadata key, + * no change will be made. + * @return mixed + */ + function bp_messages_add_meta($message_id, $meta_key, $meta_value, $unique = \false) + { + } + /** Email *********************************************************************/ + /** + * Email message recipients to alert them of a new unread private message. + * + * @since 1.0.0 + * + * @param array|BP_Messages_Message $raw_args { + * Array of arguments. Also accepts a BP_Messages_Message object. + * @type array $recipients User IDs of recipients. + * @type string $email_subject Subject line of message. + * @type string $email_content Content of message. + * @type int $sender_id User ID of sender. + * } + */ + function messages_notification_new_message($raw_args = array()) + { + } + /** + * Finds and exports personal data associated with an email address from the Messages tables. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_messages_personal_data_exporter($email_address, $page) + { + } + /** + * Dismiss a sitewide notice for a user. + * + * @since 9.0.0 + * + * @param int $user_id ID of the user to dismiss the notice for. + * Defaults to the logged-in user. + * @param int $notice_id ID of the notice to be dismissed. + * Defaults to the currently active notice. + * @return bool False on failure, true if notice is dismissed + * (or was already dismissed). + */ + function bp_messages_dismiss_sitewide_notice($user_id = 0, $notice_id = 0) + { + } + /** + * Exit one or more message thread(s) for a given user. + * + * @since 10.0.0 + * + * @param int|array $thread_ids Thread ID or array of thread IDs. + * @param int $user_id ID of the user to delete the threads for. Defaults + * to the current logged-in user. + * @return bool + */ + function bp_messages_exit_thread($thread_ids, $user_id = 0) + { + } + /** + * Messages: User's "Messages > Starred" screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Screen handler to display a user's "Starred" private messages page. + * + * @since 2.3.0 + */ + function bp_messages_star_screen() + { + } + /** + * Screen content callback to display a user's "Starred" messages page. + * + * @since 2.3.0 + */ + function bp_messages_star_content() + { + } + /** + * Messages: User's "Messages > Sent" screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Load the Messages > Sent screen. + * + * @since 1.0.0 + */ + function messages_screen_sentbox() + { + } + /** + * Messages: User's "Messages > Compose" screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Load the Messages > Compose screen. + * + * @since 1.0.0 + */ + function messages_screen_compose() + { + } + /** + * Messages: User's "Messages" screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Load the Messages > Inbox screen. + * + * @since 1.0.0 + */ + function messages_screen_inbox() + { + } + /** + * Messages: User's "Messages > Notices" screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Load the Messages > Notices screen. + * + * @since 1.0.0 + */ + function messages_screen_notices() + { + } + /** + * Messages: Conversation thread screen handler. + * + * @package BuddyPress + * @subpackage MessageScreens + * @since 3.0.0 + */ + /** + * Load an individual conversation screen. + * + * @since 1.0.0 + */ + function messages_screen_conversation() + { + } + /** + * Format notifications for the Messages component. + * + * @since 1.0.0 + * + * @param string $action The kind of notification being rendered. + * @param int $item_id The primary item id. + * @param int $secondary_item_id The secondary item id. + * @param int $total_items The total number of messaging-related notifications + * waiting for the user. + * @param string $format 'string' for notification HTML link or 'array' for separate link and text. + * @return string|array Formatted notifications. + */ + function messages_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string') + { + } + /** + * Send notifications to message recipients. + * + * @since 1.9.0 + * + * @param BP_Messages_Message $message Message object. + */ + function bp_messages_message_sent_add_notification($message) + { + } + /** + * Mark new message notification when member reads a message thread directly. + * + * @since 1.9.0 + * + * @global BP_Messages_Thread_Template $thread_template Message Thread Template Class. + */ + function bp_messages_screen_conversation_mark_notifications() + { + } + /** + * Mark new message notification as read when the corresponding message is mark read. + * + * This callback covers mark-as-read bulk actions. + * + * @since 3.0.0 + * + * @param int $thread_id ID of the thread being marked as read. + * @param int $user_id ID of the user who read the thread. + * @param int $num_rows The number of affected rows by the "mark read" update query. + * @return bool False otherwise. + */ + function bp_messages_mark_notification_on_mark_thread($thread_id, $user_id = 0, $num_rows = 0) + { + } + /** + * When a message is deleted, delete corresponding notifications. + * + * @since 2.0.0 + * + * @param int $thread_id ID of the thread. + * @param int[] $message_ids The list of message IDs to delete. + */ + function bp_messages_message_delete_notifications($thread_id, $message_ids) + { + } + /** + * Render the markup for the Messages section of Settings > Notifications. + * + * @since 1.0.0 + */ + function messages_screen_notification_settings() + { + } + /** + * Enqueue the JS for messages autocomplete. + */ + function messages_add_autocomplete_js() + { + } + /** + * Enqueue the CSS for messages autocomplete. + * + * @todo Why do we call wp_print_styles()? + */ + function messages_add_autocomplete_css() + { + } + /** + * Print inline JS for initializing the messages autocomplete. + * + * @todo Why is this here and not in a properly enqueued file? + */ + function messages_autocomplete_init_jsblock() + { + } + /** + * Registers a new script to manage the dismissal action for the Sitewide notice widget/block. + * + * @since 9.0.0 + * + * @param array $scripts Data about the scripts to register. + * @return array Data about the scripts to register. + */ + function bp_messages_register_scripts($scripts = array()) + { + } + /** + * Messages: Bulk-manage star action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Bulk manage handler to set the star status for multiple messages. + * + * @since 2.3.0 + */ + function bp_messages_star_bulk_manage_handler() + { + } + /** + * Messages: Compose action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Handle creating of private messages or sitewide notices + * + * @since 2.4.0 This function was split from messages_screen_compose(). See #6505. + * + * @return bool + */ + function bp_messages_action_create_message() + { + } + /** + * Messages: Edit notice action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Handle editing of sitewide notices. + * + * @since 2.4.0 This function was split from messages_screen_notices(). See #6505. + * + * @return bool + */ + function bp_messages_action_edit_notice() + { + } + /** + * Handle user dismissal of sitewide notices. + * + * @since 9.0.0 + * + * @return bool False on failure. + */ + function bp_messages_action_dismiss_notice() + { + } + /** + * Messages: Unread action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Handle marking a single message thread as unread. + * + * @since 2.2.0 + * + * @return bool Returns false on failure. Otherwise redirects back to the + * message box URL. + */ + function bp_messages_action_mark_unread() + { + } + /** + * Messages: Bulk-delete action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Process a request to bulk delete messages. + * + * @return bool False on failure. + */ + function messages_action_bulk_delete() + { + } + /** + * Messages: Read action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Handle marking a single message thread as read. + * + * @since 2.2.0 + * + * @return bool Returns false on failure. Otherwise redirects back to the + * message box URL. + */ + function bp_messages_action_mark_read() + { + } + /** + * Messages: View action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Process a request to view a single message thread. + * + * @return bool False if not a single conversation. + */ + function messages_action_conversation() + { + } + /** + * Messages: Bulk-manage action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Handle bulk management (mark as read/unread, delete) of message threads. + * + * @since 2.2.0 + * + * @return bool Returns false on failure. Otherwise redirects back to the + * message box URL. + */ + function bp_messages_action_bulk_manage() + { + } + /** + * Messages: Exit action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 10.0.0 + */ + /** + * Process a request to exit a messages thread. + * + * @since 10.0.0 + */ + function bp_messages_action_exit_thread() + { + } + /** + * Messages: Delete action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Process a request to delete a message. + * + * @return bool False on failure. + */ + function messages_action_delete_message() + { + } + /** + * Messages: Star action handler. + * + * @package BuddyPress + * @subpackage MessageActions + * @since 3.0.0 + */ + /** + * Action handler to set a message's star status for those not using JS. + * + * @since 2.3.0 + */ + function bp_messages_star_action_handler() + { + } + /** + * Slurp up metadata for a set of messages. + * + * It grabs all message meta associated with all of the messages passed in + * $message_ids and adds it to WP cache. This improves efficiency when using + * message meta within a loop context. + * + * @since 2.2.0 + * + * @param int|string|array|bool $message_ids Accepts a single message_id, or a + * comma-separated list or array of message ids. + */ + function bp_messages_update_meta_cache($message_ids = \false) + { + } + /** + * Clear message cache after a message is saved. + * + * @since 2.0.0 + * + * @param BP_Messages_Message $message Message being saved. + */ + function bp_messages_clear_cache_on_message_save($message) + { + } + /** + * Clear message cache after a message thread is deleted. + * + * @since 2.0.0 + * + * @param int|array $thread_ids If single thread, the thread ID. + * Otherwise, an array of thread IDs. + * @param int $user_id ID of the user that the threads were deleted for. + */ + function bp_messages_clear_cache_on_message_delete($thread_ids, $user_id) + { + } + /** + * Invalidate cache for notices. + * + * Currently, invalidates active notice cache. + * + * @since 2.0.0 + */ + function bp_notices_clear_cache() + { + } + /** + * Enforce limitations on viewing private message contents + * + * @since 2.3.2 + * + * @see bp_has_message_threads() for description of parameters + * + * @param array|string $args See {@link bp_has_message_threads()}. + * @return array|string + */ + function bp_messages_enforce_current_user($args = array()) + { + } + /** + * Custom kses filtering for message content. + * + * @since 3.0.0 + * + * @param string $content The message content. + * @return string The filtered message content. + */ + function bp_messages_filter_kses($content) + { + } + /** + * Register Messages personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_messages_register_personal_data_exporter($exporters) + { + } + /** UTILITY ****************************************************************/ + /** + * Return the starred messages slug. Defaults to 'starred'. + * + * @since 2.3.0 + * + * @return string + */ + function bp_get_messages_starred_slug() + { + } + /** + * Function to determine if a message ID is starred. + * + * @since 2.3.0 + * + * @param int $mid The message ID. Please note that this isn't the message thread ID. + * @param int $user_id The user ID. + * @return bool + */ + function bp_messages_is_message_starred($mid = 0, $user_id = 0) + { + } + /** + * Output the link or raw URL for starring or unstarring a message. + * + * @since 2.3.0 + * + * @param array $args See bp_get_the_message_star_action_link() for full documentation. + */ + function bp_the_message_star_action_link($args = array()) + { + } + /** + * Return the link or raw URL for starring or unstarring a message. + * + * @since 2.3.0 + * + * @param array $args { + * Array of arguments. + * @type int $user_id The user ID. Defaults to the logged-in user ID. + * @type int $thread_id The message thread ID. Default: 0. If not zero, this takes precedence over + * $message_id. + * @type int $message_id The individual message ID. If on a single thread page, defaults to the + * current message ID in the message loop. + * @type bool $url_only Whether to return the URL only. If false, returns link with markup. + * Default: false. + * @type string $text_unstar Link text for the 'unstar' action. Only applicable if $url_only is false. + * @type string $text_star Link text for the 'star' action. Only applicable if $url_only is false. + * @type string $title_unstar Link title for the 'unstar' action. Only applicable if $url_only is false. + * @type string $title_star Link title for the 'star' action. Only applicable if $url_only is false. + * @type string $title_unstar_thread Link title for the 'unstar' action when displayed in a thread loop. + * Only applicable if $message_id is set and if $url_only is false. + * @type string $title_star_thread Link title for the 'star' action when displayed in a thread loop. + * Only applicable if $message_id is set and if $url_only is false. + * } + * @return string + */ + function bp_get_the_message_star_action_link($args = array()) + { + } + /** + * Save or delete star message meta according to a message's star status. + * + * @since 2.3.0 + * + * @param array $args { + * Array of arguments. + * @type string $action The star action. Either 'star' or 'unstar'. Default: 'star'. + * @type int $thread_id The message thread ID. Default: 0. If not zero, this takes precedence over + * $message_id. + * @type int $message_id The individual message ID to star or unstar. Default: 0. + * @type int $user_id The user ID. Defaults to the logged-in user ID. + * @type bool $bulk Whether to mark all messages in a thread as a certain action. Only relevant + * when $action is 'unstar' at the moment. Default: false. + * } + * @return bool + */ + function bp_messages_star_set_action($args = array()) + { + } + /** HOOKS ****************************************************************/ + /** + * Enqueues the dashicons font. + * + * The dashicons font is used for the star / unstar icon. + * + * @since 2.3.0 + */ + function bp_messages_star_enqueue_scripts() + { + } + /** + * Add the "Add star" and "Remove star" options to the bulk management list. + * + * @since 2.3.0 + */ + function bp_messages_star_bulk_management_dropdown() + { + } + /** + * Add CSS class for the current message depending on starred status. + * + * @since 2.3.0 + * + * @param array $retval Current CSS classes. + * @return array + */ + function bp_messages_star_message_css_class($retval = array()) + { + } + /** + * Filter message threads by those starred by the logged-in user. + * + * @since 2.3.0 + * + * @param array $r Current message thread arguments. + * @return array $r Array of starred message threads. + */ + function bp_messages_filter_starred_message_threads($r = array()) + { + } + /** + * Add the Create a Group button to the Groups directory title. + * + * The bp-legacy puts the Create a Group button into the page title, to mimic + * the behavior of bp-default. + * + * @since 2.0.0 + * @deprecated 12.0.0 + * + * @param string $title Groups directory title. + * @return string + */ + function bp_legacy_theme_group_create_button($title) + { + } + /** + * Add the Create a Group nav to the Groups directory navigation. + * + * The bp-legacy puts the Create a Group nav at the last position of + * the Groups directory navigation. + * + * @since 2.2.0 + * + */ + function bp_legacy_theme_group_create_nav() + { + } + /** + * Renders the group ID hidden input on group admin screens. + * + * @since 2.7.0 + * + * @return string|null html + */ + function bp_legacy_groups_admin_screen_hidden_input() + { + } + /** + * Add the Create a Site button to the Sites directory title. + * + * The bp-legacy puts the Create a Site button into the page title, to mimic + * the behavior of bp-default. + * + * @since 2.0.0 + * @deprecated 12.0.0 + * + * @param string $title Sites directory title. + * @return string + */ + function bp_legacy_theme_blog_create_button($title) + { + } + /** + * Add the Create a Site nav to the Sites directory navigation. + * + * The bp-legacy puts the Create a Site nav at the last position of + * the Sites directory navigation. + * + * @since 2.2.0 + * + */ + function bp_legacy_theme_blog_create_nav() + { + } + /** + * This function looks scarier than it actually is. :) + * Each object loop (activity/members/groups/blogs/forums) contains default + * parameters to show specific information based on the page we are currently + * looking at. + * + * The following function will take into account any cookies set in the JS and + * allow us to override the parameters sent. That way we can change the results + * returned without reloading the page. + * + * By using cookies we can also make sure that user settings are retained + * across page loads. + * + * @since 1.2.0 + * + * @param string $query_string Query string for the current request. + * @param string $object Object for cookie. + * @return string Query string for the component loops. + */ + function bp_legacy_theme_ajax_querystring($query_string, $object) + { + } + /** + * Load the template loop for the current object. + * + * @since 1.2.0 + * + * @return string|null Prints template loop for the specified object + */ + function bp_legacy_theme_object_template_loader() + { + } + /** + * Load messages template loop when searched on the private message page + * + * @since 1.6.0 + * + * @return string|null Prints template loop for the Messages component. + */ + function bp_legacy_theme_messages_template_loader() + { + } + /** + * Load group invitations loop to handle pagination requests sent via AJAX. + * + * @since 2.0.0 + */ + function bp_legacy_theme_invite_template_loader() + { + } + /** + * Load group membership requests loop to handle pagination requests sent via AJAX. + * + * @since 2.0.0 + */ + function bp_legacy_theme_requests_template_loader() + { + } + /** + * Load the activity loop template when activity is requested via AJAX. + * + * @since 1.2.0 + * + * @return string|null JSON object containing 'contents' (output of the template loop + * for the Activity component) and 'feed_url' (URL to the relevant RSS feed). + */ + function bp_legacy_theme_activity_template_loader() + { + } + /** + * Processes Activity updates received via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_post_update() + { + } + /** + * Posts new Activity comments received via a POST request. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string|null HTML + */ + function bp_legacy_theme_new_activity_comment() + { + } + /** + * Deletes an Activity item received via a POST request. + * + * @since 1.2.0 + */ + function bp_legacy_theme_delete_activity() + { + } + /** + * Deletes an Activity comment received via a POST request. + * + * @since 1.2.0 + */ + function bp_legacy_theme_delete_activity_comment() + { + } + /** + * AJAX spam an activity item or comment. + * + * @since 1.6.0 + */ + function bp_legacy_theme_spam_activity() + { + } + /** + * Mark an activity as a favourite via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_mark_activity_favorite() + { + } + /** + * Un-favourite an activity via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_unmark_activity_favorite() + { + } + /** + * Fetches an activity's full, non-excerpted content via a POST request. + * Used for the 'Read More' link on long activity items. + * + * @since 1.5.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_get_single_activity_content() + { + } + /** + * Invites a friend to join a group via a POST request. + * + * @since 1.2.0 + * + * @todo Audit return types + */ + function bp_legacy_theme_ajax_invite_user() + { + } + /** + * Friend/un-friend a user via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_ajax_addremove_friend() + { + } + /** + * Accept a user friendship request via a POST request. + * + * @since 1.2.0 + */ + function bp_legacy_theme_ajax_accept_friendship() + { + } + /** + * Reject a user friendship request via a POST request. + * + * @since 1.2.0 + */ + function bp_legacy_theme_ajax_reject_friendship() + { + } + /** + * Join or leave a group when clicking the "join/leave" button via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_ajax_joinleave_group() + { + } + /** + * Close and keep closed site wide notices from an admin in the sidebar, via a POST request. + * + * @since 1.2.0 + */ + function bp_legacy_theme_ajax_close_notice() + { + } + /** + * Send a private message reply to a thread via a POST request. + * + * @since 1.2.0 + * + * @return string|null HTML + */ + function bp_legacy_theme_ajax_messages_send_reply() + { + } + /** + * Mark a private message as unread in your inbox via a POST request. + * + * No longer used. + * + * @since 1.2.0 + * @deprecated 2.2.0 + */ + function bp_legacy_theme_ajax_message_markunread() + { + } + /** + * Mark a private message as read in your inbox via a POST request. + * + * No longer used. + * + * @since 1.2.0 + * @deprecated 2.2.0 + */ + function bp_legacy_theme_ajax_message_markread() + { + } + /** + * Delete a private message(s) in your inbox via a POST request. + * + * No longer used. + * + * @since 1.2.0 + * @deprecated 2.2.0 + */ + function bp_legacy_theme_ajax_messages_delete() + { + } + /** + * AJAX handler for autocomplete. + * + * Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined. + * + * @since 1.2.0 + */ + function bp_legacy_theme_ajax_messages_autocomplete_results() + { + } + /** + * AJAX callback to set a message's star status. + * + * @since 2.3.0 + */ + function bp_legacy_theme_ajax_messages_star_handler() + { + } + /** + * BP Legacy's callback for the cover image feature. + * + * @since 2.4.0 + * + * @param array $params the current component's feature parameters. + * @return null|string An array to inform about the css handle to attach the css rules to + */ + function bp_legacy_theme_cover_image($params = array()) + { + } + /** + * Add a search box to a single group's manage members screen. + * + * @since 2.7.0 + * + * @return string|null HTML for the search form. + */ + function bp_legacy_theme_group_manage_members_add_search() + { + } + /** + * Modify welcome message in Legacy template pack when + * community invitations are enabled. + * + * @since 8.0.0 + */ + function bp_members_invitations_add_legacy_welcome_message() + { + } + /** + * Modify "registration disabled" message in Legacy template pack when + * community invitations are enabled. + * + * @since 8.0.0 + */ + function bp_members_invitations_add_legacy_registration_disabled_message() + { + } + /** + * This function looks scarier than it actually is. :) + * Each object loop (activity/members/groups/blogs/forums) contains default + * parameters to show specific information based on the page we are currently + * looking at. + * + * The following function will take into account any cookies set in the JS and + * allow us to override the parameters sent. That way we can change the results + * returned without reloading the page. + * + * By using cookies we can also make sure that user settings are retained + * across page loads. + * + * @since 3.0.0 + * + * @param string $query_string Query string for the current request. + * @param string $object Object for cookie. + * + * @return string Query string for the component loops + */ + function bp_nouveau_ajax_querystring($query_string, $object) + { + } + /** + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_ajax_button($output = '', $button = \null, $before = '', $after = '', $r = array()) + { + } + /** + * Output HTML content into a wrapper. + * + * @since 3.0.0 + * + * @param array $args { + * Optional arguments. + * + * @type string $container String HTML container type that should wrap + * the items as a group: 'div', 'ul', or 'p'. Required. + * @type string $container_id The group wrapping container element ID + * @type string $container_classes The group wrapping container elements class + * @type string $output The HTML to output. Required. + * } + */ + function bp_nouveau_wrapper($args = array()) + { + } + /** + * Register the 2 sidebars for the Group & User default front page + * + * @since 3.0.0 + */ + function bp_nouveau_register_sidebars() + { + } + /** + * @since 3.0.0 + * + * @return bool + */ + function bp_nouveau_is_object_nav_in_sidebar() + { + } + /** + * @since 3.0.0 + * + * @return bool + */ + function bp_nouveau_current_user_can($capability = '') + { + } + /** + * Parse an html output to a list of component's directory nav item. + * + * @since 3.0.0 + * + * @param string $hook The hook to fire. + * @param string $component The component nav belongs to. + * @param int $position The position of the nav item. + * + * @return array A list of component's dir nav items + */ + function bp_nouveau_parse_hooked_dir_nav($hook = '', $component = '', $position = 99) + { + } + /** + * Run specific "select filter" hooks to catch the options and build an array out of them + * + * @since 3.0.0 + * + * @param string $hook + * @param array $filters + * + * @return array + */ + function bp_nouveau_parse_hooked_options($hook = '', $filters = array()) + { + } + /** + * Get Dropdown filters for the current component of the one passed in params. + * + * @since 3.0.0 + * + * @param string $context 'directory', 'user' or 'group'. + * @param string $component The BuddyPress component ID. + * + * @return array the dropdown filters. + */ + function bp_nouveau_get_component_filters($context = '', $component = '') + { + } + /** + * When previewing make sure to get the temporary setting of the customizer. + * This is necessary when we need to get these very early. + * + * @since 3.0.0 + * + * @param string $option the index of the setting to get. + * @param mixed $retval the value to use as default. + * + * @return mixed The value for the requested option. + */ + function bp_nouveau_get_temporary_setting($option = '', $retval = \false) + { + } + /** + * Get the BP Nouveau Appearance settings. + * + * @since 3.0.0 + * + * @param string $option Leave empty to get all settings, specify a value for a specific one. + * @param mixed An array of settings, the value of the requested setting. + * + * @return array|false|mixed + */ + function bp_nouveau_get_appearance_settings($option = '') + { + } + /** + * Returns the choices for the Layout option of the customizer + * or the list of corresponding css classes. + * + * @since 3.0.0 + * + * @param string $type 'option' to get the labels, 'classes' to get the classes + * + * @return array The list of labels or classes preserving keys. + */ + function bp_nouveau_customizer_grid_choices($type = 'option') + { + } + /** + * Sanitize a list of slugs to save it as an array + * + * @since 3.0.0 + * + * @param string $option A comma separated list of nav items slugs. + * + * @return array An array of nav items slugs. + */ + function bp_nouveau_sanitize_nav_order($option = '') + { + } + /** + * BP Nouveau's callback for the cover image feature. + * + * @since 3.0.0 + * + * @param array $params Optional. The current component's feature parameters. + * + * @return string + */ + function bp_nouveau_theme_cover_image($params = array()) + { + } + /** + * All user feedback messages are available here + * + * @since 3.0.0 + * @since 8.0.0 Adds the 'member-invites-none' feedback. + * + * @param string $feedback_id The ID of the message. + * + * @return string|false The list of parameters for the message + */ + function bp_nouveau_get_user_feedback($feedback_id = '') + { + } + /** + * Get the signup fields for the requested section + * + * @since 3.0.0 + * + * @param string $section Optional. The section of fields to get 'account_details' or 'blog_details'. + * + * @return array|false The list of signup fields for the requested section. False if not found. + */ + function bp_nouveau_get_signup_fields($section = '') + { + } + /** + * Get Some submit buttons data. + * + * @since 3.0.0 + * @since 8.0.0 Adds the 'member-send-invite' button. + * + * @param string $action The action requested. + * + * @return array|false The list of the submit button parameters for the requested action + * False if no actions were found. + */ + function bp_nouveau_get_submit_button($action = '') + { + } + /** + * Reorder a BuddyPress item nav according to a given list of nav item slugs + * + * @since 3.0.0 + * + * @param object $nav The BuddyPress Item Nav object to reorder + * @param array $order A list of slugs ordered (eg: array( 'profile', 'activity', etc..) ) + * @param string $parent_slug A parent slug if it's a secondary nav we are reordering (case of the Groups single item) + * + * @return bool False otherwise. + */ + function bp_nouveau_set_nav_item_order($nav = \null, $order = array(), $parent_slug = '') + { + } + /** + * Gets the component's slug thanks to its ID. + * + * @since 8.0.0 + * + * @param string $component_id The component ID. + * @return string The slug for the requested component ID. + */ + function bp_nouveau_get_component_slug($component_id = '') + { + } + /** + * Registers the 'bp/primary-nav' Widget Block. + * + * @since 9.0.0 + * @since 12.0.0 Use the WP Blocks API v2. + * + * @param array $blocks The Core Blocks list. + * @return array The Core Blocks list. + */ + function bp_nouveau_register_primary_nav_widget_block($blocks = array()) + { + } + /** + * Registers the 'bp/primary-nav' Widget Block classnames. + * + * @since 9.0.0 + * + * @param array $block_globals The list of global properties for Core blocks. + * @return array The list of global properties for Core blocks. + */ + function bp_nouveau_register_core_block_globals($block_globals = array()) + { + } + /** + * Unregister the 'bp/primary-nav' Block from the post context. + * + * @since 9.0.0 + */ + function bp_nouveau_unregister_blocks_for_post_context() + { + } + /** + * Callback function to render the BP Primary Nav Block. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_nouveau_render_primary_nav_block($attributes = array()) + { + } + /** + * Retuns the theme layout available widths. + * + * @since 10.0.0 + * + * @return array The available theme layout widths. + */ + function bp_nouveau_get_theme_layout_widths() + { + } + /** + * Get the current displayed object for the priority nav. + * + * @since 12.0.0 + * + * @return string The current displayed object (`member` or `group`). + */ + function bp_nouveau_get_current_priority_nav_object() + { + } + /** + * Checks whether a single item supports priority nav. + * + * @since 12.0.0 + * + * @param string $single_item The single item object name. Possible valuers are 'member' or 'group'. + * @return bool True if the single item supports priority nav. False otherwise. + */ + function bp_nouveau_single_item_supports_priority_nav($single_item = '') + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_get_blogs_directory_nav_items() + { + } + /** + * Get Dropdown filters for the blogs component + * + * @since 3.0.0 + * + * @param string $context 'directory' or 'user' + * + * @return array the filters + */ + function bp_nouveau_get_blogs_filters($context = '') + { + } + /** + * Add settings to the customizer for the blogs component. + * + * @since 3.0.0 + * + * @param array $settings the settings to add. + * + * @return array the settings to add. + */ + function bp_nouveau_blogs_customizer_settings($settings = array()) + { + } + /** + * Add controls for the settings of the customizer for the blogs component. + * + * @since 3.0.0 + * + * @param array $controls the controls to add. + * + * @return array the controls to add. + */ + function bp_nouveau_blogs_customizer_controls($controls = array()) + { + } + /** + * Inline script to toggle the signup blog form + * + * @since 3.0.0 + * + * @return string Javascript output + */ + function bp_nouveau_get_blog_signup_inline_script() + { + } + /** + * Filter bp_get_blog_class(). + * Adds a class if blog item has a latest post. + * + * @since 3.0.0 + */ + function bp_nouveau_blog_loop_item_has_lastest_post($classes) + { + } + /** + * Register Blogs Ajax actions. + * + * @since 12.0.0 + */ + function bp_nouveau_register_blogs_ajax_actions() + { + } + /** + * Launch the Blogs loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_blogs($bp_nouveau = \null) + { + } + /** + * Template tag to wrap all Legacy actions that was used + * before the blogs directory content + * + * @since 3.0.0 + */ + function bp_nouveau_before_blogs_directory_content() + { + } + /** + * Template tag to wrap all Legacy actions that was used after the blogs directory content + * + * @since 3.0.0 + */ + function bp_nouveau_after_blogs_directory_content() + { + } + /** + * Fire specific hooks into the blogs create template + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_blogs_create_hook($when = '', $suffix = '') + { + } + /** + * Fire specific hooks into the blogs confirm template + * + * @since 12.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_blogs_confirm_hook($when = '', $suffix = '') + { + } + /** + * Fire an isolated hook inside the blogs loop + * + * @since 3.0.0 + */ + function bp_nouveau_blogs_loop_item() + { + } + /** + * Output the action buttons inside the blogs loop. + * + * @since 3.0.0 + * + * @param array $args See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_blogs_loop_buttons($args = array()) + { + } + /** + * Get the action buttons for the current blog in the loop. + * + * @since 3.0.0 + * + * @param string $type Type of Group of buttons to get. + * + * @return array + */ + function bp_nouveau_get_blogs_buttons($args) + { + } + /** + * Check if the Sites has a latest post + * + * @since 3.0.0 + * + * @return bool True if the sites has a latest post. False otherwise. + */ + function bp_nouveau_blog_has_latest_post() + { + } + /** + * Enqueue styles for the Messages UI (mentions). + * + * @since 3.0.0 + * + * @param array $styles Optional. The array of styles to enqueue. + * + * @return array The same array with the specific messages styles. + */ + function bp_nouveau_messages_enqueue_styles($styles = array()) + { + } + /** + * Register Scripts for the Messages component + * + * @since 3.0.0 + * + * @param array $scripts The array of scripts to register + * + * @return array The same array with the specific messages scripts. + */ + function bp_nouveau_messages_register_scripts($scripts = array()) + { + } + /** + * Enqueue the messages scripts + * + * @since 3.0.0 + */ + function bp_nouveau_messages_enqueue_scripts() + { + } + /** + * Localize the strings needed for the messages UI + * + * @since 3.0.0 + * + * @param array $params Associative array containing the JS Strings needed by scripts + * @return array The same array with specific strings for the messages UI if needed. + */ + function bp_nouveau_messages_localize_scripts($params = array()) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_messages_adjust_nav() + { + } + /** + * Replaces the Notices Compose URL. + * + * @since 3.0.0 + * + * @param array $admin_nav The WP Admin Nav. + */ + function bp_nouveau_messages_adjust_admin_nav($admin_nav) + { + } + /** + * Prepend a notification about the active Sitewide notice. + * + * @since 3.0.0 + * + * @param false|array $notifications False if there are no items, an array of notification items otherwise. + * @param int $user_id The user ID. + * @return false|array False if there are no items, an array of notification items otherwise. + */ + function bp_nouveau_add_notice_notification_for_user($notifications, $user_id) + { + } + /** + * Format the notice notifications. + * + * @since 3.0.0 + * @deprecated 10.0.0 + * + * @param array $array. + */ + function bp_nouveau_format_notice_notification_for_user($array) + { + } + /** + * @since 3.0.0 + * @deprecated 12.0.0 + */ + function bp_nouveau_unregister_notices_widget() + { + } + /** + * Add active sitewide notices to the BP template_message global. + * + * @since 3.0.0 + */ + function bp_nouveau_push_sitewide_notices() + { + } + /** + * Disable the WP Editor buttons not allowed in messages content. + * + * @since 3.0.0 + * + * @param array $buttons The WP Editor buttons list. + * @param array The filtered WP Editor buttons list. + */ + function bp_nouveau_messages_mce_buttons($buttons = array()) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_messages_at_on_tinymce_init($settings, $editor_id) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_get_message_date($date) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_messages_get_bulk_actions() + { + } + /** + * Register notifications filters for the messages component. + * + * @since 3.0.0 + */ + function bp_nouveau_messages_notification_filters() + { + } + /** + * Fires Messages Legacy hooks to catch the content and add them + * as extra keys to the JSON Messages UI reply. + * + * @since 3.0.1 + * + * @param array $hooks The list of hooks to fire. + * @return array An associative containing the caught content. + */ + function bp_nouveau_messages_catch_hook_content($hooks = array()) + { + } + /** + * Register Messages Ajax actions. + * + * @since 12.0.0 + */ + function bp_nouveau_register_messages_ajax_actions() + { + } + /** + * Launch the Messages loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_messages($bp_nouveau = \null) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_messages_send_message() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_messages_send_reply() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_get_user_message_threads() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_messages_thread_read() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_get_thread_messages() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_delete_thread_messages() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_star_thread_messages() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_readunread_thread_messages() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_dismiss_sitewide_notice() + { + } + /** + * Ajax Handler of the exit action. + * + * @since 10.0.0 + */ + function bp_nouveau_ajax_exit_thread_messages() + { + } + /** + * Fire specific hooks into the private messages template. + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_messages_hook($when = '', $suffix = '') + { + } + /** + * Prints the JS Templates of the private messages UI. + * + * @since 10.0.0 + */ + function bp_nouveau_messages_print_templates() + { + } + /** + * Prints the HTML placeholders of the private messages UI. + * + * @since 10.0.0 + */ + function bp_nouveau_messages_print_placeholders() + { + } + /** + * Load the new Messages User Interface + * + * @since 3.0.0 + */ + function bp_nouveau_messages_member_interface() + { + } + /** + * Output the Member's messages search form. + * + * @since 3.0.0 + * @since 3.2.0 Move the function into Template Tags and use a template part. + */ + function bp_nouveau_message_search_form() + { + } + /** + * Load the template loop for the current object. + * + * @since 3.0.0 + * + * @return string Template loop for the specified object + */ + function bp_nouveau_ajax_object_template_loader() + { + } + /** + * Register Scripts for the Activity component + * + * @since 3.0.0 + * + * @param array $scripts The array of scripts to register. + * + * @return array The same array with the specific activity scripts. + */ + function bp_nouveau_activity_register_scripts($scripts = array()) + { + } + /** + * Enqueue the activity scripts + * + * @since 3.0.0 + */ + function bp_nouveau_activity_enqueue_scripts() + { + } + /** + * Localize the strings needed for the Activity Post form UI + * + * @since 3.0.0 + * + * @param array $params Associative array containing the JS Strings needed by scripts. + * + * @return array The same array with specific strings for the Activity Post form UI if needed. + */ + function bp_nouveau_activity_localize_scripts($params = array()) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_get_activity_directory_nav_items() + { + } + /** + * Make sure bp_get_activity_show_filters() will return the filters and the context + * instead of the output. + * + * @since 3.0.0 + * + * @param string $output HTML output + * @param array $filters Optional. + * @param string $context + * + * @return array + */ + function bp_nouveau_get_activity_filters_array($output = '', $filters = array(), $context = '') + { + } + /** + * Get Dropdown filters of the activity component + * + * @since 3.0.0 + * + * @return array the filters + */ + function bp_nouveau_get_activity_filters() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_activity_secondary_avatars($action, $activity) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_activity_scope_newest_class($classes = '') + { + } + /** + * Get the activity query args for the widget. + * + * @since 3.0.0 + * + * @return array The activity arguments. + */ + function bp_nouveau_activity_widget_query() + { + } + /** + * Register notifications filters for the activity component. + * + * @since 3.0.0 + */ + function bp_nouveau_activity_notification_filters() + { + } + /** + * Add controls for the settings of the customizer for the activity component. + * + * @since 3.0.0 + * + * @param array $controls Optional. The controls to add. + * + * @return array the controls to add. + */ + function bp_nouveau_activity_customizer_controls($controls = array()) + { + } + /** + * Remove brackets around the "Read more" text. + * + * @since 7.0.0 + * + * @param string $read_more The read more text. + * @return string The read more text without brackets. + */ + function bp_nouveau_activity_excerpt_append_text($read_more = '') + { + } + /** + * Register Activity Ajax actions. + * + * @since 12.0.0 + */ + function bp_nouveau_register_activity_ajax_actions() + { + } + /** + * Launch the Activity loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_activity($bp_nouveau = \null) + { + } + /** + * Mark an activity as a favourite via a POST request. + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_mark_activity_favorite() + { + } + /** + * Un-favourite an activity via a POST request. + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_unmark_activity_favorite() + { + } + /** + * Clear mentions if the directory tab is clicked + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_clear_new_mentions() + { + } + /** + * Deletes an Activity item/Activity comment item received via a POST request. + * + * @since 3.0.0 + * + * @return string JSON reply. + */ + function bp_nouveau_ajax_delete_activity() + { + } + /** + * Fetches an activity's full, non-excerpted content via a POST request. + * Used for the 'Read More' link on long activity items. + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_get_single_activity_content() + { + } + /** + * Posts new Activity comments received via a POST request. + * + * @since 3.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string JSON reply + */ + function bp_nouveau_ajax_new_activity_comment() + { + } + /** + * Get items to attach the activity to. + * + * This is used within the activity post form autocomplete field. + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_get_activity_objects() + { + } + /** + * Processes Activity updates received via a POST request. + * + * @since 3.0.0 + * + * @return string JSON reply + */ + function bp_nouveau_ajax_post_update() + { + } + /** + * AJAX spam an activity item or comment. + * + * @since 3.0.0 + * + * @return string JSON reply. + */ + function bp_nouveau_ajax_spam_activity() + { + } + /** + * Before Activity's directory content legacy do_action hooks wrapper + * + * @since 3.0.0 + */ + function bp_nouveau_before_activity_directory_content() + { + } + /** + * After Activity's directory content legacy do_action hooks wrapper + * + * @since 3.0.0 + */ + function bp_nouveau_after_activity_directory_content() + { + } + /** + * Prints the JS Templates used to render the Activity Post Form. + * + * @since 10.0.0 + */ + function bp_nouveau_activity_print_post_form_templates() + { + } + /** + * Enqueue needed scripts for the Activity Post Form + * + * @since 3.0.0 + * @since 5.0.0 Move the `bp_before_activity_post_form` hook inside the Activity post form. + */ + function bp_nouveau_before_activity_post_form() + { + } + /** + * Load JS Templates for the Activity Post Form + * + * @since 3.0.0 + */ + function bp_nouveau_after_activity_post_form() + { + } + /** + * Display the displayed user activity post form if needed + * + * @since 3.0.0 + * + * @return string HTML. + */ + function bp_nouveau_activity_member_post_form() + { + } + /** + * Fire specific hooks into the activity entry template + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_activity_hook($when = '', $suffix = '') + { + } + /** + * Output the `data-bp-activity-id` attribute. + * + * @since 10.0.0 + */ + function bp_nouveau_activity_data_attribute_id() + { + } + /** + * Output the `data-bp-activity-comment-id` attribute. + * + * @since 12.0.0 + */ + function bp_nouveau_activity_comment_data_attribute_id() + { + } + /** + * Checks if an activity of the loop has some content. + * + * @since 3.0.0 + * + * @return bool True if the activity has some content. False Otherwise. + */ + function bp_nouveau_activity_has_content() + { + } + /** + * Output the Activity content into the loop. + * + * @since 3.0.0 + */ + function bp_nouveau_activity_content() + { + } + /** + * Output the Activity timestamp into the bp-timestamp attribute. + * + * @since 3.0.0 + */ + function bp_nouveau_activity_timestamp() + { + } + /** + * Get the Activity timestamp. + * + * @since 3.0.0 + * + * @return integer The Activity timestamp. + */ + function bp_nouveau_get_activity_timestamp() + { + } + /** + * Output the action buttons inside an Activity Loop. + * + * @since 3.0.0 + * + * @param array $args See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_activity_entry_buttons($args = array()) + { + } + /** + * Get the action buttons inside an Activity Loop. + * + * @todo This function is too large and needs refactoring and reviewing. + * @since 3.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param array $args See bp_nouveau_wrapper() for the description of parameters. + * @return array Activity action buttons used into an Activity Loop. + */ + function bp_nouveau_get_activity_entry_buttons($args) + { + } + /** + * Output Activity Comments if any + * + * @since 3.0.0 + */ + function bp_nouveau_activity_comments() + { + } + /** + * Loops through a level of activity comments and loads the template for each. + * + * Note: This is an adaptation of the bp_activity_recurse_comments() BuddyPress core function + * + * @since 3.0.0 + * + * @param object $comment The activity object currently being recursed. + */ + function bp_nouveau_activity_recurse_comments($comment) + { + } + /** + * Ouptut the Activity comment action string + * + * @since 3.0.0 + */ + function bp_nouveau_activity_comment_action() + { + } + /** + * Get the Activity comment action string + * + * @since 3.0.0 + */ + function bp_nouveau_get_activity_comment_action() + { + } + /** + * Load the Activity comment form + * + * @since 3.0.0 + */ + function bp_nouveau_activity_comment_form() + { + } + /** + * Output the action buttons for the activity comments + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_activity_comment_buttons($args = array()) + { + } + /** + * Get the action buttons for the activity comments + * + * @since 3.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + * + * @return array + */ + function bp_nouveau_get_activity_comment_buttons($args) + { + } + /** + * Outputs the Activity RSS link. + * + * @since 8.0.0 + */ + function bp_nouveau_activity_rss_link() + { + } + /** + * Returns the Activity RSS link. + * + * @since 8.0.0 + * + * @return string The Activity RSS link. + */ + function bp_nouveau_activity_get_rss_link() + { + } + /** + * Outputs the Activity RSS Tooltip. + * + * @since 8.0.0 + */ + function bp_nouveau_activity_rss_tooltip() + { + } + /** + * Returns the Activity RSS Tooltip. + * + * @since 8.0.0 + * + * @return string The Activity RSS Tooltip. + */ + function bp_nouveau_activity_get_rss_tooltip() + { + } + /** + * Outputs the Activity RSS screen reader text. + * + * @since 8.0.0 + */ + function bp_nouveau_activity_rss_screen_reader_text() + { + } + /** + * Returns the Activity RSS screen reader text. + * + * @since 8.0.0 + * + * @return string The Activity RSS screen reader text. + */ + function bp_nouveau_activity_get_rss_screen_reader_text() + { + } + /** + * Provide a convenience function to add markup wrapper for message strings + * + * @param string $message The message text string + * @param string $type The message type - 'error, 'info', 'warning', success' + * + * @return string + * + * @since 3.0 + */ + function bp_nouveau_message_markup_wrapper($message, $type) + { + } + /** + * Register Scripts for the Groups component + * + * @since 3.0.0 + * + * @param array $scripts Optional. The array of scripts to register. + * + * @return array The same array with the specific groups scripts. + */ + function bp_nouveau_groups_register_scripts($scripts = array()) + { + } + /** + * Enqueue the groups scripts + * + * @since 3.0.0 + */ + function bp_nouveau_groups_enqueue_scripts() + { + } + /** + * Can all members be invited to join any group? + * + * @since 3.0.0 + * + * @param bool $default False to allow. True to disallow. + * + * @return bool + */ + function bp_nouveau_groups_disallow_all_members_invites($default = \false) + { + } + /** + * Activate the Groups invitations feature if any member can be invited. + * + * @since 10.0.0 + * + * @param bool True if any member can be invited. False otherwise. + */ + function bp_nouveau_is_groups_invitations_active() + { + } + /** + * Localize the strings needed for the Group's Invite UI + * + * @since 3.0.0 + * + * @param array $params Associative array containing the JS Strings needed by scripts + * + * @return array The same array with specific strings for the Group's Invite UI if needed. + */ + function bp_nouveau_groups_localize_scripts($params = array()) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_groups_get_inviter_ids($user_id, $group_id) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_prepare_group_potential_invites_for_js($user) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_get_group_potential_invites($args = array()) + { + } + /** + * Rename the Group invite step. + * + * @since 3.0.0 + * @since 10.0.0 The function is no more creating a Group invite step. + * + * @param array $steps The Group create steps. + * @return array The Group create steps. + */ + function bp_nouveau_group_invites_create_steps($steps = array()) + { + } + /** + * Rename the Group Invites nav. + * + * @since 3.0.0 + * @since 10.0.0 The function is no longer creating a Group invite nav. + */ + function bp_nouveau_group_setup_nav() + { + } + /** + * Includes a message into the sent invitation email. + * + * @since 3.0.0 + * @deprecated 6.3.0 + * + * @param string $message The message to send with the invite + */ + function bp_nouveau_groups_invites_custom_message($message = '') + { + } + /** + * Format a Group for a json reply + * + * @since 3.0.0 + */ + function bp_nouveau_prepare_group_for_js($item) + { + } + /** + * Group invites restriction settings navigation. + * + * @since 3.0.0 + */ + function bp_nouveau_groups_invites_restriction_nav() + { + } + /** + * Group invites restriction settings Admin Bar navigation. + * + * @since 3.0.0 + * + * @param array $wp_admin_nav The list of settings admin subnav items. + * + * @return array The list of settings admin subnav items. + */ + function bp_nouveau_groups_invites_restriction_admin_nav($wp_admin_nav) + { + } + /** + * Group invites restriction screen. + * + * @since 3.0.0 + */ + function bp_nouveau_groups_screen_invites_restriction() + { + } + /** + * Makes sure the BP REST API groups/invites endpoint respects invite restrictions. + * + * @since 7.2.1 + * + * @param bool|WP_Error $retval Whether the request can continue. + * @param WP_REST_Request $request The request sent to the API. + * @return bool|WP_Error + */ + function bp_nouveau_restrict_rest_group_invite_to_friends($retval, $request) + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_get_groups_directory_nav_items() + { + } + /** + * Get Dropdown filters for the groups component + * + * @since 3.0.0 + * + * @param string $context 'directory' or 'user' + * + * @return array the filters + */ + function bp_nouveau_get_groups_filters($context = '') + { + } + /** + * Catch the content hooked to the 'bp_group_header_meta' action + * + * @since 3.0.0 + * + * @return string|bool HTML Output if hooked. False otherwise. + */ + function bp_nouveau_get_hooked_group_meta() + { + } + /** + * Display the Widgets of Group extensions into the default front page? + * + * @since 3.0.0 + * + * @return bool True to display. False otherwise. + */ + function bp_nouveau_groups_do_group_boxes() + { + } + /** + * Display description of the Group into the default front page? + * + * @since 3.0.0 + * + * @return bool True to display. False otherwise. + */ + function bp_nouveau_groups_front_page_description() + { + } + /** + * Add sections to the customizer for the groups component. + * + * @since 3.0.0 + * + * @param array $sections the Customizer sections to add. + * + * @return array the Customizer sections to add. + */ + function bp_nouveau_groups_customizer_sections($sections = array()) + { + } + /** + * Add settings to the customizer for the groups component. + * + * @since 3.0.0 + * + * @param array $settings Optional. The settings to add. + * + * @return array the settings to add. + */ + function bp_nouveau_groups_customizer_settings($settings = array()) + { + } + /** + * Add controls for the settings of the customizer for the groups component. + * + * @since 3.0.0 + * + * @param array $controls Optional. The controls to add. + * + * @return array the controls to add. + */ + function bp_nouveau_groups_customizer_controls($controls = array()) + { + } + /** + * Add the default group front template to the front template hierarchy. + * + * @since 3.0.0 + * + * @param array $templates Optional. The list of templates for the front.php template part. + * @param BP_Groups_Group $group Optional. The group object. + * + * @return array The same list with the default front template if needed. + */ + function bp_nouveau_group_reset_front_template($templates = array(), $group = \null) + { + } + /** + * Locate a single group template into a specific hierarchy. + * + * @since 3.0.0 + * + * @param string $template Optional. The template part to get (eg: activity, members...). + * + * @return string The located template. + */ + function bp_nouveau_group_locate_template_part($template = '') + { + } + /** + * Load a single group template part + * + * @since 3.0.0 + * + * @param string $template Optional. The template part to get (eg: activity, members...). + * + * @return string HTML output. + */ + function bp_nouveau_group_get_template_part($template = '') + { + } + /** + * Are we inside the Current group's default front page sidebar? + * + * @since 3.0.0 + * + * @return bool True if in the group's home sidebar. False otherwise. + */ + function bp_nouveau_group_is_home_widgets() + { + } + /** + * Filter the Latest activities Widget to only keep the one of the group displayed + * + * @since 3.0.0 + * + * @param array $args Optional. The Activities Template arguments. + * + * @return array The Activities Template arguments. + */ + function bp_nouveau_group_activity_widget_overrides($args = array()) + { + } + /** + * Filter the Groups widget to only keep the displayed group. + * + * @since 3.0.0 + * + * @param array $args Optional. The Groups Template arguments. + * + * @return array The Groups Template arguments. + */ + function bp_nouveau_group_groups_widget_overrides($args = array()) + { + } + /** + * Filter the Members widgets to only keep members of the displayed group. + * + * @since 3.0.0 + * + * @param array $args Optional. The Members Template arguments. + * + * @return array The Members Template arguments. + */ + function bp_nouveau_group_members_widget_overrides($args = array()) + { + } + /** + * Init the Group's default front page filters as we're in the sidebar + * + * @since 3.0.0 + */ + function bp_nouveau_groups_add_home_widget_filters() + { + } + /** + * Remove the Group's default front page filters as we're no more in the sidebar + * + * @since 3.0.0 + */ + function bp_nouveau_groups_remove_home_widget_filters() + { + } + /** + * Get the hook, nonce, and eventually a specific template for Core Group's create screens. + * + * @since 3.0.0 + * + * @param string $id Optional. The screen id + * + * @return mixed An array containing the hook dynamic part, the nonce, and eventually a specific template. + * False if it's not a core create screen. + */ + function bp_nouveau_group_get_core_create_screens($id = '') + { + } + /** + * Get the hook and nonce for Core Group's manage screens. + * + * @since 3.0.0 + * + * @param string $id Optional. The screen id + * + * @return mixed An array containing the hook dynamic part and the nonce. + * False if it's not a core manage screen. + */ + function bp_nouveau_group_get_core_manage_screens($id = '') + { + } + /** + * Register notifications filters for the groups component. + * + * @since 3.0.0 + */ + function bp_nouveau_groups_notification_filters() + { + } + /** + * Makes sure the Nouveau specific behavior about Group invites visibility is applied to the REST API. + * + * @since 7.2.1 + * + * @param true|WP_Error $retval Whether the current user can list invites. + * @param WP_REST_Request $request The request sent to the API. + * @return true|WP_Error Whether the current user can list invites. + */ + function bp_nouveau_rest_group_invites_get_items_permissions_check($retval, $request) + { + } + /** + * Register Groups Ajax actions. + * + * @since 12.0.0 + */ + function bp_nouveau_register_groups_ajax_actions() + { + } + /** + * Launch the Groups loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_groups($bp_nouveau = \null) + { + } + /** + * Join or leave a group when clicking the "join/leave" button via a POST request. + * + * @since 3.0.0 + * + * @return string HTML + */ + function bp_nouveau_ajax_joinleave_group() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_get_users_to_invite() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_send_group_invites() + { + } + /** + * @since 3.0.0 + */ + function bp_nouveau_ajax_remove_group_invite() + { + } + /** + * Template tag to wrap all Legacy actions that was used + * before the groups directory content + * + * @since 3.0.0 + */ + function bp_nouveau_before_groups_directory_content() + { + } + /** + * Template tag to wrap all Legacy actions that was used + * after the groups directory content + * + * @since 3.0.0 + */ + function bp_nouveau_after_groups_directory_content() + { + } + /** + * Fire specific hooks into the groups create template. + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_groups_create_hook($when = '', $suffix = '') + { + } + /** + * Fire specific hooks into the single groups templates. + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_group_hook($when = '', $suffix = '') + { + } + /** + * Fire an isolated hook inside the groups loop + * + * @since 3.0.0 + */ + function bp_nouveau_groups_loop_item() + { + } + /** + * Display the current group activity post form if needed + * + * @since 3.0.0 + */ + function bp_nouveau_groups_activity_post_form() + { + } + /** + * Prints the JS Templates to invite new members to join the Group. + * + * @since 10.0.0 + */ + function bp_nouveau_group_print_invites_templates() + { + } + /** + * Prints the HTML placeholders to invite new members to join the Group. + * + * @since 10.0.0 + */ + function bp_nouveau_group_print_invites_placeholders() + { + } + /** + * Load the Group Invites UI. + * + * @since 3.0.0 + * + * @return string HTML Output. + */ + function bp_nouveau_group_invites_interface() + { + } + /** + * Gets the displayed user group invites preferences + * + * @since 3.0.0 + * @since 4.4.0 + * + * @param int $user_id The user ID to check group invites preference for. + * @return int Returns 1 if user chose to restrict to friends, 0 otherwise. + */ + function bp_nouveau_groups_get_group_invites_setting($user_id = 0) + { + } + /** + * Load the requested Create Screen for the new group. + * + * @since 3.0.0 + */ + function bp_nouveau_group_creation_screen() + { + } + /** + * Load the requested Manage Screen for the current group. + * + * @since 3.0.0 + */ + function bp_nouveau_group_manage_screen() + { + } + /** + * Output the action buttons for the displayed group + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_group_header_buttons($args = array()) + { + } + /** + * Output the action buttons inside the groups loop. + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_groups_loop_buttons($args = array()) + { + } + /** + * Output the action buttons inside the invites loop of the displayed user. + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_groups_invite_buttons($args = array()) + { + } + /** + * Output the action buttons inside the requests loop of the group's manage screen. + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_groups_request_buttons($args = array()) + { + } + /** + * Output the action buttons inside the manage members loop of the group's manage screen. + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_groups_manage_members_buttons($args = array()) + { + } + /** + * Get the action buttons for the current group in the loop, + * or the current displayed group. + * + * @since 3.0.0 + * + * @param array $args Optional. See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_get_groups_buttons($args = array()) + { + } + /** + * Does the group has metas or a specific meta value. + * + * @since 3.0.0 + * @since 3.2.0 Adds the $meta_key argument. + * + * @param string $meta_key The key of the meta to check the value for. + * @return bool True if the group has meta. False otherwise. + */ + function bp_nouveau_group_has_meta($meta_key = '') + { + } + /** + * Does the group have extra meta? + * + * @since 3.0.0 + * + * @return bool True if the group has meta. False otherwise. + */ + function bp_nouveau_group_has_meta_extra() + { + } + /** + * Display the group meta. + * + * @since 3.0.0 + * @deprecated 7.0.0 Use bp_nouveau_the_group_meta() + * @see bp_nouveau_the_group_meta() + * + * @return string HTML Output. + */ + function bp_nouveau_group_meta() + { + } + /** + * Outputs or returns the group meta(s). + * + * @since 7.0.0 + * + * @param array $args { + * Optional. An array of arguments. + * + * @type array $keys The list of template meta keys. + * @type string $delimeter The delimeter to use in case there is more than + * one key to output. + * @type boolean $echo True to output the template meta value. False otherwise. + * } + * @return string HTML Output. + */ + function bp_nouveau_the_group_meta($args = array()) + { + } + /** + * Get the group template meta. + * + * @since 3.0.0 + * @since 7.0.0 Adds the `$keys` parameter. + * + * @param array $keys One or more template meta keys to populate with their values. + * Possible keys are `status`, `count`, `group_type_list`, `description`, `extra`. + * @return array The corresponding group template meta values. + */ + function bp_nouveau_get_group_meta($keys = array()) + { + } + /** + * Load the appropriate content for the single group pages + * + * @since 3.0.0 + */ + function bp_nouveau_group_template_part() + { + } + /** + * Use the appropriate Group header and enjoy a template hierarchy + * + * @since 3.0.0 + */ + function bp_nouveau_group_header_template_part() + { + } + /** + * Get a link to set the Group's default front page and directly + * reach the Customizer section where it's possible to do it. + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_groups_get_customizer_option_link() + { + } + /** + * Get a link to set the Group's front page widgets and directly + * reach the Customizer section where it's possible to do it. + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_groups_get_customizer_widgets_link() + { + } + /** + * Output the group description excerpt + * + * @since 3.0.0 + * + * @param object $group Optional. The group being referenced. + * Defaults to the group currently being iterated on in the groups loop. + * @param int $length Optional. Length of returned string, including ellipsis. Default: 100. + */ + function bp_nouveau_group_description_excerpt($group = \null, $length = \null) + { + } + /** + * Filters the excerpt of a group description. + * + * Checks if the group loop is set as a 'Grid' layout and returns a reduced excerpt. + * + * @since 3.0.0 + * + * @param object $group Optional. The group being referenced. Defaults to the group currently being + * iterated on in the groups loop. + * @param int $length Optional. Length of returned string, including ellipsis. Default: 100. + * + * @return string Excerpt. + */ + function bp_nouveau_get_group_description_excerpt($group = \null, $length = \null) + { + } + /** + * Output "checked" attribute to determine if the group type should be checked. + * + * @since 3.2.0 + * + * @param object $type Group type object. See bp_groups_get_group_type_object(). + */ + function bp_nouveau_group_type_checked($type = \null) + { + } + /** + * Adds the "Notify group members of these changes" checkbox to the Manage > Details panel. + * + * See #7837 for background on why this technique is required. + * + * @since 4.0.0 + */ + function bp_nouveau_add_notify_group_members_checkbox() + { + } + /** + * Code to hook into the WP Customizer + * + * @since 3.0.0 + * @version 12.0.0 + */ + /** + * Add a specific panel for the BP Nouveau Template Pack. + * + * @since 3.0.0 + * + * @param WP_Customize_Manager $wp_customize WordPress customizer. + */ + function bp_nouveau_customize_register(\WP_Customize_Manager $wp_customize) + { + } + /** + * Enqueue needed JS for our customizer Settings & Controls + * + * @since 3.0.0 + */ + function bp_nouveau_customizer_enqueue_scripts() + { + } + /** + * Register Scripts for the Members component + * + * @since 8.0.0 + * + * @param array $scripts Optional. The array of scripts to register. + * @return array The same array with the specific members scripts. + */ + function bp_nouveau_members_register_scripts($scripts = array()) + { + } + /** + * Enqueue the members scripts + * + * @since 3.0.0 + */ + function bp_nouveau_members_enqueue_scripts() + { + } + /** + * Get the nav items for the Members directory + * + * @since 3.0.0 + * + * @return array An associative array of nav items. + */ + function bp_nouveau_get_members_directory_nav_items() + { + } + /** + * Get Dropdown filters for the members component + * + * @since 3.0.0 + * + * @param string $context Optional. + * + * @return array the filters + */ + function bp_nouveau_get_members_filters($context = '') + { + } + /** + * Catch the content hooked to the do_action hooks in single member header + * and in the members loop. + * + * @since 3.0.0 + * @since 6.0.0 Replace wrongly positioned `bp_directory_members_item` + * with `bp_directory_members_item_meta` + * + * @return string|false HTML Output if hooked. False otherwise. + */ + function bp_nouveau_get_hooked_member_meta() + { + } + /** + * Add the default user front template to the front template hierarchy + * + * @since 3.0.0 + * + * @param array $templates The list of templates for the front.php template part. + * + * @return array The same list with the default front template if needed. + */ + function bp_nouveau_member_reset_front_template($templates = array()) + { + } + /** + * Only locate global user's front templates + * + * @since 3.0.0 + * + * @param array $templates The User's front template hierarchy. + * + * @return array Only the global front templates. + */ + function bp_nouveau_member_restrict_user_front_templates($templates = array()) + { + } + /** + * Locate a single member template into a specific hierarchy. + * + * @since 3.0.0 + * + * @param string $template The template part to get (eg: activity, groups...). + * + * @return string The located template. + */ + function bp_nouveau_member_locate_template_part($template = '') + { + } + /** + * Load a single member template part + * + * @since 3.0.0 + * + * @param string $template The template part to get (eg: activity, groups...). + * + * @return string HTML output. + */ + function bp_nouveau_member_get_template_part($template = '') + { + } + /** + * Display the User's WordPress bio info into the default front page? + * + * @since 3.0.0 + * + * @return bool True to display. False otherwise. + */ + function bp_nouveau_members_wp_bio_info() + { + } + /** + * Are we inside the Current user's default front page sidebar? + * + * @since 3.0.0 + * + * @return bool True if in the group's home sidebar. False otherwise. + */ + function bp_nouveau_member_is_home_widgets() + { + } + /** + * Filter the Latest activities Widget to only keep the one of displayed user + * + * @since 3.0.0 + * + * @param array $args The Activities Template arguments. + * + * @return array The Activities Template arguments. + */ + function bp_nouveau_member_activity_widget_overrides($args = array()) + { + } + /** + * Filter the Groups widget to only keep the groups the displayed user is a member of. + * + * @since 3.0.0 + * + * @param array $args The Groups Template arguments. + * + * @return array The Groups Template arguments. + */ + function bp_nouveau_member_groups_widget_overrides($args = array()) + { + } + /** + * Filter the Members widgets to only keep members of the displayed group. + * + * @since 3.0.0 + * + * @param array $args The Members Template arguments. + * + * @return array The Members Template arguments. + */ + function bp_nouveau_member_members_widget_overrides($args = array()) + { + } + /** + * Init the Member's default front page filters as we're in the sidebar + * + * @since 3.0.0 + */ + function bp_nouveau_members_add_home_widget_filters() + { + } + /** + * Remove the Member's default front page filters as we're no more in the sidebar + * + * @since 3.0.0 + */ + function bp_nouveau_members_remove_home_widget_filters() + { + } + /** + * Get the WP Profile fields for all or a specific user + * + * @since 3.0.0 + * + * @param WP_User $user The user object. Optional. + * + * @return array The list of WP Profile fields + */ + function bp_nouveau_get_wp_profile_fields($user = \null) + { + } + /** + * Build the Member's nav for the our customizer control. + * + * @since 3.0.0 + * + * @return array The Members single item primary nav ordered. + */ + function bp_nouveau_member_customizer_nav() + { + } + /** + * Includes additional information about the Members loop Ajax response. + * + * @since 10.0.0 + * + * @param array $additional_info An associative array with additional information to include in the Ajax response. + * @param array $args The Ajax query arguments. + * @return array Additional information about the members loop. + */ + function bp_nouveau_members_loop_additional_info($additional_info = array(), $args = array()) + { + } + /** + * Launch the Members loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_members($bp_nouveau = \null) + { + } + /** + * Template tag to wrap all Legacy actions that was used + * before the members directory content + * + * @since 3.0.0 + */ + function bp_nouveau_before_members_directory_content() + { + } + /** + * Template tag to wrap all Legacy actions that was used + * after the members directory content + * + * @since 3.0.0 + */ + function bp_nouveau_after_members_directory_content() + { + } + /** + * Fire specific hooks into the single members templates + * + * @since 3.0.0 + * + * @param string $when 'before' or 'after' + * @param string $suffix Use it to add terms at the end of the hook name + */ + function bp_nouveau_member_hook($when = '', $suffix = '') + { + } + /** + * Template tag to wrap the notification settings hook + * + * @since 3.0.0 + */ + function bp_nouveau_member_email_notice_settings() + { + } + /** + * Output the action buttons for the displayed user profile + * + * @since 3.0.0 + * + * @param array $args See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_member_header_buttons($args = array()) + { + } + /** + * Output the action buttons in member loops + * + * @since 3.0.0 + * + * @param array $args See bp_nouveau_wrapper() for the description of parameters. + */ + function bp_nouveau_members_loop_buttons($args = array()) + { + } + /** + * Get the action buttons for the displayed user profile + * + * @since 3.0.0 + * + * @return array + */ + function bp_nouveau_get_members_buttons($args) + { + } + /** + * Does the member has meta. + * + * @since 3.0.0 + * + * @return bool True if the member has meta. False otherwise. + */ + function bp_nouveau_member_has_meta() + { + } + /** + * Display the member meta. + * + * @since 3.0.0 + * + * @return string HTML Output. + */ + function bp_nouveau_member_meta() + { + } + /** + * Get the member meta. + * + * @since 3.0.0 + * + * @return array The member meta. + */ + function bp_nouveau_get_member_meta() + { + } + /** + * Check if some extra content needs to be displayed into the members directory. + * + * @since 6.0.0 + * + * @return bool True if some extra content needs to be displayed into the members directory. + * False otherwise. + */ + function bp_nouveau_member_has_extra_content() + { + } + /** + * Displays extra content for each item of a members loop. + * + * @since 6.0.0 + */ + function bp_nouveau_member_extra_content() + { + } + /** + * Load the appropriate content for the single member pages + * + * @since 3.0.0 + */ + function bp_nouveau_member_template_part() + { + } + /** + * Use the appropriate Member header and enjoy a template hierarchy + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_member_header_template_part() + { + } + /** + * Get a link to set the Member's default front page and directly + * reach the Customizer section where it's possible to do it. + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_members_get_customizer_option_link() + { + } + /** + * Get a link to set the Member's front page widgets and directly + * reach the Customizer section where it's possible to do it. + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_members_get_customizer_widgets_link() + { + } + /** + * Display the Member description making sure linefeeds are taking in account + * + * @since 3.0.0 + * + * @param int $user_id Optional. + * + * @return string HTML output. + */ + function bp_nouveau_member_description($user_id = 0) + { + } + /** + * Display the Edit profile link (temporary). + * + * @since 3.0.0 + * + * @todo replace with Ajax feature + * + * @return string HTML Output + */ + function bp_nouveau_member_description_edit_link() + { + } + /** + * Get the Edit profile link (temporary) + * @todo replace with Ajax featur + * + * @since 3.0.0 + * + * @return string HTML Output + */ + function bp_nouveau_member_get_description_edit_link() + { + } + /** WP Profile tags **********************************************************/ + /** + * Template tag to wrap all Legacy actions that was used + * before and after the WP User's Profile. + * + * @since 3.0.0 + */ + function bp_nouveau_wp_profile_hooks($type = 'before') + { + } + /** + * Does the displayed user has WP profile fields? + * + * @since 3.0.0 + * + * @return bool True if user has profile fields. False otherwise. + */ + function bp_nouveau_has_wp_profile_fields() + { + } + /** + * Check if there are still profile fields to output. + * + * @since 3.0.0 + * + * @return bool True if the profile field exists. False otherwise. + */ + function bp_nouveau_wp_profile_fields() + { + } + /** + * Set the current profile field and iterate into the loop. + * + * @since 3.0.0 + */ + function bp_nouveau_wp_profile_field() + { + } + /** + * Output the WP profile field ID. + * + * @since 3.0.0 + */ + function bp_nouveau_wp_profile_field_id() + { + } + /** + * Get the WP profile field ID. + * + * @since 3.0.0 + * + * @return int the profile field ID. + */ + function bp_nouveau_get_wp_profile_field_id() + { + } + /** + * Output the WP profile field label. + * + * @since 3.0.0 + */ + function bp_nouveau_wp_profile_field_label() + { + } + /** + * Get the WP profile label. + * + * @since 3.0.0 + * + * @return string the profile field label. + */ + function bp_nouveau_get_wp_profile_field_label() + { + } + /** + * Output the WP profile field data. + * + * @since 3.0.0 + */ + function bp_nouveau_wp_profile_field_data() + { + } + /** + * Get the WP profile field data. + * + * @since 3.0.0 + * + * @return string the profile field data. + */ + function bp_nouveau_get_wp_profile_field_data() + { + } + /** + * Outputs the Invitations bulk actions dropdown list. + * + * @since 8.0.0 + */ + function bp_nouveau_invitations_bulk_management_dropdown() + { + } + /** + * Customize the way to output the Members' loop member latest activities. + * + * @since 12.0.0 + * + * @param string $activity_content Formatted latest update for current member. + * @param array $args Array of parsed arguments. + * @param array $latest_update Array of the latest activity data. + * @return string The formatted latest update for current member. + */ + function bp_nouveau_get_member_latest_update($activity_content = '', $args = array(), $latest_update = array()) + { + } + /** + * Register Scripts for the xProfile component + * + * @since 3.0.0 + * + * @param array $scripts The array of scripts to register + * + * @return array The same array with the specific groups scripts. + */ + function bp_nouveau_xprofile_register_scripts($scripts = array()) + { + } + /** + * Enqueue the xprofile scripts + * + * @since 3.0.0 + */ + function bp_nouveau_xprofile_enqueue_scripts() + { + } + /** + * Launch the xProfile loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_xprofile($bp_nouveau = \null) + { + } + /** + * Fire specific hooks into the single members xprofile templates. + * + * @since 3.0.0 + * + * @param string $when Optional. Either 'before' or 'after'. + * @param string $suffix Optional. Use it to add terms at the end of the hook name. + */ + function bp_nouveau_xprofile_hook($when = '', $suffix = '') + { + } + /** + * Template tag to output the field visibility markup in edit and signup screens. + * + * @since 3.0.0 + */ + function bp_nouveau_xprofile_edit_visibilty() + { + } + /** + * Return a bool check to see whether the base re group has had extended + * profile fields added to it for the registration screen. + * + * @since 3.0.0 + * @deprecated 8.0.0 + */ + function bp_nouveau_base_account_has_xprofile() + { + } + /** + * Checks whether there are signup profile fields to display. + * + * @since 8.0.0 + * + * @param bool Whether to init an xProfile loop. + * @return bool True if there are signup profile fields to display. False otherwise. + */ + function bp_nouveau_has_signup_xprofile_fields($do_loop = \false) + { + } + /** + * Launch the Friends loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_friends($bp_nouveau = \null) + { + } + /** + * Friend/un-friend a user via a POST request. + * + * @since 3.0.0 + * + * @return string HTML + */ + function bp_nouveau_ajax_addremove_friend() + { + } + /** + * Register Scripts for the Notifications component + * + * @since 3.0.0 + * + * @param array $scripts The array of scripts to register + * @return array The same array with the specific notifications scripts. + */ + function bp_nouveau_notifications_register_scripts($scripts = array()) + { + } + /** + * Enqueue the notifications scripts + * + * @since 3.0.0 + */ + function bp_nouveau_notifications_enqueue_scripts() + { + } + /** + * Init Notifications filters and fire a hook to let + * plugins/components register their filters. + * + * @since 3.0.0 + */ + function bp_nouveau_notifications_init_filters() + { + } + /** + * Register new filters for the notifications screens. + * + * @since 3.0.0 + * + * @param array $args { + * Array of arguments. + * + * @type string $id The unique string to identify your "component action". Required. + * @type string $label The human readable notification type. Required. + * @type int $position The position to output your filter. Optional. + * } + * @return bool True if the filter has been successfully registered. False otherwise. + */ + function bp_nouveau_notifications_register_filter($args = array()) + { + } + /** + * Get one or all notifications filters. + * + * @since 3.0.0 + * + * @param string $id The notificication component action to get the filter of. + * Leave empty to get all notifications filters. + * @return array|false All or a specific notifications parameters. False if no match are found. + */ + function bp_nouveau_notifications_get_filters($id = '') + { + } + /** + * Sort Notifications according to their position arguments. + * + * @since 3.0.0 + * + * @param array $filters The notifications filters to order. + * @return array The sorted filters. + */ + function bp_nouveau_notifications_sort($filters = array()) + { + } + /** + * Add a dashicon to Notifications action links + * + * @since 3.0.0 + * + * @param string $link The action link. + * @param string $bp_tooltip The data-bp-attribute of the link. + * @param string $aria_label The aria-label attribute of the link. + * @param string $dashicon The dashicon class. + * @return string Link Output. + */ + function bp_nouveau_notifications_dashiconified_link($link = '', $bp_tooltip = '', $dashicon = '') + { + } + /** + * Edit the Mark Unread action link to include a dashicon + * + * @since 3.0.0 + * + * @param string $link Optional. The Mark Unread action link. + * + * @return string Link Output. + */ + function bp_nouveau_notifications_mark_unread_link($link = '') + { + } + /** + * Edit the Mark Read action link to include a dashicon + * + * @since 3.0.0 + * + * @param string $link Optional. The Mark Read action link. + * + * @return string Link Output. + */ + function bp_nouveau_notifications_mark_read_link($link = '') + { + } + /** + * Edit the Delete action link to include a dashicon + * + * @since 3.0.0 + * + * @param string $link Optional. The Delete action link. + * + * @return string Link Output. + */ + function bp_nouveau_notifications_delete_link($link = '') + { + } + /** + * Launch the Notifications loader class. + * + * @since 3.0.0 + */ + function bp_nouveau_notifications($bp_nouveau = \null) + { + } + /** + * Display the notifications filter options. + * + * @since 3.0.0 + */ + function bp_nouveau_notifications_filters() + { + } + /** + * Get the notifications filter options. + * + * @since 3.0.0 + * + * @return string HTML output. + */ + function bp_nouveau_get_notifications_filters() + { + } + /** + * Outputs the order action links. + * + * @since 3.0.0 + */ + function bp_nouveau_notifications_sort_order_links() + { + } + /** + * Output the dropdown for bulk management of notifications. + * + * @since 3.0.0 + */ + function bp_nouveau_notifications_bulk_management_dropdown() + { + } + /** + * Fire specific hooks at various places of templates + * + * @since 3.0.0 + * + * @param array $pieces The list of terms of the hook to join. + */ + function bp_nouveau_hook($pieces = array()) + { + } + /** + * Fire plugin hooks in the plugins.php template (Groups and Members single items) + * + * @since 3.0.0 + * + * @param string $suffix The suffix of the hook. + */ + function bp_nouveau_plugin_hook($suffix = '') + { + } + /** + * Fire friend hooks + * + * @todo Move this into bp-nouveau/includes/friends/template-tags.php + * once we'll need other friends template tags. + * + * @since 3.0.0 + * + * @param string $suffix The suffix of the hook. + */ + function bp_nouveau_friend_hook($suffix = '') + { + } + /** + * Add classes to style the template notice/feedback message + * + * @since 3.0.0 + */ + function bp_nouveau_template_message_classes() + { + } + /** + * Get the template notice/feedback message type + * + * @since 3.0.0 + * + * @return string The type of the notice. Defaults to error. + */ + function bp_nouveau_get_template_message_type() + { + } + /** + * Checks if a template notice/feedback message is set + * + * @since 3.0.0 + * + * @return bool True if a template notice is set. False otherwise. + */ + function bp_nouveau_has_template_message() + { + } + /** + * Checks if the template notice/feedback message needs a dismiss button + * + * @todo Dismiss button re-worked to try and prevent buttons on general + * BP template notices - Nouveau user_feedback key needs review. + * + * @since 3.0.0 + * + * @return bool True if a template notice needs a dismiss button. False otherwise. + */ + function bp_nouveau_has_dismiss_button() + { + } + /** + * Output the dismiss type. + * + * $type is used to set the data-attr for the button. + * 'clear' is tested for & used to remove cookies, if set, in buddypress-nouveau.js. + * Currently template_notices(BP) will take $type = 'clear' if button set to true. + * + * @since 3.0.0 + */ + function bp_nouveau_dismiss_button_type() + { + } + /** + * Displays a template notice/feedback message. + * + * @since 3.0.0 + */ + function bp_nouveau_template_message() + { + } + /** + * Get the template notice/feedback message and make sure core filter is applied. + * + * @since 3.0.0 + * + * @return string HTML Output. + */ + function bp_nouveau_get_template_message() + { + } + /** + * Template tag to display feedback notices to users, if there are to display + * + * @since 3.0.0 + */ + function bp_nouveau_template_notices() + { + } + /** + * Displays a feedback message to the user. + * + * @since 3.0.0 + * + * @param string $feedback_id The ID of the message to display. + */ + function bp_nouveau_user_feedback($feedback_id = '') + { + } + /** + * Template tag to wrap the before component loop + * + * @since 3.0.0 + */ + function bp_nouveau_before_loop() + { + } + /** + * Template tag to wrap the after component loop + * + * @since 3.0.0 + */ + function bp_nouveau_after_loop() + { + } + /** + * Pagination for loops + * + * @since 3.0.0 + * + * @param string $position Pagination for loops. + */ + function bp_nouveau_pagination($position) + { + } + /** + * Display the component's loop classes + * + * @since 3.0.0 + */ + function bp_nouveau_loop_classes() + { + } + /** + * Get the component's loop classes + * + * @since 3.0.0 + * + * @return string space separated value of classes. + */ + function bp_nouveau_get_loop_classes() + { + } + /** + * Checks if the layout preferences is set to grid (2 or more columns). + * + * @since 3.0.0 + * + * @return bool True if loop is displayed in grid mod. False otherwise. + */ + function bp_nouveau_loop_is_grid() + { + } + /** + * Returns the number of columns of the layout preferences. + * + * @since 3.0.0 + * + * @return int The number of columns. + */ + function bp_nouveau_loop_get_grid_columns() + { + } + /** + * Return a bool check for component directory layout. + * + * Checks if activity, members, groups, blogs has the vert nav layout selected. + * + * @since 3.0.0 + * + * @return bool + */ + function bp_dir_is_vert_layout() + { + } + /** + * Template tag to wrap the Legacy actions that was used + * after the components directory page. + * + * @since 6.0.0 + */ + function bp_nouveau_after_directory_page() + { + } + /** + * Get the full size avatar args. + * + * @since 3.0.0 + * + * @return array The avatar arguments. + */ + function bp_nouveau_avatar_args() + { + } + /** Template Tags for BuddyPress navigations **********************************/ + /* + * This is the BP Nouveau Navigation Loop. + * + * It can be used by any object using the + * BP_Core_Nav API introduced in BuddyPress 2.6.0. + */ + /** + * Init the Navigation Loop and check it has items. + * + * @since 3.0.0 + * + * @param array $args { + * Array of arguments. + * + * @type string $type The type of Nav to get (primary or secondary) + * Default 'primary'. Required. + * @type string $object The object to get the nav for (eg: 'directory', 'group_manage', + * or any custom object). Default ''. Optional + * @type bool $user_has_access Used by the secondary member's & group's nav. Default true. Optional. + * @type bool $show_for_displayed_user Used by the primary member's nav. Default true. Optional. + * } + * + * @return bool True if the Nav contains items. False otherwise. + */ + function bp_nouveau_has_nav($args = array()) + { + } + /** + * Checks there are still nav items to display. + * + * @since 3.0.0 + * + * @return bool True if there are still items to display. False otherwise. + */ + function bp_nouveau_nav_items() + { + } + /** + * Sets the current nav item and prepare the navigation loop to iterate to next one. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_item() + { + } + /** + * Displays the nav item ID. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_id() + { + } + /** + * Retrieve the ID attribute of the current nav item. + * + * @since 3.0.0 + * + * @return string the ID attribute. + */ + function bp_nouveau_get_nav_id() + { + } + /** + * Displays the nav item classes. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_classes() + { + } + /** + * Retrieve a space separated list of classes for the current nav item. + * + * @since 3.0.0 + * + * @return string List of classes. + */ + function bp_nouveau_get_nav_classes() + { + } + /** + * Displays the nav item scope. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_scope() + { + } + /** + * Retrieve the specific scope for the current nav item. + * + * @since 3.0.0 + * + * @return string the specific scope of the nav. + */ + function bp_nouveau_get_nav_scope() + { + } + /** + * Displays the nav item URL. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_link() + { + } + /** + * Retrieve the URL for the current nav item. + * + * @since 3.0.0 + * + * @return string The URL for the nav item. + */ + function bp_nouveau_get_nav_link() + { + } + /** + * Displays the nav item link ID. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_link_id() + { + } + /** + * Retrieve the id attribute of the link for the current nav item. + * + * @since 3.0.0 + * + * @return string The link id for the nav item. + */ + function bp_nouveau_get_nav_link_id() + { + } + /** + * Displays the nav item link title. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_link_title() + { + } + /** + * Retrieve the title attribute of the link for the current nav item. + * + * @since 3.0.0 + * + * @return string The link title for the nav item. + */ + function bp_nouveau_get_nav_link_title() + { + } + /** + * Displays the nav item link html text. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_link_text() + { + } + /** + * Retrieve the html text of the link for the current nav item. + * + * @since 3.0.0 + * + * @return string The html text for the nav item. + */ + function bp_nouveau_get_nav_link_text() + { + } + /** + * Checks if the nav item has a count attribute. + * + * @since 3.0.0 + * + * @return bool + */ + function bp_nouveau_nav_has_count() + { + } + /** + * Displays the nav item count attribute. + * + * @since 3.0.0 + */ + function bp_nouveau_nav_count() + { + } + /** + * Retrieve the count attribute for the current nav item. + * + * @since 3.0.0 + * + * @return int The count attribute for the nav item. + */ + function bp_nouveau_get_nav_count() + { + } + /** Template tags specific to the Directory navs ******************************/ + /** + * Displays the directory nav class. + * + * @since 3.0.0 + */ + function bp_nouveau_directory_type_navs_class() + { + } + /** + * Provides default nav wrapper classes. + * + * Gets the directory component nav class. + * Gets user selection Customizer options. + * + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_get_directory_type_navs_class() + { + } + /** + * Displays the directory nav item list class. + * + * @since 3.0.0 + */ + function bp_nouveau_directory_list_class() + { + } + /** + * Gets the directory nav item list class. + * + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_get_directory_list_class() + { + } + /** + * Displays the directory nav item object (data-bp attribute). + * + * @since 3.0.0 + */ + function bp_nouveau_directory_nav_object() + { + } + /** + * Gets the directory nav item object. + * + * @see BP_Component::setup_nav(). + * + * @since 3.0.0 + * + * @return array + */ + function bp_nouveau_get_directory_nav_object() + { + } + // Template tags for the single item navs. + /** + * Output main BuddyPress container classes. + * + * @since 3.0.0 + * + * @return string CSS classes + */ + function bp_nouveau_container_classes() + { + } + /** + * Returns the main BuddyPress container classes. + * + * @since 3.0.0 + * @since 7.0.0 Add a class to inform about the active Theme. + * + * @return string CSS classes + */ + function bp_nouveau_get_container_classes() + { + } + /** + * Output single item nav container classes + * + * @since 3.0.0 + */ + function bp_nouveau_single_item_nav_classes() + { + } + /** + * Returns the single item nav container classes + * + * @since 3.0.0 + * + * @return string CSS classes. + */ + function bp_nouveau_get_single_item_nav_classes() + { + } + /** + * Output single item subnav container classes. + * + * @since 3.0.0 + */ + function bp_nouveau_single_item_subnav_classes() + { + } + /** + * Returns the single item subnav container classes. + * + * @since 3.0.0 + * + * @return string CSS classes. + */ + function bp_nouveau_get_single_item_subnav_classes() + { + } + /** + * Output the groups create steps classes. + * + * @since 3.0.0 + */ + function bp_nouveau_groups_create_steps_classes() + { + } + /** + * Returns the groups create steps customizer option choice class. + * + * @since 3.0.0 + * + * @return string CSS classes. + */ + function bp_nouveau_get_group_create_steps_classes() + { + } + /** Template tags for the object search **************************************/ + /** + * Get the search primary object + * + * @since 3.0.0 + * + * @param string $object (Optional) The primary object. + * + * @return string The primary object. + */ + function bp_nouveau_get_search_primary_object($object = '') + { + } + /** + * Get The list of search objects (primary + secondary). + * + * @since 3.0.0 + * + * @param array $objects (Optional) The list of objects. + * + * @return array The list of objects. + */ + function bp_nouveau_get_search_objects($objects = array()) + { + } + /** + * Output the search form container classes. + * + * @since 3.0.0 + */ + function bp_nouveau_search_container_class() + { + } + /** + * Output the search form data-bp attribute. + * + * @since 3.0.0 + * + * @param string $attr The data-bp attribute. + * @return string The data-bp attribute. + */ + function bp_nouveau_search_object_data_attr($attr = '') + { + } + /** + * Output a selector ID. + * + * @since 3.0.0 + * + * @param string $suffix Optional. A string to append at the end of the ID. + * @param string $sep Optional. The separator to use between each token. + */ + function bp_nouveau_search_selector_id($suffix = '', $sep = '-') + { + } + /** + * Output the name attribute of a selector. + * + * @since 3.0.0 + * + * @param string $suffix Optional. A string to append at the end of the name. + * @param string $sep Optional. The separator to use between each token. + */ + function bp_nouveau_search_selector_name($suffix = '', $sep = '_') + { + } + /** + * Output the default search text for the search object + * + * @todo 28/09/17 added 'empty( $text )' check to $object query as it wasn't returning output as expected & not returning user set params + * This may require further examination - hnla + * + * @since 3.0.0 + * + * @param string $text Optional. The default search text for the search object. + * @param string $is_attr Optional. True if it's to be output inside an attribute. False otherwise. + */ + function bp_nouveau_search_default_text($text = '', $is_attr = \true) + { + } + /** + * Get the search form template part and fire some do_actions if needed. + * + * @since 3.0.0 + */ + function bp_nouveau_search_form() + { + } + // Template tags for the directory & user/group screen filters. + /** + * Get the current component or action. + * + * If on single group screens we need to switch from component to bp_current_action() to add the correct + * IDs/labels for group/activity & similar screens. + * + * @since 3.0.0 + */ + function bp_nouveau_current_object() + { + } + /** + * Output data filter container's ID attribute value. + * + * @since 3.0.0 + */ + function bp_nouveau_filter_container_id() + { + } + /** + * Get data filter container's ID attribute value. + * + * @since 3.0.0 + * + * @param string + */ + function bp_nouveau_get_filter_container_id() + { + } + /** + * Output data filter's ID attribute value. + * + * @since 3.0.0 + */ + function bp_nouveau_filter_id() + { + } + /** + * Get data filter's ID attribute value. + * + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_get_filter_id() + { + } + /** + * Output data filter's label. + * + * @since 3.0.0 + */ + function bp_nouveau_filter_label() + { + } + /** + * Get data filter's label. + * + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_get_filter_label() + { + } + /** + * Output data filter's data-bp-filter attribute value. + * + * @since 3.0.0 + */ + function bp_nouveau_filter_component() + { + } + /** + * Output the <option> of the data filter's <select> element. + * + * @since 3.0.0 + */ + function bp_nouveau_filter_options() + { + } + /** + * Get the <option> of the data filter's <select> element. + * + * @since 3.0.0 + * + * @return string + */ + function bp_nouveau_get_filter_options() + { + } + /** Template tags for the Customizer ******************************************/ + /** + * Get a link to reach a specific section into the customizer + * + * @since 3.0.0 + * + * @param array $args Optional. The argument to customize the Customizer link. + * + * @return string HTML. + */ + function bp_nouveau_get_customizer_link($args = array()) + { + } + /** Template tags for signup forms *******************************************/ + /** + * Fire specific hooks into the register template + * + * @since 3.0.0 + * + * @param string $when 'before' or 'after' + * @param string $prefix Use it to add terms before the hook name + */ + function bp_nouveau_signup_hook($when = '', $prefix = '') + { + } + /** + * Fire specific hooks into the activate template + * + * @since 3.0.0 + * + * @param string $when 'before' or 'after' + * @param string $prefix Use it to add terms before the hook name + */ + function bp_nouveau_activation_hook($when = '', $suffix = '') + { + } + /** + * Output the signup form for the requested section + * + * @since 3.0.0 + * + * @param string $section Optional. The section of fields to get 'account_details' or 'blog_details'. + * Default: 'account_details'. + */ + function bp_nouveau_signup_form($section = 'account_details') + { + } + /** + * Outputs the Privacy Policy acceptance area on the registration page. + * + * @since 4.0.0 + */ + function bp_nouveau_signup_privacy_policy_acceptance_section() + { + } + /** + * Output a submit button and the nonce for the requested action. + * + * @since 3.0.0 + * + * @param string $action The action to get the submit button for. Required. + */ + function bp_nouveau_submit_button($action, $object_id = 0) + { + } + /** + * Display supplemental error or feedback messages. + * + * This template handles in page error or feedback messages e.g signup fields + * 'Username exists' type registration field error notices. + * + * @param string $message required: the message to display. + * @param string $type optional: the type of error message e.g 'error'. + * + * @since 3.0.0 + */ + function nouveau_error_template($message = '', $type = '') + { + } + /** + * Checks whether the Activity RSS links should be output. + * + * @since 8.0.0 + * + * @return bool True to output the Activity RSS link. False otherwise. + */ + function bp_nouveau_is_feed_enable() + { + } + /** + * Displays an ellipsis to show hidden primary nav items. + * + * @since 12.0.0 + */ + function bp_nouveau_hidden_primary_nav() + { + } + /** + * Displays an ellipsis to show hidden secondary nav items. + * + * @since 12.0.0 + */ + function bp_nouveau_hidden_secondary_nav() + { + } + /** + * Get a unique instance of BP Nouveau + * + * @since 3.0.0 + * + * @return BP_Nouveau the main instance of the class + */ + function bp_nouveau() + { + } + /** + * Output the settings component slug. + * + * @since 1.5.0 + */ + function bp_settings_slug() + { + } + /** + * Return the settings component slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_settings_slug() + { + } + /** + * Output the settings component root slug. + * + * @since 1.5.0 + */ + function bp_settings_root_slug() + { + } + /** + * Return the settings component root slug. + * + * @since 1.5.0 + * + * @return string + */ + function bp_get_settings_root_slug() + { + } + /** + * Add the 'pending email change' message to the settings page. + * + * @since 2.1.0 + */ + function bp_settings_pending_email_notice() + { + } + /** + * Update email notification settings for a specific user. + * + * @since 2.3.5 + * + * @param int $user_id ID of the user whose settings are being updated. + * @param array $settings Settings array. + */ + function bp_settings_update_notification_settings($user_id, $settings) + { + } + /** + * Sanitize email notification settings as submitted by a user. + * + * @since 2.3.5 + * + * @param array $settings Array of settings. + * @return array Sanitized settings. + */ + function bp_settings_sanitize_notification_settings($settings = array()) + { + } + /** + * Build a dynamic list of allowed notification keys, based on what's hooked to 'bp_notification_settings'. + * + * @since 2.3.5 + * + * @return array + */ + function bp_settings_get_registered_notification_keys() + { + } + /** + * Finds and exports personal data associated with an email address from the Settings component. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_settings_personal_data_exporter($email_address, $page) + { + } + /** + * Fetches a user's personal data request. + * + * @since 4.0.0 + * + * @param int $user_id WP user ID. + * @return WP_User_Request|bool WP_User_Request object on success, bool false on failure. + */ + function bp_settings_get_personal_data_request($user_id = 0) + { + } + /** + * Fetches the expiration date for when a user request expires. + * + * @since 4.0.0 + * + * @param WP_User_Request $request User request object. + * @return string Formatted date. + */ + function bp_settings_get_personal_data_expiration_date(\WP_User_Request $request) + { + } + /** + * Fetches the confirmation date for a user request object. + * + * @since 4.0.0 + * + * @param WP_User_Request $request User request object. + * @return string Formatted date for the confirmation date. + */ + function bp_settings_get_personal_data_confirmation_date(\WP_User_Request $request) + { + } + /** + * Fetches the URL for a personal data export file. + * + * @since 4.0.0 + * + * @param WP_User_Request $request User request object. + * @return string Export file URL. + */ + function bp_settings_get_personal_data_export_url(\WP_User_Request $request) + { + } + /** + * Check if the generated data export file still exists or not. + * + * @since 4.0.0 + * + * @param WP_User_Request $request User request object. + * @return bool + */ + function bp_settings_personal_data_export_exists(\WP_User_Request $request) + { + } + /** + * Template tag to output a list of data exporter items. + * + * Piggybacks off of the 'wp_privacy_personal_data_exporters' filter and the + * 'exporter_friendly_name' key, which is meant for the admin area. + * + * @since 4.0.0 + * @since 5.0.0 Looks for a potential exporter's BP/custom friendly name. + */ + function bp_settings_data_exporter_items() + { + } + /** + * Whether a user can delete self account from front-end. + * + * @since 12.0.0 + * + * @return bool True if user can delete self account from front-end. False otherwise. + */ + function bp_settings_can_delete_self_account() + { + } + /** + * Whether to show the Delete account front-end nav. + * + * @since 12.0.0 + * + * @return bool True if user can be shown the Delete account nav. False otherwise. + */ + function bp_settings_show_delete_account_nav() + { + } + /** + * Whether to show the Capability front-end nav. + * + * @since 12.0.0 + * + * @return bool True if user can be shown the Capability nav. False otherwise. + */ + function bp_settings_show_capability_nav() + { + } + /** + * Registers Settings personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_settings_register_personal_data_exporter($exporters) + { + } + /** + * Settings: User's "Settings > Capabilities" screen handler. + * + * @package BuddyPress + * @subpackage SettingsScreens + * @since 3.0.0 + */ + /** + * Show the capabilities settings template. + * + * @since 1.6.0 + */ + function bp_settings_screen_capabilities() + { + } + /** + * Settings: User's "Settings > Export Data" screen handler. + * + * @package BuddyPress + * @subpackage SettingsScreens + * @since 4.0.0 + */ + /** + * Show the data settings template. + * + * @since 4.0.0 + */ + function bp_settings_screen_data() + { + } + /** + * Settings: User's "Settings > Email" screen handler. + * + * @package BuddyPress + * @subpackage SettingsScreens + * @since 3.0.0 + */ + /** + * Show the notifications settings template. + * + * @since 1.5.0 + */ + function bp_settings_screen_notification() + { + } + /** + * Settings: User's "Settings > Delete Account" screen handler. + * + * @package BuddyPress + * @subpackage SettingsScreens + * @since 3.0.0 + */ + /** + * Show the delete-account settings template. + * + * @since 1.5.0 + */ + function bp_settings_screen_delete_account() + { + } + /** + * Settings: User's "Settings" screen handler. + * + * @package BuddyPress + * @subpackage SettingsScreens + * @since 3.0.0 + */ + /** + * Show the general settings template. + * + * @since 1.5.0 + */ + function bp_settings_screen_general() + { + } + /** + * Removes 'Email' sub nav, if no component has registered options there. + * + * @since 2.2.0 + */ + function bp_settings_remove_email_subnav() + { + } + /** + * Settings: Capabilities action handler. + * + * @package BuddyPress + * @subpackage SettingsActions + * @since 3.0.0 + */ + /** + * Handles the setting of user capabilities, spamming, hamming, role, etc. + * + * @since 1.6.0 + */ + function bp_settings_action_capabilities() + { + } + /** + * Settings: Data management action handler. + * + * @package BuddyPress + * @subpackage SettingsActions + * @since 4.0.0 + */ + /** + * Data export request handler. + * + * @since 4.0.0 + */ + function bp_settings_action_data() + { + } + /** + * Settings: Email notifications action handler. + * + * @package BuddyPress + * @subpackage SettingsActions + * @since 3.0.0 + */ + /** + * Handles the changing and saving of user notification settings. + * + * @since 1.6.0 + */ + function bp_settings_action_notifications() + { + } + /** + * Settings: Account deletion action handler. + * + * @package BuddyPress + * @subpackage SettingsActions + * @since 3.0.0 + */ + /** + * Handles the deleting of a user. + * + * @since 1.6.0 + */ + function bp_settings_action_delete_account() + { + } + /** + * Settings: Email address and password action handler. + * + * @package BuddyPress + * @subpackage SettingsActions + * @since 3.0.0 + */ + /** + * Handles the changing and saving of user email addresses and passwords. + * + * We do quite a bit of logic and error handling here to make sure that users + * do not accidentally lock themselves out of their accounts. We also try to + * provide as accurate of feedback as possible without exposing anyone else's + * information to them. + * + * Special considerations are made for super admins that are able to edit any + * users accounts already, without knowing their existing password. + * + * @since 1.6.0 + */ + function bp_settings_action_general() + { + } + /** + * Process email change verification or cancel requests. + * + * @since 2.1.0 + */ + function bp_settings_verify_email_change() + { + } + /** + * Set up the bp-settings component. + * + * @since 1.6.0 + */ + function bp_setup_settings() + { + } + /** + * Sets BuddyPress globals for Ajax requests using the BP Rewrites API. + * + * @since 12.0.0 + */ + function bp_core_set_ajax_uri_globals() + { + } + /** + * Are root profiles enabled and allowed? + * + * @since 1.6.0 + * + * @return bool + */ + function bp_core_enable_root_profiles() + { + } + /** + * Load a specific template file with fallback support. + * + * Example: + * bp_core_load_template( 'members/index' ); + * Loads: + * wp-content/themes/[activated_theme]/members/index.php + * + * @since 1.0.0 + * @since 14.0.0 Uses `locate_block_template()` to support BuddyPress Block only Themes. + * + * @param array $templates Array of templates to attempt to load. + */ + function bp_core_load_template($templates) + { + } + /** + * Redirect away from /profile URIs if XProfile is not enabled. + * + * @since 1.0.0 + */ + function bp_core_catch_profile_uri() + { + } + /** + * Members user shortlink redirector. + * + * Redirects x.com/members/me/* to x.com/members/{LOGGED_IN_USER_SLUG}/* + * + * @since 2.6.0 + * + * @param string $member_slug The current member slug. + * @return string $member_slug The current member slug. + */ + function bp_core_members_shortlink_redirector($member_slug) + { + } + /** + * Catch unauthorized access to certain BuddyPress pages and redirect accordingly. + * + * @since 1.5.0 + */ + function bp_core_catch_no_access() + { + } + /** + * Redirect a user to log in for BP pages that require access control. + * + * Add an error message (if one is provided). + * + * If authenticated, redirects user back to requested content by default. + * + * @since 1.5.0 + * + * @param array|string $args { + * Optional. Array of arguments for redirecting user when visiting access controlled areas. + * @type int $mode Specifies the destination of the redirect. 1 will + * direct to the root domain (home page), which assumes you have a + * log-in form there; 2 directs to wp-login.php. Default: 2. + * @type string $redirect The URL the user will be redirected to after successfully + * logging in. Default: the URL originally requested. + * @type string $root The root URL of the site, used in case of error or mode 1 redirects. + * Default: the value of {@link bp_get_root_url()}. + * @type string $message An error message to display to the user on the log-in page. + * Default: "You must log in to access the page you requested." + * } + */ + function bp_core_no_access($args = '') + { + } + /** + * Login redirector. + * + * If a link is not publicly available, we can send members from external + * locations, like following links in an email, through the login screen. + * + * If a user clicks on this link and is already logged in, we should attempt + * to redirect the user to the authorized content instead of forcing the user + * to re-authenticate. + * + * @since 2.9.0 + */ + function bp_login_redirector() + { + } + /** + * Add a custom BuddyPress no access error message to wp-login.php. + * + * @since 1.5.0 + * @since 2.7.0 Hook moved to 'wp_login_errors' made available since WP 3.6.0. + * + * @param WP_Error $errors Current error container. + * @return WP_Error + */ + function bp_core_no_access_wp_login_error($errors) + { + } + /** + * Add our custom error code to WP login's shake error codes. + * + * @since 2.7.0 + * + * @param array $codes Array of WP error codes. + * @return array + */ + function bp_core_login_filter_shake_codes($codes) + { + } + /** + * Canonicalize BuddyPress URLs. + * + * This function ensures that requests for BuddyPress content are always + * redirected to their canonical versions. Canonical versions are always + * trailingslashed, and are typically the most general possible versions of the + * URL - eg, example.com/groups/mygroup/ instead of + * example.com/groups/mygroup/home/. + * + * @since 1.6.0 + * + * @see BP_Members_Component::setup_globals() where + * $bp->canonical_stack['base_url'] and ['component'] may be set. + * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set. + */ + function bp_redirect_canonical() + { + } + /** + * Output rel=canonical header tag for BuddyPress content. + * + * @since 1.6.0 + */ + function bp_rel_canonical() + { + } + /** + * Get the canonical URL of the current page. + * + * @since 1.6.0 + * + * @param array $args { + * Optional array of arguments. + * @type bool $include_query_args Whether to include current URL arguments + * in the canonical URL returned from the function. + * } + * @return string Canonical URL for the current page. + */ + function bp_get_canonical_url($args = array()) + { + } + /** + * Return the URL as requested on the current page load by the user agent. + * + * @since 1.6.0 + * + * @return string Requested URL string. + */ + function bp_get_requested_url() + { + } + /** + * Remove WP's canonical redirect when we are trying to load BP-specific content. + * + * Avoids issues with WordPress thinking that a BuddyPress URL might actually + * be a blog post or page. + * + * This function should be considered temporary, and may be removed without + * notice in future versions of BuddyPress. + * + * @since 1.6.0 + */ + function _bp_maybe_remove_redirect_canonical() + { + } + /** + * Rehook maybe_redirect_404() to run later than the default. + * + * WordPress's maybe_redirect_404() allows admins on a multisite installation + * to define 'NOBLOGREDIRECT', a URL to which 404 requests will be redirected. + * maybe_redirect_404() is hooked to template_redirect at priority 10, which + * creates a race condition with bp_template_redirect(), our piggyback hook. + * Due to a legacy bug in BuddyPress, internal BP content (such as members and + * groups) is marked 404 in $wp_query until bp_core_load_template(), when BP + * manually overrides the automatic 404. However, the race condition with + * maybe_redirect_404() means that this manual un-404-ing doesn't happen in + * time, with the results that maybe_redirect_404() thinks that the page is + * a legitimate 404, and redirects incorrectly to NOBLOGREDIRECT. + * + * By switching maybe_redirect_404() to catch at a higher priority, we avoid + * the race condition. If bp_core_load_template() runs, it dies before reaching + * maybe_redirect_404(). If bp_core_load_template() does not run, it means that + * the 404 is legitimate, and maybe_redirect_404() can proceed as expected. + * + * This function will be removed in a later version of BuddyPress. Plugins + * (and plugin authors!) should ignore it. + * + * @since 1.6.1 + * + * @link https://buddypress.trac.wordpress.org/ticket/4329 + * @link https://buddypress.trac.wordpress.org/ticket/4415 + */ + function _bp_rehook_maybe_redirect_404() + { + } + /** + * Remove WP's rel=canonical HTML tag if we are trying to load BP-specific content. + * + * This function should be considered temporary, and may be removed without + * notice in future versions of BuddyPress. + * + * @since 1.6.0 + */ + function _bp_maybe_remove_rel_canonical() + { + } + /** + * Stop WordPress performing a DB query for its main loop. + * + * As of WordPress 4.6, it is possible to bypass the main WP_Query entirely. + * This saves us one unnecessary database query! :) + * + * @since 2.7.0 + * + * @param null $retval Current return value for filter. + * @param WP_Query $query Current WordPress query object. + * @return null|array + */ + function bp_core_filter_wp_query($retval, $query) + { + } + /** + * Add an item to the primary navigation of the specified component. + * + * @since 1.1.0 + * @since 2.6.0 Introduced the `$component` parameter. + * @since 4.0.0 Introduced the `$component_id` argument. + * + * @param array|string $args { + * Array describing the new nav item. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type string $component_id Optional. The ID of the component registering the nav item. Defaults to slug. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. + * } + * @param string $component The component the navigation is attached to. Defaults to 'members'. + * @return null|false Returns false on failure. + */ + function bp_core_new_nav_item($args, $component = 'members') + { + } + /** + * Add a link to the main BuddyPress navigation. + * + * @since 2.4.0 + * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Core_Nav_Item + * object on success. + * @since 4.0.0 Introduced `$component_id` argument. + * + * @param array|string $args { + * Array describing the new nav item. + * @type string $component_id Optional. The ID of the component registering this nav item. Defaults to the + * the value of `$slug`. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. + * } + * @param string $component Optional. Component that the nav belongs to. + * @return false|array Returns false on failure, new nav item on success. + */ + function bp_core_create_nav_link($args = '', $component = 'members') + { + } + /** + * Register a screen function for an item in the main nav array. + * + * @since 2.4.0 + * + * @param array|string $args { + * Array describing the new nav item. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. + * } + * @return false|null Returns false on failure. + */ + function bp_core_register_nav_screen_function($args = '') + { + } + /** + * Modify the default subnav item that loads when a top level nav item is clicked. + * + * @since 1.1.0 + * + * @param array|string $args { + * Optional. Array describing the new default subnav item. + * + * @type string $parent_slug The slug of the nav item whose default is being changed. + * @type callable $screen_function The new default callback function that will run when the nav item is clicked. + * @type string $subnav_slug The slug of the new default subnav item. + * } + */ + function bp_core_new_nav_default($args = '') + { + } + /** + * Add an item to secondary navigation of the specified component. + * + * @since 1.1.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param array|string $args { + * Array describing the new subnav item. + * @type string $name Display name for the subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the new subnav item should + * be added. + * @type string $parent_url URL of the parent nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $user_has_access Optional. True if the logged-in user has access to the subnav item, + * otherwise false. Can be set dynamically when registering the subnav; + * eg, use `bp_is_my_profile()` to restrict access to profile owners only. + * Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in the + * subnav array. Default: 90. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type string $link Optional. The URL that the subnav item should point to. Defaults to a value + * generated from the `$parent_url` + `$slug`. + * @type bool $show_in_admin_bar Optional. Whether the nav item should be added into the group's "Edit" + * Admin Bar menu for group admins. Default: false. + * } + * @param string|null $component The component the navigation is attached to. Defaults to 'members'. + * @return null|false Returns false on failure. + */ + function bp_core_new_subnav_item($args, $component = \null) + { + } + /** + * Add a subnav link to the BuddyPress navigation. + * + * @since 2.4.0 + * @since 2.6.0 Introduced the `$component` parameter. Began returning a BP_Core_Nav_Item object on success. + * + * @param array|string $args { + * Array describing the new subnav item. + * @type string $name Display name for the subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the + * new subnav item should be added. + * @type string $parent_url URL of the parent nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav + * item. Default: the value of $slug. + * @type bool $user_has_access Optional. True if the logged-in user has access to the + * subnav item, otherwise false. Can be set dynamically + * when registering the subnav; eg, use bp_is_my_profile() + * to restrict access to profile owners only. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only + * to site admins (those with the 'bp_moderate' cap). + * Default: false. + * @type int $position Optional. Numerical index specifying where the item + * should appear in the subnav array. Default: 90. + * @type callable $screen_function The callback function that will run + * when the nav item is clicked. + * @type string $link Optional. The URL that the subnav item should point + * to. Defaults to a value generated from the $parent_url + $slug. + * @type bool $show_in_admin_bar Optional. Whether the nav item should be added into + * the group's "Edit" Admin Bar menu for group admins. + * Default: false. + * } + * @param string $component The component the navigation is attached to. Defaults to 'members'. + * @return false|array Returns false on failure, new BP_Core_Nav_Item instance on success. + */ + function bp_core_create_subnav_link($args = '', $component = 'members') + { + } + /** + * Register a screen function, whether or not a related subnav link exists. + * + * @since 2.4.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param array|string $args { + * Array describing the new subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the + * new subnav item should be added. + * @type string $parent_url URL of the parent nav item. + * @type bool $user_has_access Optional. True if the logged-in user has access to the + * subnav item, otherwise false. Can be set dynamically + * when registering the subnav; eg, use bp_is_my_profile() + * to restrict access to profile owners only. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible + * only to site admins (those with the 'bp_moderate' cap). + * Default: false. + * @type int $position Optional. Numerical index specifying where the item + * should appear in the subnav array. Default: 90. + * @type callable $screen_function The callback function that will run + * when the nav item is clicked. + * @type string $link Optional. The URL that the subnav item should point to. + * Defaults to a value generated from the $parent_url + $slug. + * @type bool $show_in_admin_bar Optional. Whether the nav item should be added into + * the group's "Edit" Admin Bar menu for group admins. + * Default: false. + * } + * @param string $component The component the navigation is attached to. Defaults to 'members'. + * @return null|false Returns false on failure. + */ + function bp_core_register_subnav_screen_function($args = '', $component = 'members') + { + } + /** + * For a given subnav item, either hook the screen function or generate redirect arguments, as necessary. + * + * @since 2.1.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param array $subnav_item The subnav array added to the secondary navigation of + * the component in bp_core_new_subnav_item(). + * @param string $component The component the navigation is attached to. Defaults to 'members'. + * @return array + */ + function bp_core_maybe_hook_new_subnav_screen_function($subnav_item, $component = 'members') + { + } + /** + * Check whether a given nav item has subnav items. + * + * @since 1.5.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param string $nav_item The slug of the top-level nav item whose subnav items you're checking. + * Default: the current component slug. + * @param string $component The component the navigation is attached to. Defaults to 'members'. + * @return bool $has_subnav True if the nav item is found and has subnav items; false otherwise. + */ + function bp_nav_item_has_subnav($nav_item = '', $component = 'members') + { + } + /** + * Deletes an item from the primary navigation of the specified component. + * + * @since 1.0.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param string $slug The slug of the primary navigation item. + * @param string|null $component The component the navigation is attached to. Defaults to 'members'. + * @return bool Returns false on failure, True on success. + */ + function bp_core_remove_nav_item($slug, $component = \null) + { + } + /** + * Deletes an item from the secondary navigation of the specified component. + * + * @since 1.0.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param string $parent_slug The slug of the primary navigation item. + * @param string $slug The slug of the secondary item to be removed. + * @param string|null $component The component the navigation is attached to. Defaults to 'members'. + * @return bool Returns false on failure, True on success. + */ + function bp_core_remove_subnav_item($parent_slug, $slug, $component = \null) + { + } + /** + * Clear all subnav items from a specific nav item. + * + * @since 1.0.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param string $parent_slug The slug of the parent navigation item. + * @param string $component The component the navigation is attached to. Defaults to 'members'. + */ + function bp_core_reset_subnav_items($parent_slug, $component = 'members') + { + } + /** + * Retrieve the Toolbar display preference of a user based on context. + * + * This is a direct copy of WP's private _get_admin_bar_pref() + * + * @since 1.5.0 + * + * @param string $context Context of this preference check. 'admin' or 'front'. + * @param int $user Optional. ID of the user to check. Default: 0 (which falls back to the logged-in user's ID). + * @return bool True if the toolbar should be showing for this user. + */ + function bp_get_admin_bar_pref($context, $user = 0) + { + } + /** Moderation ****************************************************************/ + /** + * Check for flooding. + * + * Check to make sure that a user is not making too many posts in a short amount + * of time. + * + * @since 1.6.0 + * + * @param int $user_id User id to check for flood. + * @return bool True if there is no flooding, false if there is. + */ + function bp_core_check_for_flood($user_id = 0) + { + } + /** + * Check for moderation keys and too many links. + * + * @since 1.6.0 + * @since 2.6.0 Added $error_type parameter. + * + * @param int $user_id User ID. + * @param string $title The title of the content. + * @param string $content The content being posted. + * @param string $error_type The error type to return. Either 'bool' or 'wp_error'. + * @return bool|WP_Error True if test is passed, false if fail. + */ + function bp_core_check_for_moderation($user_id = 0, $title = '', $content = '', $error_type = 'bool') + { + } + /** + * Check for blocked keys. + * + * @since 7.0.0 + * + * @param int $user_id User ID. + * @param string $title The title of the content. + * @param string $content The content being posted. + * @param string $error_type The error type to return. Either 'bool' or 'wp_error'. + * @return bool|WP_Error True if test is passed, false if fail. + */ + function bp_core_check_for_disallowed_keys($user_id = 0, $title = '', $content = '', $error_type = 'bool') + { + } + /** + * Get the current user's IP address. + * + * @since 1.6.0 + * + * @return string IP address. + */ + function bp_core_current_user_ip() + { + } + /** + * Get the current user's user-agent. + * + * @since 1.6.0 + * + * @return string User agent string. + */ + function bp_core_current_user_ua() + { + } + /** + * Is the BP REST plugin is active? + * + * @since 5.0.0 + * + * @return bool True if the BP REST plugin is active. False otherwise. + */ + function bp_rest_is_plugin_active() + { + } + /** + * Should we use the REST Endpoints of built BuddyPress? + * + * If the BP REST plugin is active, it overrides BuddyPress REST enpoints. + * This allows us to carry on maintaining all the BP REST API endpoints from + * the BP REST plugin on GitHub. + * + * @since 5.0.0 + * + * @return bool Whether to use the REST Endpoints of built BuddyPress. + */ + function bp_rest_in_buddypress() + { + } + /** + * Check the availability of the BP REST API. + * + * @since 5.0.0 + * + * @return bool True if the BP REST API is available. False otherwise. + */ + function bp_rest_api_is_available() + { + } + /** + * Register the jQuery.ajax wrapper for BP REST API requests. + * + * @since 5.0.0 + * @deprecated 10.0.0 + */ + function bp_rest_api_register_request_script() + { + } + /** + * BuddyPress REST API namespace. + * + * @since 5.0.0 + * + * @return string + */ + function bp_rest_namespace() + { + } + /** + * BuddyPress REST API version. + * + * @since 5.0.0 + * + * @return string + */ + function bp_rest_version() + { + } + /** + * Get a REST API object URL from a component. + * + * @since 9.0.0 + * + * @param integer $object_id Object ID. + * @param string $object_path Path of the component endpoint. + * @return string + */ + function bp_rest_get_object_url($object_id, $object_path) + { + } + /** + * Set headers to let the Client Script be aware of the pagination. + * + * @since 5.0.0 + * + * @param WP_REST_Response $response The response data. + * @param integer $total The total number of found items. + * @param integer $per_page The number of items per page of results. + * @return WP_REST_Response $response The response data. + */ + function bp_rest_response_add_total_headers(\WP_REST_Response $response, $total = 0, $per_page = 0) + { + } + /** + * Convert the input date to RFC3339 format. + * + * @since 5.0.0 + * + * @param string $date_gmt Date GMT format. + * @param string|null $date Optional. Date object. + * @return string|null ISO8601/RFC3339 formatted datetime. + */ + function bp_rest_prepare_date_response($date_gmt, $date = \null) + { + } + /** + * Clean up member_type input. + * + * @since 5.0.0 + * + * @param string $value Comma-separated list of group types. + * @return array|null + */ + function bp_rest_sanitize_member_types($value) + { + } + /** + * Validate member_type input. + * + * @since 5.0.0 + * + * @param mixed $value Mixed value. + * @return WP_Error|bool + */ + function bp_rest_validate_member_types($value) + { + } + /** + * Clean up group_type input. + * + * @since 5.0.0 + * + * @param string $value Comma-separated list of group types. + * @return array|null + */ + function bp_rest_sanitize_group_types($value) + { + } + /** + * Validate group_type input. + * + * @since 5.0.0 + * + * @param mixed $value Mixed value. + * @return WP_Error|bool + */ + function bp_rest_validate_group_types($value) + { + } + /** + * Clean up an array, comma- or space-separated list of strings. + * + * @since 5.0.0 + * + * @param array|string $collection List of strings. + * @return array Sanitized array of strings. + */ + function bp_rest_sanitize_string_list($collection) + { + } + /** + * Get the user object, if the ID is valid. + * + * @since 5.0.0 + * + * @param int $user_id Supplied user ID. + * @return WP_User|bool + */ + function bp_rest_get_user($user_id) + { + } + /** + * Registers a new field on an existing BuddyPress object. + * + * @since 5.0.0 + * + * @param string $component_id The name of the *active* component (eg: `activity`, `groups`, `xprofile`). + * Required. + * @param string $attribute The attribute name. Required. + * @param array $args { + * Optional. An array of arguments used to handle the registered field. + * @see `register_rest_field()` for a full description. + * } + * @param string $object_type The xProfile object type to get. This parameter is only required for + * the Extended Profiles component. Not used for all other components. + * Possible values are `data`, `field` or `group`. + * @return bool True if the field has been registered successfully. False otherwise. + */ + function bp_rest_register_field($component_id, $attribute, $args = array(), $object_type = '') + { + } + /** + * Setup BuddyPress Admin. + * + * @since 1.6.0 + */ + function bp_admin() + { + } + /** + * Initialize the Customizer for emails. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $wp_customize The Customizer object. + */ + function bp_email_init_customizer(\WP_Customize_Manager $wp_customize) + { + } + /** + * Are we looking at the email customizer? + * + * @since 2.5.0 + * + * @return bool + */ + function bp_is_email_customizer() + { + } + /** + * Only show email sections in the Customizer. + * + * @since 2.5.0 + * + * @param bool $active Whether the Customizer section is active. + * @param WP_Customize_Section $section {@see WP_Customize_Section} instance. + * @return bool + */ + function bp_email_customizer_hide_sections($active, $section) + { + } + /** + * Get Customizer sections for emails. + * + * @since 2.5.0 + * + * @return array + */ + function bp_email_get_customizer_sections() + { + } + /** + * Get Customizer settings for emails. + * + * @since 2.5.0 + * + * @return array + */ + function bp_email_get_customizer_settings() + { + } + /** + * Get Customizer controls for emails. + * + * @since 2.5.0 + * + * @return array + */ + function bp_email_get_customizer_controls() + { + } + /** + * Implements a JS redirect to the Customizer, previewing a randomly selected email. + * + * @since 2.5.0 + */ + function bp_email_redirect_to_customizer() + { + } + /** + * Adapt BuddyPress key actions starting point according to the request parser in use. + * + * The legacy request parser needs key actions to hook at `bp_init`, while the BP Rewrites API + * needs key actions to hook at `bp_parse_query`. + * + * @since 12.0.0 + */ + function bp_core_setup_query_parser() + { + } + /** + * Set up the Opt-outs admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 8.0.0 + * + * @global object $bp_optouts_list_table List table instance for nonmember opt-outs admin page. + */ + function bp_core_optouts_admin_load() + { + } + /** + * Get admin notice when viewing the optouts management page. + * + * @since 8.0.0 + * + * @return array + */ + function bp_core_get_optouts_notice() + { + } + /** + * Opt-outs admin page router. + * + * Depending on the context, display + * - the list of optouts, + * - or the delete confirmation screen, + * + * Also prepare the admin notices. + * + * @since 8.0.0 + */ + function bp_core_optouts_admin() + { + } + /** + * This is the list of optouts. + * + * @since 8.0.0 + * + * @global string $plugin_page + * @global object $bp_optouts_list_table List table instance for nonmember opt-outs admin page. + */ + function bp_core_optouts_admin_index() + { + } + /** + * This is the confirmation screen for actions. + * + * @since 8.0.0 + * + * @param string $action Delete or resend optout. + * + * @return null|false + */ + function bp_core_optouts_admin_manage($action = '') + { + } + /** + * Get default values for the taxonomy registered metadata. + * + * @since 7.0.0 + * + * @param string $type_taxonomy The type's taxonomy name. + * @return array Default values for the taxonomy registered metadata. + */ + function bp_core_admin_get_type_default_meta_values($type_taxonomy) + { + } + /** + * Insert a new type into the database. + * + * @since 7.0.0 + * + * @param array $args { + * Array of arguments describing the object type. + * + * @type string $taxonomy The Type's taxonomy. Required. + * @type string $bp_type_id Unique string identifier for the member type. Required. + * @see keys of the array returned by bp_get_type_metadata_schema() for the other arguments. + * } + * @return integer|WP_Error The Type's term ID on success. A WP_Error object otherwise. + */ + function bp_core_admin_insert_type($args = array()) + { + } + /** + * Update a type into the database. + * + * @since 7.0.0 + * + * @param array $args { + * Array of arguments describing the object type. + * + * @type string $taxonomy The Type's taxonomy. Required. + * @type integer $type_term_id The Type's term ID. Required. + * @see keys of the array returned by bp_get_type_metadata_schema() for the other arguments. + * } + * @return bool|WP_Error True on success. A WP_Error object otherwise. + */ + function bp_core_admin_update_type($args = array()) + { + } + /** + * Delete a type from the database. + * + * @since 7.0.0 + * + * @param array $args { + * Array of arguments describing the object type. + * + * @type string $taxonomy The Type's taxonomy. Required. + * @type integer $type_term_id The Type's term ID. Required. + * } + * @return bool|WP_Error True on success. A WP_Error object otherwise. + */ + function bp_core_admin_delete_type($args = array()) + { + } + /** Menu **********************************************************************/ + /** + * Initializes the wp-admin area "BuddyPress" menus and sub menus. + */ + function bp_core_admin_menu_init() + { + } + /** + * In BP 1.6, the top-level admin menu was removed. For backpat, this function + * keeps the top-level menu if a plugin has registered a menu into the old + * 'bp-general-settings' menu. + * + * The old "bp-general-settings" page was renamed "bp-components". + * + * @since 1.6.0 + * + * @global array $_parent_pages + * @global array $_registered_pages + * @global array $submenu + */ + function bp_core_admin_backpat_menu() + { + } + /** + * This tells WP to highlight the Settings > BuddyPress menu item, + * regardless of which actual BuddyPress admin screen we are on. + * + * The conditional prevents the behavior when the user is viewing the + * backpat "Help" page, the Activity page, or any third-party plugins. + * + * @since 1.6.0 + * + * @global string $plugin_page + * @global array $submenu + */ + function bp_core_modify_admin_menu_highlight() + { + } + /** + * Generates markup for a fallback top-level BuddyPress menu page, if the site is running + * a legacy plugin which hasn't been updated. If the site is up to date, this page + * will never appear. + * + * @see bp_core_admin_backpat_menu() + * + * @since 1.6.0 + * + * @todo Add convenience links into the markup once new positions are finalized. + */ + function bp_core_admin_backpat_page() + { + } + /** Notices *******************************************************************/ + /** + * Print admin messages to admin_notices or network_admin_notices. + * + * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow + * boxes. + * + * @since 1.5.0 + */ + function bp_core_print_admin_notices() + { + } + /** + * Add an admin notice to the BP queue. + * + * Messages added with this function are displayed in BuddyPress's general purpose admin notices + * box. It is recommended that you hook this function to admin_init, so that your messages are + * loaded in time. + * + * @since 1.5.0 + * + * @param string $notice The notice you are adding to the queue. + * @param string $type The notice type; optional. Usually either "updated" or "error". + */ + function bp_core_add_admin_notice($notice = '', $type = 'updated') + { + } + /** + * Verify that some BP prerequisites are set up properly, and notify the admin if not. + * + * On every Dashboard page, this function checks the following: + * - that every BP component that needs a WP page for a directory has one. + * - that no WP page has multiple BP components associated with it. + * The administrator will be shown a notice for each check that fails. + * + * @since 1.2.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_core_activation_notice() + { + } + /** + * Redirect user to BuddyPress's What's New page on activation. + * + * @since 1.7.0 + * + * @internal Used internally to redirect BuddyPress to the about page on activation. + */ + function bp_do_activation_redirect() + { + } + /** UI/Styling ****************************************************************/ + /** + * Outputs the BP Admin Tabbed header. + * + * @since 10.0.0 + * + * @param string $title The title of the Admin page. + * @param string $active_tab The current displayed tab. + * @param string $context The context of use for the tabs. Defaults to 'settings'. + * Possible values are 'settings' & 'tools'. + */ + function bp_core_admin_tabbed_screen_header($title = '', $active_tab = '', $context = 'settings') + { + } + /** + * Output the tabs in the admin area. + * + * @since 1.5.0 + * @since 8.0.0 Adds the `$context` parameter. + * + * @param string $active_tab Optional. Name of the tab that is active. + * @param string $context Optional. The context of use for the tabs. Defaults to 'settings'. + * Possible values are 'settings' or 'tools'. + * @param bool $echo_tabs Optional. Whether to echo or return the tabs. Default: true. + * @return string|null + */ + function bp_core_admin_tabs($active_tab = '', $context = 'settings', $echo_tabs = \true) + { + } + /** + * Returns the BP Admin settings tabs. + * + * @since 10.0.0 + * + * @param bool $apply_filters Whether to apply filters or not. + * @return array The BP Admin settings tabs. + */ + function bp_core_get_admin_settings_tabs($apply_filters = \true) + { + } + /** + * Returns the BP Admin tools tabs. + * + * @since 10.0.0 + * + * @param bool $apply_filters Whether to apply filters or not. + * @return array The BP Admin tools tabs. + */ + function bp_core_get_admin_tools_tabs($apply_filters = \true) + { + } + /** + * Get the data for the tabs in the admin area. + * + * @since 2.2.0 + * @since 8.0.0 Adds the `$context` parameter. + * + * @param string $active_tab Name of the tab that is active. Optional. + * @param string $context The context of use for the tabs. Defaults to 'settings'. + * Possible values are 'settings' & 'tools'. + * @return string + */ + function bp_core_get_admin_tabs($active_tab = '', $context = 'settings') + { + } + /** + * Makes sure plugins using `bp_core_admin_tabs()` to output their custom BP Admin Tabs are well displayed + * inside the 10.0.0 tabbed header. + * + * @since 10.0.0 + * + * @param string $context The context of use for the tabs. + * @param string $active_tab The active tab. + */ + function bp_backcompat_admin_tabs($context = '', $active_tab = '') + { + } + /** Help **********************************************************************/ + /** + * Adds contextual help to BuddyPress admin pages. + * + * @since 1.7.0 + * @todo Make this part of the BP_Component class and split into each component. + * + * @param string $screen Current screen. + */ + function bp_core_add_contextual_help($screen = '') + { + } + /** + * Renders contextual help content to contextual help tabs. + * + * @since 1.7.0 + * + * @param string $tab Current help content tab. + * @return string + */ + function bp_core_add_contextual_help_content($tab = '') + { + } + /** Separator *****************************************************************/ + /** + * Add a separator to the WordPress admin menus. + * + * @since 1.7.0 + * @since 14.0.0 Added 'bp_admin_separator' filter. + * + * @global array $menu + */ + function bp_admin_separator() + { + } + /** + * Tell WordPress we have a custom menu order. + * + * @since 1.7.0 + * + * @param bool $menu_order Optional. Menu order. Default: false. + * @return bool False if user cannot see admin pages, otherwise true. + */ + function bp_admin_custom_menu_order($menu_order = \false) + { + } + /** + * Move our custom separator above our custom post types. + * + * @since 1.7.0 + * + * @param array $menu_order Menu Order. + * @return array Modified menu order. + */ + function bp_admin_menu_order($menu_order = array()) + { + } + /** Utility *****************************************************************/ + /** + * When using a WP_List_Table, get the currently selected bulk action. + * + * WP_List_Tables have bulk actions at the top and at the bottom of the tables, + * and the inputs have different keys in the $_REQUEST array. This function + * reconciles the two values and returns a single action being performed. + * + * @since 1.7.0 + * + * @return string + */ + function bp_admin_list_table_current_bulk_action() + { + } + /** Menus *********************************************************************/ + /** + * Register meta box and associated JS for BuddyPress WP Nav Menu. + * + * @since 1.9.0 + */ + function bp_admin_wp_nav_menu_meta_box() + { + } + /** + * BP Member nav menu filter to short-circuit WP's query. + * + * @since 7.0.0 + * + * @param null $nil A null value. + * @param WP_Query $wp_query The WP_Query instance (passed by reference). + * @return array The BP Member nav items to short-circuit WP's query, + */ + function bp_admin_get_wp_nav_menu_items($nil, $wp_query) + { + } + /** + * Build and populate the BuddyPress accordion on Appearance > Menus. + * + * @since 1.9.0 + * @since 7.0.0 Uses wp_nav_menu_item_post_type_meta_box() + * + * @global int|string $nav_menu_selected_id + * + * @param WP_Post $post The current post object. + * @param array $box The meta box arguments. + */ + function bp_admin_do_wp_nav_menu_meta_box($post = '', $box = array()) + { + } + /** + * In admin emails list, for non-en_US locales, add notice explaining how to reinstall emails. + * + * If BuddyPress installs before its translations are in place, tell people how to reinstall + * the emails so they have their contents in their site's language. + * + * @since 2.5.0 + */ + function bp_admin_email_maybe_add_translation_notice() + { + } + /** + * Display metabox for email taxonomy type. + * + * Shows the term description in a list, rather than the term name itself. + * + * @since 2.5.0 + * + * @param WP_Post $post Post object. + */ + function bp_email_tax_type_metabox($post) + { + } + /** + * Custom metaboxes used by our 'bp-email' post type. + * + * @since 2.5.0 + */ + function bp_email_custom_metaboxes() + { + } + /** + * Customized version of the 'Excerpt' metabox for our 'bp-email' post type. + * + * We are using the 'Excerpt' metabox as our plain-text email content editor. + * + * @since 2.5.0 + * + * @param WP_Post $post Post object. + */ + function bp_email_plaintext_metabox($post) + { + } + /** + * Restrict various items from view if editing a BuddyPress menu. + * + * If a person is editing a BP menu item, that person should not be able to + * see or edit the following fields: + * + * - CSS Classes - We use the 'bp-menu' CSS class to determine if the + * menu item belongs to BP, so we cannot allow manipulation of this field to + * occur. + * - URL - This field is automatically generated by BP on output, so this + * field is useless and can cause confusion. + * + * Note: These restrictions are only enforced if JavaScript is enabled. + * + * @since 1.9.0 + */ + function bp_admin_wp_nav_menu_restrict_items() + { + } + /** + * Add "Mark as Spam/Ham" button to user row actions. + * + * @since 2.0.0 + * + * @param string[] $actions User row action links. + * @param WP_User $user_object WP_User object for the currently listed user. + * @return array $actions User row action links. + */ + function bp_core_admin_user_row_actions($actions, $user_object) + { + } + /** + * Catch requests to mark individual users as spam/ham from users.php. + * + * @since 2.0.0 + */ + function bp_core_admin_user_manage_spammers() + { + } + /** + * Inline script that adds the 'site-spammed' class to spammed users. + * + * @since 2.0.0 + */ + function bp_core_admin_user_spammed_js() + { + } + /** + * Catch and process an admin notice dismissal. + * + * @since 2.7.0 + */ + function bp_core_admin_notice_dismiss_callback() + { + } + /** + * Add a "buddypress" class to body element of wp-admin. + * + * @since 2.8.0 + * + * @param string $classes CSS classes for the body tag in the admin, a space separated string. + * @return string + */ + function bp_core_admin_body_classes($classes) + { + } + /** + * Adds a BuddyPress category to house BuddyPress blocks. + * + * @since 5.0.0 + * @since 8.0.0 The `bp_block_category_post_types` filter has been deprecated. + * @since 12.0.0 This category is left for third party plugin but not used anymore. + * + * @todo deprecate. + * + * @param array $categories Array of block categories. + * @param string|WP_Post|null $editor_name_or_post Post being loaded. + */ + function bp_block_category($categories = array(), $editor_name_or_post = \null) + { + } + /** + * Outputs an Admin Notification. + * + * @since 11.4.0 + * + * @param object|null $notification An Admin Notification object. + */ + function bp_core_admin_format_notifications($notification = \null) + { + } + /** + * Sets the "per page" screen option for BP Items WP Admin lists. + * + * @since 14.0.0 + * + * @param bool $value Will always be false unless another plugin filters it first. + * @param string $option Screen option name. + * @param string $new_value Screen option form value. + * @return string|int Option value. False to abandon update. + */ + function bp_admin_set_screen_options($value, $option, $new_value) + { + } + /** + * When a new site is created in a multisite installation, run the activation + * routine on that site. + * + * @since 1.7.0 + * + * @param int $blog_id ID of the blog being installed to. + * @param int $user_id ID of the user the install is for. + * @param string $domain Domain to use with the install. + * @param string $path Path to use with the install. + * @param int $site_id ID of the site being installed to. + * @param array $meta Metadata to use with the site creation. + */ + function bp_new_site($blog_id, $user_id, $domain, $path, $site_id, $meta) + { + } + /** Sub-Actions ***************************************************************/ + /** + * Piggy back admin_init action. + * + * @since 1.7.0 + */ + function bp_admin_init() + { + } + /** + * Piggy back admin_menu action. + * + * @since 1.7.0 + */ + function bp_admin_menu() + { + } + /** + * Piggy back admin_head action. + * + * @since 1.7.0 + */ + function bp_admin_head() + { + } + /** + * Piggy back admin_notices action. + * + * @since 1.7.0 + */ + function bp_admin_notices() + { + } + /** + * Piggy back admin_enqueue_scripts action. + * + * @since 1.7.0 + * + * @param string $hook_suffix The current admin page, passed to admin_enqueue_scripts. + */ + function bp_admin_enqueue_scripts($hook_suffix = '') + { + } + /** + * Dedicated action to register BuddyPress importers. + * + * @since 1.7.0 + */ + function bp_register_importers() + { + } + /** + * Dedicated action to register admin styles. + * + * @since 1.7.0 + */ + function bp_register_admin_style() + { + } + /** + * Dedicated action to register admin settings. + * + * @since 1.7.0 + */ + function bp_register_admin_settings() + { + } + /** + * Main installer. + * + * Can be passed an optional array of components to explicitly run installation + * routines on, typically the first time a component is activated in Settings. + * + * @since 1.0.0 + * + * @param array|bool $active_components Components to install. + */ + function bp_core_install($active_components = \false) + { + } + /** + * Install database tables for the Notifications component. + * + * @since 1.0.0 + */ + function bp_core_install_notifications() + { + } + /** + * Install database tables for the Activity component. + * + * @since 1.0.0 + */ + function bp_core_install_activity_streams() + { + } + /** + * Install database tables for the Notifications component. + * + * @since 1.0.0 + */ + function bp_core_install_friends() + { + } + /** + * Install database tables for the Groups component. + * + * @since 1.0.0 + */ + function bp_core_install_groups() + { + } + /** + * Install database tables for the Messages component. + * + * @since 1.0.0 + */ + function bp_core_install_private_messaging() + { + } + /** + * Install database tables for the Profiles component. + * + * @since 1.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_core_install_extended_profiles() + { + } + /** + * Install database tables for the Sites component. + * + * @since 1.0.0 + */ + function bp_core_install_blog_tracking() + { + } + /** Signups *******************************************************************/ + /** + * Install the signups table. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_core_install_signups() + { + } + /** + * Update the signups table, adding `signup_id` column and drop `domain` index. + * + * This is necessary because WordPress's `pre_schema_upgrade()` function wraps + * table ALTER's in multisite checks, and other plugins may have installed their + * own sign-ups table; Eg: Gravity Forms User Registration Add On. + * + * @since 2.0.1 + * + * @see pre_schema_upgrade() + * @link https://core.trac.wordpress.org/ticket/27855 WordPress Trac Ticket + * @link https://buddypress.trac.wordpress.org/ticket/5563 BuddyPress Trac Ticket + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_core_upgrade_signups() + { + } + /** + * Add default emails. + * + * @since 2.5.0 + */ + function bp_core_install_emails() + { + } + /** + * Install database tables for the Invitations API + * + * @since 5.0.0 + * + * @uses bp_core_set_charset() + * @uses bp_core_get_table_prefix() + * @uses dbDelta() + */ + function bp_core_install_invitations() + { + } + /** + * Install database tables to store opt-out requests from nonmembers. + * + * @since 8.0.0 + * + * @uses bp_core_set_charset() + * @uses bp_core_get_table_prefix() + * @uses dbDelta() + */ + function bp_core_install_nonmember_opt_outs() + { + } + /** + * Handles BP Rewrites settings updates & load styles and scripts. + * + * @since 12.0.0 + */ + function bp_core_admin_rewrites_load() + { + } + /** + * Outputs BP Rewrites URLs settings. + * + * @since 12.0.0 + */ + function bp_core_admin_rewrites_settings() + { + } + /** + * Render the BuddyPress Tools page. + * + * @since 2.0.0 + */ + function bp_core_admin_tools() + { + } + /** + * Handle the processing and feedback of the admin tools page. + * + * @since 2.0.0 + */ + function bp_admin_repair_handler() + { + } + /** + * Get the array of the repair list. + * + * @return array + */ + function bp_admin_repair_list() + { + } + /** + * Reset all BuddyPress slug to default ones. + * + * @since 12.0.0 + */ + function bp_admin_reset_slugs() + { + } + /** + * Recalculate friend counts for each user. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return array + */ + function bp_admin_repair_friend_count() + { + } + /** + * Recalculate group counts for each user. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return array + */ + function bp_admin_repair_group_count() + { + } + /** + * Recalculate user-to-blog relationships and useful blog meta data. + * + * @since 2.1.0 + * + * @return array + */ + function bp_admin_repair_blog_records() + { + } + /** + * Repair site icons/blog avatars synchronization. + * + * @since 7.0.0 + * + * @return array + */ + function bp_admin_repair_blog_site_icons() + { + } + /** + * Recalculate the total number of active site members. + * + * @since 2.0.0 + * + * @return array + */ + function bp_admin_repair_count_members() + { + } + /** + * Create the invitations database table if it does not exist. + * Migrate outstanding group invitations if needed. + * + * @since 6.0.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @return array + */ + function bp_admin_invitations_table() + { + } + /** + * Assemble admin notices relating success/failure of repair processes. + * + * @since 2.0.0 + * + * @param string $message Feedback message. + * @param string|bool $html_class Unused. Defaults to false. + * @return false|Closure + */ + function bp_admin_tools_feedback($message, $html_class = \false) + { + } + /** + * Render the Available Tools page. + * + * We register this page on Network Admin as a top-level home for our + * BuddyPress tools. This displays the default content. + * + * @since 2.0.0 + */ + function bp_core_admin_available_tools_page() + { + } + /** + * Render an introduction of BuddyPress tools on Available Tools page. + * + * @since 2.0.0 + */ + function bp_core_admin_available_tools_intro() + { + } + /** + * Delete emails and restore from defaults. + * + * @since 2.5.0 + * + * @return array + */ + function bp_admin_reinstall_emails() + { + } + /** + * Add notice on the "Tools > BuddyPress" page if more sites need recording. + * + * This notice only shows up in the network admin dashboard. + * + * @since 2.6.0 + */ + function bp_core_admin_notice_repopulate_blogs_resume() + { + } + /** + * Add BuddyPress debug info to the WordPress Site Health info screen. + * + * @since 5.0.0 + * + * @param array $debug_info The Site's debug info. + * @return array The Site's debug info, including the BuddyPress specific ones. + */ + function bp_core_admin_debug_information($debug_info = array()) + { + } + /** + * Adds a BuddyPress section to the Site Health Info Admin Screen help tabs. + * + * @since 14.0.0 + */ + function bp_core_admin_debug_information_add_help_tab() + { + } + /** + * Main settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_main_section' settings section. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_main_section() + { + } + /** + * Admin bar for logged out users setting field. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_admin_bar() + { + } + /** + * Choose whether the community is visible to anyone or only to members. + * + * @since 12.0.0 + */ + function bp_admin_setting_callback_community_visibility() + { + } + /** + * Sanitize the visibility setting when it is saved. + * + * @since 12.0.0 + * + * @param mixed $saved_value The value passed to the save function. + * @return array + */ + function bp_admin_sanitize_callback_community_visibility($saved_value) + { + } + /** + * Form element to change the active template pack. + */ + function bp_admin_setting_callback_theme_package_id() + { + } + /** Activity *******************************************************************/ + /** + * Groups settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_activity_section' settings section. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_activity_section() + { + } + /** + * Allow Akismet setting field. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_activity_akismet() + { + } + /** + * Allow activity comments on posts and comments. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_blogforum_comments() + { + } + /** + * Allow Heartbeat to refresh activity stream. + * + * @since 2.0.0 + */ + function bp_admin_setting_callback_heartbeat() + { + } + /** + * Sanitization for bp-disable-blogforum-comments setting. + * + * In the UI, a checkbox asks whether you'd like to *enable* post/comment activity comments. For + * legacy reasons, the option that we store is 1 if these comments are *disabled*. So we use this + * function to flip the boolean before saving the intval. + * + * @since 1.6.0 + * + * @param bool $value Whether or not to sanitize. + * @return int + */ + function bp_admin_sanitize_callback_blogforum_comments($value = \false) + { + } + /** Members *******************************************************************/ + /** + * Profile settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_members_section' settings section. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_members_section() + { + } + /** + * Allow members to upload avatars field. + * + * @since 1.6.0 + * @since 6.0.0 Setting has been moved into the Members section. + */ + function bp_admin_setting_callback_avatar_uploads() + { + } + /** + * Allow members to upload cover images field. + * + * @since 2.4.0 + * @since 6.0.0 Setting has been moved into the Members section. + */ + function bp_admin_setting_callback_cover_image_uploads() + { + } + /** + * Allow members to invite non-members to the network. + * + * @since 8.0.0 + */ + function bp_admin_setting_callback_members_invitations() + { + } + /** + * Allow new users to request membership to the network. + * + * @since 10.0.0 + */ + function bp_admin_setting_callback_membership_requests() + { + } + /** XProfile ******************************************************************/ + /** + * Profile settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_xprofile_section' settings section. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_xprofile_section() + { + } + /** + * Enable BP->WP profile syncing field. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_profile_sync() + { + } + /** Groups Section ************************************************************/ + /** + * Groups settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_groups_section' settings section. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_groups_section() + { + } + /** + * Allow all users to create groups field. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_group_creation() + { + } + /** + * 'Enable group avatars' field markup. + * + * @since 2.3.0 + */ + function bp_admin_setting_callback_group_avatar_uploads() + { + } + /** + * 'Enable group cover images' field markup. + * + * @since 2.4.0 + */ + function bp_admin_setting_callback_group_cover_image_uploads() + { + } + /** + * 'Enable group activity deletions. + * + * @since 14.0.0 + */ + function bp_admin_setting_callback_group_activity_deletions() + { + } + /** Account settings Section ************************************************************/ + /** + * Account settings section description for the settings page. + * + * @internal This function is used as a callback for the 'bp_account_section' settings section. + * + * @since 12.0.0 + */ + function bp_admin_setting_callback_settings_section() + { + } + /** + * Allow members to delete their accounts setting field. + * + * @since 1.6.0 + */ + function bp_admin_setting_callback_account_deletion() + { + } + /** Settings Page *************************************************************/ + /** + * The main settings page + * + * @since 1.6.0 + */ + function bp_core_admin_settings() + { + } + /** + * Save our settings. + * + * @since 1.6.0 + */ + function bp_core_admin_settings_save() + { + } + /** + * Output settings API option. + * + * @since 1.6.0 + * + * @param string $option Form option to echo. + * @param string $default_option Form option default. + * @param bool $slug Form option slug. + */ + function bp_form_option($option, $default_option = '', $slug = \false) + { + } + /** + * Return settings API option. + * + * @since 1.6.0 + * + * @param string $option Form option to return. + * @param string $default_option Optional. Form option default. Default is empty string. + * @param bool $slug Optional. Form option slug. Default is false. + * @return string + */ + function bp_get_form_option($option, $default_option = '', $slug = \false) + { + } + /** + * Renders the Component Setup admin panel. + * + * @since 1.6.0 + */ + function bp_core_admin_components_settings() + { + } + /** + * Creates reusable markup for component setup on the Components and Pages dashboard panel. + * + * @since 1.6.0 + * + * @todo Use settings API + */ + function bp_core_admin_components_options() + { + } + /** + * Handle saving the Component settings. + * + * @since 1.6.0 + * + * @todo Use settings API when it supports saving network settings + */ + function bp_core_admin_components_settings_handler() + { + } + /** + * Calculates the components that should be active after save, based on submitted settings. + * + * The way that active components must be set after saving your settings must + * be calculated differently depending on which of the Components subtabs you + * are coming from: + * - When coming from All or Active, the submitted checkboxes accurately + * reflect the desired active components, so we simply pass them through + * - When coming from Inactive, components can only be activated - already + * active components will not be passed in the $_POST global. Thus, we must + * parse the newly activated components with the already active components + * saved in the $bp global + * - When activating a Retired component, the situation is similar to Inactive. + * - When deactivating a Retired component, no value is passed in the $_POST + * global (because the component settings are checkboxes). So, in order to + * determine whether a retired component is being deactivated, we retrieve a + * list of retired components, and check each one to ensure that its checkbox + * is not present, before merging the submitted components with the active + * ones. + * + * @since 1.7.0 + * + * @param array $submitted This is the array of component settings coming from the POST + * global. You should stripslashes_deep() before passing to this function. + * @return array The calculated list of component settings + */ + function bp_core_admin_get_active_components_from_submitted_settings($submitted) + { + } + /** + * Return a list of component information. + * + * We use this information both to build the markup for the admin screens, as + * well as to do some processing on settings data submitted from those screens. + * + * @since 1.7.0 + * + * @param string $type Optional; Component type to fetch. Defaults to 'all'. + * Possible values include 'all', 'optional', 'retired', and 'required'. + * @return array Requested components' data. + */ + function bp_core_admin_get_components($type = 'all') + { + } + /** + * Removes the filter to `comments_pre_query` to restrict `bp_comments_pre_query` + * usage to the `core/comments' block. + * + * @since 10.7.0 + * + * @param string $block_content The rendered block content. + * @return string Unchanged rendered block content. + */ + function bp_post_render_core_comments_block($block_content) + { + } + /** + * Checks the current block being rendered is `core/comments` before hooking to + * `comments_pre_query`. + * + * @since 10.7.0 + * + * @param string|null $pre_render The pre-rendered content. Default null. + * @param array $parsed_block The block being rendered. + * @return string|null Unchanged pre-rendered content. + */ + function bp_pre_render_core_comments_block($pre_render, $parsed_block) + { + } + /** + * Prevent specific pages (eg 'Activate') from showing on page listings. + * + * @since 1.5.0 + * + * @param array $pages List of excluded page IDs, as passed to the + * 'wp_list_pages_excludes' filter. + * @return array The exclude list, with BP's pages added. + */ + function bp_core_exclude_pages($pages = array()) + { + } + /** + * Prevent specific pages (eg 'Activate') from showing in the Pages meta box of the Menu Administration screen. + * + * @since 2.0.0 + * + * @param object|null $object The post type object used in the meta box. + * @return object|null The $object, with a query argument to remove register and activate pages id. + */ + function bp_core_exclude_pages_from_nav_menu_admin($object = \null) + { + } + /** + * Adds current page CSS classes to the parent BP page in a WP Page Menu. + * + * Because BuddyPress primarily uses virtual pages, we need a way to highlight + * the BP parent page during WP menu generation. This function checks the + * current BP component against the current page in the WP menu to see if we + * should highlight the WP page. + * + * @since 2.2.0 + * + * @param array $retval CSS classes for the current menu page in the menu. + * @param WP_Post $page The page properties for the current menu item. + * @return array + */ + function bp_core_menu_highlight_parent_page($retval, $page) + { + } + /** + * Adds current page CSS classes to the parent BP page in a WP Nav Menu. + * + * When {@link wp_nav_menu()} is used, this function helps to highlight the + * current BP parent page during nav menu generation. + * + * @since 2.2.0 + * + * @param array $retval CSS classes for the current nav menu item in the menu. + * @param WP_Post $item The properties for the current nav menu item. + * @return array + */ + function bp_core_menu_highlight_nav_menu_item($retval, $item) + { + } + /** + * Filter the blog post comments array and insert BuddyPress URLs for users. + * + * @since 1.2.0 + * + * @param array $comments The array of comments supplied to the comments template. + * @return array $comments The modified comment array. + */ + function bp_core_filter_comments($comments) + { + } + /** + * When a user logs in, redirect him in a logical way. + * + * @since 1.2.0 + * + * are redirected to on login. + * + * @param string $redirect_to The URL to be redirected to, sanitized in wp-login.php. + * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to']). + * @param WP_User $user The WP_User object corresponding to a successfully + * logged-in user. Otherwise a WP_Error object. + * @return string The redirect URL. + */ + function bp_core_login_redirect($redirect_to, $redirect_to_raw, $user) + { + } + /** + * Decode HTML entities for plain-text emails. + * + * @since 2.5.0 + * + * @param string $retval Current email content. + * @param string $prop Email property to check against. + * @param string $transform Either 'raw' or 'replace-tokens'. + * @return string|null $retval Modified email content. + */ + function bp_email_plaintext_entity_decode($retval, $prop, $transform) + { + } + /** + * Replace the generated password in the welcome email with '[User Set]'. + * + * On a standard BP installation, users who register themselves also set their + * own passwords. Therefore there is no need for the insecure practice of + * emailing the plaintext password to the user in the welcome email. + * + * This filter will not fire when a user is registered by the site admin. + * + * @since 1.2.1 + * + * @param string $welcome_email Complete email passed through WordPress. + * @return string Filtered $welcome_email with the password replaced + * by '[User Set]'. + */ + function bp_core_filter_user_welcome_email($welcome_email) + { + } + /** + * Replace the generated password in the welcome email with '[User Set]'. + * + * On a standard BP installation, users who register themselves also set their + * own passwords. Therefore there is no need for the insecure practice of + * emailing the plaintext password to the user in the welcome email. + * + * This filter will not fire when a user is registered by the site admin. + * + * @since 1.2.1 + * + * @param string $welcome_email Complete email passed through WordPress. + * @param int $blog_id ID of the blog user is joining. + * @param int $user_id ID of the user joining. + * @param string $password Password of user. + * @return string Filtered $welcome_email with $password replaced by '[User Set]'. + */ + function bp_core_filter_blog_welcome_email($welcome_email, $blog_id, $user_id, $password) + { + } + /** + * Notify new users of a successful registration (with blog). + * + * This function filter's WP's 'wpmu_signup_blog_notification', and replaces + * WP's default welcome email with a BuddyPress-specific message. + * + * @since 1.0.0 + * + * @see wpmu_signup_blog_notification() for a description of parameters. + * + * @param string $domain The new blog domain. + * @param string $path The new blog path. + * @param string $title The site title. + * @param string $user The user's login name. + * @param string $user_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @return bool Returns false to stop original WPMU function from continuing. + */ + function bp_core_activation_signup_blog_notification($domain, $path, $title, $user, $user_email, $key) + { + } + /** + * Notify new users of a successful registration (without blog). + * + * @since 1.0.0 + * + * @see wpmu_signup_user_notification() for a full description of params. + * + * @param string $user The user's login name. + * @param string $user_email The user's email address. + * @param string $key The activation key created in wpmu_signup_user(). + * @param array $meta By default, an empty array. + * @return false|string Returns false to stop original WPMU function from continuing. + */ + function bp_core_activation_signup_user_notification($user, $user_email, $key, $meta) + { + } + /** + * Ensure that some meta values are set for new multisite signups. + * + * @since 10.0.0 + * + * @see wpmu_signup_user() for a full description of params. + * + * @param array $meta Signup meta data. Default empty array. + * @return array Signup meta data. + */ + function bp_core_add_meta_to_multisite_signups($meta) + { + } + /** + * Filter the page title for BuddyPress pages. + * + * @since 1.5.0 + * + * @see wp_title() + * + * @param string $title Original page title. + * @param string $sep How to separate the various items within the page title. + * @param string $seplocation Direction to display title. + * @return string New page title. + */ + function bp_modify_page_title($title = '', $sep = '»', $seplocation = 'right') + { + } + /** + * Filter the document title for BuddyPress pages. + * + * @since 2.4.3 + * + * @param array $title The WordPress document title parts. + * @return array the unchanged title parts or the BuddyPress ones + */ + function bp_modify_document_title_parts($title = array()) + { + } + /** + * Add BuddyPress-specific items to the wp_nav_menu. + * + * @since 1.9.0 + * + * @param WP_Post $menu_item The menu item. + * @return WP_Post The modified WP_Post object. + */ + function bp_setup_nav_menu_item($menu_item) + { + } + /** + * Populate BuddyPress user nav items for the customizer. + * + * @since 2.3.3 + * + * @param array $items The array of menu items. + * @param string $type The requested type. + * @param string $object The requested object name. + * @param integer $page The page num being requested. + * @return array The paginated BuddyPress user nav items. + */ + function bp_customizer_nav_menus_get_items($items = array(), $type = '', $object = '', $page = 0) + { + } + /** + * Set BuddyPress item navs for the customizer. + * + * @since 2.3.3 + * + * @param array $item_types An associative array structured for the customizer. + * @return array $item_types An associative array structured for the customizer. + */ + function bp_customizer_nav_menus_set_item_types($item_types = array()) + { + } + /** + * Eventually append BuddyPress directories to WP Dropdown's pages control. + * + * @since 12.0.0 + * + * @param WP_Post[] $pages Array of page objects. + * @param array $args Array of get_pages() arguments. + * @return WP_Post[] Array of page objects, potentially including BP directories. + */ + function bp_core_include_directory_on_front($pages = array(), $args = array()) + { + } + /** + * Filter SQL query strings to swap out the 'meta_id' column. + * + * WordPress uses the meta_id column for commentmeta and postmeta, and so + * hardcodes the column name into its *_metadata() functions. BuddyPress, on + * the other hand, uses 'id' for the primary column. To make WP's functions + * usable for BuddyPress, we use this just-in-time filter on 'query' to swap + * 'meta_id' with 'id. + * + * @since 2.0.0 + * + * @access private Do not use. + * + * @param string $q SQL query. + * @return string + */ + function bp_filter_metaid_column_name($q) + { + } + /** + * Filter the edit post link to avoid its display in BuddyPress pages. + * + * @since 2.1.0 + * + * @param string $edit_link The edit link. + * @param int $post_id Post ID. + * @return false|string Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link) + * otherwise + */ + function bp_core_filter_edit_post_link($edit_link = '', $post_id = 0) + { + } + /** + * Add 'loading="lazy"' attribute into images and iframes. + * + * @since 7.0.0 + * + * @param string $content Content to inject attribute into. + * @return string + */ + function bp_core_add_loading_lazy_attribute($content = '') + { + } + /** + * Should BuddyPress load the mentions scripts and related assets, including results to prime the + * mentions suggestions? + * + * @since 2.2.0 + * + * @param bool $load_mentions True to load mentions assets, false otherwise. + * @param bool $mentions_enabled True if mentions are enabled. + * @return bool True if mentions scripts should be loaded. + */ + function bp_maybe_load_mentions_scripts_for_blog_content($load_mentions, $mentions_enabled) + { + } + /** + * Add email link styles to rendered email template. + * + * This is only used when the email content has been merged into the email template. + * + * @since 2.5.0 + * + * @param string $value Property value. + * @param string $property_name Email template property name. + * @param string $transform How the return value was transformed. + * @return string Updated value. + */ + function bp_email_add_link_color_to_template($value, $property_name, $transform) + { + } + /** + * Add custom headers to outgoing emails. + * + * @since 2.5.0 + * + * @param array $headers Array of email headers. + * @param string $property Name of property. Unused. + * @param string $transform Return value transformation. Unused. + * @param BP_Email $email Email object reference. + * @return array + */ + function bp_email_set_default_headers($headers, $property, $transform, $email) + { + } + /** + * Add default email tokens. + * + * @since 2.5.0 + * + * @param array $tokens Email tokens. + * @param string $property_name Unused. + * @param string $transform Unused. + * @param BP_Email $email Email being sent. + * @return array + */ + function bp_email_set_default_tokens($tokens, $property_name, $transform, $email) + { + } + /** + * Find and render the template for Email posts (the Customizer and admin previews). + * + * Misuses the `template_include` filter which expects a string, but as we need to replace + * the `{{{content}}}` token with the post's content, we use object buffering to load the + * template, replace the token, and render it. + * + * The function returns an empty string to prevent WordPress rendering another template. + * + * @since 2.5.0 + * + * @param string $template Path to template (probably single.php). + * @return string + */ + function bp_core_render_email_template($template) + { + } + /** + * Adds BuddyPress components' slugs to the WordPress Multisite subdirectory reserved names. + * + * @since 6.0.0 + * + * @param array $names The WordPress Multisite subdirectory reserved names. + * @return array The WordPress & BuddyPress Multisite subdirectory reserved names. + */ + function bp_core_components_subdirectory_reserved_names($names = array()) + { + } + /** + * Make sure `buddypress` post type links are built using BP Rewrites. + * + * @since 12.0.0 + * + * @param string $link The post type link. + * @param WP_Post|null $post The post type object. + * @return string The post type link. + */ + function bp_get_post_type_link($link = '', $post = \null) + { + } + /** + * Get the Attachments Uploads dir data. + * + * @since 2.4.0 + * + * @param string $data The data to get. Possible values are: 'dir', 'basedir' & 'baseurl'. + * Leave empty to get all datas. + * @return string|array The needed Upload dir data. + */ + function bp_attachments_uploads_dir_get($data = '') + { + } + /** + * Gets the upload dir array for cover images. + * + * @since 3.0.0 + * + * @param array $args { + * @type int $object_id The ID of the object (Required). + * @type string $object_directory The object directory (eg: members, groups) (Required). + * } + * @return array + */ + function bp_attachments_cover_image_upload_dir($args = array()) + { + } + /** + * Get the max upload file size for any attachment. + * + * @since 2.4.0 + * + * @param string $type A string to inform about the type of attachment + * we wish to get the max upload file size for. + * @return int Max upload file size for any attachment. + */ + function bp_attachments_get_max_upload_file_size($type = '') + { + } + /** + * Get allowed types for any attachment. + * + * @since 2.4.0 + * @since 11.0.0 Adds the support for .webp images to Avatars and Cover images. + * + * @param string $type The extension types to get. + * Default: 'avatar'. + * @return array The list of allowed extensions for attachments. + */ + function bp_attachments_get_allowed_types($type = 'avatar') + { + } + /** + * Get allowed attachment mime types. + * + * @since 2.4.0 + * + * @param string $type The extension types to get (Optional). + * @param array $allowed_types List of allowed extensions. + * @return array List of allowed mime types. + */ + function bp_attachments_get_allowed_mimes($type = '', $allowed_types = array()) + { + } + /** + * Check the uploaded attachment type is allowed. + * + * @since 2.4.0 + * + * @param string $file Full path to the file. + * @param string $filename The name of the file (may differ from $file due to $file being + * in a tmp directory). + * @param array $allowed_mimes The attachment allowed mimes (Required). + * @return bool True if the attachment type is allowed. False otherwise + */ + function bp_attachments_check_filetype($file, $filename, $allowed_mimes) + { + } + /** + * Use the absolute path to an image to set an attachment type for a given item. + * + * @since 2.4.0 + * + * @param string $type The attachment type to create (avatar or cover_image). Default: avatar. + * @param array $args { + * @type int $item_id The ID of the object (Required). Default: 0. + * @type string $object The object type (eg: group, user, blog) (Required). Default: 'user'. + * @type string $component The component for the object (eg: groups, members, blogs). Default: ''. + * @type string $image The absolute path to the image (Required). Default: ''. + * @type int $crop_w Crop width. Default: 0. + * @type int $crop_h Crop height. Default: 0. + * @type int $crop_x The horizontal starting point of the crop. Default: 0. + * @type int $crop_y The vertical starting point of the crop. Default: 0. + * } + * @return bool + */ + function bp_attachments_create_item_type($type = 'avatar', $args = array()) + { + } + /** + * Get the url or the path for a type of attachment. + * + * @since 2.4.0 + * + * @param string $data whether to get the url or the path. + * @param array $args { + * @type string $object_dir The object dir (eg: members/groups). Defaults to members. + * @type int $item_id The object id (eg: a user or a group id). Defaults to current user. + * @type string $type The type of the attachment which is also the subdir where files are saved. + * Defaults to 'cover-image' + * @type string $file The name of the file. + * } + * @return string|bool The url or the path to the attachment, false otherwise + */ + function bp_attachments_get_attachment($data = 'url', $args = array()) + { + } + /** + * Delete an attachment for the given arguments + * + * @since 2.4.0 + * + * @see bp_attachments_get_attachment() For more information on accepted arguments. + * + * @param array $args Array of arguments for the attachment deletion. + * @return bool True if the attachment was deleted, false otherwise. + */ + function bp_attachments_delete_file($args = array()) + { + } + /** + * Get the BuddyPress Plupload settings. + * + * @since 2.3.0 + * + * @return array List of BuddyPress Plupload settings. + */ + function bp_attachments_get_plupload_default_settings() + { + } + /** + * Builds localization strings for the BuddyPress Uploader scripts. + * + * @since 2.3.0 + * + * @return array Plupload default localization strings. + */ + function bp_attachments_get_plupload_l10n() + { + } + /** + * Enqueues the script needed for the Uploader UI. + * + * @since 2.3.0 + * + * @see BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how + * to set specific script data. + * + * @param string $class_name Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar). + * @return null|WP_Error + */ + function bp_attachments_enqueue_scripts($class_name = '') + { + } + /** + * Check the current user's capability to edit an avatar for a given object. + * + * @since 2.3.0 + * + * @param string $capability The capability to check. + * @param array $args An array containing the item_id and the object to check. + * @return bool + */ + function bp_attachments_current_user_can($capability, $args = array()) + { + } + /** + * Send a JSON response back to an Ajax upload request. + * + * @since 2.3.0 + * + * @param bool $success True for a success, false otherwise. + * @param bool $is_html4 True if the Plupload runtime used is html4, false otherwise. + * @param mixed $data Data to encode as JSON, then print and die. + */ + function bp_attachments_json_response($success, $is_html4 = \false, $data = \null) + { + } + /** + * Get an Attachment template part. + * + * @since 2.3.0 + * + * @param string $slug Template part slug. eg 'uploader' for 'uploader.php'. + */ + function bp_attachments_get_template_part($slug) + { + } + /** Cover Image ***************************************************************/ + /** + * Get the cover image settings + * + * @since 2.4.0 + * + * @param string $component The component to get the settings for ("members" for user or "groups"). + * @return false|array The cover image settings in array, false on failure. + */ + function bp_attachments_get_cover_image_settings($component = 'members') + { + } + /** + * Get cover image Width and Height. + * + * @since 2.4.0 + * + * @param string $component The BuddyPress component concerned ("members" for user or "groups"). + * @return array|bool An associative array containing the advised width and height for the cover image. False if settings are empty. + */ + function bp_attachments_get_cover_image_dimensions($component = 'members') + { + } + /** + * Are we on a page to edit a cover image? + * + * @since 2.4.0 + * + * @return bool True if on a page to edit a cover image, false otherwise. + */ + function bp_attachments_cover_image_is_edit() + { + } + /** + * Does the user has a cover image? + * + * @since 2.4.0 + * + * @param int $user_id User ID to retrieve cover image for. + * @return bool True if the user has a cover image, false otherwise. + */ + function bp_attachments_get_user_has_cover_image($user_id = 0) + { + } + /** + * Does the group has a cover image? + * + * @since 2.4.0 + * @since 6.0.0 Renamed the filter coherently. + * + * @param int $group_id Group ID to check cover image existence for. + * @return bool True if the group has a cover image, false otherwise. + */ + function bp_attachments_get_group_has_cover_image($group_id = 0) + { + } + /** + * Generate the cover image file. + * + * @since 2.4.0 + * + * @param array $args { + * @type string $file The absolute path to the image. Required. + * @type string $component The component for the object (eg: groups, members). Required. + * @type string $cover_image_dir The Cover image dir to write the image into. Required. + * } + * @param BP_Attachment_Cover_Image|null $cover_image_class The class to use to fit the cover image. + * @return false|array An array containing cover image data on success, false otherwise. + */ + function bp_attachments_cover_image_generate_file($args = array(), $cover_image_class = \null) + { + } + /** + * Ajax Upload and set a cover image + * + * @since 2.4.0 + */ + function bp_attachments_cover_image_ajax_upload() + { + } + /** + * Ajax delete a cover image for a given object and item id. + * + * @since 2.4.0 + */ + function bp_attachments_cover_image_ajax_delete() + { + } + /** + * Register Cover Image ajax actions. + * + * @since 12.0.0 + */ + function bp_attachments_cover_register_ajax_actions() + { + } + /** + * Returns a file's mime type. + * + * @since 11.0.0 + * + * @param string $file Absolute path of a file or directory. + * @return false|string False if the mime type is not supported by WordPress. + * The mime type of a file or 'directory' for a directory. + */ + function bp_attachments_get_mime_type($file = '') + { + } + /** + * Returns a BP Attachments file object. + * + * @since 10.2.0 + * + * @param SplFileInfo $file The SplFileInfo file object. + * @return null|object Null if the file is not supported by WordPress. + * A BP Attachments file object otherwise. + */ + function bp_attachments_get_file_object(\SplFileInfo $file) + { + } + /** + * List the files of a directory. + * + * @since 10.0.0 + * + * @param string $directory_path Absolute path of a directory. + * @return array The file objects list of the directory. + */ + function bp_attachments_list_directory_files($directory_path = '') + { + } + /** + * List the files of a directory recursively and eventually find a file using its ID. + * + * @since 10.0.0 + * + * @param string $directory_path Absolute path of a directory. + * @param string $find The file ID to find into the directory or its children. + * @return array The file objects list of the directory and subdirectories. + */ + function bp_attachments_list_directory_files_recursively($directory_path = '', $find = '') + { + } + /** Versions ******************************************************************/ + /** + * Output the BuddyPress version. + * + * @since 1.6.0 + */ + function bp_version() + { + } + /** + * Return the BuddyPress version. + * + * @since 1.6.0 + * + * @return string The BuddyPress version. + */ + function bp_get_version() + { + } + /** + * Output the BuddyPress database version. + * + * @since 1.6.0 + */ + function bp_db_version() + { + } + /** + * Return the BuddyPress database version. + * + * @since 1.6.0 + * + * @return string The BuddyPress database version. + */ + function bp_get_db_version() + { + } + /** + * Output the BuddyPress database version. + * + * @since 1.6.0 + */ + function bp_db_version_raw() + { + } + /** + * Return the BuddyPress database version. + * + * @since 1.6.0 + * + * @return string The BuddyPress version direct from the database. + */ + function bp_get_db_version_raw() + { + } + /** + * Output a BuddyPress major version. + * + * @since 11.0.0 + * + * @param string $version BuddyPress version. + */ + function bp_major_version($version = '') + { + } + /** + * Return a BuddyPress major version. + * + * @since 11.0.0 + * + * @param string $version BuddyPress version. + * @return string The corresponding BuddyPress major version. + */ + function bp_get_major_version($version = '') + { + } + /** + * Output the BuddyPress version used for its first install. + * + * @since 11.0.0 + */ + function bp_initial_version() + { + } + /** + * Return the BuddyPress version used for its first install. + * + * @since 11.0.0 + * + * @return string The BuddyPress version used for its first install. + */ + function bp_get_initial_version() + { + } + /** + * Check whether the current version of WP exceeds a given version. + * + * @since 7.0.0 + * + * @param string $version WP version, in "PHP-standardized" format. + * @param string $compare Optional. Comparison operator. Default '>='. + * @return bool + */ + function bp_is_running_wp($version, $compare = '>=') + { + } + /** Functions *****************************************************************/ + /** + * Get the BuddyPress URL Parser in use. + * + * @since 12.0.0 + * + * @return string The name of the parser in use. + */ + function bp_core_get_query_parser() + { + } + /** + * Get the $wpdb base prefix, run through the 'bp_core_get_table_prefix' filter. + * + * The filter is intended primarily for use in multinetwork installations. + * + * @since 1.2.6 + * + * @global wpdb $wpdb WordPress database object. + * + * @return string Filtered database prefix. + */ + function bp_core_get_table_prefix() + { + } + /** + * Sort an array of objects or arrays by a specific key/property. + * + * The main purpose for this function is so that you can avoid having to create + * your own awkward callback function for usort(). + * + * @since 2.2.0 + * @since 2.7.0 Added $preserve_keys parameter. + * + * @param array $items The items to be sorted. Its constituent items + * can be either associative arrays or objects. + * @param string|int $key The array index or property name to sort by. + * @param string $type Sort type. 'alpha' for alphabetical, 'num' + * for numeric. Default: 'alpha'. + * @param bool $preserve_keys Whether to keep the keys or not. + * + * @return array $items The sorted array. + */ + function bp_sort_by_key($items, $key, $type = 'alpha', $preserve_keys = \false) + { + } + /** + * Sort an array of objects or arrays by alphabetically sorting by a specific key/property. + * + * For instance, if you have an array of WordPress post objects, you can sort + * them by post_name as follows: + * $sorted_posts = bp_alpha_sort_by_key( $posts, 'post_name' ); + * + * @since 1.9.0 + * + * @param array $items The items to be sorted. Its constituent items can be either associative arrays or objects. + * @param string|int $key The array index or property name to sort by. + * @return array $items The sorted array. + */ + function bp_alpha_sort_by_key($items, $key) + { + } + /** + * Format numbers the BuddyPress way. + * + * @since 1.2.0 + * + * @param int $number The number to be formatted. + * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}. + * @return string The formatted number. + */ + function bp_core_number_format($number = 0, $decimals = \false) + { + } + /** + * A utility for parsing individual function arguments into an array. + * + * The purpose of this function is to help with backward compatibility in cases where + * + * function foo( $bar = 1, $baz = false, $barry = array(), $blip = false ) { // ... + * + * is deprecated in favor of + * + * function foo( $args = array() ) { + * $defaults = array( + * 'bar' => 1, + * 'arg2' => false, + * 'arg3' => array(), + * 'arg4' => false, + * ); + * $r = bp_parse_args( $args, $defaults ); // ... + * + * The first argument, $old_args_keys, is an array that matches the parameter positions (keys) to + * the new $args keys (values): + * + * $old_args_keys = array( + * 0 => 'bar', // because $bar was the 0th parameter for foo() + * 1 => 'baz', // because $baz was the 1st parameter for foo() + * 2 => 'barry', // etc + * 3 => 'blip' + * ); + * + * For the second argument, $func_args, you should just pass the value of func_get_args(). + * + * @since 1.6.0 + * + * @param array $old_args_keys Old argument indexes, keyed to their positions. + * @param array $func_args The parameters passed to the originating function. + * @return array $new_args The parsed arguments. + */ + function bp_core_parse_args_array($old_args_keys, $func_args) + { + } + /** + * Merge user defined arguments into defaults array. + * + * This function is used throughout BuddyPress to allow for either a string or + * array to be merged into another array. It is identical to wp_parse_args() + * except it allows for arguments to be passively or aggressively filtered using + * the optional $filter_key parameter. If no $filter_key is passed, no filters + * are applied. + * + * @since 2.0.0 + * + * @param string|array $args Value to merge with $defaults. + * @param array $defaults Array that serves as the defaults. + * @param string $filter_key String to key the filters from. + * @return array Merged user defined values with defaults. + */ + function bp_parse_args($args, $defaults = array(), $filter_key = '') + { + } + /** + * Sanitizes a pagination argument based on both the request override and the + * original value submitted via a query argument, likely to a template class + * responsible for limiting the result set of a template loop. + * + * @since 2.2.0 + * + * @param string $page_arg The $_REQUEST argument to look for. + * @param int $page The original page value to fall back to. + * @return int A sanitized integer value, good for pagination. + */ + function bp_sanitize_pagination_arg($page_arg = '', $page = 1) + { + } + /** + * Sanitize an 'order' parameter for use in building SQL queries. + * + * Strings like 'DESC', 'desc', ' desc' will be interpreted into 'DESC'. + * Everything else becomes 'ASC'. + * + * @since 1.8.0 + * + * @param string $order The 'order' string, as passed to the SQL constructor. + * @return string The sanitized value 'DESC' or 'ASC'. + */ + function bp_esc_sql_order($order = '') + { + } + /** + * Escape special characters in a SQL LIKE clause. + * + * In WordPress 4.0, like_escape() was deprecated, due to incorrect + * documentation and improper sanitization leading to a history of misuse. To + * maintain compatibility with versions of WP before 4.0, we duplicate the + * logic of the replacement, wpdb::esc_like(). + * + * @since 2.1.0 + * + * @global wpdb $wpdb WordPress database object. + * @see wpdb::esc_like() for more details on proper use. + * + * @param string $text The raw text to be escaped. + * @return string Text in the form of a LIKE phrase. Not SQL safe. Run through + * wpdb::prepare() before use. + */ + function bp_esc_like($text) + { + } + /** + * Are we running username compatibility mode? + * + * @since 1.5.0 + * + * @todo Move to members component? + * + * @return bool False when compatibility mode is disabled, true when enabled. + * Default: false. + */ + function bp_is_username_compatibility_mode() + { + } + /** + * Return the parent forum ID for the Legacy Forums abstraction layer. + * + * @since 1.5.0 + * @since 3.0.0 Supported for compatibility with bbPress 2. + * + * @return int Forum ID. + */ + function bp_forums_parent_forum_id() + { + } + /** Directory *****************************************************************/ + /** + * Returns an array of core component IDs. + * + * @since 2.1.0 + * + * @return array + */ + function bp_core_get_packaged_component_ids() + { + } + /** + * Fetch a list of BP directory pages from the appropriate meta table. + * + * @since 1.5.0 + * @since 10.0.0 Eventually switch the current site to BP root's one on multisite configs. + * + * @param string $status 'active' to return only pages associated with active components, 'all' to return all saved + * pages. When running save routines, use 'all' to avoid removing data related to inactive + * components. Default: 'active'. + * @return array|string An array of page IDs, keyed by component names, or an + * empty string if the list is not found. + */ + function bp_core_get_directory_page_ids($status = 'active') + { + } + /** + * Get the page ID corresponding to a component directory. + * + * @since 2.6.0 + * + * @param string|null $component The slug representing the component. Defaults to the current component. + * @return int|false The ID of the directory page associated with the component. False if none is found. + */ + function bp_core_get_directory_page_id($component = \null) + { + } + /** + * Get the component ID corresponding to a directory page ID. + * + * @since 12.0.0 + * + * @param int $page_id The ID of the directory page associated with the component. + * @return int|false The slug representing the component. False if none is found. + */ + function bp_core_get_component_from_directory_page_id($page_id = 0) + { + } + /** + * Store the list of BP directory pages in the appropriate meta table. + * + * The bp-pages data is stored in site_options (falls back to options on non-MS), + * in an array keyed by blog_id. This allows you to change your + * bp_get_root_blog_id() and go through the setup process again. + * + * @since 1.5.0 + * + * @param array $blog_page_ids The IDs of the WP pages corresponding to BP + * component directories. + */ + function bp_core_update_directory_page_ids($blog_page_ids) + { + } + /** + * Get the BP Directory pages allowed stati. + * + * @since 11.0.0 + * + * @return array The BP Directory pages allowed stati. + */ + function bp_core_get_directory_pages_stati() + { + } + /** + * Get the directory pages post type. + * + * @since 12.0.0 + * + * @return string The post type to use for directory pages. + */ + function bp_core_get_directory_post_type() + { + } + /** + * Get names and slugs for BuddyPress component directory pages. + * + * @since 1.5.0 + * + * @return object Page names, IDs, and slugs. + */ + function bp_core_get_directory_pages() + { + } + /** + * Creates necessary directory pages. + * + * Directory pages are those WordPress pages used by BP components to display + * content (eg, the 'groups' page created by BP). + * + * @since 1.7.0 + * @since 12.0.0 Adds the `$return_pages` parameter. + * + * @param array $components Components to create pages for. + * @param string $existing 'delete' if you want to delete existing page mappings + * and replace with new ones. Otherwise existing page mappings + * are kept, and the gaps filled in with new pages. Default: 'keep'. + * @param boolean $return_pages Whether to return the page mapping or not. + * @return array|null + */ + function bp_core_add_page_mappings($components, $existing = 'keep', $return_pages = \false) + { + } + /** + * Get the default page titles for BP directory pages. + * + * @since 2.7.0 + * + * @return array + */ + function bp_core_get_directory_page_default_titles() + { + } + /** + * Make sure Components directory page `post_name` are unique. + * + * Goal is to avoid a slug conflict between a Page and a Component's directory page `post_name`. + * + * @since 12.0.0 + * + * @param string $slug The post slug. + * @param int $post_ID Post ID. + * @param string $post_status The post status. + * @param string $post_type Post type. + * @param int $post_parent Post parent ID. + * @param string $original_slug The original post slug. + */ + function bp_core_set_unique_directory_page_slug($slug = '', $post_ID = 0, $post_status = '', $post_type = '', $post_parent = 0, $original_slug = '') + { + } + /** + * Checks if a component's directory is set as the site's homepage. + * + * @since 12.0.0 + * + * @param string $component The component ID. + * @return bool True if a component's directory is set as the site's homepage. + * False otherwise. + */ + function bp_is_directory_homepage($component = '') + { + } + /** + * Remove the entry from bp_pages when the corresponding WP page is deleted. + * + * Bails early on multisite installations when not viewing the root site. + * + * @link https://buddypress.trac.wordpress.org/ticket/6226 + * + * @since 2.2.0 + * + * @param int $post_id Post ID. + */ + function bp_core_on_directory_page_delete($post_id) + { + } + /** + * Get the 'search' query argument for a given component. + * + * @since 2.4.0 + * @since 2.7.0 The `$component` parameter was made optional, with the current component + * as the fallback value. + * + * @param string|null $component Optional. Component name. Defaults to current component. + * @return string|bool Query argument on success. False on failure. + */ + function bp_core_get_component_search_query_arg($component = \null) + { + } + /** + * Get a list of all active component objects. + * + * @since 8.0.0 + * + * @param array $args { + * Optional. An array of key => value arguments to match against the component objects. + * Default empty array. + * + * @type string $name Translatable name for the component. + * @type string $id Unique ID for the component. + * @type string $slug Unique slug for the component, for use in query strings and URLs. + * @type bool $has_directory True if the component has a top-level directory. False otherwise. + * @type string $root_slug Slug used by the component's directory page. + * } + * @param string $output Optional. The type of output to return. Accepts 'ids' + * or 'objects'. Default 'ids'. + * @param string $operator Optional. The logical operation to perform. 'or' means only one + * element from the array needs to match; 'and' means all elements + * must match. Accepts 'or' or 'and'. Default 'and'. + * @return array A list of component ids or objects. + */ + function bp_core_get_active_components($args = array(), $output = 'ids', $operator = 'and') + { + } + /** URI ***********************************************************************/ + /** + * Perform a status-safe wp_redirect() that is compatible with BP's URI parser. + * + * @since 1.0.0 + * + * @param string $location The redirect URL. + * @param int $status Optional. The numeric code to give in the redirect + * headers. Default: 302. + */ + function bp_core_redirect($location = '', $status = 302) + { + } + /** + * Return the URL path of the referring page. + * + * This is a wrapper for `wp_get_referer()` that sanitizes the referer URL to + * a webroot-relative path. For example, 'http://example.com/foo/' will be + * reduced to '/foo/'. + * + * @since 2.3.0 + * + * @return bool|string Returns false on error, a URL path on success. + */ + function bp_get_referer_path() + { + } + /** + * Get the path of the current site. + * + * @since 1.0.0 + * + * @global object $current_site + * + * @return string URL to the current site. + */ + function bp_core_get_site_path() + { + } + /** Time **********************************************************************/ + /** + * Get the current GMT time to save into the DB. + * + * @since 1.2.6 + * + * @param bool $gmt True to use GMT (rather than local) time. Default: true. + * @param string $type See the 'type' parameter in {@link current_time()}. + * Default: 'mysql'. + * @return string Current time in 'Y-m-d h:i:s' format. + */ + function bp_core_current_time($gmt = \true, $type = 'mysql') + { + } + /** + * Calculate the human time difference between two dates. + * + * Based on function created by Dunstan Orchard - http://1976design.com + * + * @since 8.0.0 + * + * @param array $args { + * An array of arguments. All arguments are technically optional. + * + * @type int|string $older_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'. + * @type int|string $newer_date An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'. + * @type int $time_chunks The number of time chunks to get (1 or 2). + * } + * @return null|array|false Null if there's no time diff. An array containing 1 or 2 chunks + * of human time. False if travelling into the future. + */ + function bp_core_time_diff($args = array()) + { + } + /** + * Get an English-language representation of the time elapsed since a given date. + * + * This function will return an English representation of the time elapsed + * since a given date. + * eg: 2 hours, 50 minutes + * eg: 4 days + * eg: 4 weeks, 6 days + * + * Note that fractions of minutes are not represented in the return string. So + * an interval of 3 minutes will be represented by "3 minutes ago", as will an + * interval of 3 minutes 59 seconds. + * + * @since 1.0.0 + * @since 8.0.0 Move the time difference calculation into `bp_core_time_diff()`. + * + * @param int|string $older_date The earlier time from which you're calculating + * the time elapsed. Enter either as an integer Unix timestamp, + * or as a date string of the format 'Y-m-d h:i:s'. + * @param int|bool $newer_date Optional. Unix timestamp of date to compare older + * date to. Default: false (current time). + * @return string String representing the time since the older date, eg + * "2 hours, 50 minutes". + */ + function bp_core_time_since($older_date, $newer_date = \false) + { + } + /** + * Get an age to display according to the birth date. + * + * @since 8.0.0 + * + * @param int|string $birth_date A timestamp or a MySQL formatted date. + * @return string The age to display. + */ + function bp_core_time_old($birth_date) + { + } + /** + * Output an ISO-8601 date from a date string. + * + * @since 2.7.0 + * + * @param string String of date to convert. Timezone should be UTC before using this. + * @return string|null + */ + function bp_core_iso8601_date($timestamp = '') + { + } + /** + * Return an ISO-8601 date from a date string. + * + * @since 2.7.0 + * + * @param string String of date to convert. Timezone should be UTC before using this. + * @return string + */ + function bp_core_get_iso8601_date($timestamp = '') + { + } + /** Messages ******************************************************************/ + /** + * Add a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads. + * + * @since 1.0.0 + * + * @param string $message Feedback message to be displayed. + * @param string $type Message type. 'updated', 'success', 'error', 'warning'. + * Default: 'success'. + */ + function bp_core_add_message($message, $type = '') + { + } + /** + * Set up the display of the 'template_notices' feedback message. + * + * Checks whether there is a feedback message in the WP cookie and, if so, adds + * a "template_notices" action so that the message can be parsed into the + * template and displayed to the user. + * + * After the message is displayed, it removes the message vars from the cookie + * so that the message is not shown to the user multiple times. + * + * @since 1.1.0 + */ + function bp_core_setup_message() + { + } + /** + * Render the 'template_notices' feedback message. + * + * The hook action 'template_notices' is used to call this function, it is not + * called directly. + * + * @since 1.1.0 + */ + function bp_core_render_message() + { + } + /** Last active ***************************************************************/ + /** + * Listener function for the logged-in user's 'last_activity' metadata. + * + * Many functions use a "last active" feature to show the length of time since + * the user was last active. This function will update that time as a usermeta + * setting for the user every 5 minutes while the user is actively browsing the + * site. + * + * @since 1.0.0 + * + * @return false|null Returns false if there is nothing to do. + */ + function bp_core_record_activity() + { + } + /** + * Format last activity string based on time since date given. + * + * @since 1.0.0 + * + * @param int|string $last_activity_date The date of last activity. + * @param string $string A sprintf()-able statement of the form 'Active %s'. + * @return string $last_active A string of the form '3 years ago'. + */ + function bp_core_get_last_activity($last_activity_date = '', $string = '') + { + } + /** Meta **********************************************************************/ + /** + * Get the meta_key for a given piece of user metadata + * + * BuddyPress stores a number of pieces of user data in the WordPress central + * usermeta table. In order to allow plugins to enable multiple instances of + * BuddyPress on a single WP installation, BP's usermeta keys are filtered + * through this function, so that they can be altered on the fly. + * + * Plugin authors should use BP's _user_meta() functions, which bakes in + * bp_get_user_meta_key(): + * $friend_count = bp_get_user_meta( $user_id, 'total_friend_count', true ); + * If you must use WP's _user_meta() functions directly for some reason, you + * should use this function to determine the $key parameter, eg + * $friend_count = get_user_meta( $user_id, bp_get_user_meta_key( 'total_friend_count' ), true ); + * If using the WP functions, do not not hardcode your meta keys. + * + * @since 1.5.0 + * + * @param string|bool $key The usermeta meta_key. + * @return string $key The usermeta meta_key. + */ + function bp_get_user_meta_key($key = \false) + { + } + /** + * Get a piece of usermeta. + * + * This is a wrapper for get_user_meta() that allows for easy use of + * bp_get_user_meta_key(), thereby increasing compatibility with non-standard + * BP setups. + * + * @since 1.5.0 + * + * @see get_user_meta() For complete details about parameters and return values. + * + * @param int $user_id The ID of the user whose meta you're fetching. + * @param string $key The meta key to retrieve. + * @param bool $single Whether to return a single value. + * @return mixed Will be an array if $single is false. Will be value of meta data field if $single + * is true. + */ + function bp_get_user_meta($user_id, $key, $single = \false) + { + } + /** + * Update a piece of usermeta. + * + * This is a wrapper for update_user_meta() that allows for easy use of + * bp_get_user_meta_key(), thereby increasing compatibility with non-standard + * BP setups. + * + * @since 1.5.0 + * + * @see update_user_meta() For complete details about parameters and return values. + * + * @param int $user_id The ID of the user whose meta you're setting. + * @param string $key The meta key to set. + * @param mixed $value Metadata value. + * @param mixed $prev_value Optional. Previous value to check before removing. + * @return bool False on failure, true on success. + */ + function bp_update_user_meta($user_id, $key, $value, $prev_value = '') + { + } + /** + * Delete a piece of usermeta. + * + * This is a wrapper for delete_user_meta() that allows for easy use of + * bp_get_user_meta_key(), thereby increasing compatibility with non-standard + * BP setups. + * + * @since 1.5.0 + * + * @see delete_user_meta() For complete details about parameters and return values. + * + * @param int $user_id The ID of the user whose meta you're deleting. + * @param string $key The meta key to delete. + * @param mixed $value Optional. Metadata value. + * @return bool False for failure. True for success. + */ + function bp_delete_user_meta($user_id, $key, $value = '') + { + } + /** Embeds ********************************************************************/ + /** + * Initializes {@link BP_Embed} after everything is loaded. + * + * @since 1.5.0 + */ + function bp_embed_init() + { + } + /** + * Are oembeds allowed in activity items? + * + * @since 1.5.0 + * + * @return bool False when activity embed support is disabled; true when + * enabled. Default: true. + */ + function bp_use_embed_in_activity() + { + } + /** + * Are oembeds allowed in activity replies? + * + * @since 1.5.0 + * + * @return bool False when activity replies embed support is disabled; true + * when enabled. Default: true. + */ + function bp_use_embed_in_activity_replies() + { + } + /** + * Are oembeds allowed in private messages? + * + * @since 1.5.0 + * + * @return bool False when private message embed support is disabled; true when + * enabled. Default: true. + */ + function bp_use_embed_in_private_messages() + { + } + /** + * Extracts media metadata from a given content. + * + * @since 2.6.0 + * + * @param string $content The content to check. + * @param string|int $type The type to check. Can also use a bitmask. See the class constants in the + * BP_Media_Extractor class for more info. + * @return false|array If media exists, will return array of media metadata. Else, boolean false. + */ + function bp_core_extract_media_from_content($content = '', $type = 'all') + { + } + /** Admin *********************************************************************/ + /** + * Output the correct admin URL based on BuddyPress and WordPress configuration. + * + * @since 1.5.0 + * + * @see bp_get_admin_url() For description of parameters. + * + * @param string $path See {@link bp_get_admin_url()}. + * @param string $scheme See {@link bp_get_admin_url()}. + */ + function bp_admin_url($path = '', $scheme = 'admin') + { + } + /** + * Return the correct admin URL based on BuddyPress and WordPress configuration. + * + * @since 1.5.0 + * + * + * @param string $path Optional. The sub-path under /wp-admin to be + * appended to the admin URL. + * @param string $scheme The scheme to use. Default is 'admin', which + * obeys {@link force_ssl_admin()} and {@link is_ssl()}. 'http' + * or 'https' can be passed to force those schemes. + * @return string Admin url link with optional path appended. + */ + function bp_get_admin_url($path = '', $scheme = 'admin') + { + } + /** + * Should BuddyPress appear in network admin (vs a single site Dashboard)? + * + * Because BuddyPress can be installed in multiple ways and with multiple + * configurations, we need to check a few things to be confident about where + * to hook into certain areas of WordPress's admin. + * + * @since 1.5.0 + * + * @return bool True if the BP admin screen should appear in the Network Admin, + * otherwise false. + */ + function bp_core_do_network_admin() + { + } + /** + * Return the action name that BuddyPress nav setup callbacks should be hooked to. + * + * Functions used to set up BP Dashboard pages (wrapping such admin-panel + * functions as add_submenu_page()) should use bp_core_admin_hook() for the + * first parameter in add_action(). BuddyPress will then determine + * automatically whether to load the panels in the Network Admin. Ie: + * + * add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' ); + * + * @since 1.5.0 + * + * @return string $hook The proper hook ('network_admin_menu' or 'admin_menu'). + */ + function bp_core_admin_hook() + { + } + /** Multisite *****************************************************************/ + /** + * Is this the root blog? + * + * @since 1.5.0 + * + * @param int $blog_id Optional. Default: the ID of the current blog. + * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id(). + */ + function bp_is_root_blog($blog_id = 0) + { + } + /** + * Get the ID of the root blog. + * + * The "root blog" is the blog on a WordPress network where BuddyPress content + * appears (where member profile URLs resolve, where a given theme is loaded, + * etc.). + * + * @since 1.5.0 + * + * @return int The root site ID. + */ + function bp_get_root_blog_id() + { + } + /** + * Are we running multiblog mode? + * + * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress + * Multisite. "Multiblog" is BuddyPress setup that allows BuddyPress components + * to be viewed on every blog on the network, each with their own settings. + * + * Thus, instead of having all 'boonebgorges' links go to + * http://example.com/members/boonebgorges + * on the root blog, each blog will have its own version of the same content, eg + * http://site2.example.com/members/boonebgorges (for subdomains) + * http://example.com/site2/members/boonebgorges (for subdirectories) + * + * Multiblog mode is disabled by default, meaning that all BuddyPress content + * must be viewed on the root blog. It's also recommended not to use the + * BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated + * on individual sites. + * + * Why would you want to use this? Originally it was intended to allow + * BuddyPress to live in mu-plugins and be visible on mapped domains. This is + * a very small use-case with large architectural shortcomings, so do not go + * down this road unless you specifically need to. + * + * @since 1.5.0 + * + * @return bool False when multiblog mode is disabled; true when enabled. + * Default: false. + */ + function bp_is_multiblog_mode() + { + } + /** + * Is BuddyPress active at the network level for this network? + * + * Used to determine admin menu placement, and where settings and options are + * stored. If you're being *really* clever and manually pulling BuddyPress in + * with an mu-plugin or some other method, you'll want to filter + * 'bp_is_network_activated' and override the auto-determined value. + * + * @since 1.7.0 + * + * @return bool True if BuddyPress is network activated. + */ + function bp_is_network_activated() + { + } + /** Global Manipulators *******************************************************/ + /** + * Set the "is_directory" global. + * + * @since 1.5.0 + * + * @param bool $is_directory Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. + */ + function bp_update_is_directory($is_directory = \false, $component = '') + { + } + /** + * Set the "is_item_admin" global. + * + * @since 1.5.0 + * + * @param bool $is_item_admin Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. + */ + function bp_update_is_item_admin($is_item_admin = \false, $component = '') + { + } + /** + * Set the "is_item_mod" global. + * + * @since 1.5.0 + * + * @param bool $is_item_mod Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. + */ + function bp_update_is_item_mod($is_item_mod = \false, $component = '') + { + } + /** + * Trigger a 404. + * + * @since 1.5.0 + * + * @global WP_Query $wp_query WordPress query object. + * + * @param string $redirect If 'remove_canonical_direct', remove WordPress' "helpful" + * redirect_canonical action. Default: 'remove_canonical_redirect'. + */ + function bp_do_404($redirect = 'remove_canonical_direct') + { + } + /** Nonces ********************************************************************/ + /** + * Makes sure the user requested an action from another page on this site. + * + * To avoid security exploits within the theme. + * + * @since 1.6.0 + * + * @param string $action Action nonce. + * @param string $query_arg Where to look for nonce in $_REQUEST. + * @return bool True if the nonce is verified, otherwise false. + */ + function bp_verify_nonce_request($action = '', $query_arg = '_wpnonce') + { + } + /** Requests ******************************************************************/ + /** + * Return true|false if this is a POST request. + * + * @since 1.9.0 + * + * @return bool + */ + function bp_is_post_request() + { + } + /** + * Return true|false if this is a GET request. + * + * @since 1.9.0 + * + * @return bool + */ + function bp_is_get_request() + { + } + /** Miscellaneous hooks *******************************************************/ + /** + * Looks for the requested file name into a list of custom language locations. + * + * @since 14.0.0 + * + * @param string $file_name The file name. + * @return string A file path or an empty string if no files were found into custom language locations. + */ + function bp_get_custom_translation_file($file_name = '') + { + } + /** + * Override translation file for current language. + * + * @since 14.0.0 + * + * @param string $file Absolut path to the translation file to use. + * @param string $domain The text domain to check against `buddypress`. + * @param string $locale The current locale for the WordPress site. + * @return string Absolut path to the translation file to use. + */ + function bp_load_custom_translation_file($file, $domain, $locale = '') + { + } + /** + * Override script translation file for current language. + * + * @since 14.0.0 + * + * @param string|false $file Path to the translation file to load. False if there isn't one. + * @param string $handle Name of the script to register a translation domain to. + * @param string $domain The text domain. + * @return string Path to the translation file to load. + */ + function bp_load_custom_script_translation_file($file, $handle, $domain) + { + } + /** + * Load the buddypress translation file for current language. + * + * @since 1.0.2 + * + * @return void + */ + function bp_core_load_buddypress_textdomain() + { + } + /** + * A JavaScript-free implementation of the search functions in BuddyPress. + * + * @since 1.0.1 + * @since 10.0.0 Add support for Activity search. + * + * @param string $slug The slug to redirect to for searching. + */ + function bp_core_action_search_site($slug = '') + { + } + /** + * Remove "prev" and "next" relational links from <head> on BuddyPress pages. + * + * WordPress automatically generates these relational links to the current + * page. However, BuddyPress doesn't adhere to these links. In this + * function, we remove these links when on a BuddyPress page. This also + * prevents additional, unnecessary queries from running. + * + * @since 2.1.0 + */ + function bp_remove_adjacent_posts_rel_link() + { + } + /** + * Strip the span count of a menu item or of a title part. + * + * @since 2.2.2 + * + * @param string $title_part Title part to clean up. + * @return string + */ + function _bp_strip_spans_from_title($title_part = '') + { + } + /** + * Get the correct filename suffix for minified assets. + * + * @since 2.5.0 + * + * @return string + */ + function bp_core_get_minified_asset_suffix() + { + } + /** + * Return a list of component information. + * + * @since 2.6.0 + * + * @param string $type Optional; component type to fetch. Default value is 'all', or 'optional', 'retired', 'required'. + * @return array Requested components' data. + */ + function bp_core_get_components($type = 'all') + { + } + /** Nav Menu ******************************************************************/ + /** + * Create fake "post" objects for BP's logged-in nav menu for use in the WordPress "Menus" settings page. + * + * WordPress nav menus work by representing post or tax term data as a custom + * post type, which is then used to populate the checkboxes that appear on + * Dashboard > Appearance > Menu as well as the menu as rendered on the front + * end. Most of the items in the BuddyPress set of nav items are neither posts + * nor tax terms, so we fake a post-like object so as to be compatible with the + * menu. + * + * This technique also allows us to generate links dynamically, so that, for + * example, "My Profile" will always point to the URL of the profile of the + * logged-in user. + * + * @since 1.9.0 + * + * @return mixed A URL or an array of dummy pages. + */ + function bp_nav_menu_get_loggedin_pages() + { + } + /** + * Create fake "post" objects for BP's logged-out nav menu for use in the WordPress "Menus" settings page. + * + * WordPress nav menus work by representing post or tax term data as a custom + * post type, which is then used to populate the checkboxes that appear on + * Dashboard > Appearance > Menu as well as the menu as rendered on the front + * end. Most of the items in the BuddyPress set of nav items are neither posts + * nor tax terms, so we fake a post-like object so as to be compatible with the + * menu. + * + * @since 1.9.0 + * + * @return mixed A URL or an array of dummy pages. + */ + function bp_nav_menu_get_loggedout_pages() + { + } + /** + * Get the URL for a BuddyPress WP nav menu item, based on slug. + * + * BuddyPress-specific WP nav menu items have dynamically generated URLs, + * based on the identity of the current user. This function lets you fetch the + * proper URL for a given nav item slug (such as 'login' or 'messages'). + * + * @since 1.9.0 + * + * @param string $slug The slug of the nav item: login, register, or one of the + * slugs from the members navigation. + * @return string $nav_item_url The URL generated for the current user. + */ + function bp_nav_menu_get_item_url($slug) + { + } + /** Suggestions***************************************************************/ + /** + * BuddyPress Suggestions API for types of at-mentions. + * + * This is used to power BuddyPress' at-mentions suggestions, but it is flexible enough to be used + * for similar kinds of future requirements, or those implemented by third-party developers. + * + * @since 2.1.0 + * + * @param array $args Array of args for the suggestions. + * @return array|WP_Error Array of results. If there were any problems, returns a WP_Error object. + */ + function bp_core_get_suggestions($args) + { + } + /** + * Register Ajax actions needing the BP URI globals to be set. + * + * @since 12.0.0 + * + * @param string $ajax_action The ajax action needing the BP URI globals to be set. + * @return bool True if the ajax action was registered. False otherwise. + */ + function bp_ajax_register_action($ajax_action = '') + { + } + /** + * Is the requested ajax action registered? + * + * @since 12.0.0 + * + * @param string $ajax_action The ajax action to check. + * @return bool True if the ajax action is registered. False otherwise + */ + function bp_ajax_action_is_registered($ajax_action = '') + { + } + /** + * AJAX endpoint for Suggestions API lookups. + * + * @since 2.1.0 + * @since 4.0.0 Moved here to make sure this function is available + * even if the Activity component is not active. + */ + function bp_ajax_get_suggestions() + { + } + /** + * Set data from the BP root blog's upload directory. + * + * Handy for multisite instances because all uploads are made on the BP root + * blog and we need to query the BP root blog for the upload directory data. + * + * This function ensures that we only need to use {@link switch_to_blog()} + * once to get what we need. + * + * @since 2.3.0 + * + * @return bool|array + */ + function bp_upload_dir() + { + } + /** Post Types *****************************************************************/ + /** + * Output the name of the email post type. + * + * @since 2.5.0 + */ + function bp_email_post_type() + { + } + /** + * Returns the name of the email post type. + * + * @since 2.5.0 + * + * @return string The name of the email post type. + */ + function bp_get_email_post_type() + { + } + /** + * Return labels used by the email post type. + * + * @since 2.5.0 + * + * @return array + */ + function bp_get_email_post_type_labels() + { + } + /** + * Return array of features that the email post type supports. + * + * @since 2.5.0 + * + * @return array + */ + function bp_get_email_post_type_supports() + { + } + /** Taxonomies *****************************************************************/ + /** + * Returns the BP Taxonomy common arguments. + * + * @since 7.0.0 + * + * @return array The BP Taxonomy common arguments. + */ + function bp_get_taxonomy_common_args() + { + } + /** + * Returns the BP Taxonomy common labels. + * + * @since 7.0.0 + * + * @return array The BP Taxonomy common labels. + */ + function bp_get_taxonomy_common_labels() + { + } + /** + * Output the name of the email type taxonomy. + * + * @since 2.5.0 + */ + function bp_email_tax_type() + { + } + /** + * Return the name of the email type taxonomy. + * + * @since 2.5.0 + * + * @return string The unique email taxonomy type ID. + */ + function bp_get_email_tax_type() + { + } + /** + * Return labels used by the email type taxonomy. + * + * @since 2.5.0 + * + * @return array + */ + function bp_get_email_tax_type_labels() + { + } + /** + * Return arguments used by the email type taxonomy. + * + * @since 7.0.0 + * + * @return array + */ + function bp_get_email_tax_type_args() + { + } + /** + * Returns the default BuddyPress type metadata schema. + * + * @since 7.0.0 + * + * @param boolean $suppress_filters Whether to suppress filters. Default `false`. + * @param string $type_taxonomy Optional. the Type's taxonomy name. + * @return array The default BuddyPress type metadata schema. + */ + function bp_get_type_metadata_schema($suppress_filters = \false, $type_taxonomy = '') + { + } + /** + * Registers a meta key for BuddyPress types. + * + * @since 7.0.0 + * + * @param string $type_tax The BuddyPress type taxonomy. + * @param string $meta_key The meta key to register. + * @param array $args Data used to describe the meta key when registered. See + * {@see register_meta()} for a list of supported arguments. + * @return bool True if the meta key was successfully registered, false if not. + */ + function bp_register_type_meta($type_tax, $meta_key, array $args) + { + } + /** + * Update a list of metadata for a given type ID and a given taxonomy. + * + * @since 7.0.0 + * + * @param integer $type_id The database ID of the BP Type. + * @param string $taxonomy The BP Type taxonomy. + * @param array $type_metas An associative array (meta_key=>meta_value). + * @return bool False on failure. True otherwise. + */ + function bp_update_type_metadata($type_id = 0, $taxonomy = '', $type_metas = array()) + { + } + /** + * Get types for a given BP Taxonomy. + * + * @since 7.0.0 + * + * @param string $taxonomy The taxonomy to transform terms in types for. + * @param array $types Existing types to merge with the types found into the database. + * For instance this function is used internally to merge Group/Member + * types registered using code with the ones created by the administrator + * from the Group/Member types Administration screen. If not provided, only + * Types created by the administrator will be returned. + * Optional. + * @return array The types of the given taxonomy. + */ + function bp_get_taxonomy_types($taxonomy = '', $types = array()) + { + } + /** Email *****************************************************************/ + /** + * Get an BP_Email object for the specified email type. + * + * This function pre-populates the object with the subject, content, and template from the appropriate + * email post type item. It does not replace placeholder tokens in the content with real values. + * + * @since 2.5.0 + * + * @param string $email_type Unique identifier for a particular type of email. + * @return BP_Email|WP_Error BP_Email object, or WP_Error if there was a problem. + */ + function bp_get_email($email_type) + { + } + /** + * Send email, similar to WordPress' wp_mail(). + * + * A true return value does not automatically mean that the user received the + * email successfully. It just only means that the method used was able to + * process the request without any errors. + * + * @since 2.5.0 + * + * @param string $email_type Type of email being sent. + * @param string|array|int|WP_User $to Either a email address, user ID, WP_User object, + * or an array containing the address and name. + * @param array $args { + * Optional. Array of extra parameters. + * + * @type array $tokens Optional. Associative arrays of string replacements for the email. + * } + * @return bool|WP_Error True if the email was sent successfully. Otherwise, a WP_Error object + * describing why the email failed to send. The contents will vary based + * on the email delivery class you are using. + */ + function bp_send_email($email_type, $to, $args = array()) + { + } + /** + * Return email appearance settings. + * + * @since 2.5.0 + * @since 3.0.0 Added "direction" parameter for LTR/RTL email support, and + * "link_text_color" to override that in the email body. + * + * @return array + */ + function bp_email_get_appearance_settings() + { + } + /** + * Get the paths to possible templates for the specified email object. + * + * @since 2.5.0 + * + * @param WP_Post $object Post to get email template for. + * @return array + */ + function bp_email_get_template(\WP_Post $object) + { + } + /** + * Replace all tokens in the input text with appropriate values. + * + * Intended for use with the email system introduced in BuddyPress 2.5.0. + * + * @since 2.5.0 + * + * @param string $text Text to replace tokens in. + * @param array $tokens Token names and replacement values for the $text. + * @return string + */ + function bp_core_replace_tokens_in_text($text, $tokens) + { + } + /** + * Get a list of emails for populating the email post type. + * + * @since 2.5.1 + * @since 10.0.0 Added members-membership-request and + * members-membership-request-rejected email types. + * + * @return array + */ + function bp_email_get_schema() + { + } + /** + * Get a list of emails for populating email type taxonomy terms. + * + * @since 2.5.1 + * @since 2.7.0 $field argument added. + * + * @param string $field Optional; defaults to "description" for backwards compatibility. Other values: "all". + * @return array { + * The array of email types and their schema. + * + * @type string $description The description of the action which causes this to trigger. + * @type array $unsubscribe { + * Replacing this with false indicates that a user cannot unsubscribe from this type. + * + * @type string $meta_key The meta_key used to toggle the email setting for this notification. + * @type string $message The message shown when the user has successfully unsubscribed. + * } + */ + function bp_email_get_type_schema($field = 'description') + { + } + /** + * Handles unsubscribing user from notification emails. + * + * @since 2.7.0 + */ + function bp_email_unsubscribe_handler() + { + } + /** + * Creates unsubscribe link for notification emails. + * + * @since 2.7.0 + * + * @param string $redirect_to The URL to which the unsubscribe query string is appended. + * @param array $args { + * Used to build unsubscribe query string. + * + * @type string $notification_type Which notification type is being sent. + * @type string $user_id The ID of the user to whom the notification is sent. + * @type string $redirect_to Optional. The url to which the user will be redirected. Default is the activity directory. + * @type string $email Optional. The email address of the user to whom the notification is sent. + * } + * @return string The unsubscribe link. + */ + function bp_email_get_unsubscribe_link($args) + { + } + /** + * Get a persistent salt for email unsubscribe links. + * + * @since 2.7.0 + * + * @return string|null Returns null if value isn't set, otherwise string. + */ + function bp_email_get_salt() + { + } + /** + * Get a list of emails for use in our unsubscribe functions. + * + * @since 2.8.0 + * + * @see https://buddypress.trac.wordpress.org/ticket/7431 + * + * @return array The array of email types and their schema. + */ + function bp_email_get_unsubscribe_type_schema() + { + } + /** + * Gets the BP Email type of a BP Email ID or object. + * + * @since 8.0.0 + * + * @param int|WP_Post $email Optional. BP Email ID or BP Email object. Defaults to global $post. + * @return string The type of the BP Email object. + */ + function bp_email_get_type($email = \null) + { + } + /** + * Get BuddyPress content allowed tags. + * + * @since 3.0.0 + * + * @global array $allowedtags KSES allowed HTML elements. + * @return array BuddyPress content allowed tags. + */ + function bp_get_allowedtags() + { + } + /** + * Remove script and style tags from a string. + * + * @since 3.0.1 + * + * @param string $string The string to strip tags from. + * @return string The stripped tags string. + */ + function bp_strip_script_and_style_tags($string) + { + } + /** + * Checks whether the current installation is "large". + * + * By default, an installation counts as "large" if there are 10000 users or more. + * Filter 'bp_is_large_install' to adjust. + * + * @since 4.1.0 + * + * @return bool + */ + function bp_is_large_install() + { + } + /** + * Add a new BP_Optout. + * + * @since 8.0.0 + * + * @param array $args { + * An array of arguments describing the new opt-out. + * @type string $email_address Email address of user who has opted out. + * @type int $user_id Optional. ID of user whose communication + * prompted the user to opt-out. + * @type string $email_type Optional. Name of the email type that + * prompted the user to opt-out. + * @type string $date_modified Optional. Specify a time, else now will be used. + * } + * @return false|int False on failure, ID of new (or existing) opt-out if successful. + */ + function bp_add_optout($args = array()) + { + } + /** + * Find matching BP_Optouts. + * + * @since 8.0.0 + * + * @see BP_Optout::get() for a description of parameters and return values. + * + * @param array $args See {@link BP_Optout::get()}. + * @return array See {@link BP_Optout::get()}. + */ + function bp_get_optouts($args = array()) + { + } + /** + * Check an email address to see if that individual has opted out. + * + * @since 8.0.0 + * + * @param string $email_address Email address to check. + * @return bool True if the user has opted out, false otherwise. + */ + function bp_user_has_opted_out($email_address = '') + { + } + /** + * Delete a BP_Optout by ID. + * + * @since 8.0.0 + * + * @param int $id ID of the optout to delete. + * @return bool + */ + function bp_delete_optout_by_id($id = 0) + { + } + /** + * Get the list of versions needing their deprecated functions to be loaded. + * + * @since 11.0.0 + * + * @return array The list of versions needing their deprecated functions to be loaded. + */ + function bp_get_deprecated_functions_versions() + { + } + /** + * Get the BuddyPress Post Type site ID. + * + * @since 12.0.0 + * + * @return int The site ID the BuddyPress Post Type should be registered on. + */ + function bp_get_post_type_site_id() + { + } + /** + * Returns registered navigation items for all or a specific component. + * + * @since 12.0.0 + * + * @param string $component The component ID. + * @return array The list of registered navigation items. + */ + function bp_get_component_navigations($component = '') + { + } + /** + * Get the community visibility value calculated from the + * saved visibility setting. + * + * @since 12.0.0 + * + * @param string $component Whether we want the visibility for a single component + * or for all components. + * + * @return arrary|string $retval The calculated visbility settings for the site. + */ + function bp_get_community_visibility($component = 'global') + { + } + /** + * Returns the list of unread Admin Notification IDs. + * + * @since 11.4.0 + * + * @return array The list of unread Admin Notification IDs. + */ + function bp_core_get_unread_admin_notifications() + { + } + /** + * Dismisses an Admin Notification. + * + * @since 11.4.0 + * + * @param string $notification_id The Admin Notification to dismiss. + */ + function bp_core_dismiss_admin_notification($notification_id = '') + { + } + /** + * @since 11.4.0 + * + * @return array The list of Admin notifications. + */ + function bp_core_get_admin_notifications() + { + } + /** + * Plugin Dependency Action Hooks. + * + * The purpose of the following hooks is to mimic the behavior of something + * called 'plugin dependency' which enables a plugin to have plugins of their + * own in a safe and reliable way. + * + * We do this in BuddyPress by mirroring existing WordPress hooks in many places + * allowing dependent plugins to hook into the BuddyPress specific ones, thus + * guaranteeing proper code execution only when BuddyPress is active. + * + * The following functions are wrappers for hooks, allowing them to be + * manually called and/or piggy-backed on top of other hooks if needed. + * + * @package BuddyPress + * @subpackage Core + * @since 1.7.0 + */ + /** + * Fire the 'bp_include' action, where plugins should include files. + * + * @since 1.2.5 + */ + function bp_include() + { + } + /** + * Fire the 'bp_late_include' action for loading conditional files. + * + * @since 3.0.0 + */ + function bp_late_include() + { + } + /** + * Fire the 'bp_setup_components' action, where plugins should initialize components. + * + * @since 1.6.0 + */ + function bp_setup_components() + { + } + /** + * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL. + * + * @since 2.1.0 + */ + function bp_setup_canonical_stack() + { + } + /** + * Fire the 'bp_register_taxonomies' action, where plugins should register taxonomies. + * + * @since 2.2.0 + */ + function bp_register_taxonomies() + { + } + /** + * Fire the 'bp_register_type_metadata' action, where plugins should register metadata for their custom BuddyPress types. + * + * @since 7.0.0 + */ + function bp_register_type_metadata() + { + } + /** + * Fire the 'bp_register_post_types' action, where plugins should register post types. + * + * @since 2.5.0 + */ + function bp_register_post_types() + { + } + /** + * Fire the 'bp_register_post_statuses' action, where plugins should register post statuses. + * + * @since 12.0.0 + */ + function bp_register_post_statuses() + { + } + /** + * Fire the 'bp_setup_globals' action, where plugins should initialize global settings. + * + * @since 1.2.0 + */ + function bp_setup_globals() + { + } + /** + * Fire the 'bp_register_nav' action, where plugins should register their navigation items. + * + * @since 1.2.0 + */ + function bp_register_nav() + { + } + /** + * Fire the 'bp_setup_nav' action, where navigation items are generated. + * + * @since 1.2.0 + */ + function bp_setup_nav() + { + } + /** + * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar. + * + * @since 1.5.0 + */ + function bp_setup_admin_bar() + { + } + /** + * Fire the 'bp_setup_title' action, where plugins should modify the page title. + * + * @since 1.5.0 + */ + function bp_setup_title() + { + } + /** + * Fire the 'bp_register_widgets' action, where plugins should register widgets. + * + * @since 1.2.0 + */ + function bp_setup_widgets() + { + } + /** + * Fire the 'bp_register_member_types' action, where plugins should register member types. + * + * @since 2.3.0 + */ + function bp_register_member_types() + { + } + /** + * Fire the 'bp_setup_cache_groups' action, where cache groups are registered. + * + * @since 2.2.0 + */ + function bp_setup_cache_groups() + { + } + /** + * Set up the currently logged-in user. + * + * @since 1.7.0 + * + * @link https://buddypress.trac.wordpress.org/ticket/6046 + * @link https://core.trac.wordpress.org/ticket/24169 + */ + function bp_setup_current_user() + { + } + /** + * Fire the 'bp_init' action, BuddyPress's main initialization hook. + * + * @since 1.2.5 + */ + function bp_init() + { + } + /** + * Fire the 'bp_rest_api_init' action, where BuddyPress registers REST API endpoints. + * + * @since 2.6.0 + */ + function bp_rest_api_init() + { + } + /** + * BP Blocks Init hook. + * + * @since 6.0.0 + */ + function bp_blocks_init() + { + } + /** + * Fire the 'bp_customize_register' action when the Customizer has loaded, + * allowing scripts and styles to be initialized. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $customizer Customizer instance. + */ + function bp_customize_register(\WP_Customize_Manager $customizer) + { + } + /** + * Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded. + * + * Attached to 'plugins_loaded'. + * + * @since 1.2.0 + */ + function bp_loaded() + { + } + /** + * Fire the 'bp_ready' action, which runs after BP is set up and the page is about to render. + * + * Attached to 'wp'. + * + * @since 1.6.0 + */ + function bp_ready() + { + } + /** + * Fire the 'bp_actions' action, which runs just before rendering. + * + * Attach potential template actions, such as catching form requests or routing + * custom URLs. + * + * @since 1.5.0 + */ + function bp_actions() + { + } + /** + * Fire the 'bp_screens' action, which runs just before rendering. + * + * Runs just after 'bp_actions'. Use this hook to attach your template + * loaders. + * + * @since 1.5.0 + */ + function bp_screens() + { + } + /** + * Fire 'bp_widgets_init', which runs after widgets have been set up. + * + * Hooked to 'widgets_init'. + * + * @since 1.6.0 + */ + function bp_widgets_init() + { + } + /** + * Fire 'bp_head', which is used to hook scripts and styles in the <head>. + * + * Hooked to 'wp_head'. + * + * @since 1.6.0 + */ + function bp_head() + { + } + /** Theme Permissions *********************************************************/ + /** + * Fire the 'bp_template_redirect' action. + * + * Run at 'template_redirect', just before WordPress selects and loads a theme + * template. The main purpose of this hook in BuddyPress is to redirect users + * who do not have the proper permission to access certain content. + * + * @since 1.6.0 + */ + function bp_template_redirect() + { + } + /** Theme Helpers *************************************************************/ + /** + * Fire the 'bp_register_theme_packages' action. + * + * The main action used registering theme packages. + * + * @since 1.7.0 + */ + function bp_register_theme_packages() + { + } + /** + * Fire the 'bp_enqueue_scripts' action, where BP enqueues its CSS and JS. + * + * @since 1.6.0 + */ + function bp_enqueue_scripts() + { + } + /** + * Fires an action hook to enqueue scripts and styles for specific BuddyPress contexts. + * + * @since 11.0.0 + * + * @param string $context The specific BuddyPress context. Supported values are `embed` and `community`. + * Default: `embed`. + */ + function bp_enqueue_context_scripts($context = 'embed') + { + } + /** + * Fires the 'bp_enqueue_embed_scripts' action in the <head> for BP oEmbeds. + * + * @since 2.6.0 + */ + function bp_enqueue_embed_scripts() + { + } + /** + * Fires the `bp_enqueue_community_scripts` action for Template packs scripts and styles. + * + * @since 11.0.0 + */ + function bp_enqueue_community_scripts() + { + } + /** + * Fire the 'bp_add_rewrite_tag' action, where BP adds its custom rewrite tags. + * + * @since 1.8.0 + */ + function bp_add_rewrite_tags() + { + } + /** + * Fire the 'bp_add_rewrite_rules' action, where BP adds its custom rewrite rules. + * + * @since 1.9.0 + */ + function bp_add_rewrite_rules() + { + } + /** + * Fire the 'bp_add_permastructs' action, where BP adds its BP-specific permalink structure. + * + * @since 1.9.0 + */ + function bp_add_permastructs() + { + } + /** + * Fire the 'bp_setup_theme' action. + * + * The main purpose of 'bp_setup_theme' is give themes a place to load their + * BuddyPress-specific functionality. + * + * @since 1.6.0 + */ + function bp_setup_theme() + { + } + /** + * Fire the 'bp_after_setup_theme' action. + * + * Piggy-back action for BuddyPress-specific theme actions once the theme has + * been set up and the theme's functions.php has loaded. + * + * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of + * time for other themes to load their features, such as BuddyPress support, + * before our theme compatibility layer kicks in. + * + * @since 1.6.0 + */ + function bp_after_setup_theme() + { + } + /** Theme Compatibility Filter ************************************************/ + /** + * Fire the 'bp_request' filter, a piggy-back of WP's 'request'. + * + * @since 1.7.0 + * + * @see WP::parse_request() for a description of parameters. + * + * @param array $query_vars See {@link WP::parse_request()}. + * @return array $query_vars See {@link WP::parse_request()}. + */ + function bp_request($query_vars = array()) + { + } + /** + * Fire the 'bp_login_redirect' filter, a piggy-back of WP's 'login_redirect'. + * + * @since 1.7.0 + * + * @param string $redirect_to See 'login_redirect'. + * @param string $redirect_to_raw See 'login_redirect'. + * @param bool $user See 'login_redirect'. + * @return string + */ + function bp_login_redirect($redirect_to = '', $redirect_to_raw = '', $user = \false) + { + } + /** + * Fire 'bp_template_include', main filter used for theme compatibility and displaying custom BP theme files. + * + * Hooked to 'template_include'. + * + * @since 1.6.0 + * + * @param string $template See 'template_include'. + * @return string Template file to use. + */ + function bp_template_include($template = '') + { + } + /** + * Fire the 'bp_generate_rewrite_rules' action, where BP generates its rewrite rules. + * + * @since 1.7.0 + * + * @param WP_Rewrite $wp_rewrite See 'generate_rewrite_rules'. + */ + function bp_generate_rewrite_rules($wp_rewrite) + { + } + /** + * Fire the 'bp_allowed_themes' filter. + * + * Filter the allowed themes list for BuddyPress-specific themes. + * + * @since 1.7.0 + * + * @param array $themes The path of the template to include. + * @return array + */ + function bp_allowed_themes($themes) + { + } + /** Requests ******************************************************************/ + /** + * The main action used for handling theme-side POST requests. + * + * @since 1.9.0 + */ + function bp_post_request() + { + } + /** + * The main action used for handling theme-side GET requests. + * + * @since 1.9.0 + */ + function bp_get_request() + { + } + /** + * Gets default URL chunks rewrite information. + * + * @since 12.0.0 + * + * @return array Default URL chunks rewrite information. + */ + function bp_rewrites_get_default_url_chunks() + { + } + /** + * Delete rewrite rules, so that they are automatically rebuilt on + * the subsequent page load. + * + * @since 12.0.0 + */ + function bp_delete_rewrite_rules() + { + } + /** + * Are Pretty URLs active? + * + * @since 12.0.0 + * + * @return bool True if Pretty URLs are on. False otherwise. + */ + function bp_has_pretty_urls() + { + } + /** + * Returns the slug to use for the screen belonging to the requested component. + * + * @since 12.0.0 + * + * @param string $component_id The BuddyPress component's ID. + * @param string $rewrite_id The screen rewrite ID, used to find the custom slugs. + * Eg: `member_profile_edit` will try to find the xProfile edit's slug. + * @param string $default_slug The screen default slug, used as a fallback. + * @return string The slug to use for the screen belonging to the requested component. + */ + function bp_rewrites_get_slug($component_id = '', $rewrite_id = '', $default_slug = '') + { + } + /** + * Returns the rewrite ID of a customized slug. + * + * @since 12.0.0 + * + * @param string $component_id The component ID (eg: `activity` for the BP Activity component). + * @param string $slug The customized slug. + * @param string $context The context for the customized slug, useful when the same slug is used + * for more than one rewrite ID of the same component. + * @return string The rewrite ID matching the customized slug. + */ + function bp_rewrites_get_custom_slug_rewrite_id($component_id = '', $slug = '', $context = '') + { + } + /** + * Builds a BuddyPress link using the WP Rewrite API. + * + * @since 12.0.0 + * + * @param array $args { + * Optional. An array of arguments. + * + * @type string $component_id The BuddyPress component ID. Defaults ''. + * @type string $directory_type Whether it's an object type URL. Defaults ''. + * Accepts '' (no object type), 'members' or 'groups'. + * @type string $single_item The BuddyPress single item's URL chunk. Defaults ''. + * Eg: the member's user nicename for Members or the group's slug for Groups. + * @type string $single_item_component The BuddyPress single item's component URL chunk. Defaults ''. + * Eg: the member's Activity page. + * @type string $single_item_action The BuddyPress single item's action URL chunk. Defaults ''. + * Eg: the member's Activity mentions page. + * @type array $single_item_action_variables The list of BuddyPress single item's action variable URL chunks. Defaults []. + * } + * @return string The BuddyPress link. + */ + function bp_rewrites_get_url($args = array()) + { + } + /** + * Gets the BP root site URL, using BP Rewrites. + * + * @since 12.0.0 + * + * @return string The BP root site URL. + */ + function bp_rewrites_get_root_url() + { + } + /** + * Get needed data to find a member single item from the requested URL. + * + * @since 12.0.0 + * + * @param string $request The request used during parsing. + * @return array Data to use to find a member single item from the request. + */ + function bp_rewrites_get_member_data($request = '') + { + } + /** + * Returns default BuddyPress taxonomies. + * + * @since 7.0.0 + * + * @return array The BuddyPress default taxonomies. + */ + function bp_get_default_taxonomies() + { + } + /** + * Register our default taxonomies. + * + * @since 2.2.0 + */ + function bp_register_default_taxonomies() + { + } + /** + * Gets the ID of the site that BP should use for taxonomy term storage. + * + * Defaults to the root blog ID. + * + * @since 2.6.0 + * + * @param string $taxonomy Taxonomy slug to check for. + * @return int + */ + function bp_get_taxonomy_term_site_id($taxonomy = '') + { + } + /** + * Set taxonomy terms on a BuddyPress object. + * + * @since 2.2.0 + * + * @see wp_set_object_terms() for a full description of function and parameters. + * + * @param int $object_id Object ID. + * @param string|array $terms Term or terms to set. + * @param string $taxonomy Taxonomy name. + * @param bool $append Optional. True to append terms to existing terms. Default: false. + * @return array Array of term taxonomy IDs. + */ + function bp_set_object_terms($object_id, $terms, $taxonomy, $append = \false) + { + } + /** + * Get taxonomy terms for a BuddyPress object. + * + * @since 2.2.0 + * + * @see wp_get_object_terms() for a full description of function and parameters. + * + * @param int|array $object_ids ID or IDs of objects. + * @param string|array $taxonomies Name or names of taxonomies to match. + * @param array $args See {@see wp_get_object_terms()}. + * @return array + */ + function bp_get_object_terms($object_ids, $taxonomies, $args = array()) + { + } + /** + * Remove taxonomy terms on a BuddyPress object. + * + * @since 2.3.0 + * + * @see wp_remove_object_terms() for a full description of function and parameters. + * + * @param int $object_id Object ID. + * @param string|array $terms Term or terms to remove. + * @param string $taxonomy Taxonomy name. + * @return bool|WP_Error True on success, false or WP_Error on failure. + */ + function bp_remove_object_terms($object_id, $terms, $taxonomy) + { + } + /** + * Retrieve IDs of objects in valid taxonomies and terms for BuddyPress-related taxonomies. + * + * Note that object IDs are from the `bp_get_taxonomy_term_site_id()`, which on some + * multisite configurations may not be the same as the current site. + * + * @since 2.7.0 + * + * @see get_objects_in_term() for a full description of function and parameters. + * + * @param int|array $term_ids Term id or array of term ids of terms that will be used. + * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names. + * @param array|string $args Change the order of the object_ids, either ASC or DESC. + * + * @return WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success, + * the array can be empty, meaning that there are no $object_ids found. When + * object IDs are found, an array of those IDs will be returned. + */ + function bp_get_objects_in_term($term_ids, $taxonomies, $args = array()) + { + } + /** + * Get term data for terms in BuddyPress taxonomies. + * + * Note that term data is from the `bp_get_taxonomy_term_site_id()`, which on some + * multisite configurations may not be the same as the current site. + * + * @since 2.7.0 + * + * @see get_term_by() for a full description of function and parameters. + * + * @param string $field Either 'slug', 'name', 'id' (term_id), or 'term_taxonomy_id'. + * @param string|int $value Search for this term value. + * @param string $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'. + * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N. + * @param string $filter Optional, default is raw or no WordPress defined filter will applied. + * + * @return WP_Term|bool WP_Term instance on success. Will return false if `$taxonomy` does not exist + * or `$term` was not found. + */ + function bp_get_term_by($field, $value, $taxonomy = '', $output = \OBJECT, $filter = 'raw') + { + } + /** + * Add a new taxonomy term to the database. + * + * @since 7.0.0 + * + * @param string $term The BP term name to add. + * @param string $taxonomy The BP taxonomy to which to add the BP term. + * @param array $args { + * Optional. Array of arguments for inserting a BP term. + * @type string $description The term description. Default empty string. + * @type string $slug The term slug to use. Default empty string. + * @type array $metas The term metas to add. Default empty array. + * } + * @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`, + * WP_Error otherwise. + */ + function bp_insert_term($term, $taxonomy = '', $args = array()) + { + } + /** + * Get taxonomy BP Terms from the database. + * + * @since 7.0.0 + * + * @param array $args { + * Array of arguments to query BP Terms. + * @see `get_terms()` for full description of arguments in case of a member type. + * } + * @return array The list of terms matching arguments. + */ + function bp_get_terms($args = array()) + { + } + /** + * Deletes a BP Term. + * + * @since 7.0.0 + * + * @param int $term_id The BP Term ID. Required. + * @param string $taxonomy The BP Taxonomy Name. Required. + * @return bool|WP_Error True on success, WP_Error on failure. + */ + function bp_delete_term($term_id = 0, $taxonomy = '') + { + } + /** Theme Compat **************************************************************/ + /** + * What follows is an attempt at intercepting the natural page load process + * to replace the_content() with the appropriate BuddyPress content. + * + * To do this, BuddyPress does several direct manipulations of global variables + * and forces them to do what they are not supposed to be doing. + * + * Don't try anything you're about to witness here, at home. Ever. + */ + /** Functions *****************************************************************/ + /** + * Set up the default theme compat theme. + * + * @since 1.7.0 + * + * @param string $theme Optional. The unique ID identifier of a theme package. + */ + function bp_setup_theme_compat($theme = '') + { + } + /** + * Get the ID of the theme package being used. + * + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatibility layers for their themes. + * + * @since 1.7.0 + * + * @return string ID of the theme package in use. + */ + function bp_get_theme_compat_id() + { + } + /** + * Get the name of the theme package being used. + * + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatibility layers for their themes. + * + * @since 1.7.0 + * + * @return string Name of the theme package currently in use. + */ + function bp_get_theme_compat_name() + { + } + /** + * Get the version of the theme package being used. + * + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatibility layers for their themes. + * + * @since 1.7.0 + * + * @return string The version string of the theme package currently in use. + */ + function bp_get_theme_compat_version() + { + } + /** + * Get the absolute path of the theme package being used. + * + * Or set manually. Tricky theme authors can override the default and include + * their own BuddyPress compatibility layers for their themes. + * + * @since 1.7.0 + * + * @return string The absolute path of the theme package currently in use. + */ + function bp_get_theme_compat_dir() + { + } + /** + * Get the URL of the theme package being used. + * + * This can be filtered, or set manually. Tricky theme authors can override + * the default and include their own BuddyPress compatibility layers for their + * themes. + * + * @since 1.7.0 + * + * @return string URL of the theme package currently in use. + */ + function bp_get_theme_compat_url() + { + } + /** + * Should we use theme compat for this theme? + * + * If the current theme's need for theme compat hasn't yet been detected, we + * do so using bp_detect_theme_compat_with_current_theme(). + * + * @since 1.9.0 + * + * @return bool True if the current theme needs theme compatibility. + */ + function bp_use_theme_compat_with_current_theme() + { + } + /** + * Set our flag to determine whether theme compat should be enabled. + * + * Theme compat is disabled when a theme meets one of the following criteria: + * 1) It declares BP support with add_theme_support( 'buddypress' ) + * 2) It is bp-default, or a child theme of bp-default + * 3) A legacy template is found at members/members-loop.php. This is a + * fallback check for themes that were derived from bp-default, and have + * not been updated for BP 1.7+; we make the assumption that any theme in + * this category will have the members-loop.php template, and so use its + * presence as an indicator that theme compatibility is not required. + * + * @since 1.9.0 + * + * @return bool True if the current theme needs theme compatibility. + */ + function bp_detect_theme_compat_with_current_theme() + { + } + /** + * Is the current page using theme compatibility? + * + * @since 1.7.0 + * + * @return bool True if the current page uses theme compatibility. + */ + function bp_is_theme_compat_active() + { + } + /** + * Set the flag that tells whether the current page is using theme compatibility. + * + * @since 1.7.0 + * + * @param bool $set True to set the flag to true, false to set it to false. + * @return bool + */ + function bp_set_theme_compat_active($set = \true) + { + } + /** + * Set the theme compat templates global. + * + * Stash possible template files for the current query. Useful if plugins want + * to override them, or see what files are being scanned for inclusion. + * + * @since 1.7.0 + * + * @param array $templates The template stack. + * @return array The template stack (value of $templates). + */ + function bp_set_theme_compat_templates($templates = array()) + { + } + /** + * Set the theme compat template global. + * + * Stash the template file for the current query. Useful if plugins want + * to override it, or see what file is being included. + * + * @since 1.7.0 + * + * @param string $template The template currently in use. + * @return string The template currently in use (value of $template). + */ + function bp_set_theme_compat_template($template = '') + { + } + /** + * Set the theme compat original_template global. + * + * Stash the original template file for the current query. Useful for checking + * if BuddyPress was able to find a more appropriate template. + * + * @since 1.7.0 + * + * @param string $template The template originally selected by WP. + * @return string The template originally selected by WP (value of $template). + */ + function bp_set_theme_compat_original_template($template = '') + { + } + /** + * Set a theme compat feature + * + * @since 2.4.0 + * + * @param string $theme_id The theme id (eg: legacy). + * @param array $feature An associative array (eg: array( name => 'feature_name', 'settings' => array() )). + */ + function bp_set_theme_compat_feature($theme_id, $feature = array()) + { + } + /** + * Get a theme compat feature + * + * @since 2.4.0 + * + * @param string $feature The feature (eg: cover_image). + * @return object The feature settings. + */ + function bp_get_theme_compat_feature($feature = '') + { + } + /** + * Setup the theme's features. + * + * Note: BP Legacy's buddypress-functions.php is not loaded in WP Administration + * as it's loaded using bp_locate_template(). That's why this function is here. + * + * @since 2.4.0 + * + * @global string $content_width the content width of the theme + */ + function bp_register_theme_compat_default_features() + { + } + /** + * Check whether a given template is the one that WP originally selected to display current page. + * + * @since 1.7.0 + * + * @param string $template The template name to check. + * @return bool True if the value of $template is the same as the + * "original_template" originally selected by WP. Otherwise false. + */ + function bp_is_theme_compat_original_template($template = '') + { + } + /** + * Register a new BuddyPress theme package in the active theme packages array. + * + * For an example of how this function is used, see: + * {@link BuddyPress::register_theme_packages()}. + * + * @since 1.7.0 + * + * @see BP_Theme_Compat for a description of the $theme parameter arguments. + * + * @param array $theme See {@link BP_Theme_Compat}. + * @param bool $override If true, overrides whatever package is currently set. + * Default: true. + */ + function bp_register_theme_package($theme = array(), $override = \true) + { + } + /** + * Populate various WordPress globals with dummy data to prevent errors. + * + * This dummy data is necessary because theme compatibility essentially fakes + * WordPress into thinking that there is content where, in fact, there is none + * (at least, no WordPress post content). By providing dummy data, we ensure + * that template functions - things like is_page() - don't throw errors. + * + * @since 1.7.0 + * + * @global WP_Query $wp_query WordPress database access object. + * @global WP_Post $post Current post object. + * + * @param array $args Array of optional arguments. Arguments parallel the properties + * of {@link WP_Post}; see that class for more details. + */ + function bp_theme_compat_reset_post($args = array()) + { + } + /** + * Reset main query vars and filter 'the_content' to output a BuddyPress template part as needed. + * + * @since 1.7.0 + * + * @param string $template Template name. + * @return string $template Template name. + */ + function bp_template_include_theme_compat($template = '') + { + } + /** + * Conditionally replace 'the_content'. + * + * Replaces the_content() if the post_type being displayed is one that would + * normally be handled by BuddyPress, but proper single page templates do not + * exist in the currently active theme. + * + * @since 1.7.0 + * + * @param string $content Original post content. + * @return string $content Post content, potentially modified. + */ + function bp_replace_the_content($content = '') + { + } + /** + * Are we currently replacing the_content? + * + * @since 1.8.0 + * + * @return bool True if the_content is currently in the process of being + * filtered and replaced. + */ + function bp_do_theme_compat() + { + } + /** Filters *******************************************************************/ + /** + * Remove all filters from a WordPress filter hook. + * + * Removed filters are stashed in the $bp global, in case they need to be + * restored later. + * + * @since 1.7.0 + * + * @global WP_filter $wp_filter + * @global array $merged_filters + * + * @param string $tag The filter tag to remove filters from. + * @param int|bool $priority Optional. If present, only those callbacks attached + * at a given priority will be removed. Otherwise, all callbacks + * attached to the tag will be removed, regardless of priority. + * @return bool + */ + function bp_remove_all_filters($tag, $priority = \false) + { + } + /** + * Restore filters that were removed using bp_remove_all_filters(). + * + * @since 1.7.0 + * + * @global WP_filter $wp_filter + * @global array $merged_filters + * + * @param string $tag The tag to which filters should be restored. + * @param int|bool $priority Optional. If present, only those filters that were originally + * attached to the tag with $priority will be restored. Otherwise, + * all available filters will be restored, regardless of priority. + * @return bool + */ + function bp_restore_all_filters($tag, $priority = \false) + { + } + /** + * Force comments_status to 'closed' for BuddyPress post types. + * + * @since 1.7.0 + * + * @param bool $open True if open, false if closed. + * @param int $post_id ID of the post to check. + * @return bool True if open, false if closed. + */ + function bp_comments_open($open, $post_id = 0) + { + } + /** + * Avoid potential extra comment query on BuddyPress pages. + * + * @since 10.5.0 + * + * @param array|int|null $comment_data The comments list, the comment count or null. + * @param WP_Comment_Query $wp_comment_query The WP_Comment_Query instance. + * @return array|int|null Null to leave WordPress deal with the comment query, an empty array or 0 to shortcircuit it. + */ + function bp_comments_pre_query($comment_data, $wp_comment_query) + { + } + /** + * Do not allow {@link comments_template()} to render during theme compatibility. + * + * When theme compatibility sets the 'is_page' flag to true via + * {@link bp_theme_compat_reset_post()}, themes that use comments_template() + * in their page template will run. + * + * To prevent comments_template() from rendering, we set the 'is_page' and + * 'is_single' flags to false since that function looks at these conditionals + * before querying the database for comments and loading the comments template. + * + * This is done during the output buffer as late as possible to prevent any + * wonkiness. + * + * @since 1.9.2 + * + * @param string $retval The current post content. + * @return string $retval + */ + function bp_theme_compat_toggle_is_page($retval = '') + { + } + /** + * Restores the 'is_single' and 'is_page' flags if toggled by BuddyPress. + * + * @since 1.9.2 + * + * @see bp_theme_compat_toggle_is_page() + * @param object $query The WP_Query object. + */ + function bp_theme_compat_loop_end($query) + { + } + /** + * Maybe override the preferred template pack if the theme declares a dependency. + * + * @since 3.0.0 + */ + function bp_check_theme_template_pack_dependency() + { + } + /** + * Informs about whether current theme compat is about a block theme. + * + * @since 14.0.0 + * + * @return bool True if current theme compat is about a block theme. + * False otherwise. + */ + function bp_theme_compat_is_block_theme() + { + } + /** + * Registers the `buddypress` theme feature. + * + * @since 14.0.0 + */ + function bp_register_buddypress_theme_feature() + { + } + /** + * Filters the WP theme support API so that it can be used to check whether the + * current theme has global BuddyPress and/or BP Component specific support. + * + * Please do not use in your plugins or themes. + * + * @since 14.0.0 + * @access private + * + * @param bool $supports Whether the active theme supports the given feature. Default false. + * @param array $args Array of arguments for the feature. + * @param mixed $feature The theme feature. + * @return boolean True if the feature is supported. False otherwise. + */ + function _bp_filter_current_theme_supports($supports = \false, $args = array(), $feature = \null) + { + } + /** + * BP wrapper function for WP's `current_theme_supports()`. + * + * @since 14.0.0 + * + * @param array $args An associative array containing **ONE** feature & keyed by the BP Component ID. + * @return boolean True if the theme supports the BP feature. False otherwise. + */ + function bp_current_theme_supports($args = array()) + { + } + /** + * Output the "options nav", the secondary-level single item navigation menu. + * + * Uses the component's nav global to render out the sub navigation for the + * current component. Each component adds to its sub navigation array within + * its own setup_nav() function. + * + * This sub navigation array is the secondary level navigation, so for profile + * it contains: + * [Public, Edit Profile, Change Avatar] + * + * The function will also analyze the current action for the current component + * to determine whether or not to highlight a particular sub nav item. + * + * @since 1.0.0 + * + * viewed user. + * + * @param string $parent_slug Options nav slug. + * @return string + */ + function bp_get_options_nav($parent_slug = '') + { + } + /** + * Get the directory title for a component. + * + * Used for the <title> element and the page header on the component directory + * page. + * + * @since 2.0.0 + * + * @param string $component Component to get directory title for. + * @return string + */ + function bp_get_directory_title($component = '') + { + } + /** Avatars *******************************************************************/ + /** + * Output the current avatar upload step. + * + * @since 1.1.0 + */ + function bp_avatar_admin_step() + { + } + /** + * Return the current avatar upload step. + * + * @since 1.1.0 + * + * @return string The current avatar upload step. Returns 'upload-image' + * if none is found. + */ + function bp_get_avatar_admin_step() + { + } + /** + * Output the URL of the avatar to crop. + * + * @since 1.1.0 + */ + function bp_avatar_to_crop() + { + } + /** + * Return the URL of the avatar to crop. + * + * @since 1.1.0 + * + * @return string URL of the avatar awaiting cropping. + */ + function bp_get_avatar_to_crop() + { + } + /** + * Output the relative file path to the avatar to crop. + * + * @since 1.1.0 + */ + function bp_avatar_to_crop_src() + { + } + /** + * Return the relative file path to the avatar to crop. + * + * @since 1.1.0 + * + * @return string Relative file path to the avatar. + */ + function bp_get_avatar_to_crop_src() + { + } + /** + * Output the name of the BP site. Used in RSS headers. + * + * @since 1.0.0 + */ + function bp_site_name() + { + } + /** + * Returns the name of the BP site. Used in RSS headers. + * + * @since 1.6.0 + * + * @return string + */ + function bp_get_site_name() + { + } + /** + * Format a date based on a UNIX timestamp. + * + * This function can be used to turn a UNIX timestamp into a properly formatted + * (and possibly localized) string, useful for outputting the date & time an + * action took place. + * + * Not to be confused with `bp_core_time_since()`, this function is best used + * for displaying a more exact date and time vs. a human-readable time. + * + * Note: This function may be improved or removed at a later date, as it is + * hardly used and adds an additional layer of complexity to calculating dates + * and times together with timezone offsets and i18n. + * + * @since 1.1.0 + * + * @param int|string $time The UNIX timestamp to be formatted. + * @param bool $exclude_time Optional. True to return only the month + day, false + * to return month, day, and time. Default: false. + * @param bool $gmt Optional. True to display in local time, false to + * leave in GMT. Default: true. + * @return mixed A string representation of $time, in the format + * "March 18, 2014 at 2:00 pm" (or whatever your + * 'date_format' and 'time_format' settings are + * on your root blog). False on failure. + */ + function bp_format_time($time = '', $exclude_time = \false, $gmt = \true) + { + } + /** + * Select between two dynamic strings, according to context. + * + * This function can be used in cases where a phrase used in a template will + * differ for a user looking at his own profile and a user looking at another + * user's profile (eg, "My Friends" and "Joe's Friends"). Pass both versions + * of the phrase, and bp_word_or_name() will detect which is appropriate, and + * do the necessary argument swapping for dynamic phrases. + * + * @since 1.0.0 + * + * @param string $youtext The "you" version of the phrase (eg "Your Friends"). + * @param string $nametext The other-user version of the phrase. Should be in + * a format appropriate for sprintf() - use %s in place of the displayed + * user's name (eg "%'s Friends"). + * @param bool $capitalize Optional. Force into title case. Default: true. + * @param bool $echo Optional. True to echo the results, false to return them. + * Default: true. + * @return string|null $nametext If ! $echo, returns the appropriate string. + */ + function bp_word_or_name($youtext, $nametext, $capitalize = \true, $echo = \true) + { + } + /** Search Form ***************************************************************/ + /** + * Return the "action" attribute for search forms. + * + * @since 1.0.0 + * + * @return string URL action attribute for search forms, eg example.com/search/. + */ + function bp_search_form_action() + { + } + /** + * Generate the basic search form as used in BP-Default's header. + * + * @since 1.0.0 + * + * @return string HTML <select> element. + */ + function bp_search_form_type_select() + { + } + /** + * Output the 'name' attribute for search form input element. + * + * @since 2.7.0 + * + * @param string $component See bp_get_search_input_name(). + */ + function bp_search_input_name($component = '') + { + } + /** + * Get the 'name' attribute for the search form input element. + * + * @since 2.7.0 + * + * @param string $component Component name. Defaults to current component. + * @return string Text for the 'name' attribute. + */ + function bp_get_search_input_name($component = '') + { + } + /** + * Output the placeholder text for the search box for a given component. + * + * @since 2.7.0 + * + * @param string $component See bp_get_search_placeholder(). + */ + function bp_search_placeholder($component = '') + { + } + /** + * Get the placeholder text for the search box for a given component. + * + * @since 2.7.0 + * + * @param string $component Component name. Defaults to current component. + * @return string Placeholder text for the search field. + */ + function bp_get_search_placeholder($component = '') + { + } + /** + * Output the default text for the search box for a given component. + * + * @since 1.5.0 + * + * @see bp_get_search_default_text() + * + * @param string $component See {@link bp_get_search_default_text()}. + */ + function bp_search_default_text($component = '') + { + } + /** + * Return the default text for the search box for a given component. + * + * @since 1.5.0 + * + * @param string $component Component name. Default: current component. + * @return string Placeholder text for search field. + */ + function bp_get_search_default_text($component = '') + { + } + /** + * Output the attributes for a form field. + * + * @since 2.2.0 + * + * @param string $name The field name to output attributes for. + * @param array $attributes Array of existing attributes to add. + */ + function bp_form_field_attributes($name = '', $attributes = array()) + { + } + /** + * Get the attributes for a form field. + * + * Primarily to add better support for touchscreen devices, but plugin devs + * can use the 'bp_get_form_field_extra_attributes' filter for further + * manipulation. + * + * @since 2.2.0 + * + * @param string $name The field name to get attributes for. + * @param array $attributes Array of existing attributes to add. + * @return string + */ + function bp_get_form_field_attributes($name = '', $attributes = array()) + { + } + /** + * Create and output a button. + * + * @since 1.2.6 + * + * @see bp_get_button() + * + * @param array|string $args See {@link BP_Button}. + */ + function bp_button($args = '') + { + } + /** + * Create and return a button. + * + * @since 1.2.6 + * + * @see BP_Button for a description of arguments and return value. + * + * @param array|string $args See {@link BP_Button}. + * @return string HTML markup for the button. + */ + function bp_get_button($args = '') + { + } + /** + * Truncate text. + * + * Cuts a string to the length of $length and replaces the last characters + * with the ending if the text is longer than length. + * + * This function is borrowed from CakePHP v2.0, under the MIT license. See + * http://book.cakephp.org/view/1469/Text#truncate-1625 + * + * @since 1.0.0 + * @since 2.6.0 Added 'strip_tags' and 'remove_links' as $options args. + * + * @param string $text String to truncate. + * @param int $length Optional. Length of returned string, including ellipsis. + * Default: 225. + * @param array $options { + * An array of HTML attributes and options. Each item is optional. + * @type string $ending The string used after truncation. + * Default: ' […]'. + * @type bool $exact If true, $text will be trimmed to exactly $length. + * If false, $text will not be cut mid-word. Default: false. + * @type bool $html If true, don't include HTML tags when calculating + * excerpt length. Default: true. + * @type bool $filter_shortcodes If true, shortcodes will be stripped. + * Default: true. + * @type bool $strip_tags If true, HTML tags will be stripped. Default: false. + * Only applicable if $html is set to false. + * @type bool $remove_links If true, URLs will be stripped. Default: false. + * Only applicable if $html is set to false. + * } + * @return string Trimmed string. + */ + function bp_create_excerpt($text, $length = 225, $options = array()) + { + } + /** + * Output the total member count for the site. + * + * @since 1.2.0 + */ + function bp_total_member_count() + { + } + /** + * Return the total member count in your BP instance. + * + * Since BuddyPress 1.6, this function has used bp_core_get_active_member_count(), + * which counts non-spam, non-deleted users who have last_activity. + * This value will correctly match the total member count number used + * for pagination on member directories. + * + * Before BuddyPress 1.6, this function used bp_core_get_total_member_count(), + * which did not take into account last_activity, and thus often + * resulted in higher counts than shown by member directory pagination. + * + * @since 1.2.0 + * + * @return int Member count. + */ + function bp_get_total_member_count() + { + } + /** + * Is blog signup allowed? + * + * Returns true if is_multisite() and blog creation is enabled at + * Network Admin > Settings. + * + * @since 1.2.0 + * + * @return bool True if blog signup is allowed, otherwise false. + */ + function bp_get_blog_signup_allowed() + { + } + /** + * Check whether an activation has just been completed. + * + * @since 1.1.0 + * + * @return bool True if the activation_complete global flag has been set, + * otherwise false. + */ + function bp_account_was_activated() + { + } + /** + * Check whether registrations require activation on this installation. + * + * On a normal BuddyPress installation, all registrations require email + * activation. This filter exists so that customizations that omit activation + * can remove certain notification text from the registration screen. + * + * @since 1.2.0 + * + * @return bool True by default. + */ + function bp_registration_needs_activation() + { + } + /** + * Retrieve a client friendly version of the root blog name. + * + * The blogname option is escaped with esc_html on the way into the database in + * sanitize_option, we want to reverse this for the plain text arena of emails. + * + * @since 1.7.0 + * @since 2.5.0 No longer used by BuddyPress, but not deprecated in case any existing plugins use it. + * + * @see https://buddypress.trac.wordpress.org/ticket/4401 + * + * @param array $args { + * Array of optional parameters. + * @type string $before String to appear before the site name in the + * email subject. Default: '['. + * @type string $after String to appear after the site name in the + * email subject. Default: ']'. + * @type string $default The default site name, to be used when none is + * found in the database. Default: 'Community'. + * @type string $text Text to append to the site name (ie, the main text of + * the email subject). + * } + * @return string Sanitized email subject. + */ + function bp_get_email_subject($args = array()) + { + } + /** + * Allow templates to pass parameters directly into the template loops via AJAX. + * + * For the most part this will be filtered in a theme's functions.php for + * example in the default theme it is filtered via bp_dtheme_ajax_querystring(). + * + * By using this template tag in the templates it will stop them from showing + * errors if someone copies the templates from the default theme into another + * WordPress theme without coping the functions from functions.php. + * + * @since 1.2.0 + * + * @param string|bool $object Current template component. + * @return string The AJAX querystring. + */ + function bp_ajax_querystring($object = \false) + { + } + /** Template Classes and _is functions ****************************************/ + /** + * Return the name of the current component. + * + * @since 1.0.0 + * + * @return string Component name. + */ + function bp_current_component() + { + } + /** + * Return the name of the current action. + * + * @since 1.0.0 + * + * @return string Action name. + */ + function bp_current_action() + { + } + /** + * Return the name of the current item. + * + * @since 1.1.0 + * + * @return string|bool + */ + function bp_current_item() + { + } + /** + * Return the value of $bp->action_variables. + * + * @since 1.0.0 + * + * @return array|bool $action_variables The action variables array, or false + * if the array is empty. + */ + function bp_action_variables() + { + } + /** + * Return the value of a given action variable. + * + * @since 1.5.0 + * + * @param int $position The key of the action_variables array that you want. + * @return string|bool $action_variable The value of that position in the + * array, or false if not found. + */ + function bp_action_variable($position = 0) + { + } + /** + * Returns the BP root blog's domain name. + * + * @since 12.0.0 + * + * @return string The BP root blog's domain name. + */ + function bp_get_domain() + { + } + /** + * Gets the BP root blog's URL. + * + * @since 12.0.0 + * + * @return string The BP root blog's URL. + */ + function bp_get_root_url() + { + } + /** + * Output the "root url", the URL of the BP root blog. + * + * @since 12.0.0 + */ + function bp_root_url() + { + } + /** + * Output the root slug for a given component. + * + * @since 1.5.0 + * + * @param string $component The component name. + */ + function bp_root_slug($component = '') + { + } + /** + * Get the root slug for given component. + * + * The "root slug" is the string used when concatenating component + * directory URLs. For example, on an installation where the Groups + * component's directory is located at http://example.com/groups/, the + * root slug for the Groups component is 'groups'. This string + * generally corresponds to page_name of the component's directory + * page. + * + * In order to maintain backward compatibility, the following procedure + * is used: + * 1) Use the short slug to get the canonical component name from the + * active component array. + * 2) Use the component name to get the root slug out of the + * appropriate part of the $bp global. + * 3) If nothing turns up, it probably means that $component is itself + * a root slug. + * + * Example: If your groups directory is at /community/companies, this + * function first uses the short slug 'companies' (ie the current + * component) to look up the canonical name 'groups' in + * $bp->active_components. Then it uses 'groups' to get the root slug, + * from $bp->groups->root_slug. + * + * @since 1.5.0 + * + * @param string $component Optional. Defaults to the current component. + * @return string $root_slug The root slug. + */ + function bp_get_root_slug($component = '') + { + } + /** + * Return the component name based on a root slug. + * + * @since 1.5.0 + * + * @param string $root_slug Needle to our active component haystack. + * @return mixed False if none found, component name if found. + */ + function bp_get_name_from_root_slug($root_slug = '') + { + } + /** + * Returns whether or not a user has access. + * + * @since 1.2.4 + * + * @return bool + */ + function bp_user_has_access() + { + } + /** + * Output the search slug. + * + * @since 1.5.0 + * + */ + function bp_search_slug() + { + } + /** + * Return the search slug. + * + * @since 1.5.0 + * + * @return string The search slug. Default: 'search'. + */ + function bp_get_search_slug() + { + } + /** + * Get the ID of the currently displayed user. + * + * @since 1.0.0 + * + * @return int $id ID of the currently displayed user. + */ + function bp_displayed_user_id() + { + } + /** + * Get the ID of the currently logged-in user. + * + * @since 1.0.0 + * + * @return int ID of the logged-in user. + */ + function bp_loggedin_user_id() + { + } + /** The is_() functions to determine the current page *****************************/ + /** + * Check to see whether the current page belongs to the specified component. + * + * This function is designed to be generous, accepting several different kinds + * of value for the $component parameter. It checks $component_name against: + * - the component's root_slug, which matches the page slug in $bp->pages. + * - the component's regular slug. + * - the component's id, or 'canonical' name. + * + * @since 1.5.0 + * + * @param string $component Name of the component being checked. + * @return bool Returns true if the component matches, or else false. + */ + function bp_is_current_component($component = '') + { + } + /** + * Check to see whether the current page matches a given action. + * + * Along with bp_is_current_component() and bp_is_action_variable(), this + * function is mostly used to help determine when to use a given screen + * function. + * + * In BP parlance, the current_action is the URL chunk that comes directly + * after the current item slug. E.g., in + * http://example.com/groups/my-group/members + * the current_action is 'members'. + * + * @since 1.5.0 + * + * @param string $action The action being tested against. + * @return bool True if the current action matches $action. + */ + function bp_is_current_action($action = '') + { + } + /** + * Check to see whether the current page matches a given action_variable. + * + * Along with bp_is_current_component() and bp_is_current_action(), this + * function is mostly used to help determine when to use a given screen + * function. + * + * In BP parlance, action_variables are an array made up of the URL chunks + * appearing after the current_action in a URL. For example, + * http://example.com/groups/my-group/admin/group-settings + * $action_variables[0] is 'group-settings'. + * + * @since 1.5.0 + * + * @param string $action_variable The action_variable being tested against. + * @param int|bool $position Optional. The array key you're testing against. If you + * don't provide a $position, the function will return true if the + * $action_variable is found *anywhere* in the action variables array. + * @return bool True if $action_variable matches at the $position provided. + */ + function bp_is_action_variable($action_variable = '', $position = \false) + { + } + /** + * Check against the current_item. + * + * @since 1.5.0 + * + * @param string $item The item being checked. + * @return bool True if $item is the current item. + */ + function bp_is_current_item($item = '') + { + } + /** + * Are we looking at a single item? (group, user, etc). + * + * @since 1.1.0 + * + * @return bool True if looking at a single item, otherwise false. + */ + function bp_is_single_item() + { + } + /** + * Is the logged-in user an admin for the current item? + * + * @since 1.5.0 + * + * @return bool True if the current user is an admin for the current item, + * otherwise false. + */ + function bp_is_item_admin() + { + } + /** + * Is the logged-in user a mod for the current item? + * + * @since 1.5.0 + * + * @return bool True if the current user is a mod for the current item, + * otherwise false. + */ + function bp_is_item_mod() + { + } + /** + * Is this a component directory page? + * + * @since 1.0.0 + * + * @return bool True if the current page is a component directory, otherwise false. + */ + function bp_is_directory() + { + } + /** + * Check to see if a component's URL should be in the root, not under a member page. + * + * - Yes ('groups' is root) : http://example.com/groups/the-group + * - No ('groups' is not-root): http://example.com/members/andy/groups/the-group + * + * This function is on the chopping block. It's currently only used by a few + * already deprecated functions. + * + * @since 1.5.0 + * + * @param string $component_name Component name to check. + * + * @return bool True if root component, else false. + */ + function bp_is_root_component($component_name = '') + { + } + /** + * Check if the specified BuddyPress component directory is set to be the front page. + * + * Corresponds to the setting in wp-admin's Settings > Reading screen. + * + * @since 1.5.0 + * + * @global int $current_blog WordPress global for the current blog. + * + * @param string $component Optional. Name of the component to check for. + * Default: current component. + * @return bool True if the specified component is set to be the site's front + * page, otherwise false. + */ + function bp_is_component_front_page($component = '') + { + } + /** + * Is this a blog page, ie a non-BP page? + * + * You can tell if a page is displaying BP content by whether the + * current_component has been defined. + * + * @since 1.0.0 + * + * @return bool True if it's a non-BP page, false otherwise. + */ + function bp_is_blog_page() + { + } + /** + * Checks whether the requested URL is site home's one. + * + * @since 12.1.0 + * + * @return bool True if the requested URL is site home's one. False otherwise. + */ + function bp_is_site_home() + { + } + /** + * Is this a BuddyPress component? + * + * You can tell if a page is displaying BP content by whether the + * current_component has been defined. + * + * Generally, we can just check to see that there's no current component. + * The one exception is single user home tabs, where $bp->current_component + * is unset. Thus the addition of the bp_is_user() check. + * + * @since 1.7.0 + * + * @return bool True if it's a BuddyPress page, false otherwise. + */ + function is_buddypress() + { + } + /** Components ****************************************************************/ + /** + * Check whether a given component (or feature of a component) is active. + * + * @since 1.2.0 See r2539. + * @since 2.3.0 Added $feature as a parameter. + * + * @param string $component The component name. + * @param string $feature The feature name. + * @return bool + */ + function bp_is_active($component = '', $feature = '') + { + } + /** + * Check whether the current page is part of the Members component. + * + * @since 1.5.0 + * + * @return bool True if the current page is part of the Members component. + */ + function bp_is_members_component() + { + } + /** + * Check whether the current page is part of the Profile component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Profile component. + */ + function bp_is_profile_component() + { + } + /** + * Check whether the current page is part of the Activity component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Activity component. + */ + function bp_is_activity_component() + { + } + /** + * Check whether the current page is part of the Blogs component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Blogs component. + */ + function bp_is_blogs_component() + { + } + /** + * Check whether the current page is part of the Messages component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Messages component. + */ + function bp_is_messages_component() + { + } + /** + * Check whether the current page is part of the Friends component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Friends component. + */ + function bp_is_friends_component() + { + } + /** + * Check whether the current page is part of the Groups component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Groups component. + */ + function bp_is_groups_component() + { + } + /** + * Check whether the current page is part of the Forums component. + * + * @since 1.5.0 + * @since 3.0.0 Required for bbPress 2 integration. + * + * @return bool True if the current page is part of the Forums component. + */ + function bp_is_forums_component() + { + } + /** + * Check whether the current page is part of the Notifications component. + * + * @since 1.9.0 + * + * @return bool True if the current page is part of the Notifications component. + */ + function bp_is_notifications_component() + { + } + /** + * Check whether the current page is part of the Settings component. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the Settings component. + */ + function bp_is_settings_component() + { + } + /** + * Check whether the current page is an Invitations screen. + * + * @since 8.0.0 + * + * @return bool True if the current page is an Invitations screen. + */ + function bp_is_members_invitations_screen() + { + } + /** + * Is the current component an active core component? + * + * Use this function when you need to check if the current component is an + * active core component of BuddyPress. If the current component is inactive, it + * will return false. If the current component is not part of BuddyPress core, + * it will return false. If the current component is active, and is part of + * BuddyPress core, it will return true. + * + * @since 1.7.0 + * + * @return bool True if the current component is active and is one of BP's + * packaged components. + */ + function bp_is_current_component_core() + { + } + /** Activity ******************************************************************/ + /** + * Is the current page the activity directory? + * + * @since 2.0.0 + * + * @return bool True if the current page is the activity directory. + */ + function bp_is_activity_directory() + { + } + /** + * Is the current page a single activity item permalink? + * + * @since 1.5.0 + * + * @return bool True if the current page is a single activity item permalink. + */ + function bp_is_single_activity() + { + } + /** User **********************************************************************/ + /** + * Is the current page the members directory? + * + * @since 2.0.0 + * + * @return bool True if the current page is the members directory. + */ + function bp_is_members_directory() + { + } + /** + * Is the current page part of the profile of the logged-in user? + * + * Will return true for any subpage of the logged-in user's profile, eg + * http://example.com/members/joe/friends/. + * + * @since 1.2.0 + * + * @return bool True if the current page is part of the profile of the logged-in user. + */ + function bp_is_my_profile() + { + } + /** + * Is the current page a user page? + * + * Will return true anytime there is a displayed user. + * + * @since 1.5.0 + * + * @return bool True if the current page is a user page. + */ + function bp_is_user() + { + } + /** + * Is the current page a user custom front page? + * + * Will return true anytime there is a custom front page for the displayed user. + * + * @since 2.6.0 + * + * @return bool True if the current page is a user custom front page. + */ + function bp_is_user_front() + { + } + /** + * Is the current page a user's activity stream page? + * + * Eg http://example.com/members/joe/activity/ (or any subpages thereof). + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's activity stream page. + */ + function bp_is_user_activity() + { + } + /** + * Is the current page a user's Friends activity stream? + * + * Eg http://example.com/members/joe/friends/ + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Friends activity stream. + */ + function bp_is_user_friends_activity() + { + } + /** + * Is the current page a user's Groups activity stream? + * + * Eg http://example.com/members/joe/groups/ + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's Groups activity stream. + */ + function bp_is_user_groups_activity() + { + } + /** + * Is the current page part of a user's extended profile? + * + * Eg http://example.com/members/joe/profile/ (or a subpage thereof). + * + * @since 1.1.0 + * + * @return bool True if the current page is part of a user's extended profile. + */ + function bp_is_user_profile() + { + } + /** + * Is the current page part of a user's profile editing section? + * + * Eg http://example.com/members/joe/profile/edit/ (or a subpage thereof). + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's profile edit page. + */ + function bp_is_user_profile_edit() + { + } + /** + * Is the current page part of a user's profile avatar editing section? + * + * Eg http://example.com/members/joe/profile/change-avatar/ (or a subpage thereof). + * + * @since 1.5.0 + * + * @return bool True if the current page is the user's avatar edit page. + */ + function bp_is_user_change_avatar() + { + } + /** + * Is the current page the a user's change cover image profile page? + * + * Eg http://example.com/members/joe/profile/change-cover-image/ (or a subpage thereof). + * + * @since 2.4.0 + * + * @return bool True if the current page is a user's profile edit cover image page. + */ + function bp_is_user_change_cover_image() + { + } + /** + * Is the current page part of a user's Groups page? + * + * Eg http://example.com/members/joe/groups/ (or a subpage thereof). + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Groups page. + */ + function bp_is_user_groups() + { + } + /** + * Is the current page part of a user's Blogs page? + * + * Eg http://example.com/members/joe/blogs/ (or a subpage thereof). + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Blogs page. + */ + function bp_is_user_blogs() + { + } + /** + * Is the current page a user's Recent Blog Posts page? + * + * Eg http://example.com/members/joe/blogs/recent-posts/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Recent Blog Posts page. + */ + function bp_is_user_recent_posts() + { + } + /** + * Is the current page a user's Recent Blog Comments page? + * + * Eg http://example.com/members/joe/blogs/recent-comments/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Recent Blog Comments page. + */ + function bp_is_user_recent_commments() + { + } + /** + * Is the current page a user's Friends page? + * + * Eg http://example.com/members/joe/blogs/friends/ (or a subpage thereof). + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Friends page. + */ + function bp_is_user_friends() + { + } + /** + * Is the current page a user's Friend Requests page? + * + * Eg http://example.com/members/joe/friends/requests/. + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's Friends Requests page. + */ + function bp_is_user_friend_requests() + { + } + /** + * Is this a user's notifications page? + * + * Eg http://example.com/members/joe/notifications/ (or a subpage thereof). + * + * @since 1.9.0 + * + * @return bool True if the current page is a user's Notifications page. + */ + function bp_is_user_notifications() + { + } + /** + * Is this a user's settings page? + * + * Eg http://example.com/members/joe/settings/ (or a subpage thereof). + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's Settings page. + */ + function bp_is_user_settings() + { + } + /** + * Is this a user's General Settings page? + * + * Eg http://example.com/members/joe/settings/general/. + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's General Settings page. + */ + function bp_is_user_settings_general() + { + } + /** + * Is this a user's Notification Settings page? + * + * Eg http://example.com/members/joe/settings/notifications/. + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's Notification Settings page. + */ + function bp_is_user_settings_notifications() + { + } + /** + * Is this a user's Account Deletion page? + * + * Eg http://example.com/members/joe/settings/delete-account/. + * + * @since 1.5.0 + * + * @return bool True if the current page is a user's Delete Account page. + */ + function bp_is_user_settings_account_delete() + { + } + /** + * Is this a user's profile settings? + * + * Eg http://example.com/members/joe/settings/profile/. + * + * @since 2.0.0 + * + * @return bool True if the current page is a user's Profile Settings page. + */ + function bp_is_user_settings_profile() + { + } + /** + * Is the current page a user's community invitations page? + * + * Eg http://example.com/members/cassie/invitations/ (or a subpage thereof). + * + * @since 8.0.0 + * + * @return bool True if the current page is a user's community invitations page. + */ + function bp_is_user_members_invitations() + { + } + /** + * Is the current page a user's List Invites page? + * + * Eg http://example.com/members/cassie/invitations/list-invites/. + * + * @since 8.0.0 + * + * @return bool True if the current page is a user's List Invites page. + */ + function bp_is_user_members_invitations_list() + { + } + /** + * Is the current page a user's Send Invites page? + * + * Eg http://example.com/members/cassie/invitations/send-invites/. + * + * @since 8.0.0 + * + * @return bool True if the current page is a user's Send Invites page. + */ + function bp_is_user_members_invitations_send_screen() + { + } + /** Groups ********************************************************************/ + /** + * Is the current page the groups directory? + * + * @since 2.0.0 + * + * @return bool True if the current page is the groups directory. + */ + function bp_is_groups_directory() + { + } + /** + * Does the current page belong to a single group? + * + * Will return true for any subpage of a single group. + * + * @since 1.2.0 + * + * @return bool True if the current page is part of a single group. + */ + function bp_is_group() + { + } + /** + * Is the current page a single group's home page? + * + * URL will vary depending on which group tab is set to be the "home". By + * default, it's the group's recent activity. + * + * @since 1.1.0 + * + * @return bool True if the current page is a single group's home page. + */ + function bp_is_group_home() + { + } + /** + * Is the current page part of the group creation process? + * + * @since 1.1.0 + * + * @return bool True if the current page is part of the group creation process. + */ + function bp_is_group_create() + { + } + /** + * Is the current page part of a single group's admin screens? + * + * Eg http://example.com/groups/mygroup/admin/settings/. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of a single group's admin. + */ + function bp_is_group_admin_page() + { + } + /** + * Is the current page a group's activity page? + * + * @since 1.2.1 + * + * @return bool True if the current page is a group's activity page. + */ + function bp_is_group_activity() + { + } + /** + * Is the current page a group forum topic? + * + * @since 1.1.0 + * @since 3.0.0 Required for bbPress 2 integration. + * + * @return bool True if the current page is part of a group forum topic. + */ + function bp_is_group_forum_topic() + { + } + /** + * Is the current page a group forum topic edit page? + * + * @since 1.2.0 + * @since 3.0.0 Required for bbPress 2 integration. + * + * @return bool True if the current page is part of a group forum topic edit page. + */ + function bp_is_group_forum_topic_edit() + { + } + /** + * Is the current page a group's Members page? + * + * Eg http://example.com/groups/mygroup/members/. + * + * @since 1.1.0 + * + * @return bool True if the current page is part of a group's Members page. + */ + function bp_is_group_members() + { + } + /** + * Is the current page a group's Invites page? + * + * Eg http://example.com/groups/mygroup/send-invites/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a group's Send Invites page. + */ + function bp_is_group_invites() + { + } + /** + * Is the current page a group's Request Membership page? + * + * Eg http://example.com/groups/mygroup/request-membership/. + * + * @since 1.2.0 + * + * @return bool True if the current page is a group's Request Membership page. + */ + function bp_is_group_membership_request() + { + } + /** + * Is the current page a leave group attempt? + * + * @since 1.1.0 + * + * @return bool True if the current page is a Leave Group attempt. + */ + function bp_is_group_leave() + { + } + /** + * Is the current page part of a single group? + * + * Not currently used by BuddyPress. + * + * @todo How is this functionally different from bp_is_group()? + * + * @return bool True if the current page is part of a single group. + */ + function bp_is_group_single() + { + } + /** + * Is the current group page a custom front? + * + * @since 2.4.0 + * + * @return bool True if the current group page is a custom front. + */ + function bp_is_group_custom_front() + { + } + /** + * Is the current page the Create a Blog page? + * + * Eg http://example.com/sites/create/. + * + * @since 1.1.0 + * + * @return bool True if the current page is the Create a Blog page. + */ + function bp_is_create_blog() + { + } + /** + * Is the current page the blogs directory ? + * + * @since 2.0.0 + * + * @return bool True if the current page is the blogs directory. + */ + function bp_is_blogs_directory() + { + } + /** Messages ******************************************************************/ + /** + * Is the current page part of a user's Messages pages? + * + * Eg http://example.com/members/joe/messages/ (or a subpage thereof). + * + * @since 1.2.0 + * + * @return bool True if the current page is part of a user's Messages pages. + */ + function bp_is_user_messages() + { + } + /** + * Is the current page a user's Messages Inbox? + * + * Eg http://example.com/members/joe/messages/inbox/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Messages Inbox. + */ + function bp_is_messages_inbox() + { + } + /** + * Is the current page a user's Messages Sentbox? + * + * Eg http://example.com/members/joe/messages/sentbox/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Messages Sentbox. + */ + function bp_is_messages_sentbox() + { + } + /** + * Is the current page a user's Messages Compose screen?? + * + * Eg http://example.com/members/joe/messages/compose/. + * + * @since 1.1.0 + * + * @return bool True if the current page is a user's Messages Compose screen. + */ + function bp_is_messages_compose_screen() + { + } + /** + * Is the current page the Notices screen? + * + * Eg http://example.com/members/joe/messages/notices/. + * + * @since 1.1.0 + * + * @return bool True if the current page is the Notices screen. + */ + function bp_is_notices() + { + } + /** + * Is the current page a single Messages conversation thread? + * + * @since 1.6.0 + * + * @return bool True if the current page a single Messages conversation thread? + */ + function bp_is_messages_conversation() + { + } + /** + * Not currently used by BuddyPress. + * + * @param string $component Current component to check for. + * @param string $callback Callback to invoke. + * @return bool + */ + function bp_is_single($component, $callback) + { + } + /** Registration **************************************************************/ + /** + * Is the current page the Activate page? + * + * Eg http://example.com/activate/. + * + * @since 1.1.0 + * + * @return bool True if the current page is the Activate page. + */ + function bp_is_activation_page() + { + } + /** + * Is the current page the Register page? + * + * Eg http://example.com/register/. + * + * @since 1.1.0 + * + * @return bool True if the current page is the Register page. + */ + function bp_is_register_page() + { + } + /** + * Get the title parts of the BuddyPress displayed page + * + * @since 2.4.3 + * + * @param string $seplocation Location for the separator. + * @return array the title parts + */ + function bp_get_title_parts($seplocation = 'right') + { + } + /** + * Customize the body class, according to the currently displayed BP content. + * + * @since 1.1.0 + */ + function bp_the_body_class() + { + } + /** + * Customize the body class, according to the currently displayed BP content. + * + * Uses the above is_() functions to output a body class for each scenario. + * + * @since 1.1.0 + * + * @param array $wp_classes The body classes coming from WP. + * @param array|bool $custom_classes Classes that were passed to get_body_class(). + * @return array $classes The BP-adjusted body classes. + */ + function bp_get_the_body_class($wp_classes = array(), $custom_classes = \false) + { + } + /** + * Customizes the post CSS class according to BuddyPress content. + * + * Hooked to the 'post_class' filter. + * + * @since 2.1.0 + * + * @param array $wp_classes The post classes coming from WordPress. + * @return array + */ + function bp_get_the_post_class($wp_classes = array()) + { + } + /** + * Sort BuddyPress nav menu items by their position property. + * + * This is an internal convenience function and it will probably be removed in + * a later release. Do not use. + * + * @access private + * @since 1.7.0 + * + * @param array $a First item. + * @param array $b Second item. + * @return int Returns an integer less than, equal to, or greater than zero if + * the first argument is considered to be respectively less than, + * equal to, or greater than the second. + */ + function _bp_nav_menu_sort($a, $b) + { + } + /** + * Get the items registered in the primary and secondary BuddyPress navigation menus. + * + * @since 1.7.0 + * @since 2.6.0 Introduced the `$component` parameter. + * + * @param string $component Optional. Component whose nav items are being fetched. + * @return array A multidimensional array of all navigation items. + */ + function bp_get_nav_menu_items($component = 'members') + { + } + /** + * Display a navigation menu. + * + * @since 1.7.0 + * + * @param string|array $args { + * An array of optional arguments. + * + * @type string $after Text after the link text. Default: ''. + * @type string $before Text before the link text. Default: ''. + * @type string $container The name of the element to wrap the navigation + * with. 'div' or 'nav'. Default: 'div'. + * @type string $container_class The class that is applied to the container. + * Default: 'menu-bp-container'. + * @type string $container_id The ID that is applied to the container. + * Default: ''. + * @type int $depth How many levels of the hierarchy are to be included. + * 0 means all. Default: 0. + * @type bool $echo True to echo the menu, false to return it. + * Default: true. + * @type bool $fallback_cb If the menu doesn't exist, should a callback + * function be fired? Default: false (no fallback). + * @type string $items_wrap How the list items should be wrapped. Should be + * in the form of a printf()-friendly string, using numbered + * placeholders. Default: '<ul id="%1$s" class="%2$s">%3$s</ul>'. + * @type string $link_after Text after the link. Default: ''. + * @type string $link_before Text before the link. Default: ''. + * @type string $menu_class CSS class to use for the <ul> element which + * forms the menu. Default: 'menu'. + * @type string $menu_id The ID that is applied to the <ul> element which + * forms the menu. Default: 'menu-bp', incremented. + * @type string $walker Allows a custom walker class to be specified. + * Default: 'BP_Walker_Nav_Menu'. + * } + * @return string|null If $echo is false, returns a string containing the nav + * menu markup. + */ + function bp_nav_menu($args = array()) + { + } + /** + * Prints the Recipient Salutation. + * + * @since 2.5.0 + * + * @param array $settings Email Settings. + */ + function bp_email_the_salutation($settings = array()) + { + } + /** + * Gets the Recipient Salutation. + * + * @since 2.5.0 + * @since 8.0.0 Checks current BP Email type schema to eventually use the unnamed salutation. + * + * @param array $settings Email Settings. + * @return string The Recipient Salutation. + */ + function bp_email_get_salutation($settings = array()) + { + } + /** + * Outputs the BP Email's template footer. + * + * @since 12.1.0 + */ + function bp_email_footer() + { + } + /** + * Checks if a Widget/Block is active. + * + * @since 9.0.0 + * + * @param string $block_name The Block name to check (eg: 'bp/sitewide-notices'). Optional. + * @param string $widget_id_base The Widget ID base to check (eg: 'bp_messages_sitewide_notices_widget' ). Optional. + * @return bool True if the Widget/Block is active. False otherwise. + */ + function bp_is_widget_block_active($block_name = '', $widget_id_base = '') + { + } + /** + * Return an array of roles from the currently loaded blog. + * + * WordPress roles are dynamically flipped when calls to switch_to_blog() and + * restore_current_blog() are made, so we use and trust WordPress core to have + * loaded the correct results for us here. As enhancements are made to + * WordPress's RBAC, so should our capability functions here. + * + * @since 2.1.0 + * + * @global WP_Roles $wp_roles WordPress role management object. + * + * @return array + */ + function bp_get_current_blog_roles() + { + } + /** + * Add capabilities to WordPress user roles. + * + * This is called on plugin activation. + * + * @since 1.6.0 + * + * @global WP_Roles $wp_roles WordPress role management object. + */ + function bp_add_caps() + { + } + /** + * Remove capabilities from WordPress user roles. + * + * This is called on plugin deactivation. + * + * @since 1.6.0 + * + * @global WP_Roles $wp_roles WordPress role management object. + */ + function bp_remove_caps() + { + } + /** + * Map community caps to built in WordPress caps. + * + * @since 1.6.0 + * @since 12.0.0 Added mapping for `bp_view` capability. + * + * @see WP_User::has_cap() for description of the arguments passed to the + * 'map_meta_cap' filter. + * args. + * + * @param array $caps See {@link WP_User::has_cap()}. + * @param string $cap See {@link WP_User::has_cap()}. + * @param int $user_id See {@link WP_User::has_cap()}. + * @param mixed $args See {@link WP_User::has_cap()}. + * @return array Actual capabilities for meta capability. See {@link WP_User::has_cap()}. + */ + function bp_map_meta_caps($caps, $cap, $user_id, $args) + { + } + /** + * Return community capabilities. + * + * @since 1.6.0 + * + * @return array Community capabilities. + */ + function bp_get_community_caps() + { + } + /** + * Return an array of capabilities based on the role that is being requested. + * + * @since 1.6.0 + * + * @param string $role The role for which you're loading caps. + * @return array Capabilities for $role. + */ + function bp_get_caps_for_role($role = '') + { + } + /** + * Set a default role for the current user. + * + * Give a user the default role when creating content on a site they do not + * already have a role or capability on. + * + * @since 1.6.0 + */ + function bp_set_current_user_default_role() + { + } + /** + * Check whether the current user has a given capability. + * + * @since 1.6.0 + * @since 2.4.0 Second argument modified to accept an array, rather than `$blog_id`. + * @since 2.7.0 Deprecated $args['blog_id'] in favor of $args['site_id']. + * + * @param string $capability Capability or role name. + * @param array|int $args { + * Array of extra arguments applicable to the capability check. + * @type int $site_id Optional. Blog ID. Defaults to the BP root blog. + * @type int $blog_id Deprecated. Use $site_id instead. + * @type mixed $a,... Optional. Extra arguments applicable to the capability check. + * } + * @return bool True if the user has the cap for the given parameters. + */ + function bp_current_user_can($capability, $args = array()) + { + } + /** + * Callback function to inform whether current user can moderate the community. + * + * @since 12.0.0 + * + * @return bool True if current user can moderate the community. False otherwise. + */ + function bp_current_user_can_moderate() + { + } + /** + * Check whether the specified user has a given capability on a given site. + * + * @since 2.7.0 + * + * @param int $user_id + * @param string $capability Capability or role name. + * @param array|int $args { + * Array of extra arguments applicable to the capability check. + * + * @type int $site_id Optional. Site ID. Defaults to the BP root blog. + * @type mixed $a,... Optional. Extra arguments applicable to the capability check. + * } + * @return bool True if the user has the cap for the given parameters. + */ + function bp_user_can($user_id, $capability, $args = array()) + { + } + /** + * Adds the `bp_moderate` cap to Roles having the `manage_options` cap when + * BuddyPress is not active on the network. + * + * @since 7.0.0 + * + * @access private + * + * @param WP_Roles $wp_roles The WordPress roles object. + */ + function _bp_roles_init(\WP_Roles $wp_roles) + { + } + /** Deprecated ****************************************************************/ + /** + * Temporary implementation of 'bp_moderate' cap. + * + * In BuddyPress 1.6, the 'bp_moderate' cap was introduced. In order to + * enforce that bp_current_user_can( 'bp_moderate' ) always returns true for + * Administrators, we must manually add the 'bp_moderate' cap to the list of + * user caps for Admins. + * + * Note that this level of enforcement is only necessary in the case of + * non-Multisite. This is because WordPress automatically assigns every + * capability - and thus 'bp_moderate' - to Super Admins on a Multisite + * installation. See {@link WP_User::has_cap()}. + * + * This implementation of 'bp_moderate' is temporary, until BuddyPress properly + * matches caps to roles and stores them in the database. + * + * Plugin authors: Please do not use this function; thank you. :) + * + * @since 1.6.0 + * @deprecated 7.0.0 + * + * @access private + * + * @see WP_User::has_cap() + * + * @param array $caps The caps that WP associates with the given role. + * @param string $cap The caps being tested for in WP_User::has_cap(). + * @param int $user_id ID of the user being checked against. + * @param array $args Miscellaneous arguments passed to the user_has_cap filter. + * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant. + */ + function _bp_enforce_bp_moderate_cap_for_admins($caps = array(), $cap = '', $user_id = 0, $args = array()) + { + } + /** + * Adds BuddyPress-specific user roles. + * + * This is called on plugin activation. + * + * @since 1.6.0 + * @deprecated 1.7.0 + */ + function bp_add_roles() + { + } + /** + * Removes BuddyPress-specific user roles. + * + * This is called on plugin deactivation. + * + * @since 1.6.0 + * @deprecated 1.7.0 + */ + function bp_remove_roles() + { + } + /** + * The participant role for registered users without roles. + * + * This is primarily for multisite compatibility when users without roles on + * sites that have global communities enabled. + * + * @since 1.6.0 + * @deprecated 1.7.0 + */ + function bp_get_participant_role() + { + } + /** + * The moderator role for BuddyPress users. + * + * @since 1.6.0 + * @deprecated 1.7.0 + */ + function bp_get_moderator_role() + { + } + /** + * Parse the WordPress core version number into the major release. + * + * @since 1.5.2 + * + * @global string $wp_version WP Version number. + * + * @return double + */ + function bp_get_major_wp_version() + { + } + /** + * Get SQL chunk for filtering spam users from member queries. + * + * @internal + * @todo Why is this function defined in this file? + * + * @param string|bool $prefix Global table prefix. + * @return string SQL chunk. + */ + function bp_core_get_status_sql($prefix = \false) + { + } + /** + * Catch the new site data for a later use. + * + * @since 6.0.0 + */ + function bp_catch_site_data($errors = \null, $data = array()) + { + } + /** + * Fires a BuddyPress hook when a new WordPress site is inserted into the database. + * + * This hook makes sure BuddyPress is back compatible with WordPress versions < 5.1.0. + * + * @since 6.0.0 + * + * @param int|WP_Site $site The Site ID or the WP Site object. + * @param int|array $args_or_user_id An array of Site arguments or the User ID. + * @param string $domain Site domain. + * @param string $path Site path. + * @param int $network_id Network ID. Only relevant on multi-network installations. + * @param array $meta Meta data. Used to set initial site options. + */ + function bp_insert_site($site, $args_or_user_id = \null, $domain = '', $path = '', $network_id = 0, $meta = array()) + { + } + /** + * Makes sure the `bp_delete_site` hook is fired if site's deletion + * was performed without dropping tables. + * + * @since 6.0.0 + * + * @param WP_Site $site The site object. + */ + function bp_delete_site_no_tables_drop($site) + { + } + /** + * Fires a BuddyPress hook when a new WordPress site is deleted. + * + * This hook makes sure BuddyPress is back compatible with WordPress versions < 5.1.0. + * + * @since 6.0.0 + * + * @param int|WP_Error $site_id_or_error A WP Error object or the site ID. + * @param bool|WP_Site $drop_or_site A WP Site object or a boolean to inform whether site's table should be dropped. + */ + function bp_delete_site($site_id_or_error, $drop_or_site = \false) + { + } + /** + * Set up the bp-core component. + * + * @since 1.6.0 + */ + function bp_setup_core() + { + } + /** + * BuddyPress blocks require the BP REST API. + * + * @since 6.0.0 + * + * @return bool True if the current installation supports BP Blocks. + * False otherwise. + */ + function bp_support_blocks() + { + } + /** + * Registers the BP Block components. + * + * @since 6.0.0 + * @since 9.0.0 Adds a dependency to `wp-server-side-render` if WP >= 5.3. + * Uses a dependency to `wp-editor` otherwise. + * @since 12.0.0 Uses the `@wordpress/scripts` `index.asset.php` generated file to get dependencies. + */ + function bp_register_block_components() + { + } + /** + * Registers the BP Block Assets. + * + * @since 9.0.0 + * @since 12.0.0 Adds the BuddyPress Blocks collection & uses the `@wordpress/scripts` + * `index.asset.php` generated file to get dependencies. + */ + function bp_register_block_assets() + { + } + /** + * Enqueue additional BP Assets for the Block Editor. + * + * @since 12.0.0 + */ + function bp_enqueue_block_editor_assets() + { + } + /** + * Filters the Block Editor settings to gather BuddyPress ones into a `bp` key. + * + * @since 6.0.0 + * + * @param array $editor_settings Default editor settings. + * @return array The editor settings including BP blocks specific ones. + */ + function bp_blocks_editor_settings($editor_settings = array()) + { + } + /** + * Preload the Active BuddyPress Components. + * + * @since 9.0.0 + * + * @param string[] $paths The Block Editors preload paths. + * @return string[] The Block Editors preload paths. + */ + function bp_blocks_preload_paths($paths = array()) + { + } + /** + * Register a BuddyPress block type. + * + * @since 6.0.0 + * + * @param array $args The registration arguments for the block type. + * @return BP_Block The BuddyPress block type object. + */ + function bp_register_block($args = array()) + { + } + /** + * Gets a Widget Block list of classnames. + * + * @since 9.0.0 + * + * @param string $block_name The Block name. + * @return array The list of widget classnames for the Block. + */ + function bp_blocks_get_widget_block_classnames($block_name = '') + { + } + /** + * Make sure the BP Widget Block classnames are included into Widget Blocks. + * + * @since 9.0.0 + * + * @param string $classname The classname to be used in the block widget's container HTML. + * @param string $block_name The name of the block. + * @return string The classname to be used in the block widget's container HTML. + */ + function bp_widget_block_dynamic_classname($classname, $block_name) + { + } + /** + * Create a link to the registration form for use on the bottom of the login form widget. + * + * @since 9.0.0 + * + * @param string $content Content to display. Default empty. + * @param array $args Array of login form arguments. + * @return string HTML output. + */ + function bp_blocks_get_login_widget_registration_link($content = '', $args = array()) + { + } + /** + * Callback function to render the BP Login Form. + * + * @since 9.0.0 + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_block_render_login_form_block($attributes = array()) + { + } + /** + * Is this a fresh installation of BuddyPress? + * + * If there is no raw DB version, we infer that this is the first installation. + * + * @since 1.7.0 + * + * @return bool True if this is a fresh BP install, otherwise false. + */ + function bp_is_install() + { + } + /** + * Is this a BuddyPress update? + * + * Determined by comparing the registered BuddyPress version to the version + * number stored in the database. If the registered version is greater, it's + * an update. + * + * @since 1.6.0 + * + * @return bool True if update, otherwise false. + */ + function bp_is_update() + { + } + /** + * Determine whether BuddyPress is in the process of being activated. + * + * @since 1.6.0 + * + * @param string $basename BuddyPress basename. + * @return bool True if activating BuddyPress, false if not. + */ + function bp_is_activation($basename = '') + { + } + /** + * Determine whether BuddyPress is in the process of being deactivated. + * + * @since 1.6.0 + * + * @param string $basename BuddyPress basename. + * @return bool True if deactivating BuddyPress, false if not. + */ + function bp_is_deactivation($basename = '') + { + } + /** + * Update the BP version stored in the database to the current version. + * + * @since 1.6.0 + */ + function bp_version_bump() + { + } + /** + * Set up the BuddyPress updater. + * + * @since 1.6.0 + */ + function bp_setup_updater() + { + } + /** + * Initialize an update or installation of BuddyPress. + * + * BuddyPress's version updater looks at what the current database version is, + * and runs whatever other code is needed - either the "update" or "install" + * code. + * + * This is most often used when the data schema changes, but should also be used + * to correct issues with BuddyPress metadata silently on software update. + * + * @since 1.7.0 + */ + function bp_version_updater() + { + } + /** + * Perform database operations that must take place before the general schema upgrades. + * + * `dbDelta()` cannot handle certain operations - like changing indexes - so we do it here instead. + * + * @since 2.3.0 + */ + function bp_pre_schema_upgrade() + { + } + /** Upgrade Routines **********************************************************/ + /** + * Remove unused metadata from database when upgrading from < 1.5. + * + * Database update methods based on version numbers. + * + * @since 1.7.0 + */ + function bp_update_to_1_5() + { + } + /** + * Remove unused metadata from database when upgrading from < 1.6.0. + * + * Database update methods based on version numbers. + * + * @since 1.7.0 + */ + function bp_update_to_1_6() + { + } + /** + * Add the notifications component to active components. + * + * Notifications was added in 1.9.0, and previous installations will already + * have the core notifications API active. We need to add the new Notifications + * component to the active components option to retain existing functionality. + * + * @since 1.9.0 + */ + function bp_update_to_1_9() + { + } + /** + * Perform database updates for BP 1.9.2. + * + * In 1.9, BuddyPress stopped registering its theme directory when it detected + * that bp-default (or a child theme) was not currently being used, in effect + * deprecating bp-default. However, this ended up causing problems when site + * admins using bp-default would switch away from the theme temporarily: + * bp-default would no longer be available, with no obvious way (outside of + * a manual filter) to restore it. In 1.9.2, we add an option that flags + * whether bp-default or a child theme is active at the time of upgrade; if so, + * + * the theme directory will continue to be registered even if the theme is + * deactivated temporarily. Thus, new installations will not see bp-default, + * but legacy installations using the theme will continue to see it. + * + * @since 1.9.2 + */ + function bp_update_to_1_9_2() + { + } + /** + * 2.0 update routine. + * + * - Ensure that the activity tables are installed, for last_activity storage. + * - Migrate last_activity data from usermeta to activity table. + * - Add values for all BuddyPress options to the options table. + * + * @since 2.0.0 + */ + function bp_update_to_2_0() + { + } + /** + * 2.0.1 database upgrade routine. + * + * @since 2.0.1 + */ + function bp_update_to_2_0_1() + { + } + /** + * 2.2.0 update routine. + * + * - Add messages meta table. + * - Update the component field of the 'new members' activity type. + * - Clean up hidden friendship activities. + * + * @since 2.2.0 + */ + function bp_update_to_2_2() + { + } + /** + * 2.3.0 update routine. + * + * - Add notifications meta table. + * + * @since 2.3.0 + */ + function bp_update_to_2_3() + { + } + /** + * 2.5.0 update routine. + * + * - Add emails. + * + * @since 2.5.0 + */ + function bp_update_to_2_5() + { + } + /** + * 2.7.0 update routine. + * + * - Add email unsubscribe salt. + * - Save legacy directory titles to the corresponding WP pages. + * - Add ignore deprecated code option (false for updates). + * + * @since 2.7.0 + */ + function bp_update_to_2_7() + { + } + /** + * Retuns needed the fullname field ID for an update task. + * + * @since 8.0.0 + * + * @return int The fullname field ID. + */ + function bp_get_fullname_field_id_for_update() + { + } + /** + * 5.0.0 update routine. + * + * - Make sure the custom visibility is disabled for the default profile field. + * - Create the invitations table. + * - Migrate requests and invitations to the new table. + * + * @since 5.0.0 + */ + function bp_update_to_5_0() + { + } + /** + * 8.0.0 update routine. + * + * - Edit the `new_avatar` activity type's component to `members`. + * - Upgrade Primary xProfile Group's fields to signup fields. + * + * @since 8.0.0 + */ + function bp_update_to_8_0() + { + } + /** + * Select only the emails that need to be installed with version 8.0. + * + * @since 8.0.0 + * + * @param array $emails The array of emails schema. + */ + function bp_core_get_8_0_upgrade_email_schema($emails) + { + } + /** + * 10.0.0 update routine. + * + * - Install new BP Emails for membership requests. + * + * @since 10.0.0 + */ + function bp_update_to_10_0() + { + } + /** + * Select only the emails that need to be installed with version 10.0. + * + * @since 10.0.0 + * + * @param array $emails The array of emails schema. + */ + function bp_core_get_10_0_upgrade_email_schema($emails) + { + } + /** + * 11.0.0 update routine. + * + * - Install new BP Emails for group membership requests which is completed by admin. + * + * @since 11.0.0 + */ + function bp_update_to_11_0() + { + } + /** + * Select only the emails that need to be installed with version 11.0. + * + * @since 11.0.0 + * + * @param array $emails The array of emails schema. + */ + function bp_core_get_11_0_upgrade_email_schema($emails) + { + } + /** + * 11.4.0 update routine. + * + * @since 11.4.0 + */ + function bp_update_to_11_4() + { + } + /** + * 12.0.0 update routine. + * + * - Swith directory page post type from "page" to "buddypress". + * - Remove Legacy Widgets option. + * - Add the default community visibility value. + * + * @since 12.0.0 + */ + function bp_update_to_12_0() + { + } + /** + * 14.0.0 update routine. + * + * Edit db schema to stop using boolean fields in favor of tinyint ones. + * This moves was necessary to support WP Playground. + * + * @since 14.0.0 + */ + function bp_update_to_14_0() + { + } + /** + * Updates the component field for new_members type. + * + * @since 2.2.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_migrate_new_member_activity_component() + { + } + /** + * Remove all hidden friendship activities. + * + * @since 2.2.0 + */ + function bp_cleanup_friendship_activities() + { + } + /** + * Update WP pages so that their post_title matches the legacy component directory title. + * + * As of 2.7.0, component directory titles come from the `post_title` attribute of the corresponding WP post object, + * instead of being hardcoded. To ensure that directory titles don't change for existing installations, we update these + * WP posts with the formerly hardcoded titles. + * + * @since 2.7.0 + */ + function bp_migrate_directory_page_titles() + { + } + /** + * Redirect user to BP's What's New page on first page load after activation. + * + * @since 1.7.0 + * + * @internal Used internally to redirect BuddyPress to the about page on activation. + */ + function bp_add_activation_redirect() + { + } + /** Signups *******************************************************************/ + /** + * Check if the signups table needs to be created or upgraded. + * + * @since 2.0.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_core_maybe_install_signups() + { + } + /** Activation Actions ********************************************************/ + /** + * Fire activation hooks and events. + * + * Runs on BuddyPress activation. + * + * @since 1.6.0 + */ + function bp_activation() + { + } + /** + * Fire deactivation hooks and events. + * + * Runs on BuddyPress deactivation. + * + * @since 1.6.0 + */ + function bp_deactivation() + { + } + /** + * Fire uninstall hook. + * + * Runs when uninstalling BuddyPress. + * + * @since 1.6.0 + */ + function bp_uninstall() + { + } + /** + * Add the secondary BuddyPress area to the my-account menu. + * + * @since 1.6.0 + * + * @global WP_Admin_Bar $wp_admin_bar WordPress object implementing a Toolbar API. + */ + function bp_admin_bar_my_account_root() + { + } + /** + * Toggle the display of the toolbar based on certain conditions. + * + * @since 1.2.0 + */ + function bp_core_load_admin_bar() + { + } + /** + * Handle the enqueueing of toolbar CSS. + * + * This function exists mostly for backwards compatibility reasons, so anyone + * previously unhooking this function can continue to do so. It's hooked to + * the `bp_init` action in `bp-core-actions.php`. + * + * @since 1.5.0 + */ + function bp_core_load_admin_bar_css() + { + } + /** + * Enqueue supplemental WordPress Toolbar styling. + * + * @since 2.1.0 + * + * @see bp_core_register_common_styles() + * @see bp_core_load_admin_bar_css() + */ + function bp_core_enqueue_admin_bar_css() + { + } + /** + * Get the default site options and their values. + * + * Default values should not be set by calls to `get_option()` or `get_site_option()` due to + * these causing load order problems with `bp_core_clear_root_options_cache()`; see #BP7227. + * + * @since 1.6.0 + * + * @return array Filtered option names and values. + */ + function bp_get_default_options() + { + } + /** + * Add default options when BuddyPress is first activated. + * + * Only called once when BuddyPress is activated. + * Non-destructive, so existing settings will not be overridden. + * + * @since 1.6.0 + */ + function bp_add_options() + { + } + /** + * Delete default options. + * + * Hooked to bp_uninstall, it is only called once when BuddyPress is uninstalled. + * This is destructive, so existing settings will be destroyed. + * + * Currently unused. + * + * @since 1.6.0 + */ + function bp_delete_options() + { + } + /** + * Add filters to each BP option, allowing them to be overloaded from inside the $bp->options array. + * + * @since 1.6.0 + */ + function bp_setup_option_filters() + { + } + /** + * Filter default options and allow them to be overloaded from inside the $bp->options array. + * + * @since 1.6.0 + * + * @param bool $value Optional. Default value false. + * @return mixed False if not overloaded, mixed if set. + */ + function bp_pre_get_option($value = \false) + { + } + /** + * Retrieve an option. + * + * This is a wrapper for {@link get_blog_option()}, which in turn stores settings data + * (such as bp-pages) on the appropriate blog, given your current setup. + * + * The 'bp_get_option' filter is primarily for backward-compatibility. + * + * @since 1.5.0 + * + * @param string $option_name The option to be retrieved. + * @param string $default Optional. Default value to be returned if the option + * isn't set. See {@link get_blog_option()}. + * @return mixed The value for the option. + */ + function bp_get_option($option_name, $default = '') + { + } + /** + * Add an option. + * + * This is a wrapper for {@link add_blog_option()}, which in turn stores + * settings data on the appropriate blog, given your current setup. + * + * @since 2.0.0 + * + * @param string $option_name The option key to be set. + * @param mixed $value The value to be set. + * @return bool + */ + function bp_add_option($option_name, $value) + { + } + /** + * Save an option. + * + * This is a wrapper for {@link update_blog_option()}, which in turn stores + * settings data (such as bp-pages) on the appropriate blog, given your current + * setup. + * + * @since 1.5.0 + * + * @param string $option_name The option key to be set. + * @param mixed $value The value to be set. + * @return bool + */ + function bp_update_option($option_name, $value) + { + } + /** + * Delete an option. + * + * This is a wrapper for {@link delete_blog_option()}, which in turn deletes + * settings data (such as bp-pages) on the appropriate blog, given your current + * setup. + * + * @since 1.5.0 + * + * @param string $option_name The option key to be deleted. + * @return bool + */ + function bp_delete_option($option_name) + { + } + /** + * Copy BP options from a single site to multisite config. + * + * Run when switching from single to multisite and we need to copy blog options + * to site options. + * + * This function is no longer used. + * + * @since 1.2.4 + * @deprecated 1.6.0 + * + * @param array $keys Array of site options. + * @return bool + */ + function bp_core_activate_site_options($keys = array()) + { + } + /** + * Fetch global BP options. + * + * BuddyPress uses common options to store configuration settings. Many of these + * settings are needed at run time. Instead of fetching them all and adding many + * initial queries to each page load, let's fetch them all in one go. + * + * @since 1.5.0 + * + * @todo Use settings API and audit these methods. + * + * @return array $root_blog_options_meta List of options. + */ + function bp_core_get_root_options() + { + } + /** + * Get a root option. + * + * "Root options" are those that apply across an entire installation, and are fetched only a single + * time during a pageload and stored in `buddypress()->site_options` to prevent future lookups. + * See {@see bp_core_get_root_options()}. + * + * @since 2.3.0 + * + * @param string $option Name of the option key. + * @return mixed Value, if found. + */ + function bp_core_get_root_option($option) + { + } + /** Active? *******************************************************************/ + /** + * Is profile syncing disabled? + * + * @since 1.6.0 + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if profile sync is enabled, otherwise false. + */ + function bp_disable_profile_sync($default = \false) + { + } + /** + * Is the Toolbar hidden for logged out users? + * + * @since 1.6.0 + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if the admin bar should be hidden for logged-out users, + * otherwise false. + */ + function bp_hide_loggedout_adminbar($default = \true) + { + } + /** + * Are members able to upload their own avatars? + * + * @since 1.6.0 + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if avatar uploads are disabled, otherwise false. + */ + function bp_disable_avatar_uploads($default = \true) + { + } + /** + * Are members able to upload their own cover images? + * + * @since 2.4.0 + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if cover image uploads are disabled, otherwise false. + */ + function bp_disable_cover_image_uploads($default = \false) + { + } + /** + * Are group avatars disabled? + * + * For backward compatibility, this option falls back on the value of 'bp-disable-avatar-uploads' when no value is + * found in the database. + * + * @since 2.3.0 + * + * @param bool|null $default Optional. Fallback value if not found in the database. + * Defaults to the value of `bp_disable_avatar_uploads()`. + * @return bool True if group avatar uploads are disabled, otherwise false. + */ + function bp_disable_group_avatar_uploads($default = \null) + { + } + /** + * Are group cover images disabled? + * + * @since 2.4.0 + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if group cover image uploads are disabled, otherwise false. + */ + function bp_disable_group_cover_image_uploads($default = \false) + { + } + /** + * Are group activity deletions disabled? + * + * @since 14.0.0 + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if group activity deletions are disabled, otherwise false. + */ + function bp_disable_group_activity_deletions($retval = \false) + { + } + /** + * Are members able to delete their own accounts? + * + * @since 1.6.0 + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if users are able to delete their own accounts, otherwise + * false. + */ + function bp_disable_account_deletion($retval = \false) + { + } + /** + * Are post/comment activity stream comments disabled? + * + * @since 1.6.0 + * + * @todo split and move into blog and forum components. + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if activity comments are disabled for blog and forum + * items, otherwise false. + */ + function bp_disable_blogforum_comments($retval = \false) + { + } + /** + * Is group creation turned off? + * + * @since 1.6.0 + * + * @todo Move into groups component. + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if group creation is restricted, otherwise false. + */ + function bp_restrict_group_creation($retval = \true) + { + } + /** + * Check whether Akismet is enabled. + * + * @since 1.6.0 + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if Akismet is enabled, otherwise false. + */ + function bp_is_akismet_active($retval = \true) + { + } + /** + * Check whether Activity Heartbeat refresh is enabled. + * + * @since 2.0.0 + * + * @param bool $retval Optional. Fallback value if not found in the database. + * Default: true. + * @return bool True if Heartbeat refresh is enabled, otherwise false. + */ + function bp_is_activity_heartbeat_active($retval = \true) + { + } + /** + * Get the current theme package ID. + * + * @since 1.7.0 + * + * @param string $package_id Optional. Fallback value if not found in the database. + * Default: 'legacy'. + * @return string ID of the theme package. + */ + function bp_get_theme_package_id($package_id = 'legacy') + { + } + /** + * Register scripts commonly used by BuddyPress. + * + * @since 2.1.0 + */ + function bp_core_register_common_scripts() + { + } + /** + * Register styles commonly used by BuddyPress. + * + * @since 2.1.0 + */ + function bp_core_register_common_styles() + { + } + /** + * Load the JS for "Are you sure?" confirm links. + * + * @since 1.1.0 + */ + function bp_core_confirmation_js() + { + } + /** + * Enqueues the css and js required by the Avatar UI. + * + * @since 2.3.0 + */ + function bp_core_avatar_scripts() + { + } + /** + * Enqueues the css and js required by the Cover Image UI. + * + * @since 2.4.0 + */ + function bp_core_cover_image_scripts() + { + } + /** + * Enqueues jCrop library and hooks BP's custom cropper JS. + * + * @since 1.1.0 + */ + function bp_core_add_jquery_cropper() + { + } + /** + * Output the inline JS needed for the cropper to work on a per-page basis. + * + * @since 1.1.0 + */ + function bp_core_add_cropper_inline_js() + { + } + /** + * Output the inline CSS for the BP image cropper. + * + * @since 1.1.0 + */ + function bp_core_add_cropper_inline_css() + { + } + /** + * Define the 'ajaxurl' JS variable, used by themes as an AJAX endpoint. + * + * @since 1.1.0 + */ + function bp_core_add_ajax_url_js() + { + } + /** + * Get the proper value for BP's ajaxurl. + * + * Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite + * configurations. + * + * @since 1.7.0 + * + * @return string AJAX endpoint URL. + */ + function bp_core_ajax_url() + { + } + /** + * Get the JavaScript dependencies for buddypress.js. + * + * @since 2.0.0 + * + * @return array The JavaScript dependencies. + */ + function bp_core_get_js_dependencies() + { + } + /** + * Add inline css to display the component's single item cover image. + * + * @since 2.4.0 + * + * @param bool $return True to get the inline css. + * @return null|array|false The inline css or an associative array containing + * the css rules and the style handle. + */ + function bp_add_cover_image_inline_css($return = \false) + { + } + /** + * Enqueues livestamp.js on BuddyPress pages. + * + * @since 2.7.0 + */ + function bp_core_add_livestamp() + { + } + /** + * Enqueue and localize livestamp.js script. + * + * @since 2.7.0 + */ + function bp_core_enqueue_livestamp() + { + } + /** + * Prune the WP Super Cache. + * + * When WP Super Cache is installed, this function will clear cached pages + * so that success/error messages or time-sensitive content are not cached. + * + * @since 1.0.0 + * + * @global string $cache_path Path directory. + * + * @see prune_super_cache() + */ + function bp_core_clear_cache() + { + } + /** + * Clear all cached objects for a user, or those that a user is part of. + * + * @since 1.0.0 + * + * @param string $user_id User ID to delete cache for. + */ + function bp_core_clear_user_object_cache($user_id) + { + } + /** + * Clear member count caches and transients. + * + * @since 1.6.0 + */ + function bp_core_clear_member_count_caches() + { + } + /** + * Clear the directory_pages cache when one of the pages is updated. + * + * @since 2.0.0 + * + * @param int $post_id ID of the page that was saved. + */ + function bp_core_clear_directory_pages_cache_page_edit($post_id = 0) + { + } + /** + * Clear the directory_pages cache when the bp-pages option is updated. + * + * @since 2.0.0 + * + * @param string $option Option name. + */ + function bp_core_clear_directory_pages_cache_settings_edit($option) + { + } + /** + * Clear the root_blog_options cache when any of its options are updated. + * + * @since 2.0.0 + * + * @param string $option Option name. + */ + function bp_core_clear_root_options_cache($option) + { + } + /** + * Determine which items from a list do not have cached values. + * + * @since 2.0.0 + * + * @param array $item_ids ID list. + * @param string $cache_group The cache group to check against. + * @return array + */ + function bp_get_non_cached_ids($item_ids, $cache_group) + { + } + /** + * Update the metadata cache for the specified objects. + * + * Based on WordPress's {@link update_meta_cache()}, this function primes the + * cache with metadata related to a set of objects. This is typically done when + * querying for a loop of objects; pre-fetching metadata for each queried + * object can lead to dramatic performance improvements when using metadata + * in the context of template loops. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param array $args { + * Array of arguments. + * @type array|string $object_ids List of object IDs to fetch metadata for. + * Accepts an array or a comma-separated list of numeric IDs. + * @type string $object_type The type of object, eg 'groups' or 'activity'. + * @type string $meta_table The name of the metadata table being queried. + * @type string $object_column Optional. The name of the database column where IDs + * (those provided by $object_ids) are found. Eg, 'group_id' + * for the groups metadata tables. Default: $object_type . '_id'. + * @type string $cache_key_prefix Optional. The prefix to use when creating + * cache key names. Default: the value of $meta_table. + * } + * @return false|array Metadata cache for the specified objects, or false on failure. + */ + function bp_update_meta_cache($args = array()) + { + } + /** + * Gets a value that has been cached using an incremented key. + * + * A utility function for use by query methods like BP_Activity_Activity::get(). + * + * @since 2.7.0 + * @see bp_core_set_incremented_cache() + * + * @param string $key Unique key for the query. Usually a SQL string. + * @param string $group Cache group. Eg 'bp_activity'. + * @return array|bool False if no cached values are found, otherwise an array of IDs. + */ + function bp_core_get_incremented_cache($key, $group) + { + } + /** + * Caches a value using an incremented key. + * + * An "incremented key" is a cache key that is hashed with a unique incrementor, + * allowing for bulk invalidation. + * + * Use this method when caching data that should be invalidated whenever any + * object of a given type is created, updated, or deleted. This usually means + * data related to object queries, which can only reliably cached until the + * underlying set of objects has been modified. See, eg, BP_Activity_Activity::get(). + * + * @since 2.7.0 + * + * @param string $key Unique key for the query. Usually a SQL string. + * @param string $group Cache group. Eg 'bp_activity'. + * @param array $ids Array of IDs. + * @return bool + */ + function bp_core_set_incremented_cache($key, $group, $ids) + { + } + /** + * Delete a value that has been cached using an incremented key. + * + * A utility function for use by query methods like BP_Activity_Activity::get(). + * + * @since 3.0.0 + * @see bp_core_set_incremented_cache() + * + * @param string $key Unique key for the query. Usually a SQL string. + * @param string $group Cache group. Eg 'bp_activity'. + * @return bool + */ + function bp_core_delete_incremented_cache($key, $group) + { + } + /** + * Gets the key to be used when caching a value using an incremented cache key. + * + * The $key is hashed with a component-specific incrementor, which is used to + * invalidate multiple caches at once. + * @since 2.7.0 + * + * @param string $key Unique key for the query. Usually a SQL string. + * @param string $group Cache group. Eg 'bp_activity'. + * @return string + */ + function bp_core_get_incremented_cache_key($key, $group) + { + } + /** + * Gets a group-specific cache incrementor. + * + * The incrementor is paired with query identifiers (like SQL strings) to + * create cache keys that can be invalidated en masse. + * + * If an incrementor does not yet exist for the given `$group`, one will + * be created. + * + * @since 2.7.0 + * + * @param string $group Cache group. Eg 'bp_activity'. + * @return string + */ + function bp_core_get_incrementor($group) + { + } + /** + * Reset a group-specific cache incrementor. + * + * Call this function when all incrementor-based caches associated with a given + * cache group should be invalidated. + * + * @since 2.7.0 + * + * @param string $group Cache group. Eg 'bp_activity'. + * @return bool + */ + function bp_core_reset_incrementor($group) + { + } + /** + * Resets all incremented bp_invitations caches. + * + * @since 5.0.0 + */ + function bp_invitations_reset_cache_incrementor() + { + } + /** + * Add a cache group for Database object types. + * + * @since 7.0.0 + */ + function bp_set_object_type_terms_cache_group() + { + } + /** + * Clear the Database object types cache. + * + * @since 7.0.0 + * + * @param int $type_id The Type's term ID. + * @param string $taxonomy The Type's taxonomy name. + */ + function bp_clear_object_type_terms_cache($type_id = 0, $taxonomy = '') + { + } + /** + * Resets all incremented bp_optout caches. + * + * @since 8.0.0 + */ + function bp_optouts_reset_cache_incrementor() + { + } + /** + * Set up the constants we need for avatar support. + * + * @since 1.2.0 + */ + function bp_core_set_avatar_constants() + { + } + /** + * Set up global variables related to avatars. + * + * @since 1.5.0 + */ + function bp_core_set_avatar_globals() + { + } + /** + * Checks whether a given gravatar is one of the default ones. + * + * @since 8.0.0 + * + * @param string $d The name of the default gravatar. + * @return bool True if it's a default gravatar. False otherwise. + */ + function bp_core_is_default_gravatar($d = '') + { + } + /** + * Get an avatar for a BuddyPress object. + * + * Supports avatars for users, groups, and blogs by default, but can be + * extended to support custom components as well. + * + * This function gives precedence to locally-uploaded avatars. When a local + * avatar is not found, Gravatar is queried. To disable Gravatar fallbacks + * locally: + * add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' ); + * + * @since 1.1.0 + * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args. + * These are inherited from WordPress 4.2.0. See {@link get_avatar()}. + * + * @param array|string $args { + * An array of arguments. All arguments are technically optional; some + * will, if not provided, be auto-detected by bp_core_fetch_avatar(). This + * auto-detection is described more below, when discussing specific + * arguments. + * + * @type int|bool $item_id The numeric ID of the item for which you're requesting + * an avatar (eg, a user ID). If no 'item_id' is present, + * the function attempts to infer an ID from the 'object' + the + * current context: if 'object' is 'user' and the current page is a + * user page, 'item_id' will default to the displayed user ID; if + * 'group' and on a group page, to the current group ID; if 'blog', + * to the current blog's ID. If no 'item_id' can be determined in + * this way, the function returns false. Default: false. + * @type string $object The kind of object for which you're getting an + * avatar. BuddyPress natively supports three options: 'user', + * 'group', 'blog'; a plugin may register more. Default: 'user'. + * @type string $type When a new avatar is uploaded to BP, 'thumb' and + * 'full' versions are saved. This parameter specifies whether you'd + * like the 'full' or smaller 'thumb' avatar. Default: 'thumb'. + * @type string|bool $avatar_dir The name of the subdirectory where the + * requested avatar should be found. If no value is passed, + * 'avatar_dir' is inferred from 'object': 'user' becomes 'avatars', + * 'group' becomes 'group-avatars', 'blog' becomes 'blog-avatars'. + * Remember that this string denotes a subdirectory of BP's main + * avatar directory (usually based on {@link wp_upload_dir()}); it's a + * string like 'group-avatars' rather than the full directory path. + * Generally, it'll only be necessary to override the default value if + * storing avatars in a non-default location. Defaults to false + * (auto-detected). + * @type int|bool $width Requested avatar width. The unit is px. This value + * is used to build the 'width' attribute for the <img> element. If + * no value is passed, BP uses the global avatar width for this + * avatar type. Default: false (auto-detected). + * @type int|bool $height Requested avatar height. The unit is px. This + * value is used to build the 'height' attribute for the <img> + * element. If no value is passed, BP uses the global avatar height + * for this avatar type. Default: false (auto-detected). + * @type string $class The CSS class for the <img> element. Note that BP + * uses the 'avatar' class fairly extensively in its default styling, + * so if you plan to pass a custom value, consider appending it to + * 'avatar' (eg 'avatar foo') rather than replacing it altogether. + * Default: 'avatar'. + * @type string|bool $css_id The CSS id for the <img> element. + * Default: false. + * @type string $title The title attribute for the <img> element. + * Default: false. + * @type string $alt The alt attribute for the <img> element. In BP, this + * value is generally passed by the wrapper functions, where the data + * necessary for concatenating the string is at hand; see + * {@link bp_get_activity_avatar()} for an example. Default: ''. + * @type string|bool $email An email to use in Gravatar queries. Unless + * otherwise configured, BP uses Gravatar as a fallback for avatars + * that are not provided locally. Gravatar's API requires using a hash + * of the user's email address; this argument provides it. If not + * provided, the function will infer it: for users, by getting the + * user's email from the database, for groups/blogs, by concatenating + * "{$item_id}-{$object}@{bp_get_domain()}". The user query adds + * overhead, so it's recommended that wrapper functions provide a + * value for 'email' when querying user IDs. Default: false. + * @type bool $no_grav Whether to disable the default Gravatar fallback. + * By default, BP will fall back on Gravatar when it cannot find a + * local avatar. In some cases, this may be undesirable, in which + * case 'no_grav' should be set to true. To disable Gravatar + * fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter. + * Default: true for groups, otherwise false. + * @type bool $html Whether to return an <img> HTML element, vs a raw URL + * to an avatar. If false, <img>-specific arguments (like 'css_id') + * will be ignored. Default: true. + * @type string $extra_attr HTML attributes to insert in the IMG element. Not sanitized. Default: ''. + * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. + * Default null. + * @type string $rating What rating to display Gravatars for. Accepts 'G', 'PG', 'R', 'X'. + * Default is the value of the 'avatar_rating' option. + * @type bool $force_default Used when creating the Gravatar URL. Whether to force the default + * image regardless if the Gravatar exists. Default: false. + * } + * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg. + */ + function bp_core_fetch_avatar($args = '') + { + } + /** + * Delete an existing avatar. + * + * @since 1.1.0 + * + * @param array|string $args { + * Array of function parameters. + * @type bool|int $item_id ID of the item whose avatar you're deleting. + * Defaults to the current item of type $object. + * @type string $object Object type of the item whose avatar you're + * deleting. 'user', 'group', 'blog', or custom. + * Default: 'user'. + * @type bool|string $avatar_dir Subdirectory where avatar is located. + * Default: false, which falls back on the default location + * corresponding to the $object. + * } + * @return bool + */ + function bp_core_delete_existing_avatar($args = '') + { + } + /** + * Ajax delete an avatar for a given object and item id. + * + * @since 2.3.0 + * + * @return string|null A JSON object containing success data if the avatar was deleted, + * error message otherwise. + */ + function bp_avatar_ajax_delete() + { + } + /** + * Handle avatar uploading. + * + * The functions starts off by checking that the file has been uploaded + * properly using bp_core_check_avatar_upload(). It then checks that the file + * size is within limits, and that it has an accepted file extension (jpg, gif, + * png). If everything checks out, crop the image and move it to its real + * location. + * + * @since 1.1.0 + * + * @see bp_core_check_avatar_upload() + * @see bp_core_check_avatar_type() + * + * @param array $file The appropriate entry the from $_FILES superglobal. + * @param string $upload_dir_filter A filter to be applied to 'upload_dir'. + * @return bool + */ + function bp_core_avatar_handle_upload($file, $upload_dir_filter) + { + } + /** + * Ajax upload an avatar. + * + * @since 2.3.0 + */ + function bp_avatar_ajax_upload() + { + } + /** + * Handle avatar webcam capture. + * + * @since 2.3.0 + * @since 10.0.0 Adds the `$return` param to eventually return the crop result. + * + * @param string $data Optional. Base64 encoded image. + * @param int $item_id Optional. Item to associate. + * @param string $retval Optional. Whether to get the crop `array` or a `boolean`. Defaults to `boolean`. + * @return array|bool + */ + function bp_avatar_handle_capture($data = '', $item_id = 0, $retval = 'boolean') + { + } + /** + * Crop an uploaded avatar. + * + * @since 1.1.0 + * @since 10.0.0 Adds the `$return` param to eventually return the crop result. + * + * @param array|string $args { + * Array of function parameters. + * + * @type string $object Object type of the item whose avatar you're + * handling. 'user', 'group', 'blog', or custom. + * Default: 'user'. + * @type string $avatar_dir Subdirectory where avatar should be stored. + * Default: 'avatars'. + * @type bool|int $item_id ID of the item that the avatar belongs to. + * @type bool|string $original_file Absolute path to the original avatar file. + * @type int $crop_w Crop width. Default: the global 'full' avatar width, + * as retrieved by bp_core_avatar_full_width(). + * @type int $crop_h Crop height. Default: the global 'full' avatar height, + * as retrieved by bp_core_avatar_full_height(). + * @type int $crop_x The horizontal starting point of the crop. Default: 0. + * @type int $crop_y The vertical starting point of the crop. Default: 0. + * } + * @param string $retval Optional. Whether to get the crop `array` or a `boolean`. Defaults to `boolean`. + * @return array|bool + */ + function bp_core_avatar_handle_crop($args = '', $retval = 'boolean') + { + } + /** + * Ajax set an avatar for a given object and item id. + * + * @since 2.3.0 + */ + function bp_avatar_ajax_set() + { + } + /** + * Filter {@link get_avatar_url()} to use the BuddyPress user avatar URL. + * + * @since 2.9.0 + * + * @param string $retval The URL of the avatar. + * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, + * user email, WP_User object, WP_Post object, or WP_Comment object. + * @param array $args Arguments passed to get_avatar_data(), after processing. + * @return string + */ + function bp_core_get_avatar_data_url_filter($retval, $id_or_email, $args) + { + } + /** + * Is the current avatar upload error-free? + * + * @since 1.0.0 + * + * @param array $file The $_FILES array. + * @return bool + */ + function bp_core_check_avatar_upload($file) + { + } + /** + * Is the file size of the current avatar upload permitted? + * + * @since 1.0.0 + * + * @param array $file The $_FILES array. + * @return bool True if the avatar is under the size limit, otherwise false. + */ + function bp_core_check_avatar_size($file) + { + } + /** + * Get allowed avatar types. + * + * @since 2.3.0 + * + * @return array + */ + function bp_core_get_allowed_avatar_types() + { + } + /** + * Get allowed avatar mime types. + * + * @since 2.3.0 + * + * @return array + */ + function bp_core_get_allowed_avatar_mimes() + { + } + /** + * Does the current avatar upload have an allowed file type? + * + * Permitted file types are JPG, GIF and PNG. + * + * @since 1.0.0 + * + * @param array $file The $_FILES array. + * @return bool True if the file extension is permitted, otherwise false. + */ + function bp_core_check_avatar_type($file) + { + } + /** + * Fetch data from the BP root blog's upload directory. + * + * @since 1.8.0 + * + * @param string $type The variable we want to return from the $bp->avatars object. + * Only 'upload_path' and 'url' are supported. Default: 'upload_path'. + * @return string The avatar upload directory path. + */ + function bp_core_get_upload_dir($type = 'upload_path') + { + } + /** + * Get the absolute upload path for the WP installation. + * + * @since 1.2.0 + * + * @return string Absolute path to WP upload directory. + */ + function bp_core_avatar_upload_path() + { + } + /** + * Get the raw base URL for root site upload location. + * + * @since 1.2.0 + * + * @return string Full URL to current upload location. + */ + function bp_core_avatar_url() + { + } + /** + * Check if a given user ID has an uploaded avatar. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user whose avatar is being checked. + * @return bool True if the user has uploaded a local avatar. Otherwise false. + */ + function bp_get_user_has_avatar($user_id = 0) + { + } + /** + * Utility function for fetching an avatar dimension setting. + * + * @since 1.5.0 + * + * @param string $type Dimension type you're fetching dimensions for. 'thumb' + * or 'full'. Default: 'thumb'. + * @param string $h_or_w Which dimension is being fetched. 'height' or 'width'. + * Default: 'height'. + * @return int|bool $dim The dimension. + */ + function bp_core_avatar_dimension($type = 'thumb', $h_or_w = 'height') + { + } + /** + * Get the 'thumb' avatar width setting. + * + * @since 1.5.0 + * + * @return int The 'thumb' width. + */ + function bp_core_avatar_thumb_width() + { + } + /** + * Get the 'thumb' avatar height setting. + * + * @since 1.5.0 + * + * @return int The 'thumb' height. + */ + function bp_core_avatar_thumb_height() + { + } + /** + * Get the 'full' avatar width setting. + * + * @since 1.5.0 + * + * @return int The 'full' width. + */ + function bp_core_avatar_full_width() + { + } + /** + * Get the 'full' avatar height setting. + * + * @since 1.5.0 + * + * @return int The 'full' height. + */ + function bp_core_avatar_full_height() + { + } + /** + * Get the max width for original avatar uploads. + * + * @since 1.5.0 + * + * @return int The max width for original avatar uploads. + */ + function bp_core_avatar_original_max_width() + { + } + /** + * Get the max filesize for original avatar uploads. + * + * @since 1.5.0 + * + * @return int The max filesize for original avatar uploads. + */ + function bp_core_avatar_original_max_filesize() + { + } + /** + * Get the URL of the 'full' default avatar. + * + * @since 1.5.0 + * @since 2.6.0 Introduced `$params` and `$object_type` parameters. + * + * @param string $type 'local' if the fallback should be the locally-hosted version + * of the mystery person, 'gravatar' if the fallback should be + * Gravatar's version. Default: 'gravatar'. + * @param array $params Parameters passed to bp_core_fetch_avatar(). + * @return string The URL of the default avatar. + */ + function bp_core_avatar_default($type = 'gravatar', $params = array()) + { + } + /** + * Get the URL of the 'thumb' default avatar. + * + * Uses Gravatar's mystery-person avatar, unless BP_AVATAR_DEFAULT_THUMB has been + * defined. + * + * @since 1.5.0 + * @since 2.6.0 Introduced `$object_type` parameter. + * + * @param string $type 'local' if the fallback should be the locally-hosted version + * of the mystery person, 'gravatar' if the fallback should be + * Gravatar's version. Default: 'gravatar'. + * @param array $params Parameters passed to bp_core_fetch_avatar(). + * @return string The URL of the default avatar thumb. + */ + function bp_core_avatar_default_thumb($type = 'gravatar', $params = array()) + { + } + /** + * Reset the week parameter of the WordPress main query if needed. + * + * When cropping an avatar, a $_POST['w'] var is sent, setting the 'week' + * parameter of the WordPress main query to this posted var. To avoid + * notices, we need to make sure this 'week' query var is reset to 0. + * + * @since 2.2.0 + * + * @param WP_Query|null $posts_query The main query object. + */ + function bp_core_avatar_reset_query($posts_query = \null) + { + } + /** + * Checks whether Avatar UI should be loaded. + * + * @since 2.3.0 + * + * @return bool True if Avatar UI should load, false otherwise. + */ + function bp_avatar_is_front_edit() + { + } + /** + * Checks whether the Webcam Avatar UI part should be loaded. + * + * @since 2.3.0 + * + * @global bool $is_safari + * @global bool $is_IE + * + * @return bool True to load the Webcam Avatar UI part. False otherwise. + */ + function bp_avatar_use_webcam() + { + } + /** + * Template function to load the Avatar UI javascript templates. + * + * @since 2.3.0 + */ + function bp_avatar_get_templates() + { + } + /** + * Trick to check if the theme's BuddyPress templates are up to date. + * + * If the "avatar templates" are not including the new template tag, this will + * help users to get the avatar UI. + * + * @since 2.3.0 + */ + function bp_avatar_template_check() + { + } + /** + * Informs about whether avatar history is disabled or not. + * + * @since 10.0.0 + * + * @return bool True if avatar history is disabled. False otherwise. + * Default: `false`. + */ + function bp_avatar_history_is_disabled() + { + } + /** + * Get a specific version of an avatar from its history. + * + * @since 10.0.0 + * + * @param int $item_id The item ID we need the avatar version for. + * @param string $object The object the item ID relates to. + * @param int|string $timestamp An integer Unix timestamp or a date string of the format 'Y-m-d h:i:s'. + * @param string $type The type of avatar we need. Possible values are `thumb` and `full`. + * @return array A list of matching results, an empty array if no avatars were found. + */ + function bp_avatar_get_version($item_id = 0, $object = 'user', $timestamp = '', $type = 'full') + { + } + /** + * Get the list of previous avatars in history + * + * @since 10.0.0 + * + * @param int $item_id The item ID we need the avatar version for. + * @param string $object The object the item ID relates to. + * @param string $type Get the `full`, `thumb` or `both` versions. + * @return array The list of previous uploaded avatars. + */ + function bp_avatar_get_avatars_history($item_id = 0, $object = 'user', $type = 'full') + { + } + /** + * Recycle a previously uploaded avatar as the current avatar. + * + * @since 10.0.0 + */ + function bp_avatar_ajax_recycle_previous_avatar() + { + } + /** + * Delete a previously uploaded avatar from avatars history. + * + * @since 10.0.0 + */ + function bp_avatar_ajax_delete_previous_avatar() + { + } + /** + * Register Avatar ajax actions. + * + * @since 12.0.0 + */ + function bp_avatar_register_ajax_actions() + { + } + /** + * Get a BuddyPress template part for display in a theme. + * + * @since 1.7.0 + * @since 7.0.0 Added $args parameter. + * + * @param string $slug Template part slug. Used to generate filenames, + * eg 'friends' for 'friends.php'. + * @param string|null $name Optional. Template part name. Used to generate + * secondary filenames, eg 'personal' for 'activity-personal.php'. + * @param array $args Optional. Extra args to pass to locate_template(). + * @return false|string Path to located template. See {@link bp_locate_template()}. + */ + function bp_get_template_part($slug, $name = \null, $args = array()) + { + } + /** + * Get an asset template part. + * + * Basically the same as {@link bp_get_template_part()}, but with 'assets/' + * prepended to the slug. + * + * @since 2.6.0 + * @since 7.0.0 Added $args parameter. + * + * @see bp_get_template_part() for full documentation. + * + * @param string $slug Template slug. + * @param string|null $name Template name. + * @param array $args Optional. Extra args to pass to locate_template(). + * @return false|string + */ + function bp_get_asset_template_part($slug, $name = \null, $args = array()) + { + } + /** + * Get a dynamic template part. + * + * @since 9.0.0 + * + * @param string $template The Template Pack's relative path to the templata. + * Optional. + * @param string $type Whether to use the template for JavaScript or PHP. + * Optional. Defaults to `js`. + * @param array $tokens The data to use to customize the template. Optional. + * @param array $allowed_tags The allowed tags to use. Optional. + * @return string HTML/JS output. + */ + function bp_get_dynamic_template_part($template = '', $type = 'js', $tokens = array(), $allowed_tags = array()) + { + } + /** + * Retrieve the name of the highest priority template file that exists. + * + * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which + * inherit from a parent theme can just overload one file. If the template is + * not found in either of those, it looks in the theme-compat folder last. + * + * @since 1.7.0 + * @since 7.0.0 Added $args parameter. + * + * @param string|array $template_names Template file(s) to search for, in order. + * @param bool $load Optional. If true, the template file will be loaded when + * found. If false, the path will be returned. Default: false. + * @param bool $require_once Optional. Whether to require_once or require. Has + * no effect if $load is false. Default: true. + * @param array $args Optional. Extra args to pass to locate_template(). + * @return string The template filename if one is located. + */ + function bp_locate_template($template_names, $load = \false, $require_once = \true, $args = array()) + { + } + /** + * Get file data of the highest priority asset that exists. + * + * Similar to {@link bp_locate_template()}, but for files like CSS and JS. + * + * @since 2.6.0 + * + * @param string $filename Relative filename to search for. + * @return false|array Array of asset data if one is located (includes absolute filepath and URI). + * Boolean false on failure. + */ + function bp_locate_template_asset($filename) + { + } + /** + * Register a new template stack location. + * + * This allows for templates to live in places beyond just the parent/child + * relationship, to allow for custom template locations. Used in conjunction + * with bp_locate_template(), this allows for easy template overrides. + * + * @since 1.7.0 + * + * @param string $location_callback Callback function that returns the stack location. + * @param int $priority Optional. The priority parameter as passed to + * add_filter(). Default: 10. + * @return bool See {@link add_filter()}. + */ + function bp_register_template_stack($location_callback = '', $priority = 10) + { + } + /** + * Deregister a previously registered template stack location. + * + * @since 1.7.0 + * + * @see bp_register_template_stack() + * + * @param string $location_callback Callback function that returns the stack location. + * @param int $priority Optional. The priority parameter passed to + * {@link bp_register_template_stack()}. Default: 10. + * @return bool See {@link remove_filter()}. + */ + function bp_deregister_template_stack($location_callback = '', $priority = 10) + { + } + /** + * Get the "template stack", a list of registered directories where templates can be found. + * + * Calls the functions added to the 'bp_template_stack' filter hook, and return + * an array of the template locations. + * + * @since 1.7.0 + * + * @see bp_register_template_stack() + * + * @global array $wp_filter Stores all of the filters. + * @global array $merged_filters Merges the filter hooks using this function. + * @global array $wp_current_filter Stores the list of current filters with + * the current one last. + * @return array The filtered value after all hooked functions are applied to it. + */ + function bp_get_template_stack() + { + } + /** + * Put a template part into an output buffer, and return it. + * + * @since 1.7.0 + * @since 7.0.0 Added $args parameter. + * + * @see bp_get_template_part() for a description of $slug, $name and $args params. + * + * @param string $slug See {@link bp_get_template_part()}. + * @param string|null $name See {@link bp_get_template_part()}. + * @param bool $ret If true, template content will be echoed. If false, + * returned. Default: true. + * @param array $args See {@link bp_get_template_part()}. + * @return string|null If $echo, returns the template content. + */ + function bp_buffer_template_part($slug, $name = \null, $ret = \true, $args = array()) + { + } + /** + * Retrieve the path to a template. + * + * Used to quickly retrieve the path of a template without including the file + * extension. It will also check the parent theme and theme-compat theme with + * the use of {@link bp_locate_template()}. Allows for more generic template + * locations without the use of the other get_*_template() functions. + * + * @since 1.7.0 + * + * @param string $type Filename without extension. + * @param array $templates An optional list of template candidates. + * @return string Full path to file. + */ + function bp_get_query_template($type, $templates = array()) + { + } + /** + * Get the possible subdirectories to check for templates in. + * + * @since 1.7.0 + * + * @param array $templates Templates we are looking for. + * @return array Possible subfolders to look in. + */ + function bp_get_template_locations($templates = array()) + { + } + /** + * Add template locations to template files being searched for. + * + * @since 1.7.0 + * + * @param array $stacks Array of template locations. + * @return array Array of all template locations registered so far. + */ + function bp_add_template_stack_locations($stacks = array()) + { + } + /** + * Add checks for BuddyPress conditions to 'parse_query' action. + * + * @since 1.7.0 + * + * @param WP_Query $posts_query WP_Query object. + */ + function bp_parse_query($posts_query) + { + } + /** + * Parse the query for the Ajax context. + * + * @since 12.0.0 + * + * @param WP_Query $referer_query WP_Query object. + */ + function bp_parse_ajax_referer_query($referer_query) + { + } + /** + * Resets the query to fit our permalink structure if needed. + * + * This is used for specific cases such as Root Member's profile. + * + * @since 12.0.0 + * + * @param string $bp_request A specific BuddyPress request. + * @param WP_Query $query The WordPress query object. + * @return true + */ + function bp_reset_query($bp_request = '', \WP_Query $query = \null) + { + } + /** + * Possibly intercept the template being loaded. + * + * Listens to the 'template_include' filter and waits for any BuddyPress specific + * template condition to be met. If one is met and the template file exists, + * it will be used; otherwise. + * + * Note that the _edit() checks are ahead of their counterparts, to prevent them + * from being stomped on accident. + * + * @since 1.7.0 + * + * @param string $template The path to the template file that is being used. + * @return string The path to the template file that is being used. + */ + function bp_template_include_theme_supports($template = '') + { + } + /** + * Set the included template. + * + * @since 1.8.0 + * + * @param mixed $template Default: false. + * @return mixed False if empty. Template name if template included. + */ + function bp_set_template_included($template = \false) + { + } + /** + * Is a BuddyPress template being included? + * + * @since 1.8.0 + * + * @return bool True if yes, false if no. + */ + function bp_is_template_included() + { + } + /** + * Attempt to load a custom BP functions file, similar to each themes functions.php file. + * + * @since 1.7.0 + * + * @global string $pagenow + */ + function bp_load_theme_functions() + { + } + /** + * Get the templates to use as the endpoint for BuddyPress template parts. + * + * @since 1.7.0 + * @since 2.4.0 Added singular.php to stack + * + * @return string Possible root level wrapper template files. + */ + function bp_get_theme_compat_templates() + { + } + /** + * Sets Block Theme compatibility if it supports BuddyPress. + * + * @since 14.0.0 + */ + function bp_set_block_theme_compat() + { + } + /** Loader ********************************************************************/ + /** + * @deprecated 1.5.0 + */ + function bp_setup_root_components() + { + } + /** WP Abstraction ************************************************************/ + /** + * bp_core_is_multisite() + * + * This function originally served as a wrapper when WordPress and WordPress MU were separate entities. + * Use is_multisite() instead. + * + * @deprecated 1.5.0 + * @deprecated Use is_multisite() + * + * @return bool + */ + function bp_core_is_multisite() + { + } + /** + * bp_core_is_main_site + * + * Checks if current blog is root blog of site. Deprecated in 1.5. + * + * @deprecated 1.5.0 + * @deprecated Use is_main_site() + * @package BuddyPress + * @param int|string $blog_id optional blog id to test (default current blog) + * @return bool True if not multisite or $blog_id is main site + * @since 1.2.6 + */ + function bp_core_is_main_site($blog_id = '') + { + } + /** + * WPMU version of is_super_admin() + * + * @deprecated 1.5.0 + * @deprecated Use is_super_admin() + * @param int|bool $user_id Optional. Defaults to logged-in user + * @return bool True if is super admin + */ + function is_site_admin($user_id = \false) + { + } + /** Admin ******************************************************************/ + /** + * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page() + * that allowed positioning of menus. Deprecated in 1.5 in favor of a WP core function. + * + * @deprecated 1.5.0 + * @deprecated Use add_menu_page(). + * @since 1.1.0 + * + * @return string + */ + function bp_core_add_admin_menu_page($args = '') + { + } + /** Activity ******************************************************************/ + /** + * @deprecated 1.5.0 + */ + function bp_is_activity_permalink() + { + } + /** Core **********************************************************************/ + /** + * @deprecated 1.5.0 + */ + function bp_core_get_wp_profile() + { + } + /** + * @deprecated 1.5.0 + * @deprecated Use bp_is_my_profile() + */ + function bp_is_home() + { + } + /** + * Is the user on the front page of the site? + * + * @deprecated 1.5.0 + * @deprecated Use is_front_page() + * @return bool + */ + function bp_is_front_page() + { + } + /** + * Is the front page of the site set to the Activity component? + * + * @deprecated 1.5.0 + * @deprecated Use bp_is_component_front_page( 'activity' ) + * @return bool + */ + function bp_is_activity_front_page() + { + } + /** + * @deprecated 1.5.0 + * @deprecated use bp_is_user() + */ + function bp_is_member() + { + } + /** + * @deprecated 1.5.0 + * @deprecated use bp_loggedin_user_link() + */ + function bp_loggedinuser_link() + { + } + /** + * Only show the search form if there are available objects to search for. + * Deprecated in 1.5; not used anymore. + * + * @deprecated 1.5.0 + * @return bool + */ + function bp_search_form_enabled() + { + } + /** + * Template tag version of bp_get_page_title() + * + * @deprecated 1.5.0 + * @deprecated Use wp_title() + * @since 1.0.0 + */ + function bp_page_title() + { + } + /** + * Prior to BuddyPress 1.5, this was used to generate the page's <title> text. + * Now, just simply use wp_title(). + * + * @deprecated 1.5.0 + * @deprecated Use wp_title() + * @since 1.0.0 + * + * @return string + */ + function bp_get_page_title() + { + } + /** + * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url(). + * + * @deprecated 1.5.0 + * @deprecated Use wp_logout_url() + * @since 1.0.0 + */ + function bp_log_out_link() + { + } + /** + * Send an email and a BP notification on receipt of an @-mention in a group + * + * @deprecated 1.5.0 + * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification() + */ + function groups_at_message_notification($content, $poster_user_id, $group_id, $activity_id) + { + } + /** + * BP 1.5 simplified notification functions a bit + * @deprecated 1.5.0 + * + * @return mixed + */ + function bp_core_delete_notifications_for_user_by_type($user_id, $component_name, $component_action) + { + } + /** + * @return mixed + */ + function bp_core_delete_notifications_for_user_by_item_id($user_id, $item_id, $component_name, $component_action, $secondary_item_id = \false) + { + } + /** + * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template. + * @deprecated 1.5.0 + */ + function bp_search_form() + { + } + /** + * Some _is_ function had their names normalized + * @deprecated 1.5.0 + */ + function bp_is_profile_edit() + { + } + /** + * @deprecated 1.5.0 + */ + function bp_is_change_avatar() + { + } + /** + * @deprecated 1.5.0 + */ + function bp_is_friend_requests() + { + } + /** + * Checks to see if a component's URL should be in the root, not under a member page: + * eg: http://example.com/groups/the-group NOT http://example.com/members/andy/groups/the-group + * You should be using bp_is_root_component(). + * + * @deprecated 1.5.0 + * @deprecated bp_is_root_component() + * @return bool True if root component, else false. + */ + function bp_core_is_root_component($component_name) + { + } + /** Theme *********************************************************************/ + /** + * Contains functions which were moved out of BP-Default's functions.php + * in BuddyPress 1.5. + * + * @deprecated 1.5.0 + * @since 1.5.0 + */ + function bp_dtheme_deprecated() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as the nav structure is set up by the {@link BP_Component} class. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_add_settings_nav() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_general_settings() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_general_settings_title() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_general_settings_content() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_notification_settings() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_notification_settings_title() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_notification_settings_content() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_delete_account() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_delete_account_title() + { + } + /** + * In BP 1.5, the Settings functions were moved out of the Core and Members + * components, and moved into a new Settings component. This function is no + * longer needed as new template files for the Settings component were + * introduced. + * + * @deprecated 1.5.0 + * @since 1.6.0 + */ + function bp_core_screen_delete_account_content() + { + } + /** + * Since BuddyPress 1.0, this generated the group settings admin/member screen. + * As of BuddyPress 1.5 (r4489), and because this function outputs HTML, it was moved into /bp-default/groups/single/admin.php. + * + * @deprecated 1.5 + * @deprecated No longer used. + * @since 1.0.0 + * @todo Remove in 1.4 + * + * @param bool $admin_list + * @param bool $group + */ + function bp_group_admin_memberlist($admin_list = \false, $group = \false) + { + } + /** + * Output the BuddyPress maintenance mode + * + * @since 1.6.0 + * @deprecated 1.7.0 + */ + function bp_maintenance_mode() + { + } + /** + * Return the BuddyPress maintenance mode + * + * @since 1.6.0 + * @deprecated 1.7.0 + * @return string The BuddyPress maintenance mode + */ + function bp_get_maintenance_mode() + { + } + /** + * @deprecated 1.7.0 + */ + function xprofile_get_profile() + { + } + /** + * @deprecated 1.7.0 + */ + function bp_get_profile_header() + { + } + /** + * @deprecated 1.7.0 + * @param string $component_name + * @return bool + */ + function bp_exists($component_name) + { + } + /** + * @deprecated 1.7.0 + */ + function bp_get_plugin_sidebar() + { + } + /** + * On multiblog installations you must first allow themes to be activated and + * show up on the theme selection screen. This function will let the BuddyPress + * bundled themes show up on the root blog selection screen and bypass this + * step. It also means that the themes won't show for selection on other blogs. + * + * @deprecated 1.7.0 + * @return array + */ + function bp_core_allow_default_theme($themes) + { + } + /** + * No longer used by BuddyPress core + * + * @deprecated 1.7.0 + * @param string $page + * @return bool True if is BuddyPress page + */ + function bp_is_page($page = '') + { + } + /** Admin *********************************************************************/ + /** + * This function was originally used to update pre-1.1 schemas, but that was + * before we had a legitimate update process. + * + * @deprecated 1.7.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_update_db_stuff() + { + } + /** Toolbar functions *********************************************************/ + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_remove_wp_menus() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_root_site() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_my_sites_menu() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_comments_menu($wp_admin_bar = '') + { + } + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_appearance_menu() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_admin_bar_updates_menu() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_members_admin_bar_my_account_logout() + { + } + /** + * @deprecated 1.6.0 + */ + function bp_core_is_user_deleted($user_id = 0) + { + } + /** + * @deprecated 1.6.0 + */ + function bp_core_is_user_spammer($user_id = 0) + { + } + /** + * Blogs functions + */ + /** + * @deprecated 1.6.0 + * @deprecated No longer used; see bp_activity_transition_post_type_comment_status() + */ + function bp_blogs_manage_comment($comment_id, $comment_status) + { + } + /** + * Core functions + */ + /** + * @deprecated 1.6.0 + * @deprecated No longer used; see BP_Admin::admin_menus() + */ + function bp_core_add_admin_menu() + { + } + /** + * @deprecated 1.6.0 + * @deprecated No longer used. We do ajax properly now. + */ + function bp_core_add_ajax_hook() + { + } + /** + * Friends functions + */ + /** + * Displays Friends header tabs + * + * @deprecated 1.6.0 + * @deprecated No longer used + */ + function bp_friends_header_tabs() + { + } + /** + * Filters the title for the Friends component + * + * @deprecated 1.6.0 + * @deprecated No longer used + */ + function bp_friends_filter_title() + { + } + /** Groups functions **********************************************************/ + /** + * @deprecated 1.6.0 + * @deprecated Renamed to groups_get_id() for greater consistency + */ + function groups_check_group_exists($group_slug) + { + } + /** Admin functions ***********************************************************/ + /** + * Loads admin panel styles and scripts. + * + * @deprecated 1.6.0 + */ + function bp_core_add_admin_menu_styles() + { + } + /** Activity functions ********************************************************/ + /** + * @deprecated 1.6.0 + */ + function updates_register_activity_actions() + { + } + /** + * Sets the "From" address in emails sent + * + * @deprecated 1.6.0 + * @return string email address + */ + function bp_core_email_from_address_filter() + { + } + function bp_die_legacy_ajax_callbacks() + { + } + /** + * Mark the posted activity as spam, if it contains disallowed keywords. + * + * Use bp_activity_check_disallowed_keys() instead. + * + * @since 1.6.0 + * @deprecated 7.0.0 + * + * @param BP_Activity_Activity $activity The activity object to check. + */ + function bp_activity_check_blacklist_keys($activity) + { + } + /** + * Check for blocked keys. + * + * Use bp_core_check_for_disallowed_keys() instead. + * + * @since 1.6.0 + * @since 2.6.0 Added $error_type parameter. + * @deprecated 7.0.0 + * + * @param int $user_id User ID. + * @param string $title The title of the content. + * @param string $content The content being posted. + * @param string $error_type The error type to return. Either 'bool' or 'wp_error'. + * @return bool|WP_Error True if test is passed, false if fail. + */ + function bp_core_check_for_blacklist($user_id = 0, $title = '', $content = '', $error_type = 'bool') + { + } + /** + * Deprecated Functions + * + * @package BuddyPress + * @subpackage Core + */ + /** + * Retrieve sitewide activity + * + * You should use bp_activity_get() instead + * + * @since 1.0.0 + * @deprecated 1.2.0 + * + * @param string|array $args + * + * @return object $activity The activity/activities object + */ + function bp_activity_get_sitewide($args = '') + { + } + /** + * Output the member activity feed link. + * + * @since 1.0.0 + * @deprecated 1.2.0 + */ + function bp_activities_member_rss_link() + { + } + /** + * Check whether bbPress plugin-powered Group Forums are enabled. + * + * @since 1.6.0 + * @since 3.0.0 $default argument's default value changed from true to false. + * @deprecated 3.0.0 No longer used in core, but supported for third-party code. + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if group forums are active, otherwise false. + */ + function bp_is_group_forums_active($default = \false) + { + } + /** + * Is this a user's forums page? + * + * Eg http://example.com/members/joe/forums/ (or a subpage thereof). + * + * @since 1.5.0 + * @deprecated 3.0.0 No longer used in core, but supported for third-party code. + * + * @return false + */ + function bp_is_user_forums() + { + } + /** + * Is the current page a group's (legacy bbPress) forum page? + * + * @since 1.1.0 + * @since 3.0.0 Always returns false. + * @deprecated 3.0.0 No longer used in core, but supported for custom theme templates. + * + * @return bool + */ + function bp_is_group_forum() + { + } + /** + * Output a 'New Topic' button for a group. + * + * @since 1.2.7 + * @deprecated 3.0.0 No longer used in core, but supported for third-party code. + * + * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed. + */ + function bp_group_new_topic_button($group = \false) + { + } + /** + * Return a 'New Topic' button for a group. + * + * @since 1.2.7 + * @deprecated 3.0.0 No longer used in core, but supported for third-party code. + * + * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed. + * + * @return false + */ + function bp_get_group_new_topic_button($group = \false) + { + } + /** + * Catch a "Mark as Spammer/Not Spammer" click from the toolbar. + * + * When a site admin selects "Mark as Spammer/Not Spammer" from the admin menu + * this action will fire and mark or unmark the user and their blogs as spam. + * Must be a site admin for this function to run. + * + * Note: no longer used in the current state. See the Settings component. + * + * @since 1.1.0 + * @since 1.6.0 No longer used, unhooked. + * @since 3.0.0 Formally marked as deprecated. + * + * @param int $user_id Optional. User ID to mark as spam. Defaults to displayed user. + */ + function bp_core_action_set_spammer_status($user_id = 0) + { + } + /** + * Process user deletion requests. + * + * Note: no longer used in the current state. See the Settings component. + * + * @since 1.1.0 + * @since 1.6.0 No longer used, unhooked. + * @since 3.0.0 Formally marked as deprecated. + */ + function bp_core_action_delete_user() + { + } + /** + * Set "From" name in outgoing email to the site name. + * + * @since 1.0.0 + * @deprecated 2.5.0 Not used. Was hooked to WordPress' "wp_mail_from_name" action. + * Use the "bp_email_get_from" action instead. + * + * @return string The blog name for the root blog. + */ + function bp_core_email_from_name_filter() + { + } + /** + * Add support for pre-2.5 email filters. + * + * @since 2.5.0 + * + * @param mixed $value + * @param string $property Name of property. + * @param string $transform Return value transformation. Unused. + * @param BP_Email $email Email object reference. + * @return mixed + */ + function bp_core_deprecated_email_filters($value, $property, $transform, $email) + { + } + /** + * Add support for pre-2.5 email actions. + * + * @since 2.5.0 + * + * @param bool|WP_Error $delivery_status Bool if the email was sent or not. + * If a WP_Error, there was a failure. + * @param BP_Email $email Email object reference. + * @return mixed + */ + function bp_core_deprecated_email_actions($delivery_status, $email) + { + } + /** + * When a blog comment status transition occurs, update the relevant activity's status. + * + * @since 1.6.0 + * @deprecated 2.5.0 + * + * @param string $new_status New comment status. + * @param string $old_status Previous comment status. + * @param object $comment Comment data. + */ + function bp_blogs_transition_activity_status($new_status, $old_status, $comment) + { + } + /** + * Record a new blog comment in the BuddyPress activity stream. + * + * Only posts the item if blog is public and post is not password-protected. + * + * @deprecated 2.5.0 + * + * @param int $comment_id ID of the comment being recorded. + * @param bool|string $is_approved Optional. The $is_approved value passed to + * the 'comment_post' action. Default: true. + * @return bool|object|null Returns false on failure, the comment object on success. + */ + function bp_blogs_record_comment($comment_id, $is_approved = \true) + { + } + /** + * Remove a blog comment activity item from the activity stream. + * + * @deprecated 2.5.0 + * + * @param int $comment_id ID of the comment to be removed. + */ + function bp_blogs_remove_comment($comment_id) + { + } + /** + * Check if the current WordPress version is using Plupload 2.1.1 + * + * Plupload 2.1.1 was introduced in WordPress 3.9. Our bp-plupload.js + * script requires it. So we need to make sure the current WordPress + * match with our needs. + * + * @since 2.3.0 + * @since 3.0.0 This is always true. + * @deprecated 6.0.0 + * + * @return bool Always true. + */ + function bp_attachments_is_wp_version_supported() + { + } + /** + * Setup the avatar upload directory for a user. + * + * @since 1.0.0 + * @deprecated 6.0.0 + * + * @package BuddyPress Core + * + * @param string $directory The root directory name. Optional. + * @param int $user_id The user ID. Optional. + * @return array Array containing the path, URL, and other helpful settings. + */ + function xprofile_avatar_upload_dir($directory = 'avatars', $user_id = 0) + { + } + /** + * This function runs when an action is set for a screen: + * example.com/members/andy/profile/change-avatar/ [delete-avatar] + * + * The function will delete the active avatar for a user. + * + * @since 1.0.0 + * @deprecated 6.0.0 + */ + function xprofile_action_delete_avatar() + { + } + /** + * Displays the change cover image page. + * + * @since 2.4.0 + * @deprecated 6.0.0 + */ + function xprofile_screen_change_cover_image() + { + } + /** + * Handles the uploading and cropping of a user avatar. Displays the change avatar page. + * + * @since 1.0.0 + * @deprecated 6.0.0 + */ + function xprofile_screen_change_avatar() + { + } + /** + * Output the status of the current group in the loop. + * + * Either 'Public' or 'Private'. + * + * @since 1.0.0 + * @deprecated 6.0.0 Not used anymore. + * + * @param object|bool $group Optional. Group object. + * Default: current group in loop. + */ + function bp_group_public_status($group = \false) + { + } + /** + * Return the status of the current group in the loop. + * + * Either 'Public' or 'Private'. + * + * @since 1.0.0 + * @deprecated 6.0.0 Not used anymore. + * + * @param object|bool $group Optional. Group object. + * Default: current group in loop. + * @return string + */ + function bp_get_group_public_status($group = \false) + { + } + /** + * Output whether the current group in the loop is public. + * + * No longer used in BuddyPress. + * + * @deprecated 6.0.0 Not used anymore. + * + * @param object|bool $group Optional. Group object. + * Default: current group in loop. + */ + function bp_group_is_public($group = \false) + { + } + /** + * Return whether the current group in the loop is public. + * + * No longer used in BuddyPress. + * + * @deprecated 6.0.0 Not used anymore. + * + * @param object|bool $group Optional. Group object. + * Default: current group in loop. + * @return mixed + */ + function bp_get_group_is_public($group = \false) + { + } + /** + * Add illegal blog names to WP so that root components will not conflict with blog names on a subdirectory installation. + * + * For example, it would stop someone creating a blog with the slug "groups". + * + * @since 1.0.0 + * @deprecated 6.0.0 + */ + function bp_core_add_illegal_names() + { + } + /** + * @deprecated 2.4.0 + */ + function bp_group_avatar_edit_form() + { + } + /** + * @deprecated 2.4.0 + * + * @param bool $deprecated Param deprecated 1.1.0 + */ + function groups_avatar_upload($deprecated = \true) + { + } + /** + * Print the generation time in the footer of the site. + * + * @since 1.0.0 + * @deprecated 2.6.0 + */ + function bp_core_print_generation_time() + { + } + /** + * Sort the navigation menu items. + * + * The sorting is split into a separate function because it can only happen + * after all plugins have had a chance to register their navigation items. + * + * @since 1.0.0 + * @deprecated 2.6.0 + * + * @return bool|null Returns false on failure. + */ + function bp_core_sort_nav_items() + { + } + /** + * Sort all subnavigation arrays. + * + * @since 1.1.0 + * @deprecated 2.6.0 + * + * @return bool|null Returns false on failure. + */ + function bp_core_sort_subnav_items() + { + } + /** + * Print moment.js config in page footer. + * + * @since 2.7.0 + * @since 4.0.0 Deprecated as BP requires WP >= 4.6. + * + * @access private + */ + function _bp_core_moment_js_config_footer() + { + } + /** + * Get the DB schema to use for BuddyPress components. + * + * @since 1.1.0 + * @deprecated 2.7.0 + * + * @return string The default database character-set, if set. + */ + function bp_core_set_charset() + { + } + /** + * Return the referrer URL without the http(s):// + * + * @deprecated 2.3.0 + * + * @return string The referrer URL. + */ + function bp_core_referrer() + { + } + /** + * Detect a change in post status, and initiate an activity update if necessary. + * + * Posts get new activity updates when (a) they are being published, and (b) + * they have not already been published. This enables proper posting for + * regular posts as well as scheduled posts, while preventing post bumping. + * + * See #4090, #3746, #2546 for background. + * + * @since 2.0.0 + * @deprecated 2.2.0 + * + * @todo Support untrashing better. + * + * @param string $new_status New status for the post. + * @param string $old_status Old status for the post. + * @param object $post Post data. + */ + function bp_blogs_catch_transition_post_status($new_status, $old_status, $post) + { + } + /** + * Record a new blog post in the BuddyPress activity stream. + * + * @deprecated 2.2.0 + * + * @param int $post_id ID of the post being recorded. + * @param object $post The WP post object passed to the 'save_post' action. + * @param int $user_id Optional. The user to whom the activity item will be + * associated. Defaults to the post_author. + * @return bool|null Returns false on failure. + */ + function bp_blogs_record_post($post_id, $post, $user_id = 0) + { + } + /** + * Updates a blog post's corresponding activity entry during a post edit. + * + * @since 2.0.0 + * @deprecated 2.2.0 + * + * @see bp_blogs_catch_transition_post_status() + * + * @param WP_Post $post + */ + function bp_blogs_update_post($post) + { + } + /** + * Clear cache when a new blog is created. + * + * @since 1.0.0 + * @deprecated 2.2.0 + * + * @param BP_Blogs_Blog $recorded_blog_obj The recorded blog, passed by + * 'bp_blogs_new_blog'. + */ + function bp_blogs_format_clear_blog_cache($recorded_blog_obj) + { + } + /** + * Format 'new_member' activity actions. + * + * @since 2.0.0 + * @deprecated 2.2.0 + * + * @param string $action Static activity action. + * @param object $activity Activity object. + * @return string + */ + function bp_xprofile_format_activity_action_new_member($action, $activity) + { + } + /** + * Add 'bp' to global group of network wide catchable objects. + * + * @since 1.1.0 + * @deprecated 2.2.0 + */ + function bp_core_add_global_group() + { + } + /** + * Add a piece of message metadata. + * + * @deprecated 2.2.2 + */ + function bp_message_add_meta($message_id, $meta_key, $meta_value, $unique = \false) + { + } + /** + * @deprecated 2.0.0 + */ + function bp_activity_clear_meta_cache_for_activity() + { + } + /** + * @deprecated 2.0.0 + */ + function bp_blogs_catch_published_post() + { + } + /** + * @deprecated 2.0.0 + */ + function bp_messages_screen_inbox_mark_notifications() + { + } + /** + * Register (not enqueue) scripts that used to be used by BuddyPress. + * + * @since 2.1.0 + */ + function bp_core_register_deprecated_scripts() + { + } + /** + * Register (not enqueue) styles that used to be used by BuddyPress. + * + * @since 2.1.0 + */ + function bp_core_register_deprecated_styles() + { + } + /** BuddyBar *****************************************************************/ + /** + * Add a Sites menu to the BuddyBar. + * + * @since 1.0.0 + * @deprecated 2.1.0 + * + * @return false|null Returns false on failure. Otherwise echoes the menu item. + */ + function bp_adminbar_blogs_menu() + { + } + /** + * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over + * to the WP Toolbar. + * + * @since 1.6.0 + * @deprecated 2.1.0 + */ + function bp_admin_setting_callback_force_buddybar() + { + } + /** + * Sanitization for _bp_force_buddybar + * + * If upgraded to 1.6 and you chose to keep the BuddyBar, a checkbox asks if you want to switch to + * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function + * to flip the boolean before saving the intval. + * + * @since 1.6.0 + * @deprecated 2.1.0 + * @access Private + */ + function bp_admin_sanitize_callback_force_buddybar($value = \false) + { + } + /** + * Wrapper function for rendering the BuddyBar. + * + * @return false|null Returns false if the BuddyBar is disabled. + * @deprecated 2.1.0 + */ + function bp_core_admin_bar() + { + } + /** + * Output the BuddyBar logo. + * + * @deprecated 2.1.0 + */ + function bp_adminbar_logo() + { + } + /** + * Output the "Log In" and "Sign Up" names to the BuddyBar. + * + * Visible only to visitors who are not logged in. + * + * @deprecated 2.1.0 + * + * @return false|null Returns false if the current user is logged in. + */ + function bp_adminbar_login_menu() + { + } + /** + * Output the My Account BuddyBar menu. + * + * @deprecated 2.1.0 + * + * @return false|null Returns false on failure. + */ + function bp_adminbar_account_menu() + { + } + function bp_adminbar_thisblog_menu() + { + } + /** + * Output the Random BuddyBar menu. + * + * Not visible for logged-in users. + * + * @deprecated 2.1.0 + */ + function bp_adminbar_random_menu() + { + } + /** + * Enqueue the BuddyBar CSS. + * + * @deprecated 2.1.0 + */ + function bp_core_load_buddybar_css() + { + } + /** + * Add menu items to the BuddyBar. + * + * @since 1.0.0 + * + * @deprecated 2.1.0 + */ + function bp_groups_adminbar_admin_menu() + { + } + /** + * Add the Notifications menu to the BuddyBar. + * + * @deprecated 2.1.0 + */ + function bp_adminbar_notifications_menu() + { + } + /** + * Add the Blog Authors menu to the BuddyBar (visible when not logged in). + * + * @deprecated 2.1.0 + */ + function bp_adminbar_authors_menu() + { + } + /** + * Add a member admin menu to the BuddyBar. + * + * Adds an Toolbar menu to any profile page providing site moderator actions + * that allow capable users to clean up a users account. + * + * @deprecated 2.1.0 + */ + function bp_members_adminbar_admin_menu() + { + } + /** + * Create the Notifications menu for the BuddyBar. + * + * @since 1.9.0 + * @deprecated 2.1.0 + */ + function bp_notifications_buddybar_menu() + { + } + /** + * Output the base URL for subdomain installations of WordPress Multisite. + * + * @since 1.6.0 + * + * @deprecated 2.1.0 + */ + function bp_blogs_subdomain_base() + { + } + /** + * Return the base URL for subdomain installations of WordPress Multisite. + * + * @since 1.6.0 + * + * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com. + * + * @deprecated 2.1.0 + */ + function bp_blogs_get_subdomain_base() + { + } + /** + * Allegedly output an avatar upload form, but it hasn't done that since 2009. + * + * @since 1.0.0 + * @deprecated 2.1.0 + */ + function bp_avatar_upload_form() + { + } + /** + * Returns the name of the hook to use once a WordPress Site is inserted into the Database. + * + * WordPress 5.1.0 deprecated the `wpmu_new_blog` action. As BuddyPress is supporting WordPress back + * to 4.9.0, this function makes sure we are using the new hook `wp_initialize_site` when the current + * WordPress version is upper or equal to 5.1.0 and that we keep on using `wpmu_new_blog` for earlier + * versions of WordPress. + * + * @since 6.0.0 + * @deprecated 10.0.0 + * + * @return string The name of the hook to use. + */ + function bp_insert_site_hook() + { + } + /** + * Returns the name of the hook to use once a WordPress Site is deleted. + * + * WordPress 5.1.0 deprecated the `delete_blog` action. As BuddyPress is supporting WordPress back + * to 4.9.0, this function makes sure we are using the new hook `wp_validate_site_deletion` when the + * current WordPress version is upper or equal to 5.1.0 and that we keep on using `delete_blog` for + * earlier versions of WordPress. + * + * @since 6.0.0 + * @deprecated 10.0.0 + * + * @return string The name of the hook to use. + */ + function bp_delete_site_hook() + { + } + /** + * Analyze the URI and break it down into BuddyPress-usable chunks. + * + * BuddyPress can use complete custom friendly URIs without the user having to + * add new rewrite rules. Custom components are able to use their own custom + * URI structures with very little work. + * + * The URIs are broken down as follows: + * - http:// example.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... + * - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... + * + * Example: + * - http://example.com/members/andy/profile/edit/group/5/ + * - $bp->current_component: string 'xprofile' + * - $bp->current_action: string 'edit' + * - $bp->action_variables: array ['group', 5] + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_core_set_uri_globals() + { + } + /** + * Add support for a top-level ("root") component. + * + * This function originally (pre-1.5) let plugins add support for pages in the + * root of the install. These root level pages are now handled by actual + * WordPress pages and this function is now a convenience for compatibility + * with the new method. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @param string $slug The slug of the component being added to the root list. + */ + function bp_core_add_root_component($slug) + { + } + /** + * Return the domain for the root blog. + * + * Eg: http://example.com OR https://example.com + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @return string The domain URL for the blog. + */ + function bp_core_get_root_domain() + { + } + /** + * Return the "root domain", the URL of the BP root blog. + * + * @since 1.1.0 + * @deprecated 12.0.0 + * + * @return string URL of the BP root blog. + */ + function bp_get_root_domain() + { + } + /** + * Output the "root domain", the URL of the BP root blog. + * + * @since 1.1.0 + * @deprecated 12.0.0 + */ + function bp_root_domain() + { + } + /** + * Renders the page mapping admin panel. + * + * @since 1.6.0 + * @deprecated 12.0.0 + */ + function bp_core_admin_slugs_settings() + { + } + /** + * Generate a list of directory pages, for use when building Components panel markup. + * + * @since 2.4.1 + * @deprecated 12.0.0 + * + * @return array + */ + function bp_core_admin_get_directory_pages() + { + } + /** + * Generate a list of static pages, for use when building Components panel markup. + * + * By default, this list contains 'register' and 'activate'. + * + * @since 2.4.1 + * @deprecated 12.0.0 + * + * @return array + */ + function bp_core_admin_get_static_pages() + { + } + /** + * Creates reusable markup for page setup on the Components and Pages dashboard panel. + * + * @package BuddyPress + * @since 1.6.0 + * @deprecated 12.0.0 + */ + function bp_core_admin_slugs_options() + { + } + /** + * Handle saving of the BuddyPress slugs. + * + * @since 1.6.0 + * @deprecated 12.0.0 + */ + function bp_core_admin_slugs_setup_handler() + { + } + /** + * Return the username for a user based on their user id. + * + * This function is sensitive to the BP_ENABLE_USERNAME_COMPATIBILITY_MODE, + * so it will return the user_login or user_nicename as appropriate. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @param int $user_id User ID to check. + * @param string|bool $user_nicename Optional. user_nicename of user being checked. + * @param string|bool $user_login Optional. user_login of user being checked. + * @return string The username of the matched user or an empty string if no user is found. + */ + function bp_core_get_username($user_id = 0, $user_nicename = \false, $user_login = \false) + { + } + /** + * Return the domain for the passed user: e.g. http://example.com/members/andy/. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @param int $user_id The ID of the user. + * @param string|bool $user_nicename Optional. user_nicename of the user. + * @param string|bool $user_login Optional. user_login of the user. + * @return string + */ + function bp_core_get_user_domain($user_id = 0, $user_nicename = \false, $user_login = \false) + { + } + /** + * Get the link for the logged-in user's profile. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @return string + */ + function bp_get_loggedin_user_link() + { + } + /** + * Get the link for the displayed user's profile. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @return string + */ + function bp_get_displayed_user_link() + { + } + /** + * Alias of {@link bp_displayed_user_domain()}. + * + * @deprecated 12.0.0 + */ + function bp_user_link() + { + } + /** + * Output group directory permalink. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + function bp_groups_directory_permalink() + { + } + /** + * Return group directory permalink. + * + * @since 1.5.0 + * @deprecated 12.0.0 + * + * @return string + */ + function bp_get_groups_directory_permalink() + { + } + /** + * Output the permalink for the group. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_permalink($group = \false) + { + } + /** + * Return the permalink for the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_permalink($group = \false) + { + } + /** + * Output the permalink for the admin section of the group. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_admin_permalink($group = \false) + { + } + /** + * Return the permalink for the admin section of the group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_admin_permalink($group = \false) + { + } + /** + * Output blog directory permalink. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + function bp_blogs_directory_permalink() + { + } + /** + * Return blog directory permalink. + * + * @since 1.5.0 + * @deprecated 12.0.0 + * + * @return string The URL of the Blogs directory. + */ + function bp_get_blogs_directory_permalink() + { + } + /** + * Returns the upper limit on the "max" item count, for widgets that support it. + * + * @since 5.0.0 + * @deprecated 12.0.0 + * + * @param string $widget_class Optional. Class name of the calling widget. + * @return int + */ + function bp_get_widget_max_count_limit($widget_class = '') + { + } + /** + * Determine whether BuddyPress should register the bp-themes directory. + * + * @since 1.9.0 + * @deprecated 12.0.0 + * + * @return bool True if bp-themes should be registered, false otherwise. + */ + function bp_do_register_theme_directory() + { + } + /** + * Fire the 'bp_register_theme_directory' action. + * + * The main action used registering theme directories. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + function bp_register_theme_directory() + { + } + /** + * Create WordPress pages to be used as BP component directories. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + function bp_core_create_root_component_page() + { + } + /** + * Create a default component slug from a WP page root_slug. + * + * Since 1.5, BP components get their root_slug (the slug used immediately + * following the root domain) from the slug of a corresponding WP page. + * + * E.g. if your BP installation at example.com has its members page at + * example.com/community/people, $bp->members->root_slug will be + * 'community/people'. + * + * By default, this function creates a shorter version of the root_slug for + * use elsewhere in the URL, by returning the content after the final '/' + * in the root_slug ('people' in the example above). + * + * Filter on 'bp_core_component_slug_from_root_slug' to override this method + * in general, or define a specific component slug constant (e.g. + * BP_MEMBERS_SLUG) to override specific component slugs. + * + * @since 1.5.0 + * @deprecated 12.0.0 + * + * @param string $root_slug The root slug, which comes from $bp->pages->[component]->slug. + * @return string The short slug for use in the middle of URLs. + */ + function bp_core_component_slug_from_root_slug($root_slug) + { + } + /** + * Define the slug constants for the Members component. + * + * Handles the three slug constants used in the Members component - + * BP_MEMBERS_SLUG, BP_REGISTER_SLUG, and BP_ACTIVATION_SLUG. If these + * constants are not overridden in wp-config.php or bp-custom.php, they are + * defined here to match the slug of the corresponding WP pages. + * + * In general, fallback values are only used during initial BP page creation, + * when no slugs have been explicitly defined. + * + * @since 1.5.0 + * @deprecated 12.0.0 + */ + function bp_core_define_slugs() + { + } + /** + * Outputs the group creation numbered steps navbar + * + * @since 3.0.0 + * @deprecated 12.0.0 + */ + function bp_nouveau_group_creation_tabs() + { + } + /** + * Displays group header tabs. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_groups_header_tabs() + { + } + /** + * Output navigation tabs for a user Blogs page. + * + * Currently unused by BuddyPress. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_blogs_blog_tabs() + { + } + /** + * Dedicated filter to inform about BP components directory page states. + * + * @since 10.0.0 + * @deprecated 12.0.0 + * + * @param string[] $post_states An array of post display states. + * @param WP_Post $post The current post object. + */ + function bp_admin_display_directory_states($post_states = array(), $post = \null) + { + } + /** + * Should BuddyPress load Legacy Widgets? + * + * @since 10.0.0 + * @deprecated 12.0.0 + * + * @return bool False if BuddyPress shouldn't load Legacy Widgets. True otherwise. + */ + function bp_core_retain_legacy_widgets() + { + } + /** + * Checks whether BuddyPress should unhook Legacy Widget registrations. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_core_maybe_unhook_legacy_widgets() + { + } + /** + * Registers the Login widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_core_register_login_widget() + { + } + /** + * Register bp-core widgets. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_core_register_widgets() + { + } + /** + * Registers the Recent Posts Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_blogs_register_recent_posts_widget() + { + } + /** + * Register the widgets for the Blogs component. + * + * @deprecated 12.0.0 + */ + function bp_blogs_register_widgets() + { + } + /** + * Registers the Friends Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_friends_register_friends_widget() + { + } + /** + * Register the friends widget. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + function bp_friends_register_widgets() + { + } + /** + * Process AJAX pagination or filtering for the Friends widget. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + function bp_core_ajax_widget_friends() + { + } + /** + * Injects specific BuddyPress CSS classes into a widget sidebar. + * + * Helps to standardize styling of BuddyPress widgets within a theme that + * does not use dynamic CSS classes in their widget sidebar's 'before_widget' + * call. + * + * @since 2.4.0 + * @deprecated 12.0.0 + * @access private + * + * @global array $wp_registered_widgets Current registered widgets. + * + * @param array $params Current sidebar params. + * @return array + */ + function _bp_core_inject_bp_widget_css_class($params) + { + } + /** + * Registers the Groups Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_groups_register_groups_widget() + { + } + /** + * Register widgets for groups component. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function groups_register_widgets() + { + } + /** + * AJAX callback for the Groups List widget. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function groups_ajax_widget_groups_list() + { + } + /** + * Registers the Members Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_members_register_members_widget() + { + } + /** + * Registers the "Who's online?" Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_members_register_whos_online_widget() + { + } + /** + * Registers the "Recently Active" Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_members_register_recently_active_widget() + { + } + /** + * Register bp-members widgets. + * + * Previously, these widgets were registered in bp-core. + * + * @since 2.2.0 + * @deprecated 12.0.0 + */ + function bp_members_register_widgets() + { + } + /** + * AJAX request handler for Members widgets. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @see BP_Core_Members_Widget + */ + function bp_core_ajax_widget_members() + { + } + /** + * Registers the Sitewide Notices Legacy Widget. + * + * @since 10.0.0 + * @deprecated 12.0.0 + */ + function bp_messages_register_sitewide_notices_widget() + { + } + /** + * Register widgets for the Messages component. + * + * @since 1.9.0 + * @deprecated 12.0.0 + */ + function bp_messages_register_widgets() + { + } + /** + * Generate the HTML for a list of group moderators. + * + * No longer used. + * + * @deprecated 12.0.0 + * + * @param bool $admin_list + * @param bool $group + */ + function bp_group_mod_memberlist($admin_list = \false, $group = \false) + { + } + /** + * Output the activities title. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_activities_title() + { + } + /** + * Return the activities title. + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @global string $bp_activity_title + * + * @return string The activities title. + */ + function bp_get_activities_title() + { + } + /** + * {@internal Missing Description} + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_activities_no_activity() + { + } + /** + * {@internal Missing Description} + * + * @since 1.0.0 + * @deprecated 12.0.0 + * + * @global string $bp_activity_no_activity + * + * @return string + */ + function bp_get_activities_no_activity() + { + } + /** + * Get the 'bp_options_title' property from the BP global. + * + * Not currently used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_get_options_title() + { + } + /** + * Check to see if there is an options avatar. + * + * An options avatar is an avatar for something like a group, or a friend. + * Basically an avatar that appears in the sub nav options bar. + * + * @deprecated 12.0.0 + * + * @return bool $value Returns true if an options avatar has been set, otherwise false. + */ + function bp_has_options_avatar() + { + } + /** + * Output the options avatar. + * + * @deprecated 12.0.0 + */ + function bp_get_options_avatar() + { + } + /** + * Output a comment author's avatar. + * + * @deprecated 12.0.0 + */ + function bp_comment_author_avatar() + { + } + /** + * Output a post author's avatar. + * + * @deprecated 12.0.0 + */ + function bp_post_author_avatar() + { + } + /** + * Output the avatar cropper <img> markup. + * + * @deprecated 12.0.0 + */ + function bp_avatar_cropper() + { + } + /** + * Do the 'bp_styles' action, and call wp_print_styles(). + * + * @deprecated 12.0.0 + */ + function bp_styles() + { + } + /** + * Fire the 'bp_custom_profile_boxes' action. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_custom_profile_boxes() + { + } + /** + * Fire the 'bp_custom_profile_sidebar_boxes' action. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_custom_profile_sidebar_boxes() + { + } + /** + * Output whether blog signup is allowed. + * + * @deprecated 12.0.0 + */ + function bp_blog_signup_allowed() + { + } + /** + * Output a block of random friends. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_friends_random_friends() + { + } + /** + * Pull up a group of random members, and display some profile data about them. + * + * This function is no longer used by BuddyPress core. + * + * @deprecated 12.0.0 + * + * @param int $total_members The number of members to retrieve. + */ + function bp_friends_random_members($total_members = 5) + { + } + /** + * Display a Friends search form. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_friend_search_form() + { + } + /** + * Output the permalink of a group's Members page. + * + * @since 1.0.0 + * @since 10.0.0 Added the `$group` parameter. + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + */ + function bp_group_all_members_permalink($group = \false) + { + } + /** + * Return the permalink of the Members page of a group. + * + * @since 1.0.0 + * @since 10.0.0 Updated to use `bp_get_group`. + * @deprecated 12.0.0 + * + * @param false|int|string|BP_Groups_Group $group (Optional) The Group ID, the Group Slug or the Group object. + * Default: false. + * @return string + */ + function bp_get_group_all_members_permalink($group = \false) + { + } + /** + * Display a Groups search form. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + */ + function bp_group_search_form() + { + } + /** + * Determine whether the displayed user has no groups. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + * + * @return bool True if the displayed user has no groups, otherwise false. + */ + function bp_group_show_no_groups_message() + { + } + /** + * Determine whether the current page is a group activity permalink. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + * + * @return bool True if this is a group activity permalink, otherwise false. + */ + function bp_group_is_activity_permalink() + { + } + /** + * Displays group filter titles. + * + * @since 1.0.0 + * @deprecated 12.0.0 + */ + function bp_groups_filter_title() + { + } + /** + * Return the ID of a user, based on user_login. + * + * No longer used. + * + * @deprecated 12.0.0 + * + * @param string $user_login user_login of the user being queried. + * @return int + */ + function bp_core_get_displayed_userid($user_login) + { + } + /** + * Fetch every post that is authored by the given user for the current blog. + * + * No longer used in BuddyPress. + * + * @deprecated 12.0.0 + * + * @param int $user_id ID of the user being queried. + * @return array Post IDs. + */ + function bp_core_get_all_posts_for_user($user_id = 0) + { + } + /** + * Repair user last_activity data. + * + * Re-runs the migration from usermeta introduced in BP 2.0. + * + * @since 2.0.0 + * @deprecated 12.4.0 + */ + function bp_admin_repair_last_activity() + { + } + /** + * Format 'new_avatar' activity actions. + * + * @since 2.0.0 + * @deprecated 8.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity object. + * @return string + */ + function bp_xprofile_format_activity_action_new_avatar($action, $activity) + { + } + /** + * Adds an activity stream item when a user has uploaded a new avatar. + * + * @since 1.0.0 + * @since 2.3.4 Add new parameter to get the user id the avatar was set for. + * @deprecated 8.0.0 + * + * @param int $user_id The user id the avatar was set for. + * @return bool + */ + function bp_xprofile_new_avatar_activity($user_id = 0) + { + } + /** + * Should the old BuddyBar be forced in place of the WP admin bar? + * + * We deprecated the BuddyBar in v2.1.0, but have completely removed it in + * v8.0. + * + * @since 1.6.0 + * @deprecated 8.0.0 + * + * @return bool + */ + function bp_force_buddybar() + { + } + /** + * Replace default WordPress avatars with BP avatars, if available. + * + * See 'get_avatar' filter description in wp-includes/pluggable.php. + * + * @since 1.1.0 + * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0. + * + * @param string $avatar The avatar path passed to 'get_avatar'. + * @param int|string|object $user A user ID, email address, or comment object. + * @param int $size Size of the avatar image ('thumb' or 'full'). + * @param string $default URL to a default image to use if no avatar is available. + * @param string $alt Alternate text to use in image tag. Default: ''. + * @param array $args Arguments passed to get_avatar_data(), after processing. + * @return string BP avatar path, if found; else the original avatar path. + */ + function bp_core_fetch_avatar_filter($avatar, $user, $size, $default, $alt = '', $args = array()) + { + } + /** + * Select the right `block_editor_settings` filter according to WP version. + * + * @since 8.0.0 + * @deprecated 14.0.0 + */ + function bp_block_init_editor_settings_filter() + { + } + /** + * Select the right `block_categories` filter according to WP version. + * + * @since 8.0.0 + * @since 12.0.0 This category is left for third party plugin but not used anymmore. + * @deprecated 14.0.0 + */ + function bp_block_init_category_filter() + { + } + /** + * Should we use the WP Toolbar? + * + * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as + * of BP 1.5. For BP 1.6, the WP Toolbar is the default. + * + * @since 1.5.0 + * @deprecated 14.0.0 + * + * @return bool Default: true. False when WP Toolbar support is disabled. + */ + function bp_use_wp_admin_bar() + { + } + /** + * In emails editor, add notice linking to token documentation on Codex. + * + * @since 2.5.0 + * @deprecated 14.0.0 + */ + function bp_admin_email_add_codex_notice() + { + } + /** + * Handle save/update of screen options for the Activity component admin screen. + * + * @since 1.6.0 + * @deprecated 14.0.0 + * + * @param string $value Will always be false unless another plugin filters it first. + * @param string $option Screen option name. + * @param string $new_value Screen option form value. + * @return string|int Option value. False to abandon update. + */ + function bp_activity_admin_screen_options($value, $option, $new_value) + { + } + /** + * Handle save/update of screen options for the Groups component admin screen. + * + * @since 1.7.0 + * @deprecated 14.0.0 + * + * @param string $value Will always be false unless another plugin filters it first. + * @param string $option Screen option name. + * @param string $new_value Screen option form value. + * @return string|int Option value. False to abandon update. + */ + function bp_groups_admin_screen_options($value, $option, $new_value) + { + } + /** + * Determines whether the current installation is running PHP 5.3 or greater. + * + * BuddyPress 2.8 introduces a minimum PHP requirement of PHP 5.3. + * + * @since 2.7.0 + * @deprecated 2.8.0 + * + * @return bool + */ + function bp_core_admin_is_running_php53_or_greater() + { + } + /** + * Replaces WP's default update notice on plugins.php with an error message, when site is not running PHP 5.3 or greater. + * + * Originally hooked to 'load-plugins.php' with priority 100. + * + * @since 2.7.0 + * @deprecated 2.8.0 + */ + function bp_core_admin_maybe_disable_update_row_for_php53_requirement() + { + } + /** + * On the "Dashboard > Updates" page, remove BuddyPress from plugins list if PHP < 5.3. + * + * Originally hooked to 'load-update-core.php'. + * + * @since 2.7.0 + * @deprecated 2.8.0 + */ + function bp_core_admin_maybe_remove_from_update_core() + { + } + /** + * Filter callback to remove BuddyPress from the update plugins list. + * + * Attached to the 'site_transient_update_plugins' filter. + * + * @since 2.7.0 + * @deprecated 2.8.0 + * + * @param object $retval Object of plugin update data. + * @return object + */ + function bp_core_admin_remove_buddypress_from_update_transient($retval) + { + } + /** + * Outputs a replacement for WP's default update notice, when site is not running PHP 5.3 or greater. + * + * When we see that a site is not running PHP 5.3 and is trying to update to + * BP 2.8+, we replace WP's default notice with our own, which both provides a + * link to our documentation of the requirement, and removes the link that + * allows a single plugin to be updated. + * + * @since 2.7.0 + * @deprecated 2.8.0 + * + * @param string $file Plugin filename. buddypress/bp-loader.php. + * @param array $plugin_data Data about the BuddyPress plugin, as returned by the + * plugins API. + */ + function bp_core_admin_php52_plugin_row($file, $plugin_data) + { + } + /** + * Add an admin notice to installations that are not running PHP 5.3+. + * + * @since 2.7.0 + * @deprecated 2.8.0 + */ + function bp_core_admin_php53_admin_notice() + { + } + /** + * Catch the arguments for buttons + * + * @since 3.0.0 + * @deprecated 11.0.0 + * + * @param array $buttons The arguments of the button that BuddyPress is about to create. + * + * @return array An empty array to stop the button creation process. + */ + function bp_nouveau_members_catch_button_args($button = array()) + { + } + /** + * Catch the arguments for buttons + * + * @since 3.0.0 + * @deprecated 11.0.0 + * + * @param array $button The arguments of the button that BuddyPress is about to create. + * + * @return array An empty array to stop the button creation process. + */ + function bp_nouveau_groups_catch_button_args($button = array()) + { + } + /** + * Catch the arguments for buttons + * + * @since 3.0.0 + * @deprecated 11.0.0 + * + * @param array $buttons The arguments of the button that BuddyPress is about to create. + * + * @return array An empty array to stop the button creation process. + */ + function bp_nouveau_blogs_catch_button_args($button = array()) + { + } + /** + * Returns a file's mime type. + * + * @since 10.2.0 + * @deprecated 11.0.0 replaced by `bp_attachments_get_mime_type()` + * + * @param string $file Absolute path of a file or directory. + * @return false|string False if the mime type is not supported by WordPress. + * The mime type of a file or 'directory' for a directory. + */ + function bp_attachements_get_mime_type($file = '') + { + } + /** + * Return moment.js config. + * + * @since 2.7.0 + * @deprecated 11.0.0 + */ + function bp_core_moment_js_config() + { + } + /** + * Add a notification for a specific user, from a specific component. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_add_notification() instead. + * + * @since 1.0.0 + * @param string $item_id + * @param int $user_id + * @param string $component_name + * @param string $component_action + * @param int $secondary_item_id + * @param false|string $date_notified + * @param int $is_new + * @return int|bool True on success, false on failure. + */ + function bp_core_add_notification($item_id, $user_id, $component_name, $component_action, $secondary_item_id = 0, $date_notified = \false, $is_new = 1) + { + } + /** + * Delete a specific notification by its ID. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_delete_notification() instead. + * + * @since 1.0.0 + * + * @param int $id ID of notification. + * @return false|integer True on success, false on failure. + */ + function bp_core_delete_notification($id) + { + } + /** + * Get a specific notification by its ID. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_get_notification() instead. + * + * @since 1.0.0 + * @param int $id ID of notification. + * @return false|BP_Core_Notification + */ + function bp_core_get_notification($id) + { + } + /** + * Get notifications for a specific user. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_get_notifications_for_user() instead. + * + * @since 1.0.0 + * @param int $user_id ID of user. + * @param string $format + * @return bool Object or array on success, false on failure. + */ + function bp_core_get_notifications_for_user($user_id, $format = 'string') + { + } + /** Delete ********************************************************************/ + /** + * Delete notifications for a user by type. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_delete_notifications_by_type() instead. + * + * @since 1.0.0 + * @param int $user_id + * @param string $component_name + * @param string $component_action + * @return false|int True on success, false on failure. + */ + function bp_core_delete_notifications_by_type($user_id, $component_name, $component_action) + { + } + /** + * Delete notifications for an item ID. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_delete_notifications_by_item_id() instead. + * + * @since 1.0.0 + * + * @param int $user_id + * @param string $component_name + * @param string $component_action + * @return false|int True on success, false on failure. + */ + function bp_core_delete_notifications_by_item_id($user_id, $item_id, $component_name, $component_action, $secondary_item_id = \false) + { + } + /** + * Delete all notifications for by type. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_delete_all_notifications_by_type() instead. + * + * @since 1.0.0 + * + * @param int $user_id + * @param string $component_name + * @param false|string $component_action + * @return bool + */ + function bp_core_delete_all_notifications_by_type($item_id, $component_name, $component_action = \false, $secondary_item_id = \false) + { + } + /** + * Delete all notifications for a user. + * + * Used when clearing out all notifications for a user, when deleted or spammed. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_delete_notifications_from_user() instead. + * + * @since 1.0.0 + * @param int $user_id + * @param string $component_name + * @param string $component_action + * @return false|int True on success, false on failure. + */ + function bp_core_delete_notifications_from_user($user_id, $component_name, $component_action) + { + } + /** Helpers *******************************************************************/ + /** + * Check if a user has access to a specific notification. + * + * Used before deleting a notification for a user. + * + * @deprecated Deprecated since BuddyPress 1.9.0. Use + * bp_notifications_check_notification_access() instead. + * + * @since 1.0.0 + * @param int $user_id + * @param int $notification_id + * @return bool + */ + function bp_core_check_notification_access($user_id, $notification_id) + { + } + /** + * Get user URL. + * + * @since 5.0.0 + * @deprecated 9.0.0 + * + * @param int $user_id User ID. + * @return string + */ + function bp_rest_get_user_url($user_id) + { + } + /** + * Slurp up metadata for a set of notifications. + * + * It grabs all notification meta associated with all of the notifications + * passed in $notification_ids and adds it to WP cache. This improves efficiency + * when using notification meta within a loop context. + * + * @since 2.3.0 + * + * @param int|string|array|bool $notification_ids Accepts a single notification_id, or a + * comma-separated list or array of + * notification ids. + */ + function bp_notifications_update_meta_cache($notification_ids = \false) + { + } + /** + * Clear all notifications cache for a given user ID. + * + * @since 2.3.0 + * + * @param int $user_id The user ID's cache to clear. + */ + function bp_notifications_clear_all_for_user_cache($user_id = 0) + { + } + /** + * Invalidate 'all_for_user_' cache when saving. + * + * @since 2.0.0 + * + * @param BP_Notifications_Notification $notification Notification object. + */ + function bp_notifications_clear_all_for_user_cache_after_save($notification) + { + } + /** + * Invalidate the 'all_for_user_' cache when deleting. + * + * @since 2.0.0 + * + * @param int $args Notification deletion arguments. + */ + function bp_notifications_clear_all_for_user_cache_before_delete($args) + { + } + /** + * Invalidates 'all_for_user_' cache when updating. + * + * @since 2.3.0 + * + * @param array $update_args See BP_Notifications_Notification::update() for description. + * @param array $where_args See BP_Notifications_Notification::update() for description. + */ + function bp_notifications_clear_all_for_user_cache_before_update($update_args, $where_args) + { + } + /** + * Set up the bp-notifications component. + * + * @since 1.9.0 + */ + function bp_setup_notifications() + { + } + /** + * Notifications: User's "Notifications" screen handler. + * + * @package BuddyPress + * @subpackage NotificationsScreens + * @since 3.0.0 + */ + /** + * Catch and route the 'unread' notifications screen. + * + * @since 1.9.0 + */ + function bp_notifications_screen_unread() + { + } + /** + * Handle marking single notifications as read. + * + * @since 1.9.0 + */ + function bp_notifications_action_mark_read() + { + } + /** + * Notifications: User's "Notifications > Read" screen handler. + * + * @package BuddyPress + * @subpackage NotificationsScreens + * @since 3.0.0 + */ + /** + * Catch and route the 'read' notifications screen. + * + * @since 1.9.0 + */ + function bp_notifications_screen_read() + { + } + /** + * Handle marking single notifications as unread. + * + * @since 1.9.0 + */ + function bp_notifications_action_mark_unread() + { + } + /** + * Build the "Notifications" dropdown. + * + * @since 1.9.0 + * + * @global WP_Admin_Bar $wp_admin_bar The WordPress object implementing a Toolbar API. + * + * @return bool + */ + function bp_notifications_toolbar_menu() + { + } + /** + * Output the notifications component slug. + * + * @since 1.9.0 + */ + function bp_notifications_slug() + { + } + /** + * Return the notifications component slug. + * + * @since 1.9.0 + * + * @return string Slug of the Notifications component. + */ + function bp_get_notifications_slug() + { + } + /** + * Output the notifications permalink for a user. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_notifications_permalink($user_id = 0) + { + } + /** + * Return the notifications permalink. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string Notifications permalink. + */ + function bp_get_notifications_permalink($user_id = 0) + { + } + /** + * Output the unread notifications permalink for a user. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_notifications_unread_permalink($user_id = 0) + { + } + /** + * Return the unread notifications permalink. + * + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string Unread notifications permalink. + */ + function bp_get_notifications_unread_permalink($user_id = 0) + { + } + /** + * Output the read notifications permalink for a user. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_notifications_read_permalink($user_id = 0) + { + } + /** + * Return the read notifications permalink. + * + * @since 1.9.0 + * + * @return string Read notifications permalink. + */ + function bp_get_notifications_read_permalink($user_id = 0) + { + } + /** The Loop ******************************************************************/ + /** + * Initialize the notifications loop. + * + * Based on the $args passed, bp_has_notifications() populates + * buddypress()->notifications->query_loop global, enabling the use of BP + * templates and template functions to display a list of notifications. + * + * @since 1.9.0 + * + * @param array|string $args { + * Arguments for limiting the contents of the notifications loop. Can be + * passed as an associative array, or as a URL query string. + * + * See {@link BP_Notifications_Notification::get()} for detailed + * information on the arguments. In addition, also supports: + * + * @type int $max Optional. Max items to display. Default: false. + * @type string $page_arg URL argument to use for pagination. + * Default: 'npage'. + * } + * @return bool + */ + function bp_has_notifications($args = '') + { + } + /** + * Get the notifications returned by the template loop. + * + * @since 1.9.0 + * + * @return array List of notifications. + */ + function bp_the_notifications() + { + } + /** + * Get the current notification object in the loop. + * + * @since 1.9.0 + * + * @return object The current notification within the loop. + */ + function bp_the_notification() + { + } + /** Loop Output ***************************************************************/ + /** + * Output the ID of the notification currently being iterated on. + * + * @since 1.9.0 + */ + function bp_the_notification_id() + { + } + /** + * Return the ID of the notification currently being iterated on. + * + * @since 1.9.0 + * + * @return int ID of the current notification. + */ + function bp_get_the_notification_id() + { + } + /** + * Output the associated item ID of the notification currently being iterated on. + * + * @since 1.9.0 + */ + function bp_the_notification_item_id() + { + } + /** + * Return the associated item ID of the notification currently being iterated on. + * + * @since 1.9.0 + * + * @return int ID of the item associated with the current notification. + */ + function bp_get_the_notification_item_id() + { + } + /** + * Output the secondary associated item ID of the notification currently being iterated on. + * + * @since 1.9.0 + */ + function bp_the_notification_secondary_item_id() + { + } + /** + * Return the secondary associated item ID of the notification currently being iterated on. + * + * @since 1.9.0 + * + * @return int ID of the secondary item associated with the current notification. + */ + function bp_get_the_notification_secondary_item_id() + { + } + /** + * Output the name of the component associated with the notification currently being iterated on. + * + * @since 1.9.0 + */ + function bp_the_notification_component_name() + { + } + /** + * Return the name of the component associated with the notification currently being iterated on. + * + * @since 1.9.0 + * + * @return int Name of the component associated with the current notification. + */ + function bp_get_the_notification_component_name() + { + } + /** + * Output the name of the action associated with the notification currently being iterated on. + * + * @since 1.9.0 + */ + function bp_the_notification_component_action() + { + } + /** + * Return the name of the action associated with the notification currently being iterated on. + * + * @since 1.9.0 + * + * @return string Name of the action associated with the current notification. + */ + function bp_get_the_notification_component_action() + { + } + /** + * Output the timestamp of the current notification. + * + * @since 1.9.0 + */ + function bp_the_notification_date_notified() + { + } + /** + * Return the timestamp of the current notification. + * + * @since 1.9.0 + * + * @return string Timestamp of the current notification. + */ + function bp_get_the_notification_date_notified() + { + } + /** + * Output the timestamp of the current notification. + * + * @since 1.9.0 + */ + function bp_the_notification_time_since() + { + } + /** + * Return the timestamp of the current notification. + * + * @since 1.9.0 + * + * @return string Timestamp of the current notification. + */ + function bp_get_the_notification_time_since() + { + } + /** + * Output full-text description for a specific notification. + * + * @since 1.9.0 + */ + function bp_the_notification_description() + { + } + /** + * Get full-text description for a specific notification. + * + * @since 1.9.0 + * + * @return string + */ + function bp_get_the_notification_description() + { + } + /** + * Output the mark read link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_mark_read_link($user_id = 0) + { + } + /** + * Return the mark read link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_mark_read_link($user_id = 0) + { + } + /** + * Output the URL used for marking a single notification as read. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_mark_read_url($user_id = 0) + { + } + /** + * Return the URL used for marking a single notification as read. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_mark_read_url($user_id = 0) + { + } + /** + * Output the mark unread link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_mark_unread_link($user_id = 0) + { + } + /** + * Return the mark unread link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_mark_unread_link($user_id = 0) + { + } + /** + * Output the URL used for marking a single notification as unread. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_mark_unread_url($user_id = 0) + { + } + /** + * Return the URL used for marking a single notification as unread. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_mark_unread_url($user_id = 0) + { + } + /** + * Output the mark link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_mark_link($user_id = 0) + { + } + /** + * Return the mark link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_mark_link($user_id = 0) + { + } + /** + * Output the delete link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_delete_link($user_id = 0) + { + } + /** + * Return the delete link for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_delete_link($user_id = 0) + { + } + /** + * Output the URL used for deleting a single notification. + * + * Since this function directly outputs a URL, it is escaped. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + */ + function bp_the_notification_delete_url($user_id = 0) + { + } + /** + * Return the URL used for deleting a single notification. + * + * @since 2.1.0 + * @since 2.6.0 Added $user_id as a parameter. + * + * @param int $user_id The user ID. + * @return string + */ + function bp_get_the_notification_delete_url($user_id = 0) + { + } + /** + * Output the action links for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter to $args. + * + * @param array|string $args Array of arguments. + */ + function bp_the_notification_action_links($args = '') + { + } + /** + * Return the action links for the current notification. + * + * @since 1.9.0 + * @since 2.6.0 Added $user_id as a parameter to $args. + * + * @param array|string $args { + * @type string $before HTML before the links. + * @type string $after HTML after the links. + * @type string $sep HTML between the links. + * @type array $links Array of links to implode by 'sep'. + * @type int $user_id User ID to fetch action links for. Defaults to displayed user ID. + * } + * @return string HTML links for actions to take on single notifications. + */ + function bp_get_the_notification_action_links($args = '') + { + } + /** + * Output the pagination count for the current notification loop. + * + * @since 1.9.0 + */ + function bp_notifications_pagination_count() + { + } + /** + * Return the pagination count for the current notification loop. + * + * @since 1.9.0 + * + * @return string HTML for the pagination count. + */ + function bp_get_notifications_pagination_count() + { + } + /** + * Output the pagination links for the current notification loop. + * + * @since 1.9.0 + */ + function bp_notifications_pagination_links() + { + } + /** + * Return the pagination links for the current notification loop. + * + * @since 1.9.0 + * + * @return string HTML for the pagination links. + */ + function bp_get_notifications_pagination_links() + { + } + /** Form Helpers **************************************************************/ + /** + * Output the form for changing the sort order of notifications. + * + * @since 1.9.0 + */ + function bp_notifications_sort_order_form() + { + } + /** + * Output the dropdown for bulk management of notifications. + * + * @since 2.2.0 + */ + function bp_notifications_bulk_management_dropdown() + { + } + /** + * Register Notifications personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_register_notifications_personal_data_exporter($exporters) + { + } + /** + * Notifications: Bulk-manage action handler. + * + * @package BuddyPress + * @subpackage NotificationsActions + * @since 3.0.0 + */ + /** + * Handles bulk management (mark as read/unread, delete) of notifications. + * + * @since 2.2.0 + */ + function bp_notifications_action_bulk_manage() + { + } + /** + * Notifications: Delete action handler. + * + * @package BuddyPress + * @subpackage NotificationsActions + * @since 3.0.0 + */ + /** + * Handle deleting single notifications. + * + * @since 1.9.0 + * + * @return bool + */ + function bp_notifications_action_delete() + { + } + /** + * Add a notification for a specific user, from a specific component. + * + * @since 1.9.0 + * + * @param array $args { + * Array of arguments describing the notification. All are optional. + * @type int $user_id ID of the user to associate the notification with. + * @type int $item_id ID of the item to associate the notification with. + * @type int $secondary_item_id ID of the secondary item to associate the + * notification with. + * @type string $component_name Name of the component to associate the + * notification with. + * @type string $component_action Name of the action to associate the + * notification with. + * @type string $date_notified Timestamp for the notification. + * } + * @return int|bool ID of the newly created notification on success, false on failure. + */ + function bp_notifications_add_notification($args = array()) + { + } + /** + * Get a specific notification by its ID. + * + * @since 1.9.0 + * + * @param int $id ID of the notification. + * @return BP_Notifications_Notification Notification object for ID specified. + */ + function bp_notifications_get_notification($id) + { + } + /** + * Delete a specific notification by its ID. + * + * @since 1.9.0 + * + * @param int $id ID of the notification to delete. + * @return false|int Integer on success, false on failure. + */ + function bp_notifications_delete_notification($id) + { + } + /** + * Mark notification read/unread for a user by ID. + * + * Used when clearing out notifications for a specific notification item. + * + * @since 1.9.0 + * + * @param int $id ID of the notification. + * @param int|bool $is_new 0 for read, 1 for unread. + * @return false|int Number of rows updated on success, false on failure. + */ + function bp_notifications_mark_notification($id, $is_new = \false) + { + } + /** + * Get all notifications for a user and cache them. + * + * @since 2.1.0 + * + * @param int $user_id ID of the user whose notifications are being fetched. + * @return array $notifications Array of notifications for user. + */ + function bp_notifications_get_all_notifications_for_user($user_id = 0) + { + } + /** + * Get a user's unread notifications, grouped by component and action. + * + * This function returns a list of notifications collapsed by component + action. + * See BP_Notifications_Notification::get_grouped_notifications_for_user() for + * more details. + * + * @since 3.0.0 + * + * @param int $user_id ID of the user whose notifications are being fetched. + * @return array $notifications + */ + function bp_notifications_get_grouped_notifications_for_user($user_id = 0) + { + } + /** + * Get notifications for a specific user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being fetched. + * @param string $format Format of the returned values. 'string' returns HTML, + * while 'object' returns a structured object for parsing. + * @return mixed Object or array on success, false on failure. + */ + function bp_notifications_get_notifications_for_user($user_id, $format = 'string') + { + } + /** Delete ********************************************************************/ + /** + * Delete notifications for a user by type. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @return int|false True on success, false on failure. + */ + function bp_notifications_delete_notifications_by_type($user_id, $component_name, $component_action) + { + } + /** + * Delete notifications for an item ID. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int $item_id ID of the associated item. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $secondary_item_id ID of the secondary associated item. + * @return int|false True on success, false on failure. + */ + function bp_notifications_delete_notifications_by_item_id($user_id, $item_id, $component_name, $component_action, $secondary_item_id = \false) + { + } + /** + * Delete notifications by notification ids. + * + * @since 10.0.0 + * + * @param int[] $ids IDs of the associated notifications. + * @return int|false The number of rows updated. False on error. + */ + function bp_notifications_delete_notifications_by_ids($ids) + { + } + /** + * Delete notifications by item ids and user. + * + * @since 10.0.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int[] $item_ids IDs of the associated items. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @return int|false The number of rows updated. False on error. + */ + function bp_notifications_delete_notifications_by_item_ids($user_id, $item_ids, $component_name, $component_action) + { + } + /** + * Delete all notifications by type. + * + * Used when clearing out notifications for an entire component. + * + * @since 1.9.0 + * + * @param int $item_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string|bool $component_action Optional. Name of the associated action. + * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. + * @return int|false True on success, false on failure. + */ + function bp_notifications_delete_all_notifications_by_type($item_id, $component_name, $component_action = \false, $secondary_item_id = \false) + { + } + /** + * Delete all notifications from a user. + * + * Used when clearing out all notifications for a user, when deleted or spammed. + * + * @todo This function assumes that items with the user_id in the item_id slot + * are associated with that user. However, this will only be true with + * certain components (such as Friends). Use with caution! + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose associated items are being deleted. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @return int|false True on success, false on failure. + */ + function bp_notifications_delete_notifications_from_user($user_id, $component_name, $component_action) + { + } + /** + * Delete a user's notifications when the user is deleted. + * + * @since 2.5.0 + * + * @param int $user_id ID of the user who is about to be deleted. + * @return int|false The number of rows deleted, or false on error. + */ + function bp_notifications_delete_notifications_on_user_delete($user_id) + { + } + /** + * Deletes user notifications data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_notifications_delete_notifications_on_delete_user($user_id) + { + } + /** Mark **********************************************************************/ + /** + * Mark notifications read/unread for a user by type. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $is_new 0 for read, 1 for unread. + * @return int|false True on success, false on failure. + */ + function bp_notifications_mark_notifications_by_type($user_id, $component_name, $component_action, $is_new = \false) + { + } + /** + * Mark notifications read/unread for an item ID. + * + * Used when clearing out notifications for a specific component when the user + * has visited that component. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int $item_id ID of the associated item. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $secondary_item_id ID of the secondary associated item. + * @param int|bool $is_new 0 for read, 1 for unread. + * @return int|false True on success, false on failure. + */ + function bp_notifications_mark_notifications_by_item_id($user_id, $item_id, $component_name, $component_action, $secondary_item_id = \false, $is_new = \false) + { + } + /** + * Mark all notifications read/unread by type. + * + * Used when clearing out notifications for an entire component. + * + * @since 1.9.0 + * + * @param int $item_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string|bool $component_action Optional. Name of the associated action. + * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. + * @param int|bool $is_new 0 for read, 1 for unread. + * @return int|false True on success, false on failure. + */ + function bp_notifications_mark_all_notifications_by_type($item_id, $component_name, $component_action = \false, $secondary_item_id = \false, $is_new = \false) + { + } + /** + * Mark all notifications read/unread from a user. + * + * Used when clearing out all notifications for a user, when deleted or spammed. + * + * @todo This function assumes that items with the user_id in the item_id slot + * are associated with that user. However, this will only be true with + * certain components (such as Friends). Use with caution! + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose associated items are being deleted. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $is_new 0 for read, 1 for unread. + * @return int|false True on success, false on failure. + */ + function bp_notifications_mark_notifications_from_user($user_id, $component_name, $component_action, $is_new = \false) + { + } + /** + * Mark notifications read/unread by item ids and user. + * + * @since 10.0.0 + * + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int[] $item_ids IDs of the associated items. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|false $is_new 0 for read, 1 for unread. + * @return int|false The number of rows updated. False on error. + */ + function bp_notifications_mark_notifications_by_item_ids($user_id, $item_ids, $component_name, $component_action, $is_new = \false) + { + } + /** + * Mark notifications read/unread by notification ids. + * + * @since 10.0.0 + * + * @param int[] $ids IDs of the associated notification items. + * @param int|false $is_new 0 for read, 1 for unread. + * @return int|false The number of rows updated. False on error. + */ + function bp_notifications_mark_notifications_by_ids($ids, $is_new = \false) + { + } + /** Helpers *******************************************************************/ + /** + * Check if a user has access to a specific notification. + * + * Used before deleting a notification for a user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user being checked. + * @param int $notification_id ID of the notification being checked. + * @return bool True if the notification belongs to the user, otherwise false. + */ + function bp_notifications_check_notification_access($user_id, $notification_id) + { + } + /** + * Get a count of unread notification items for a user. + * + * @since 1.9.0 + * + * @param int $user_id ID of the user whose unread notifications are being + * counted. + * @return int Unread notification count. + */ + function bp_notifications_get_unread_notification_count($user_id = 0) + { + } + /** + * Return an array of component names that are currently active and have + * registered Notifications callbacks. + * + * @since 1.9.1 + * + * @see http://buddypress.trac.wordpress.org/ticket/5300 + * + * @return array $component_names Array of registered components. + */ + function bp_notifications_get_registered_components() + { + } + /** + * Catch and route the 'settings' notifications screen. + * + * This is currently unused. + * + * @since 1.9.0 + */ + function bp_notifications_screen_settings() + { + } + /** Meta **********************************************************************/ + /** + * Delete a meta entry from the DB for a notification item. + * + * @since 2.3.0 + * + * @param int $notification_id ID of the notification item whose metadata is being deleted. + * @param string $meta_key Optional. The key of the metadata being deleted. If + * omitted, all metadata associated with the notification + * item will be deleted. + * @param string $meta_value Optional. If present, the metadata will only be + * deleted if the meta_value matches this parameter. + * @param bool $delete_all Optional. If true, delete matching metadata entries + * for all objects, ignoring the specified object_id. Otherwise, + * only delete matching metadata entries for the specified + * notification item. Default: false. + * @return bool True on success, false on failure. + */ + function bp_notifications_delete_meta($notification_id, $meta_key = '', $meta_value = '', $delete_all = \false) + { + } + /** + * Get metadata for a given notification item. + * + * @since 2.3.0 + * + * @param int $notification_id ID of the notification item whose metadata is being requested. + * @param string $meta_key Optional. If present, only the metadata matching + * that meta key will be returned. Otherwise, all metadata for the + * notification item will be fetched. + * @param bool $single Optional. If true, return only the first value of the + * specified meta_key. This parameter has no effect if meta_key is not + * specified. Default: true. + * @return mixed The meta value(s) being requested. + */ + function bp_notifications_get_meta($notification_id = 0, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of notification meta. + * + * @since 1.2.0 + * + * @param int $notification_id ID of the notification item whose metadata is being + * updated. + * @param string $meta_key Key of the metadata being updated. + * @param mixed $meta_value Value to be set. + * @param mixed $prev_value Optional. If specified, only update existing + * metadata entries with the specified value. + * Otherwise, update all entries. + * @return bool|int Returns false on failure. On successful + * update of existing metadata, returns true. On + * successful creation of new metadata, returns + * the integer ID of the new metadata row. + */ + function bp_notifications_update_meta($notification_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of notification metadata. + * + * @since 2.3.0 + * + * @param int $notification_id ID of the notification item. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @param bool $unique Optional. Whether to enforce a single metadata value + * for the given key. If true, and the object already has a value for + * the key, no change will be made. Default: false. + * @return int|bool The meta ID on successful update, false on failure. + */ + function bp_notifications_add_meta($notification_id, $meta_key, $meta_value, $unique = \false) + { + } + /** + * Finds and exports personal data associated with an email address from the Notifications tables. + * + * @since 4.0.0 + * + * @param string $email_address The users email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_notifications_personal_data_exporter($email_address, $page) + { + } + /** + * Loads Akismet filtering for activity. + * + * @since 1.6.0 + * @since 2.3.0 We only support Akismet 3+. + */ + function bp_activity_setup_akismet() + { + } + /** + * Delete old spam activity meta data. + * + * This is done as a clean-up mechanism, as _bp_akismet_submission meta can + * grow to be quite large. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + */ + function bp_activity_akismet_delete_old_metadata() + { + } + /** + * Check whether the $bp global lists an activity directory page. + * + * @since 1.5.0 + * + * @return bool True if activity directory page is found, otherwise false. + */ + function bp_activity_has_directory() + { + } + /** + * Are mentions enabled or disabled? + * + * The Mentions feature does a number of things, all of which will be turned + * off if you disable mentions: + * - Detecting and auto-linking @username in all BP/WP content. + * - Sending BP notifications and emails to users when they are mentioned + * using the @username syntax. + * - The Public Message button on user profiles. + * + * Mentions are enabled by default. To disable, put the following line in + * bp-custom.php or your theme's functions.php file: + * + * add_filter( 'bp_activity_do_mentions', '__return_false' ); + * + * @since 1.8.0 + * + * @return bool $retval True to enable mentions, false to disable. + */ + function bp_activity_do_mentions() + { + } + /** + * Should BuddyPress load the mentions scripts and related assets, including results to prime the + * mentions suggestions? + * + * @since 2.1.0 + * + * @return bool True if mentions scripts should be loaded. + */ + function bp_activity_maybe_load_mentions_scripts() + { + } + /** + * Locate usernames in an activity content string, as designated by an @ sign. + * + * @since 1.5.0 + * + * @param string $content The content of the activity, usually found in + * $activity->content. + * @return array|bool Associative array with user ID as key and username as + * value. Boolean false if no mentions found. + */ + function bp_activity_find_mentions($content) + { + } + /** + * Reset a user's unread mentions list and count. + * + * @since 1.5.0 + * + * @param int $user_id The id of the user whose unread mentions are being reset. + */ + function bp_activity_clear_new_mentions($user_id) + { + } + /** + * Adjusts mention count for mentioned users in activity items. + * + * This function is useful if you only have the activity ID handy and you + * haven't parsed an activity item for @mentions yet. + * + * Currently, only used in {@link bp_activity_delete()}. + * + * @since 1.5.0 + * + * @param int $activity_id The unique id for the activity item. + * @param string $action Can be 'delete' or 'add'. Defaults to 'add'. + * @return bool + */ + function bp_activity_adjust_mention_count($activity_id = 0, $action = 'add') + { + } + /** + * Update the mention count for a given user. + * + * This function should be used when you've already parsed your activity item + * for @mentions. + * + * @since 1.7.0 + * + * @param int $user_id The user ID. + * @param int $activity_id The unique ID for the activity item. + * @param string $action 'delete' or 'add'. Default: 'add'. + * @return bool + */ + function bp_activity_update_mention_count_for_user($user_id, $activity_id, $action = 'add') + { + } + /** + * Determine a user's "mentionname", the name used for that user in @-mentions. + * + * @since 1.9.0 + * + * @param int|string $user_id ID of the user to get @-mention name for. + * @return string $mentionname User name appropriate for @-mentions. + */ + function bp_activity_get_user_mentionname($user_id) + { + } + /** + * Get a user ID from a "mentionname", the name used for a user in @-mentions. + * + * @since 1.9.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param string $mentionname Username of user in @-mentions. + * @return int|bool ID of the user, if one is found. Otherwise false. + */ + function bp_activity_get_userid_from_mentionname($mentionname) + { + } + /** Actions ******************************************************************/ + /** + * Register an activity 'type' and its action description/callback. + * + * Activity actions are strings used to describe items in the activity stream, + * such as 'Joe became a registered member' or 'Bill and Susie are now + * friends'. Each activity type (such as 'new_member' or 'friendship_created') + * used by a component should be registered using this function. + * + * While it's possible to post items to the activity stream whose types are + * not registered using bp_activity_set_action(), it is not recommended; + * unregistered types will not be displayed properly in the activity admin + * panel, and dynamic action generation (which is essential for multilingual + * sites, etc) will not work. + * + * @since 1.1.0 + * + * @param string $component_id The unique string ID of the component. + * @param string $type The action type. + * @param string $description The action description. + * @param callable|bool $format_callback Callback for formatting the action string. + * @param string|bool $label String to describe this action in the activity stream filter dropdown. + * @param array $context Optional. Activity stream contexts where the filter should appear. + * Values: 'activity', 'member', 'member_groups', 'group'. + * @param int $position Optional. The position of the action when listed in dropdowns. + * @return bool False if any param is empty, otherwise true. + */ + function bp_activity_set_action($component_id, $type, $description, $format_callback = \false, $label = \false, $context = array(), $position = 0) + { + } + /** + * Set tracking arguments for a given post type. + * + * @since 2.2.0 + * + * @global array $wp_post_types + * + * @param string $post_type The name of the post type, as registered with WordPress. Eg 'post' or 'page'. + * @param array $args { + * An associative array of tracking parameters. All items are optional. + * @type string $bp_activity_admin_filter String to use in the Dashboard > Activity dropdown. + * @type string $bp_activity_front_filter String to use in the front-end dropdown. + * @type string $bp_activity_new_post String format to use for generating the activity action. Should be a + * translatable string where %1$s is replaced by a user link and %2$s is + * the URL of the newly created post. + * @type string $bp_activity_new_post_ms String format to use for generating the activity action on Multisite. + * Should be a translatable string where %1$s is replaced by a user link, + * %2$s is the URL of the newly created post, and %3$s is a link to + * the site. + * @type string $component_id ID of the BuddyPress component to associate the activity item. + * @type string $action_id Value for the 'type' param of the new activity item. + * @type callable $format_callback Callback for formatting the activity action string. + * Default: 'bp_activity_format_activity_action_custom_post_type_post'. + * @type array $contexts The directory contexts in which the filter will show. + * Default: array( 'activity' ). + * @type array $position Position of the item in filter dropdowns. + * @type string $singular Singular, translatable name of the post type item. If no value is + * provided, it's pulled from the 'singular_name' of the post type. + * @type bool $activity_comment Whether to allow comments on the activity items. Defaults to true if + * the post type does not natively support comments, otherwise false. + * } + * @return bool + */ + function bp_activity_set_post_type_tracking_args($post_type = '', $args = array()) + { + } + /** + * Get tracking arguments for a specific post type. + * + * @since 2.2.0 + * @since 2.5.0 Add post type comments tracking args + * + * @param string $post_type Name of the post type. + * @return object The tracking arguments of the post type. + */ + function bp_activity_get_post_type_tracking_args($post_type) + { + } + /** + * Get tracking arguments for all post types. + * + * @since 2.2.0 + * @since 2.5.0 Include post type comments tracking args if needed + * + * @return array List of post types with their tracking arguments. + */ + function bp_activity_get_post_types_tracking_args() + { + } + /** + * Gets the list of activity types name supporting the requested feature. + * + * This function is still a WIP, please don't use it into your plugins or themes. + * + * @since 10.0.0 + * + * @access private + * @todo `bp_activity_set_action()` should be improved to include a supports + * argument or best we should create a `bp_register_activity_type()` function + * to mimic the way WordPress registers post types. For now we'll use a non + * extendable workaround. + * + * @param string $feature The feature activity types should support. + * @return array The list of activity types name supporting the requested feature. + */ + function _bp_activity_get_types_by_support($feature = 'generated-content') + { + } + /** + * Check if the *Post Type* activity supports a specific feature. + * + * @since 2.5.0 + * + * @param string $activity_type The activity type to check. + * @param string $feature The feature to check. Currently supports: + * 'post-type-comment-tracking', 'post-type-comment-reply' & 'comment-reply'. + * See inline doc for more info. + * @return bool + */ + function bp_activity_type_supports($activity_type = '', $feature = '') + { + } + /** + * Get a specific tracking argument for a given activity type + * + * @since 2.5.0 + * + * @param string $activity_type the activity type. + * @param string $arg the key of the tracking argument. + * @return mixed the value of the tracking arg, false if not found. + */ + function bp_activity_post_type_get_tracking_arg($activity_type, $arg = '') + { + } + /** + * Get all components' activity actions, sorted by their position attribute. + * + * @since 2.2.0 + * + * @return object Actions ordered by their position. + */ + function bp_activity_get_actions() + { + } + /** + * Retrieve the current action from a component and key. + * + * @since 1.1.0 + * + * @param string $component_id The unique string ID of the component. + * @param string $key The action key. + * @return string|bool Action value if found, otherwise false. + */ + function bp_activity_get_action($component_id, $key) + { + } + /** + * Fetch details of all registered activity types. + * + * @since 1.7.0 + * + * @return array array( type => description ), ... + */ + function bp_activity_get_types() + { + } + /** + * Returns the list of available BuddyPress activity types. + * + * @since 9.0.0 + * + * @return array An array of activity type labels keyed by type names. + */ + function bp_activity_get_types_list() + { + } + /** + * Gets the current activity context. + * + * The "context" is the current view type, corresponding roughly to the + * current component. Use this context to determine which activity actions + * should be permitted in the filter dropdown. + * + * @since 2.8.0 + * + * @return string Activity context. 'member', 'member_groups', 'group', 'activity'. + */ + function bp_activity_get_current_context() + { + } + /** + * Gets a flat list of activity actions compatible with a given context. + * + * @since 2.8.0 + * + * @param string $context Optional. Name of the context. Defaults to the current context. + * @return array + */ + function bp_activity_get_actions_for_context($context = '') + { + } + /** Favorites ****************************************************************/ + /** + * Sanitize callback for the User's favorites meta. + * + * @since 12.0.0 + * + * @param array $value The list of favorited activity IDs. + * @return array The sanitized list of favorited activity IDs. + */ + function bp_activity_sanitize_user_favorites_meta($value = array()) + { + } + /** + * Use WordPress Meta API to deal with favorites meta properties and sanitization. + * + * @since 12.0.0 + */ + function bp_activity_register_user_favorites_meta() + { + } + /** + * Get a users favorite activity stream items. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose favorites are being queried. + * @return array IDs of the user's favorite activity items. + */ + function bp_activity_get_user_favorites($user_id = 0) + { + } + /** + * Add an activity stream item as a favorite for a user. + * + * @since 1.2.0 + * + * @param int $activity_id ID of the activity item being favorited. + * @param int $user_id ID of the user favoriting the activity item. + * @return bool + */ + function bp_activity_add_user_favorite($activity_id, $user_id = 0) + { + } + /** + * Remove an activity stream item as a favorite for a user. + * + * @since 1.2.0 + * + * @param int $activity_id ID of the activity item being unfavorited. + * @param int $user_id ID of the user unfavoriting the activity item. + * @return bool + */ + function bp_activity_remove_user_favorite($activity_id, $user_id = 0) + { + } + /** + * Check whether an activity item exists with a given content string. + * + * @since 1.1.0 + * + * @param string $content The content to filter by. + * @return int|null The ID of the located activity item. Null if none is found. + */ + function bp_activity_check_exists_by_content($content) + { + } + /** + * Retrieve the last time activity was updated. + * + * @since 1.0.0 + * + * @return string Date last updated. + */ + function bp_activity_get_last_updated() + { + } + /** + * Retrieve the number of favorite activity stream items a user has. + * + * @since 1.2.0 + * + * @param int $user_id ID of the user whose favorite count is being requested. + * @return int Total favorite count for the user. + */ + function bp_activity_total_favorites_for_user($user_id = 0) + { + } + /** Meta *********************************************************************/ + /** + * Delete a meta entry from the DB for an activity stream item. + * + * @since 1.2.0 + * + * @param int $activity_id ID of the activity item whose metadata is being deleted. + * @param string $meta_key Optional. The key of the metadata being deleted. If + * omitted, all metadata associated with the activity + * item will be deleted. + * @param string $meta_value Optional. If present, the metadata will only be + * deleted if the meta_value matches this parameter. + * @param bool $delete_all Optional. If true, delete matching metadata entries + * for all objects, ignoring the specified object_id. Otherwise, + * only delete matching metadata entries for the specified + * activity item. Default: false. + * @return bool + */ + function bp_activity_delete_meta($activity_id, $meta_key = '', $meta_value = '', $delete_all = \false) + { + } + /** + * Get metadata for a given activity item. + * + * @since 1.2.0 + * + * @param int $activity_id ID of the activity item whose metadata is being requested. + * @param string $meta_key Optional. If present, only the metadata matching + * that meta key will be returned. Otherwise, all metadata for the + * activity item will be fetched. + * @param bool $single Optional. If true, return only the first value of the + * specified meta_key. This parameter has no effect if meta_key is not + * specified. Default: true. + * @return mixed The meta value(s) being requested. + */ + function bp_activity_get_meta($activity_id = 0, $meta_key = '', $single = \true) + { + } + /** + * Update a piece of activity meta. + * + * @since 1.2.0 + * + * @param int $activity_id ID of the activity item whose metadata is being updated. + * @param string $meta_key Key of the metadata being updated. + * @param mixed $meta_value Value to be set. + * @param mixed $prev_value Optional. If specified, only update existing metadata entries + * with the specified value. Otherwise, update all entries. + * @return bool|int Returns false on failure. On successful update of existing + * metadata, returns true. On successful creation of new metadata, + * returns the integer ID of the new metadata row. + */ + function bp_activity_update_meta($activity_id, $meta_key, $meta_value, $prev_value = '') + { + } + /** + * Add a piece of activity metadata. + * + * @since 2.0.0 + * + * @param int $activity_id ID of the activity item. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @param bool $unique Optional. Whether to enforce a single metadata value for the + * given key. If true, and the object already has a value for + * the key, no change will be made. Default: false. + * @return int|bool The meta ID on successful update, false on failure. + */ + function bp_activity_add_meta($activity_id, $meta_key, $meta_value, $unique = \false) + { + } + /** Clean up *****************************************************************/ + /** + * Completely remove a user's activity data. + * + * @since 1.5.0 + * + * @param int $user_id ID of the user whose activity is being deleted. + * @return bool + */ + function bp_activity_remove_all_user_data($user_id = 0) + { + } + /** + * Deletes user activity data on the 'delete_user' hook. + * + * @since 6.0.0 + * + * @param int $user_id The ID of the deleted user. + */ + function bp_activity_remove_all_user_data_on_delete_user($user_id) + { + } + /** + * Mark all of the user's activity as spam. + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose activity is being spammed. + * @return bool + */ + function bp_activity_spam_all_user_data($user_id = 0) + { + } + /** + * Mark all of the user's activity as ham (not spam). + * + * @since 1.6.0 + * + * @global wpdb $wpdb WordPress database object. + * + * @param int $user_id ID of the user whose activity is being hammed. + * @return bool + */ + function bp_activity_ham_all_user_data($user_id = 0) + { + } + /** + * Allow core components and dependent plugins to register activity actions. + * + * @since 1.2.0 + */ + function bp_register_activity_actions() + { + } + /** + * Register the activity stream actions for updates. + * + * @since 1.6.0 + */ + function bp_activity_register_activity_actions() + { + } + /** + * Generate an activity action string for an activity item. + * + * @since 2.0.0 + * + * @param object $activity Activity data object. + * @return string|bool Returns false if no callback is found, otherwise returns + * the formatted action string. + */ + function bp_activity_generate_action_string($activity) + { + } + /** + * Format 'activity_update' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string $action + */ + function bp_activity_format_activity_action_activity_update($action, $activity) + { + } + /** + * Format 'activity_comment' activity actions. + * + * @since 2.0.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string $action + */ + function bp_activity_format_activity_action_activity_comment($action, $activity) + { + } + /** + * Format activity action strings for custom post types. + * + * @since 2.2.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string $action + */ + function bp_activity_format_activity_action_custom_post_type_post($action, $activity) + { + } + /** + * Format activity action strings for custom post types comments. + * + * @since 2.5.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * + * @return string + */ + function bp_activity_format_activity_action_custom_post_type_comment($action, $activity) + { + } + /* + * Business functions are where all the magic happens in BuddyPress. They will + * handle the actual saving or manipulation of information. Usually they will + * hand off to a database class for data access, then return + * true or false on success or failure. + */ + /** + * Retrieve an activity or activities. + * + * The bp_activity_get() function shares all arguments with BP_Activity_Activity::get(). + * The following is a list of bp_activity_get() parameters that have different + * default values from BP_Activity_Activity::get() (value in parentheses is + * the default for the bp_activity_get()). + * - 'per_page' (false) + * + * @since 1.2.0 + * @since 2.4.0 Introduced the `$fields` parameter. + * + * @see BP_Activity_Activity::get() For more information on accepted arguments + * and the format of the returned value. + * + * @param array|string $args See BP_Activity_Activity::get() for description. + * @return array $activity See BP_Activity_Activity::get() for description. + */ + function bp_activity_get($args = '') + { + } + /** + * Fetch specific activity items. + * + * @since 1.2.0 + * + * @see BP_Activity_Activity::get() For more information on accepted arguments. + * + * @param array|string $args { + * An array of arguments. + * All arguments and defaults are shared with BP_Activity_Activity::get(), + * except for the following: + * @type string|int|array Single activity ID, comma-separated list of IDs, + * or array of IDs. + * } + * @return array See BP_Activity_Activity::get() for description. + */ + function bp_activity_get_specific($args = '') + { + } + /** + * Add an activity item. + * + * @since 1.1.0 + * @since 2.6.0 Added 'error_type' parameter to $args. + * + * @param array|string $args { + * An array of arguments. + * @type int|bool $id Pass an activity ID to update an existing item, or + * false to create a new item. Default: false. + * @type string $action Optional. The activity action/description, typically + * something like "Joe posted an update". Values passed to this param + * will be stored in the database and used as a fallback for when the + * activity item's format_callback cannot be found (eg, when the + * component is disabled). As long as you have registered a + * format_callback for your $type, it is unnecessary to include this + * argument - BP will generate it automatically. + * See {@link bp_activity_set_action()}. + * @type string $content Optional. The content of the activity item. + * @type string $component The unique name of the component associated with + * the activity item - 'groups', 'profile', etc. + * @type string $type The specific activity type, used for directory + * filtering. 'new_blog_post', 'activity_update', etc. + * @type string $primary_link Optional. The URL for this item, as used in + * RSS feeds. Defaults to the URL for this activity + * item's permalink page. + * @type int|bool $user_id Optional. The ID of the user associated with the activity + * item. May be set to false or 0 if the item is not related + * to any user. Default: the ID of the currently logged-in user. + * @type int $item_id Optional. The ID of the associated item. + * @type int $secondary_item_id Optional. The ID of a secondary associated item. + * @type string $date_recorded Optional. The GMT time, in Y-m-d h:i:s format, when + * the item was recorded. Defaults to the current time. + * @type bool $hide_sitewide Should the item be hidden on sitewide streams? + * Default: false. + * @type bool $is_spam Should the item be marked as spam? Default: false. + * @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'. + * } + * @return WP_Error|bool|int The ID of the activity on success. False on error. + */ + function bp_activity_add($args = '') + { + } + /** + * Post an activity update. + * + * @since 1.2.0 + * + * @param array|string $args { + * An array of arguments. + * @type string $content The content of the activity update. + * @type int $user_id Optional. Defaults to the logged-in user. + * @type string $error_type Optional. Error type to return. Either 'bool' or 'wp_error'. Defaults to + * 'bool' for boolean. 'wp_error' will return a WP_Error object. + * } + * @return int|bool|WP_Error $activity_id The activity id on success. On failure, either boolean false or WP_Error + * object depending on the 'error_type' $args parameter. + */ + function bp_activity_post_update($args = '') + { + } + /** + * Create an activity item for a newly published post type post. + * + * @since 2.2.0 + * + * @param int $post_id ID of the new post. + * @param WP_Post|null $post Post object. + * @param int $user_id ID of the post author. + * @return null|WP_Error|bool|int The ID of the activity on success. False on error. + */ + function bp_activity_post_type_publish($post_id = 0, $post = \null, $user_id = 0) + { + } + /** + * Update the activity item for a custom post type entry. + * + * @since 2.2.0 + * + * @param WP_Post|null $post Post item. + * @return null|WP_Error|bool True on success, false on failure. + */ + function bp_activity_post_type_update($post = \null) + { + } + /** + * Unpublish an activity for the custom post type. + * + * @since 2.2.0 + * + * @param int $post_id ID of the post being unpublished. + * @param WP_Post|null $post Post object. + * @return bool + */ + function bp_activity_post_type_unpublish($post_id = 0, $post = \null) + { + } + /** + * Create an activity item for a newly posted post type comment. + * + * @since 2.5.0 + * + * @param int $comment_id ID of the comment. + * @param bool $is_approved Whether the comment is approved or not. + * @param object|null $activity_post_object The post type tracking args object. + * @return null|WP_Error|bool|int The ID of the activity on success. False on error. + */ + function bp_activity_post_type_comment($comment_id = 0, $is_approved = \true, $activity_post_object = \null) + { + } + /** + * Remove an activity item when a comment about a post type is deleted. + * + * @since 2.5.0 + * + * @param int $comment_id ID of the comment. + * @param object|null $activity_post_object The post type tracking args object. + * @return bool + */ + function bp_activity_post_type_remove_comment($comment_id = 0, $activity_post_object = \null) + { + } + /** + * Add an activity comment. + * + * @since 1.2.0 + * @since 2.5.0 Add a new possible parameter $skip_notification for the array of arguments. + * Add the $primary_link parameter for the array of arguments. + * @since 2.6.0 Added 'error_type' parameter to $args. + * + * @param array|string $args { + * An array of arguments. + * @type int $id Optional. Pass an ID to update an existing comment. + * @type string $content The content of the comment. + * @type int $user_id Optional. The ID of the user making the comment. + * Defaults to the ID of the logged-in user. + * @type int $activity_id The ID of the "root" activity item, ie the oldest + * ancestor of the comment. + * @type int $parent_id Optional. The ID of the parent activity item, ie the item to + * which the comment is an immediate reply. If not provided, + * this value defaults to the $activity_id. + * @type string $primary_link Optional. the primary link for the comment. + * Defaults to an empty string. + * @type bool $skip_notification Optional. false to send a comment notification, false otherwise. + * Defaults to false. + * @type string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'. + * } + * @return WP_Error|bool|int The ID of the comment on success, otherwise false. + */ + function bp_activity_new_comment($args = '') + { + } + /** + * Fetch the activity_id for an existing activity entry in the DB. + * + * @since 1.2.0 + * + * @see BP_Activity_Activity::get() For more information on accepted arguments. + * + * @param array|string $args See BP_Activity_Activity::get() for description. + * @return int $activity_id The ID of the activity item found. + */ + function bp_activity_get_activity_id($args = '') + { + } + /** + * Delete activity item(s). + * + * If you're looking to hook into one action that provides the ID(s) of + * the activity/activities deleted, then use: + * + * add_action( 'bp_activity_deleted_activities', 'my_function' ); + * + * The action passes one parameter that is a single activity ID or an + * array of activity IDs depending on the number deleted. + * + * If you are deleting an activity comment please use bp_activity_delete_comment(); + * + * @since 1.0.0 + * + * @see BP_Activity_Activity::get() For more information on accepted arguments. + * + * @param array|string $args To delete specific activity items, use + * $args = array( 'id' => $ids ); Otherwise, to use + * filters for item deletion, the argument format is + * the same as BP_Activity_Activity::get(). + * See that method for a description. + * @return bool + */ + function bp_activity_delete($args = '') + { + } + /** + * Delete an activity item by activity id. + * + * You should use bp_activity_delete() instead. + * + * @since 1.1.0 + * @deprecated 1.2.0 + * + * @param array|string $args See BP_Activity_Activity::get for a + * description of accepted arguments. + * @return bool + */ + function bp_activity_delete_by_item_id($args = '') + { + } + /** + * Delete an activity item by activity id. + * + * @since 1.1.0 + * + * + * @param int $activity_id ID of the activity item to be deleted. + * @return bool + */ + function bp_activity_delete_by_activity_id($activity_id) + { + } + /** + * Delete an activity item by its content. + * + * You should use bp_activity_delete() instead. + * + * @since 1.1.0 + * @deprecated 1.2.0 + * + * + * @param int $user_id The user id. + * @param string $content The activity id. + * @param string $component The activity component. + * @param string $type The activity type. + * @return bool + */ + function bp_activity_delete_by_content($user_id, $content, $component, $type) + { + } + /** + * Delete a user's activity for a component. + * + * You should use bp_activity_delete() instead. + * + * @since 1.1.0 + * @deprecated 1.2.0 + * + * + * @param int $user_id The user id. + * @param string $component The activity component. + * @return bool + */ + function bp_activity_delete_for_user_by_component($user_id, $component) + { + } + /** + * Delete an activity comment. + * + * @since 1.2.0 + * + * @todo Why is an activity id required? We could look this up. + * @todo Why do we encourage users to call this function directly? We could just + * as easily examine the activity type in bp_activity_delete() and then + * call this function with the proper arguments if necessary. + * + * @param int $activity_id The ID of the "root" activity, ie the comment's + * oldest ancestor. + * @param int $comment_id The ID of the comment to be deleted. + * @return bool + */ + function bp_activity_delete_comment($activity_id, $comment_id) + { + } + /** + * Delete an activity comment's children. + * + * @since 1.2.0 + * + * + * @param int $activity_id The ID of the "root" activity, ie the + * comment's oldest ancestor. + * @param int $comment_id The ID of the comment to be deleted. + */ + function bp_activity_delete_children($activity_id, $comment_id) + { + } + /** + * Get the permalink for a single activity item. + * + * When only the $activity_id param is passed, BP has to instantiate a new + * BP_Activity_Activity object. To save yourself some processing overhead, + * be sure to pass the full $activity_obj parameter as well, if you already + * have it available. + * + * @since 1.2.0 + * + * @param int $activity_id The unique id of the activity object. + * @param object|bool $activity_obj Optional. The activity object. + * @return string $link Permalink for the activity item. + */ + function bp_activity_get_permalink($activity_id, $activity_obj = \false) + { + } + /** + * Can a user see a particular activity item? + * + * @since 3.0.0 + * + * @param BP_Activity_Activity $activity Activity object. + * @param integer $user_id User ID. + * @return bool + */ + function bp_activity_user_can_read($activity, $user_id = 0) + { + } + /** + * Hide a user's activity. + * + * @since 1.2.0 + * + * @param int $user_id The ID of the user whose activity is being hidden. + * @return bool + */ + function bp_activity_hide_user_activity($user_id) + { + } + /** + * Take content, remove images, and replace them with a single thumbnail image. + * + * The format of items in the activity stream is such that we do not want to + * allow an arbitrary number of arbitrarily large images to be rendered. + * However, the activity stream is built to elegantly display a single + * thumbnail corresponding to the activity comment. This function looks + * through the content, grabs the first image and converts it to a thumbnail, + * and removes the rest of the images from the string. + * + * As of BuddyPress 2.3, this function is no longer in use. + * + * @since 1.2.0 + * + * @param string $content The content of the activity item. + * @param string|bool $link Optional. The unescaped URL that the image should link + * to. If absent, the image will not be a link. + * @param array|bool $args Optional. The args passed to the activity + * creation function (eg bp_blogs_record_activity()). + * @return string $content The content with images stripped and replaced with a + * single thumb. + */ + function bp_activity_thumbnail_content_images($content, $link = \false, $args = \false) + { + } + /** + * Gets the excerpt length for activity items. + * + * @since 2.8.0 + * + * @return int Character length for activity excerpts. + */ + function bp_activity_get_excerpt_length() + { + } + /** + * Create a rich summary of an activity item for the activity stream. + * + * More than just a simple excerpt, the summary could contain oEmbeds and other types of media. + * Currently, it's only used for blog post items, but it will probably be used for all types of + * activity in the future. + * + * @since 2.3.0 + * + * @param string $content The content of the activity item. + * @param array $activity The data passed to bp_activity_add() or the values + * from an Activity obj. + * @return string $summary + */ + function bp_activity_create_summary($content, $activity) + { + } + /** + * Fetch whether the current user is allowed to mark items as spam. + * + * @since 1.6.0 + * + * @return bool True if user is allowed to mark activity items as spam. + */ + function bp_activity_user_can_mark_spam() + { + } + /** + * Mark an activity item as spam. + * + * @since 1.6.0 + * + * @todo We should probably save $source to activity meta. + * + * @param BP_Activity_Activity $activity The activity item to be spammed. + * @param string $source Optional. Default is "by_a_person" (ie, a person has + * manually marked the activity as spam). BP core also + * accepts 'by_akismet'. + */ + function bp_activity_mark_as_spam(&$activity, $source = 'by_a_person') + { + } + /** + * Mark an activity item as ham. + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity item to be hammed. Passed by reference. + * @param string $source Optional. Default is "by_a_person" (ie, a person has + * manually marked the activity as spam). BP core also accepts + * 'by_akismet'. + */ + function bp_activity_mark_as_ham(&$activity, $source = 'by_a_person') + { + } + /* Emails *********************************************************************/ + /** + * Send email and BP notifications when a user is mentioned in an update. + * + * @since 1.2.0 + * + * @param int $activity_id The ID of the activity update. + * @param int $receiver_user_id The ID of the user who is receiving the update. + */ + function bp_activity_at_message_notification($activity_id, $receiver_user_id) + { + } + /** + * Send email and BP notifications when an activity item receives a comment. + * + * @since 1.2.0 + * @since 2.5.0 Updated to use new email APIs. + * + * @param int $comment_id The comment id. + * @param int $commenter_id The ID of the user who posted the comment. + * @param array $params {@link bp_activity_new_comment()}. + */ + function bp_activity_new_comment_notification($comment_id = 0, $commenter_id = 0, $params = array()) + { + } + /** + * Helper method to map action arguments to function parameters. + * + * @since 1.9.0 + * + * @param int $comment_id ID of the comment being notified about. + * @param array $params Parameters to use with notification. + */ + function bp_activity_new_comment_notification_helper($comment_id, $params) + { + } + /** Embeds *******************************************************************/ + /** + * Set up activity oEmbed cache during the activity loop. + * + * During an activity loop, this function sets up the hooks necessary to grab + * each item's embeds from the cache, or put them in the cache if they are + * not there yet. + * + * This does not cover recursive activity comments, as they do not use a real loop. + * For that, see {@link bp_activity_comment_embed()}. + * + * @since 1.5.0 + * + * @see BP_Embed + * @see bp_embed_activity_cache() + * @see bp_embed_activity_save_cache() + * + */ + function bp_activity_embed() + { + } + /** + * Cache full oEmbed response from oEmbed. + * + * @since 2.6.0 + * + * @param string $retval Current oEmbed result. + * @param object $data Full oEmbed response. + * @param string $url URL used for the oEmbed request. + * @return string + */ + function bp_activity_oembed_dataparse($retval, $data) + { + } + /** + * Set up activity oEmbed cache while recursing through activity comments. + * + * While crawling through an activity comment tree + * ({@link bp_activity_recurse_comments}), this function sets up the hooks + * necessary to grab each comment's embeds from the cache, or put them in + * the cache if they are not there yet. + * + * @since 1.5.0 + * + * @see BP_Embed + * @see bp_embed_activity_cache() + * @see bp_embed_activity_save_cache() + * + */ + function bp_activity_comment_embed() + { + } + /** + * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content. + * + * @since 1.5.0 + * + * @see BP_Embed + * + * @param object $activity The activity that is being expanded. + */ + function bp_dtheme_embed_read_more($activity) + { + } + /** + * Clean up 'embed_post_id' filter after comment recursion. + * + * This filter must be removed so that the non-comment filters take over again + * once the comments are done being processed. + * + * @since 1.5.0 + * + * @see bp_activity_comment_embed() + */ + function bp_activity_comment_embed_after_recurse() + { + } + /** + * Fetch an activity item's cached embeds. + * + * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. + * + * @since 1.5.0 + * + * @see BP_Embed::parse_oembed() + * + * @param string $cache An empty string passed by BP_Embed::parse_oembed() for + * functions like this one to filter. + * @param int $id The ID of the activity item. + * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). + * @return mixed The cached embeds for this activity item. + */ + function bp_embed_activity_cache($cache, $id, $cachekey) + { + } + /** + * Set an activity item's embed cache. + * + * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. + * + * @since 1.5.0 + * + * @see BP_Embed::parse_oembed() + * + * @param string $cache An empty string passed by BP_Embed::parse_oembed() for + * functions like this one to filter. + * @param string $cachekey The cache key generated in BP_Embed::parse_oembed(). + * @param int $id The ID of the activity item. + */ + function bp_embed_activity_save_cache($cache, $cachekey, $id) + { + } + /** + * Should we use Heartbeat to refresh activities? + * + * @since 2.0.0 + * + * @return bool True if activity heartbeat is enabled, otherwise false. + */ + function bp_activity_do_heartbeat() + { + } + /** + * Detect a change in post type status, and initiate an activity update if necessary. + * + * @since 2.2.0 + * + * @todo Support untrashing better. + * + * @param string $new_status New status for the post. + * @param string $old_status Old status for the post. + * @param object $post Post data. + */ + function bp_activity_catch_transition_post_type_status($new_status, $old_status, $post) + { + } + /** + * When a post type comment status transition occurs, update the relevant activity's status. + * + * @since 2.5.0 + * + * @param string $new_status New comment status. + * @param string $old_status Previous comment status. + * @param WP_Comment $comment Comment data. + */ + function bp_activity_transition_post_type_comment_status($new_status, $old_status, $comment) + { + } + /** + * Finds and exports personal data associated with an email address from the Activity tables. + * + * @since 4.0.0 + * + * @param string $email_address The user's email address. + * @param int $page Batch number. + * @return array An array of personal data. + */ + function bp_activity_personal_data_exporter($email_address, $page) + { + } + /** + * Checks whether an activity feed is enabled. + * + * @since 8.0.0 + * @since 12.0.0 Added bp_current_user_can( 'bp_view' ) check. + * + * @param string $feed_id The feed identifier. Possible values are: + * 'sitewide', 'personal', 'friends', 'mygroups', 'mentions', 'favorites'. + */ + function bp_activity_is_feed_enable($feed_id = '') + { + } + /** + * Loads our activity oEmbed component. + * + * @since 2.6.0 + */ + function bp_activity_setup_oembed() + { + } + /** + * Catch links in embed excerpt so top.location.href can be added. + * + * Due to <iframe sandbox="allow-top-navigation">, links in embeds can only be + * clicked if invoked with top.location.href via JS. + * + * @since 2.6.0 + * + * @param string $text Embed excerpt + * @return string + */ + function bp_activity_embed_excerpt_onclick_location_filter($text) + { + } + /** + * Add onclick="top.location.href" to a link. + * + * @since 2.6.0 + * + * @param array $matches Items matched by bp_activity_embed_excerpt_onclick_location_filter(). + * @return string + */ + function bp_activity_embed_excerpt_onclick_location_filter_callback($matches) + { + } + /** + * Add inline styles for BP activity embeds. + * + * @since 2.6.0 + */ + function bp_activity_embed_add_inline_styles() + { + } + /** + * Query for the activity item on the activity embed template. + * + * Basically a wrapper for {@link bp_has_activities()}, but allows us to + * use the activity loop without requerying for it again. + * + * @since 2.6.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param int $activity_id The activity ID. + * @return bool + */ + function bp_activity_embed_has_activity($activity_id = 0) + { + } + /** + * Outputs excerpt for an activity embed item. + * + * @since 2.6.0 + */ + function bp_activity_embed_excerpt($content = '') + { + } + /** + * Generates excerpt for an activity embed item. + * + * @since 2.6.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param string $content The content to generate an excerpt for. + * @return string + */ + function bp_activity_get_embed_excerpt($content = '') + { + } + /** + * Outputs the first embedded item in the activity oEmbed template. + * + * @since 2.6.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + */ + function bp_activity_embed_media() + { + } + /** + * Make sure the Activity embed template will be used if needed. + * + * @since 12.0.0 + * + * @param WP_Query $query Required. + */ + function bp_activity_parse_embed_query($query) + { + } + /** + * Callback function to render the Latest Activities Block. + * + * @since 9.0.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param array $attributes The block attributes. + * @return string HTML output. + */ + function bp_activity_render_latest_activities_block($attributes = array()) + { + } + /** + * Set up the bp-activity component. + * + * @since 1.6.0 + */ + function bp_setup_activity() + { + } + /** + * Register the Activity component admin screen. + * + * @since 1.6.0 + */ + function bp_activity_add_admin_menu() + { + } + /** + * Add activity component to custom menus array. + * + * Several BuddyPress components have top-level menu items in the Dashboard, + * which all appear together in the middle of the Dashboard menu. This function + * adds the Activity page to the array of these menu items. + * + * @since 1.7.0 + * + * @param array $custom_menus The list of top-level BP menu items. + * @return array $custom_menus List of top-level BP menu items, with Activity added. + */ + function bp_activity_admin_menu_order($custom_menus = array()) + { + } + /** + * AJAX receiver for Activity replies via the admin screen. + * + * Processes requests to add new activity comments, and echoes HTML for a new + * table row. + * + * @since 1.6.0 + */ + function bp_activity_admin_reply() + { + } + /** + * Hide the advanced edit meta boxes by default, so we don't clutter the screen. + * + * @since 1.6.0 + * + * @param array $hidden Array of items to hide. + * @param WP_Screen $screen Screen identifier. + * @return array Hidden Meta Boxes. + */ + function bp_activity_admin_edit_hidden_metaboxes($hidden, $screen) + { + } + /** + * Set up the Activity admin page. + * + * Does the following: + * - Register contextual help and screen options for this admin page. + * - Enqueues scripts and styles. + * - Catches POST and GET requests related to Activity. + * + * @since 1.6.0 + * + * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table. + */ + function bp_activity_admin_load() + { + } + /** + * Output the Activity component admin screens. + * + * @since 1.6.0 + */ + function bp_activity_admin() + { + } + /** + * Display the Activity delete confirmation screen. + * + * @since 7.0.0 + */ + function bp_activity_admin_delete() + { + } + /** + * Display the single activity edit screen. + * + * @since 1.6.0 + */ + function bp_activity_admin_edit() + { + } + /** + * Status metabox for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @param object $item Activity item. + */ + function bp_activity_admin_edit_metabox_status($item) + { + } + /** + * Primary link metabox for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @param object $item Activity item. + */ + function bp_activity_admin_edit_metabox_link($item) + { + } + /** + * User ID metabox for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @param object $item Activity item. + */ + function bp_activity_admin_edit_metabox_userid($item) + { + } + /** + * Get flattened array of all registered activity actions. + * + * Format is [activity_type] => Pretty name for activity type. + * + * @since 2.0.0 + * + * @return array $actions + */ + function bp_activity_admin_get_activity_actions() + { + } + /** + * Activity type metabox for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @param object $item Activity item. + */ + function bp_activity_admin_edit_metabox_type($item) + { + } + /** + * Primary item ID/Secondary item ID metabox for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @param object $item Activity item. + */ + function bp_activity_admin_edit_metabox_itemids($item) + { + } + /** + * Display the Activity admin index screen, which contains a list of all the activities. + * + * @since 1.6.0 + * + * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table. + * @global string $plugin_page The current plugin page. + */ + function bp_activity_admin_index() + { + } + /** + * Activity: User's "Activity > Mentions" screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the 'Mentions' activity page. + * + * @since 1.2.0 + */ + function bp_activity_screen_mentions() + { + } + /** + * Reset the logged-in user's new mentions data when he visits his mentions screen. + * + * @since 1.5.0 + */ + function bp_activity_reset_my_new_mentions() + { + } + /** + * Activity: User's "Activity" screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the 'My Activity' page. + * + * @since 1.0.0 + */ + function bp_activity_screen_my_activity() + { + } + /** + * Activity: User's "Activity > Friends" screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the 'My Friends' activity page. + * + * @since 1.0.0 + */ + function bp_activity_screen_friends() + { + } + /** + * Activity: Single permalink screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Catch and route requests for single activity item permalinks. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_permalink_router() + { + } + /** + * Load the page for a single activity item. + * + * @since 1.2.0 + */ + function bp_activity_screen_single_activity_permalink() + { + } + /** + * Activity: Directory screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the Activity directory. + * + * @since 1.5.0 + * + */ + function bp_activity_screen_index() + { + } + /** + * Activity: User's "Activity > Groups" screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the 'My Groups' activity page. + * + * @since 1.2.0 + */ + function bp_activity_screen_groups() + { + } + /** + * Activity: User's "Activity > Favorites" screen handler + * + * @package BuddyPress + * @subpackage ActivityScreens + * @since 3.0.0 + */ + /** + * Load the 'Favorites' activity page. + * + * @since 1.2.0 + */ + function bp_activity_screen_favorites() + { + } + /** + * Format notifications related to activity. + * + * @since 1.5.0 + * + * @param string $action The type of activity item. Just 'new_at_mention' for now. + * @param int $item_id The activity ID. + * @param int $secondary_item_id In the case of at-mentions, this is the mentioner's ID. + * @param int $total_items The total number of notifications to format. + * @param string $format 'string' for notification HTML link or 'array' for separate link and text. + * @param int $id Optional. The notification ID. + * @return string $return Formatted @mention notification. + */ + function bp_activity_format_notifications($action, $item_id, $secondary_item_id, $total_items, $format = 'string', $id = 0) + { + } + /** + * Notify a member when their nicename is mentioned in an activity stream item. + * + * Hooked to the 'bp_activity_sent_mention_email' action, we piggy back off the + * existing email code for now, since it does the heavy lifting for us. In the + * future when we separate emails from Notifications, this will need its own + * 'bp_activity_at_name_send_emails' equivalent helper function. + * + * @since 1.9.0 + * + * @param object $activity Activity object. + * @param string $subject (not used) Notification subject. + * @param string $message (not used) Notification message. + * @param string $content (not used) Notification content. + * @param int $receiver_user_id ID of user receiving notification. + */ + function bp_activity_at_mention_add_notification($activity, $subject, $message, $content, $receiver_user_id) + { + } + /** + * Notify a member one of their activity received a reply. + * + * @since 2.6.0 + * + * @param BP_Activity_Activity $activity The original activity. + * @param int $comment_id ID for the newly received comment. + * @param int $commenter_id ID of the user who made the comment. + */ + function bp_activity_update_reply_add_notification($activity, $comment_id, $commenter_id) + { + } + /** + * Notify a member one of their activity comment received a reply. + * + * @since 2.6.0 + * + * @param BP_Activity_Activity $activity_comment The parent activity. + * @param int $comment_id ID for the newly received comment. + * @param int $commenter_id ID of the user who made the comment. + */ + function bp_activity_comment_reply_add_notification($activity_comment, $comment_id, $commenter_id) + { + } + /** + * Mark at-mention notifications as read when users visit their Mentions page. + * + * @since 1.5.0 + * @since 2.5.0 Add the $user_id parameter + * + * @param int $user_id The id of the user whose notifications are marked as read. + */ + function bp_activity_remove_screen_notifications($user_id = 0) + { + } + /** + * Mark notifications as read when a user visits an activity permalink. + * + * @since 2.0.0 + * @since 3.2.0 Marks replies to parent update and replies to an activity comment as read. + * + * @param BP_Activity_Activity $activity Activity object. + */ + function bp_activity_remove_screen_notifications_single_activity_permalink($activity) + { + } + /** + * Mark non-mention notifications as read when user visits our read permalink. + * + * In particular, 'update_reply' and 'comment_reply' notifications are handled + * here. See {@link bp_activity_format_notifications()} for more info. + * + * @since 2.6.0 + */ + function bp_activity_remove_screen_notifications_for_non_mentions() + { + } + /** + * Delete at-mention notifications when the corresponding activity item is deleted. + * + * @since 2.0.0 + * + * @param array $activity_ids_deleted IDs of deleted activity items. + */ + function bp_activity_at_mention_delete_notification($activity_ids_deleted = array()) + { + } + /** + * Add a notification for post comments to the post author or post commenter. + * + * Requires "activity stream commenting on posts and comments" to be enabled. + * + * @since 2.6.0 + * + * @param int $activity_id The activity comment ID. + * @param WP_Comment $post_type_comment WP Comment object. + * @param array $activity_args Activity comment arguments. + * @param object $activity_post_object The post type tracking args object. + */ + function bp_activity_add_notification_for_synced_blog_comment($activity_id, $post_type_comment, $activity_args, $activity_post_object) + { + } + /** + * Add activity notifications settings to the notifications settings page. + * + * @since 1.2.0 + */ + function bp_activity_screen_notification_settings() + { + } + /** + * Add the Activity top-level menu link when viewing single activity item. + * + * @since 2.6.0 + * + * @global WP_Admin_Bar $wp_admin_bar Core class used to implement the Toolbar API. + * + * @return null Null if user does not have access to editing functionality. + */ + function bp_activity_admin_menu() + { + } + /** + * Determine whether an activity or its content string has blocks. + * + * @since 11.0.0 + * @see parse_blocks() + * + * @param string|int|BP_Activity_Activity|null $activity Activity content, Activity ID, or Activity object. + * @return bool Whether the activity content has blocks. + */ + function bp_activity_has_blocks($activity = \null) + { + } + /** + * If `bp_activity_do_blocks()` needs to remove `wpautop()` from the `bp_get_activity_content_body` filter, this re-adds it afterwards, + * for subsequent `bp_get_activity_content_body` usage. + * + * @since 11.0.0 + * + * @param string $content The activity content running through this filter. + * @return string The unmodified activity content. + */ + function bp_activity_restore_wpautop_hook($content) + { + } + /** + * Parses dynamic blocks out of the activity content and re-renders them. + * + * @since 11.0.0 + * + * @param string $content Activity content. + * @return string The block based activity content. + */ + function bp_activity_do_blocks($content) + { + } + /** + * Make sure only Emoji chars are saved into the DB. + * + * @since 11.0.0 + * + * @param string $activity_content The activity content. + * @return string The sanitized activity content. + */ + function bp_activity_blocks_preserve_emoji_chars($activity_content) + { + } + /** + * Allow usage of the paragraph tag and the link’s target attribute into Activity content. + * + * @since 11.0.0 + * + * @param array $tags The activity allowed tags. + * @return array The block based activity allowed tags. + */ + function bp_activity_blocks_allowed_tags($tags = array()) + { + } + /** + * Activity: Spam action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Mark specific activity item as spam and redirect to previous page. + * + * @since 1.6.0 + * + * @param int $activity_id Activity id to be deleted. Defaults to 0. + * @return bool False on failure. + */ + function bp_activity_action_spam_activity($activity_id = 0) + { + } + /** + * Activity: Post action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Post user/group activity update. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_post_update() + { + } + /** + * Activity: Unfavorite action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Remove activity from favorites. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_remove_favorite() + { + } + /** + * Activity: Reply action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Post new activity comment. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_post_comment() + { + } + /** + * Activity: Delete action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Delete specific activity item and redirect to previous page. + * + * @since 1.1.0 + * + * @param int $activity_id Activity id to be deleted. Defaults to 0. + * @return bool False on failure. + */ + function bp_activity_action_delete_activity($activity_id = 0) + { + } + /** + * Activity: RSS feed actions + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Load the sitewide activity feed. + * + * @since 1.0.0 + * + * @return bool False on failure. + */ + function bp_activity_action_sitewide_feed() + { + } + /** + * Load a user's personal activity feed. + * + * @since 1.0.0 + * + * @return bool False on failure. + */ + function bp_activity_action_personal_feed() + { + } + /** + * Load a user's friends' activity feed. + * + * @since 1.0.0 + * + * @return bool False on failure. + */ + function bp_activity_action_friends_feed() + { + } + /** + * Load the activity feed for a user's groups. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_my_groups_feed() + { + } + /** + * Load a user's @mentions feed. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_mentions_feed() + { + } + /** + * Load a user's favorites feed. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_favorites_feed() + { + } + /** + * Activity: Favorite action + * + * @package BuddyPress + * @subpackage ActivityActions + * @since 3.0.0 + */ + /** + * Mark activity as favorite. + * + * @since 1.2.0 + * + * @return bool False on failure. + */ + function bp_activity_action_mark_favorite() + { + } + /** + * Output the activity component slug. + * + * @since 1.5.0 + * + */ + function bp_activity_slug() + { + } + /** + * Return the activity component slug. + * + * @since 1.5.0 + * + * + * @return string The activity component slug. + */ + function bp_get_activity_slug() + { + } + /** + * Output the activity component root slug. + * + * @since 1.5.0 + * + */ + function bp_activity_root_slug() + { + } + /** + * Return the activity component root slug. + * + * @since 1.5.0 + * + * + * @return string The activity component root slug. + */ + function bp_get_activity_root_slug() + { + } + /** + * Output activity directory permalink. + * + * @since 1.5.0 + * + */ + function bp_activity_directory_permalink() + { + } + /** + * Return activity directory permalink. + * + * @since 1.5.0 + * + * + * @return string Activity directory permalink. + */ + function bp_get_activity_directory_permalink() + { + } + /** + * Initialize the activity loop. + * + * Based on the $args passed, bp_has_activities() populates the + * $activities_template global, enabling the use of BuddyPress templates and + * template functions to display a list of activity items. + * + * @since 1.0.0 + * @since 2.4.0 Introduced the `$fields` parameter. + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param array|string $args { + * Arguments for limiting the contents of the activity loop. Most arguments + * are in the same format as {@link BP_Activity_Activity::get()}. However, + * because the format of the arguments accepted here differs in a number of + * ways, and because bp_has_activities() determines some default arguments in + * a dynamic fashion, we list all accepted arguments here as well. + * + * Arguments can be passed as an associative array, or as a URL querystring + * (eg, 'user_id=4&display_comments=threaded'). + * + * @type int $page Which page of results to fetch. Using page=1 without per_page will result + * in no pagination. Default: 1. + * @type int|bool $per_page Number of results per page. Default: 20. + * @type string $page_arg String used as a query parameter in pagination links. Default: 'acpage'. + * @type int|bool $max Maximum number of results to return. Default: false (unlimited). + * @type string $fields Activity fields to retrieve. 'all' to fetch entire activity objects, + * 'ids' to get only the activity IDs. Default 'all'. + * @type string|bool $count_total If true, an additional DB query is run to count the total activity items + * for the query. Default: false. + * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'. + * @type array|bool $exclude Array of activity IDs to exclude. Default: false. + * @type array|bool $in Array of IDs to limit query by (IN). 'in' is intended to be used in + * conjunction with other filter parameters. Default: false. + * @type array|bool $include Array of exact activity IDs to query. Providing an 'include' array will + * override all other filters passed in the argument array. When viewing the + * permalink page for a single activity item, this value defaults to the ID of + * that item. Otherwise the default is false. + * @type array $meta_query Limit by activitymeta by passing an array of meta_query conditions. See + * {@link WP_Meta_Query::queries} for a description of the syntax. + * @type array $date_query Limit by date by passing an array of date_query conditions. See first + * parameter of {@link WP_Date_Query::__construct()} for syntax. + * @type array $filter_query Advanced activity filtering. See {@link BP_Activity_Query::__construct()}. + * @type string $search_terms Limit results by a search term. Default: false. + * @type string $scope Use a BuddyPress pre-built filter. + * - 'just-me' retrieves items belonging only to a user; this is equivalent + * to passing a 'user_id' argument. + * - 'friends' retrieves items belonging to the friends of a user. + * - 'groups' retrieves items belonging to groups to which a user belongs to. + * - 'favorites' retrieves a user's favorited activity items. + * - 'mentions' retrieves items where a user has received an @-mention. + * The default value of 'scope' is set to one of the above if that value + * appears in the appropriate place in the URL; eg, 'scope' will be 'groups' + * when visiting http://example.com/members/joe/activity/groups/. Otherwise + * defaults to false. + * @type int|array|bool $user_id The ID(s) of user(s) whose activity should be fetched. Pass a single ID or + * an array of IDs. When viewing a user profile page (but not that user's + * activity subpages, ie My Friends, My Groups, etc), 'user_id' defaults to + * the ID of the displayed user. Otherwise the default is false. + * @type string|array|bool $object Filters by the `component` column in the database, which is generally the + * component ID in the case of BuddyPress components, or the plugin slug in + * the case of plugins. For example, 'groups' will limit results to those that + * are associated with the BP Groups component. Accepts a single component + * string, or an array of multiple components. Defaults to 'groups' when + * viewing the page of a single group, the My Groups activity filter, or the + * Activity > Groups filter of a user profile. Otherwise defaults to false. + * @type string|array|bool $action Filters by the `type` column in the database, which is a string + * categorizing the activity item (eg, 'new_blog_post', 'created_group'). + * Accepts a comma-delimited string or an array of types. Default: false. + * @type int|array|bool $primary_id Filters by the `item_id` column in the database. The meaning of + * 'primary_id' differs between components/types; for example, in the case of + * 'created_group', 'primary_id' is the ID of the group. Accepts a single ID, + * or an array of multiple IDs. When viewing a single group, defaults to the + * current group ID. When viewing a user's Groups stream page, defaults to the + * IDs of the user's groups. Otherwise defaults to false. + * @type int|array|bool $secondary_id Filters by the `secondary_item_id` column in the database. The meaning of + * 'secondary_id' differs between components/types. Accepts a single ID, or an + * array of multiple IDs. Defaults to false. + * @type int $offset Return only activity items with an ID greater than or equal to this one. + * Note that providing an offset will disable pagination. Default: false. + * @type string|bool $display_comments How to handle activity comments. Possible values: + * - 'threaded' - comments appear in a threaded tree, under their parent + * items. + * - 'stream' - the activity stream is presented in a flat manner, with + * comments sorted in chronological order alongside other activity items. + * - false - don't fetch activity comments at all. + * Default: 'threaded'. + * @type bool $show_hidden Whether to show items marked hide_sitewide. Defaults to false, except in + * the following cases: + * - User is viewing his own activity stream. + * - User is viewing the activity stream of a non-public group of which he + * is a member. + * @type string|bool $spam Spam status. 'ham_only', 'spam_only', or false to show all activity + * regardless of spam status. Default: 'ham_only'. + * @type bool $populate_extras Whether to pre-fetch the activity metadata for the queried items. + * Default: true. + * } + * @return bool Returns true when activities are found, otherwise false. + */ + function bp_has_activities($args = '') + { + } + /** + * Determine if there are still activities left in the loop. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool Returns true when activities are found. + */ + function bp_activities() + { + } + /** + * Get the current activity object in the loop. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return object The current activity within the loop. + */ + function bp_the_activity() + { + } + /** + * Output the URL for the Load More link. + * + * @since 2.1.0 + */ + function bp_activity_load_more_link() + { + } + /** + * Get the URL for the Load More link. + * + * @since 2.1.0 + * @since 11.0.0 Adds the `offset_lower` query arg to avoid last displayed activity to be duplicated. + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @return string $link + */ + function bp_get_activity_load_more_link() + { + } + /** + * Output the activity pagination count. + * + * @since 1.0.0 + */ + function bp_activity_pagination_count() + { + } + /** + * Return the activity pagination count. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The pagination text. + */ + function bp_get_activity_pagination_count() + { + } + /** + * Output the activity pagination links. + * + * @since 1.0.0 + * + */ + function bp_activity_pagination_links() + { + } + /** + * Return the activity pagination links. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The pagination links. + */ + function bp_get_activity_pagination_links() + { + } + /** + * Return true when there are more activity items to be shown than currently appear. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool $has_more_items True if more items, false if not. + */ + function bp_activity_has_more_items() + { + } + /** + * Output the activity count. + * + * @since 1.2.0 + * + */ + function bp_activity_count() + { + } + /** + * Return the activity count. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activity count. + */ + function bp_get_activity_count() + { + } + /** + * Output the number of activities per page. + * + * @since 1.2.0 + * + */ + function bp_activity_per_page() + { + } + /** + * Return the number of activities per page. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activities per page. + */ + function bp_get_activity_per_page() + { + } + /** + * Output the activity ID. + * + * @since 1.2.0 + * + */ + function bp_activity_id() + { + } + /** + * Return the activity ID. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activity ID. + */ + function bp_get_activity_id() + { + } + /** + * Output the activity item ID. + * + * @since 1.2.0 + * + */ + function bp_activity_item_id() + { + } + /** + * Return the activity item ID. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activity item ID. + */ + function bp_get_activity_item_id() + { + } + /** + * Output the activity secondary item ID. + * + * @since 1.2.0 + * + */ + function bp_activity_secondary_item_id() + { + } + /** + * Return the activity secondary item ID. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activity secondary item ID. + */ + function bp_get_activity_secondary_item_id() + { + } + /** + * Output the date the activity was recorded. + * + * @since 1.2.0 + * + */ + function bp_activity_date_recorded() + { + } + /** + * Return the date the activity was recorded. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The date the activity was recorded. + */ + function bp_get_activity_date_recorded() + { + } + /** + * Output the display name of the member who posted the activity. + * + * @since 2.1.0 + * + */ + function bp_activity_member_display_name() + { + } + /** + * Return the display name of the member who posted the activity. + * + * @since 2.1.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The date the activity was recorded. + */ + function bp_get_activity_member_display_name() + { + } + /** + * Output the activity object name. + * + * @since 1.2.0 + * + */ + function bp_activity_object_name() + { + } + /** + * Return the activity object name. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity object name. + */ + function bp_get_activity_object_name() + { + } + /** + * Output the activity type. + * + * @since 1.2.0 + * + */ + function bp_activity_type() + { + } + /** + * Return the activity type. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity type. + */ + function bp_get_activity_type() + { + } + /** + * Return the activity type template part name. + * + * @since 10.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity type template part name. + */ + function bp_activity_type_part() + { + } + /** + * Output the activity action name. + * + * Just a wrapper for bp_activity_type(). + * + * @since 1.2.0 + * @deprecated 1.5.0 + * + * @todo Properly deprecate in favor of bp_activity_type() and + * remove redundant echo + * + */ + function bp_activity_action_name() + { + } + /** + * Return the activity type. + * + * Just a wrapper for bp_get_activity_type(). + * + * @since 1.2.0 + * @deprecated 1.5.0 + * + * @todo Properly deprecate in favor of bp_get_activity_type(). + * + * + * @return string The activity type. + */ + function bp_get_activity_action_name() + { + } + /** + * Output the activity user ID. + * + * @since 1.1.0 + * + */ + function bp_activity_user_id() + { + } + /** + * Return the activity user ID. + * + * @since 1.1.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int The activity user ID. + */ + function bp_get_activity_user_id() + { + } + /** + * Output the activity user link. + * + * @since 1.2.0 + * + */ + function bp_activity_user_link() + { + } + /** + * Return the activity user link. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $link The activity user link. + */ + function bp_get_activity_user_link() + { + } + /** + * Output the avatar of the user that performed the action. + * + * @since 1.1.0 + * + * @see bp_get_activity_avatar() for description of arguments. + * + * @param array|string $args See {@link bp_get_activity_avatar()} for description. + */ + function bp_activity_avatar($args = '') + { + } + /** + * Return the avatar of the user that performed the action. + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For a description of the arguments. + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param array|string $args { + * Arguments are listed here with an explanation of their defaults. + * For more information about the arguments, see + * {@link bp_core_fetch_avatar()}. + * @type string $alt Default: 'Profile picture of [user name]' if + * activity user name is available, otherwise 'Profile picture'. + * @type string $class Default: 'avatar'. + * @type string|bool $email Default: Email of the activity's + * associated user, if available. Otherwise false. + * @type string $type Default: 'full' when viewing a single activity + * permalink page, otherwise 'thumb'. + * @type int|bool $user_id Default: ID of the activity's user. + * } + * @return string User avatar string. + */ + function bp_get_activity_avatar($args = '') + { + } + /** + * Output the avatar of the object that action was performed on. + * + * @since 1.2.0 + * + * @see bp_get_activity_secondary_avatar() for description of arguments. + * + * @param array|string $args See {@link bp_get_activity_secondary_avatar} for description. + */ + function bp_activity_secondary_avatar($args = '') + { + } + /** + * Return the avatar of the object that action was performed on. + * + * @since 1.2.0 + * + * @see bp_core_fetch_avatar() for description of arguments. + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param array|string $args { + * For a complete description of arguments, see {@link bp_core_fetch_avatar()}. + * @type string $alt Default value varies based on current activity + * item component. + * @type string $type Default: 'full' when viewing a single activity + * permalink page, otherwise 'thumb'. + * @type string $class Default: 'avatar'. + * @type string|bool $email Default: email of the activity's user. + * @type int|bool $user_id Default: ID of the activity's user. + * } + * @return string The secondary avatar. + */ + function bp_get_activity_secondary_avatar($args = '') + { + } + /** + * Returns the Allowed HTML tags for the activity action. + * + * @since 12.4.1 + * + * @return array The Allowed HTML tags for the activity action. + */ + function bp_activity_action_allowed_html() + { + } + /** + * Output Activity metadata. + * + * @since 12.4.1 + */ + function bp_output_activity_meta($content = '') + { + } + /** + * Output the activity action. + * + * @since 1.2.0 + * + * @param array $args See bp_get_activity_action(). + */ + function bp_activity_action($args = array()) + { + } + /** + * Return the activity action. + * + * @since 1.2.0 + * @since 1.7.0 Introduce function parameter, $args. + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param array $args { + * @type bool $no_timestamp Whether to exclude the timestamp. + * } + * + * @return string The activity action. + */ + function bp_get_activity_action($args = array()) + { + } + /** + * Output the activity content body. + * + * @since 1.2.0 + */ + function bp_activity_content_body() + { + } + /** + * Return the activity content body. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity content body. + */ + function bp_get_activity_content_body() + { + } + /** + * Does the activity have content? + * + * @since 1.2.0 + * @since 10.0.0 Generate a richer content for activity types supporting the feature. + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool True if activity has content, false otherwise. + */ + function bp_activity_has_content() + { + } + /** + * Does this property has been generated? + * + * @since 10.0.0 + * + * @param string $property The name of the property to check into the generated content. + * @return bool True if the property is not empty. False otherwise. + */ + function bp_activity_has_generated_content_part($property = '') + { + } + /** + * Outputs a property of the activity generated content. + * + * @since 10.0.0 + * + * @param string $property The name of the property to check into the generated content. + */ + function bp_activity_generated_content_part($property = '') + { + } + /** + * Returns the property of the activity generated content. + * + * @since 10.0.0 + * + * @param string $property The name of the property to check into the generated content. + * @param string $return Whether to return the property value or a boolean to check it exists. + * @return bool|string A boolean when requested, false if there is no value, the HTML output otherwise. + */ + function bp_activity_get_generated_content_part($property = '', $return = '') + { + } + /** + * Output the activity content. + * + * @since 1.0.0 + * @deprecated 1.5.0 + * + * @todo properly deprecate this function. + * + */ + function bp_activity_content() + { + } + /** + * Return the activity content. + * + * @since 1.0.0 + * @deprecated 1.5.0 + * + * @todo properly deprecate this function. + * + * + * @return string The activity content. + */ + function bp_get_activity_content() + { + } + /** + * Attach metadata about an activity item to the activity content. + * + * This metadata includes the time since the item was posted (which will appear + * as a link to the item's permalink). + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param string $content The activity content. + * @return string The activity content with the metadata string attached. + */ + function bp_insert_activity_meta($content = '') + { + } + /** + * Determine if the current user can delete an activity item. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param false|BP_Activity_Activity $activity Optional. Falls back on the current item in the loop. + * @return bool True if can delete, false otherwise. + */ + function bp_activity_user_can_delete($activity = \false) + { + } + /** + * Output the activity parent content. + * + * @since 1.2.0 + * + * @see bp_get_activity_parent_content() for a description of arguments. + * + * @param array|string $args See {@link bp_get_activity_parent_content} for description. + */ + function bp_activity_parent_content($args = '') + { + } + /** + * Return the activity content. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param string $args Unused. Left over from an earlier implementation. + * @return mixed False on failure, otherwise the activity parent content. + */ + function bp_get_activity_parent_content($args = '') + { + } + /** + * Output the parent activity's user ID. + * + * @since 1.7.0 + */ + function bp_activity_parent_user_id() + { + } + /** + * Return the parent activity's user ID. + * + * @since 1.7.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool|int False if parent activity can't be found, otherwise + * the parent activity's user ID. + */ + function bp_get_activity_parent_user_id() + { + } + /** + * Output whether or not the current activity is in a current user's favorites. + * + * @since 1.2.0 + * + */ + function bp_activity_is_favorite() + { + } + /** + * Return whether the current activity is in a current user's favorites. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool True if user favorite, false otherwise. + */ + function bp_get_activity_is_favorite() + { + } + /** + * Output the comment markup for an activity item. + * + * @since 1.2.0 + * + * @param array|string $deprecated See {@link bp_activity_get_comments} for description. + */ + function bp_activity_comments($deprecated = '') + { + } + /** + * Get the comment markup for an activity item. + * + * @since 1.2.0 + * + * @todo Given that checks for children already happen in bp_activity_recurse_comments(), + * this function can probably be streamlined or removed. + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param string $deprecated Unused. Left over from an earlier implementation. + * @return bool + */ + function bp_activity_get_comments($deprecated = '') + { + } + /** + * Loops through a level of activity comments and loads the template for each. + * + * Note: The recursion itself used to happen entirely in this function. Now it is + * split between here and the comment.php template. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param object $comment The activity object currently being recursed. + * @return bool|string + */ + function bp_activity_recurse_comments($comment) + { + } + /** + * Utility function that returns the comment currently being recursed. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return object|bool $current_comment The activity comment currently being + * displayed. False on failure. + */ + function bp_activity_current_comment() + { + } + /** + * Output the ID of the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_id() + { + } + /** + * Return the ID of the activity comment currently being displayed. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int|bool $comment_id The ID of the activity comment currently + * being displayed, false if none is found. + */ + function bp_get_activity_comment_id() + { + } + /** + * Output the ID of the author of the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_user_id() + { + } + /** + * Return the ID of the author of the activity comment currently being displayed. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return int|bool $user_id The user_id of the author of the displayed + * activity comment. False on failure. + */ + function bp_get_activity_comment_user_id() + { + } + /** + * Output the author link for the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_user_link() + { + } + /** + * Return the author link for the activity comment currently being displayed. + * + * @since 1.5.0 + * + * + * @return string $user_link The URL of the activity comment author's profile. + */ + function bp_get_activity_comment_user_link() + { + } + /** + * Output the author name for the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_name() + { + } + /** + * Return the author name for the activity comment currently being displayed. + * + * The use of the 'bp_acomment_name' filter is deprecated. Please use + * 'bp_activity_comment_name'. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $name The full name of the activity comment author. + */ + function bp_get_activity_comment_name() + { + } + /** + * Output the formatted date_recorded of the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_date_recorded() + { + } + /** + * Return the formatted date_recorded for the activity comment currently being displayed. + * + * @since 1.5.0 + * + * + * @return string|bool $date_recorded Time since the activity was recorded, + * in the form "%s ago". False on failure. + */ + function bp_get_activity_comment_date_recorded() + { + } + /** + * Output the date_recorded of the activity comment currently being displayed. + * + * @since 2.3.0 + * + */ + function bp_activity_comment_date_recorded_raw() + { + } + /** + * Return the date_recorded for the activity comment currently being displayed. + * + * @since 2.3.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string|bool $date_recorded Time since the activity was recorded, + * in the form "%s ago". False on failure. + */ + function bp_get_activity_comment_date_recorded_raw() + { + } + /** + * Output the 'delete' URL for the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_delete_link() + { + } + /** + * Gets the 'delete' URL for the activity comment currently being displayed. + * + * @since 1.5.0 + * + * + * @return string $link The nonced URL for deleting the current + * activity comment. + */ + function bp_get_activity_comment_delete_link() + { + } + /** + * Output the content of the activity comment currently being displayed. + * + * @since 1.5.0 + * + */ + function bp_activity_comment_content() + { + } + /** + * Return the content of the activity comment currently being displayed. + * + * The content is run through two filters. 'bp_get_activity_content' + * will apply all filters applied to activity items in general. Use + * 'bp_activity_comment_content' to modify the content of activity + * comments only. + * + * @since 1.5.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $content The content of the current activity comment. + */ + function bp_get_activity_comment_content() + { + } + /** + * Output the activity comment count. + * + * @since 1.2.0 + * + */ + function bp_activity_comment_count() + { + } + /** + * Return the comment count of an activity item. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @param array|null $deprecated Deprecated. + * @return int $count The activity comment count. + */ + function bp_activity_get_comment_count($deprecated = \null) + { + } + /** + * Return the total number of comments to the current comment. + * + * This function recursively adds the total number of comments each + * activity child has, and returns them. + * + * @since 1.2.0 + * + * + * @param object $comment Activity comment object. + * @param int $count The current iteration count. + * @return int $count The activity comment count. + */ + function bp_activity_recurse_comment_count($comment, $count = 0) + { + } + /** + * Output the depth of the current activity comment. + * + * @since 2.0.0 + * @since 2.8.0 Added $comment as a parameter. + * + * @param object|int $comment Object of the activity comment or activity comment ID. Usually unnecessary + * when used in activity comment loop. + */ + function bp_activity_comment_depth($comment = 0) + { + } + /** + * Return the current activity comment depth. + * + * @since 2.0.0 + * @since 2.8.0 Added $comment as a parameter. + * + * @param object|int $comment Object of the activity comment or activity comment ID. Usually unnecessary + * when used in activity comment loop. + * @return int + */ + function bp_activity_get_comment_depth($comment = 0) + { + } + /** + * Output the activity comment link. + * + * @since 1.2.0 + * + */ + function bp_activity_comment_link() + { + } + /** + * Return the activity comment link. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity comment link. + */ + function bp_get_activity_comment_link() + { + } + /** + * Output the activity comment form no JavaScript display CSS. + * + * @since 1.2.0 + * + */ + function bp_activity_comment_form_nojs_display() + { + } + /** + * Return the activity comment form no JavaScript display CSS. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string|false The activity comment form no JavaScript + * display CSS. False on failure. + */ + function bp_get_activity_comment_form_nojs_display() + { + } + /** + * Outputs the URL to cancel a comment. + * + * @since 12.0.0 + */ + function bp_activity_comment_cancel_url() + { + } + /** + * Returns the URL to cancel a comment. + * + * @since 12.0.0 + * + * @return string The URL to cancel a comment. + */ + function bp_get_activity_comment_cancel_url() + { + } + /** + * Output the activity comment form action. + * + * @since 1.2.0 + * + */ + function bp_activity_comment_form_action() + { + } + /** + * Return the activity comment form action. + * + * @since 1.2.0 + * + * @return string The activity comment form action. + */ + function bp_get_activity_comment_form_action() + { + } + /** + * Output the activity permalink ID. + * + * @since 1.2.0 + * + */ + function bp_activity_permalink_id() + { + } + /** + * Return the activity permalink ID. + * + * @since 1.2.0 + * + * + * @return string The activity permalink ID. + */ + function bp_get_activity_permalink_id() + { + } + /** + * Output the activity thread permalink. + * + * @since 1.2.0 + * + */ + function bp_activity_thread_permalink() + { + } + /** + * Return the activity thread permalink. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @return string $link The activity thread permalink. + */ + function bp_get_activity_thread_permalink() + { + } + /** + * Output the activity comment permalink. + * + * @since 1.8.0 + * + */ + function bp_activity_comment_permalink() + { + } + /** + * Return the activity comment permalink. + * + * @since 1.8.0 + * + * @return string $link The activity comment permalink. + */ + function bp_get_activity_comment_permalink() + { + } + /** + * Output the activity favorite link. + * + * @since 1.2.0 + * + */ + function bp_activity_favorite_link() + { + } + /** + * Return the activity favorite link. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity favorite link. + */ + function bp_get_activity_favorite_link() + { + } + /** + * Output the activity unfavorite link. + * + * @since 1.2.0 + * + */ + function bp_activity_unfavorite_link() + { + } + /** + * Return the activity unfavorite link. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity unfavorite link. + */ + function bp_get_activity_unfavorite_link() + { + } + /** + * Output the activity CSS class. + * + * @since 1.0.0 + * + */ + function bp_activity_css_class() + { + } + /** + * Return the current activity item's CSS class. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity item's CSS class. + */ + function bp_get_activity_css_class() + { + } + /** + * Output the activity delete link. + * + * @since 1.1.0 + * + */ + function bp_activity_delete_link() + { + } + /** + * Return the activity delete link. + * + * @since 1.1.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $link Activity delete link. Contains $redirect_to arg + * if on single activity page. + */ + function bp_get_activity_delete_link() + { + } + /** + * Output the URL to delete a single activity stream item. + * + * @since 2.1.0 + * + */ + function bp_activity_delete_url() + { + } + /** + * Return the URL to delete a single activity item. + * + * @since 2.1.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $link Activity delete link. Contains $redirect_to arg + * if on single activity page. + */ + function bp_get_activity_delete_url() + { + } + /** + * Output the activity latest update link. + * + * @since 1.2.0 + * + * @see bp_get_activity_latest_update() for description of parameters. + * + * @param int $user_id See {@link bp_get_activity_latest_update()} for description. + */ + function bp_activity_latest_update($user_id = 0) + { + } + /** + * Return the activity latest update link. + * + * @since 1.2.0 + * + * + * @param int $user_id If empty, will fall back on displayed user. + * @return string|bool $latest_update The activity latest update link. + * False on failure. + */ + function bp_get_activity_latest_update($user_id = 0) + { + } + /** + * Output the activity filter links. + * + * @since 1.1.0 + * + * @see bp_get_activity_filter_links() for description of parameters. + * + * @param array|bool $args See {@link bp_get_activity_filter_links()} for description. + */ + function bp_activity_filter_links($args = \false) + { + } + /** + * Return the activity filter links. + * + * @since 1.1.0 + * + * + * @param array|bool $args { + * @type string $style The type of markup to use for the links. + * 'list', 'paragraph', or 'span'. Default: 'list'. + * } + * @return string|bool $component_links The activity filter links. + * False on failure. + */ + function bp_get_activity_filter_links($args = \false) + { + } + /** + * Determine if a comment can be made on an activity item. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return bool $can_comment True if item can receive comments. + */ + function bp_activity_can_comment() + { + } + /** + * Determine whether a comment can be made on an activity reply item. + * + * @since 1.5.0 + * + * @param bool|object $comment Activity comment. + * @return bool $can_comment True if comment can receive comments, + * otherwise false. + */ + function bp_activity_can_comment_reply($comment = \false) + { + } + /** + * Determine whether favorites are allowed. + * + * Defaults to true, but can be modified by plugins. + * + * @since 1.5.0 + * + * @return bool True if comment can receive comments. + */ + function bp_activity_can_favorite() + { + } + /** + * Output the total favorite count for a specified user. + * + * @since 1.2.0 + * + * @see bp_get_total_favorite_count_for_user() for description of parameters. + * + * @param int $user_id See {@link bp_get_total_favorite_count_for_user()}. + */ + function bp_total_favorite_count_for_user($user_id = 0) + { + } + /** + * Return the total favorite count for a specified user. + * + * @since 1.2.0 + * + * + * @param int $user_id ID of user being queried. Default: displayed user ID. + * @return int The total favorite count for the specified user. + */ + function bp_get_total_favorite_count_for_user($user_id = 0) + { + } + /** + * Output the total mention count for a specified user. + * + * @since 1.2.0 + * + * @see bp_get_total_mention_count_for_user() for description of parameters. + * + * @param int $user_id See {@link bp_get_total_mention_count_for_user()}. + */ + function bp_total_mention_count_for_user($user_id = 0) + { + } + /** + * Return the total mention count for a specified user. + * + * @since 1.2.0 + * + * + * @param int $user_id ID of user being queried. Default: displayed user ID. + * @return int The total mention count for the specified user. + */ + function bp_get_total_mention_count_for_user($user_id = 0) + { + } + /** + * Output the public message link for displayed user. + * + * @since 1.2.0 + * + */ + function bp_send_public_message_link() + { + } + /** + * Return the public message link for the displayed user. + * + * @since 1.2.0 + * + * + * @return string The public message link for the displayed user. + */ + function bp_get_send_public_message_link() + { + } + /** + * Recurse through all activity comments and return the activity comment IDs. + * + * @since 2.0.0 + * + * @param array $activity Array of activities generated from {@link bp_activity_get()}. + * @param array $activity_ids Used for recursion purposes in this function. + * @return array + */ + function bp_activity_recurse_comments_activity_ids($activity = array(), $activity_ids = array()) + { + } + /** + * Output the mentioned user display name. + * + * @since 1.2.0 + * + * @see bp_get_mentioned_user_display_name() for description of parameters. + * + * @param int|string|bool $user_id_or_username See {@link bp_get_mentioned_user_display_name()}. + */ + function bp_mentioned_user_display_name($user_id_or_username = \false) + { + } + /** + * Returns the mentioned user display name. + * + * @since 1.2.0 + * + * + * @param int|string|bool $user_id_or_username User ID or username. + * @return string The mentioned user's display name. + */ + function bp_get_mentioned_user_display_name($user_id_or_username = \false) + { + } + /** + * Output button for sending a public message (an @-mention). + * + * @since 1.2.0 + * + * @see bp_activity_get_public_message_button_args() for description of parameters. + * + * @param array|string $args See {@link bp_activity_get_public_message_button_args()}. + */ + function bp_send_public_message_button($args = '') + { + } + /** + * Get the arguments for the public message button. + * + * @since 11.0.0 + * + * @param array|string $args { + * All arguments are optional. See {@link BP_Button} for complete + * descriptions. + * @type string $id Default: 'public_message'. + * @type string $component Default: 'activity'. + * @type bool $must_be_logged_in Default: true. + * @type bool $block_self Default: true. + * @type string $wrapper_id Default: 'post-mention'. + * @type string $link_href Default: the public message link for + * the current member in the loop. + * @type string $link_title Default: 'Send a public message on your + * activity stream.'. + * @type string $link_text Default: 'Public Message'. + * @type string $link_class Default: 'activity-button mention'. + * } + * @return array The arguments for the public message button. + */ + function bp_activity_get_public_message_button_args($args = '') + { + } + /** + * Return button for sending a public message (an @-mention). + * + * @since 1.2.0 + * @since 11.0.0 uses `bp_activity_get_public_message_button_args()`. + * + * @see bp_activity_get_public_message_button_args() for description of parameters. + * + * @param array|string $args See {@link bp_activity_get_public_message_button_args()}. + * @return string The button for sending a public message. + */ + function bp_get_send_public_message_button($args = '') + { + } + /** + * Output the activity post form action. + * + * @since 1.2.0 + * + */ + function bp_activity_post_form_action() + { + } + /** + * Return the activity post form action. + * + * @since 1.2.0 + * + * + * @return string The activity post form action. + */ + function bp_get_activity_post_form_action() + { + } + /** + * Echo a list of linked avatars of users who have commented on the current activity item. + * + * Use this function to easily output activity comment authors' avatars. + * + * Avatars are wrapped in <li> elements, but you've got to provide your own + * <ul> or <ol> wrapper markup. + * + * @since 1.7.0 + * + * @see bp_core_fetch_avatar() for a description of arguments. + * + * @param array $args See {@link bp_core_fetch_avatar()}. + */ + function bp_activity_comments_user_avatars($args = array()) + { + } + /** + * Return the IDs of every user who's left a comment on the current activity item. + * + * @since 1.7.0 + * + * @global BP_Activity_Template $activities_template The Activity template object. + * + * @return bool|array An array of IDs, or false if none are found. + */ + function bp_activity_get_comments_user_ids() + { + } + /** + * Recurse through all activity comments and collect the IDs of the users who wrote them. + * + * @since 1.7.0 + * + * @param array $comments Array of {@link BP_Activity_Activity} items. + * @return array Array of user IDs. + */ + function bp_activity_recurse_comments_user_ids(array $comments = array()) + { + } + /** + * Output the mentionname for the displayed user. + * + * @since 1.9.0 + */ + function bp_displayed_user_mentionname() + { + } + /** + * Get the mentionname for the displayed user. + * + * @since 1.9.0 + * + * @return string Mentionname for the displayed user, if available. + */ + function bp_get_displayed_user_mentionname() + { + } + /** + * Echo a list of all registered activity types for use in dropdowns or checkbox lists. + * + * @since 1.7.0 + * + * @param string $output Optional. Either 'select' or 'checkbox'. Default: 'select'. + * @param array|string $args { + * Optional extra arguments. + * @type string $checkbox_name When returning checkboxes, sets the 'name' + * attribute. + * @type array|string $selected A list of types that should be checked/ + * selected. + * } + */ + function bp_activity_types_list($output = 'select', $args = '') + { + } + /* RSS Feed Template Tags ****************************************************/ + /** + * Output the sitewide activity feed link. + * + * @since 1.0.0 + * + */ + function bp_sitewide_activity_feed_link() + { + } + /** + * Returns the sitewide activity feed link. + * + * @since 1.0.0 + * + * + * @return string The sitewide activity feed link. + */ + function bp_get_sitewide_activity_feed_link() + { + } + /** + * Output the member activity feed link. + * + * @since 1.2.0 + */ + function bp_member_activity_feed_link() + { + } + /** + * Return the member activity feed link. + * + * @since 1.2.0 + * + * @return string $link The member activity feed link. + */ + function bp_get_member_activity_feed_link() + { + } + /** + * Return the member activity feed link. + * + * @since 1.0.0 + * @deprecated 1.2.0 + * + * @todo properly deprecate in favor of bp_get_member_activity_feed_link(). + * + * + * @return string The member activity feed link. + */ + function bp_get_activities_member_rss_link() + { + } + /** Template tags for RSS feed output ****************************************/ + /** + * Outputs the activity feed item guid. + * + * @since 1.0.0 + * + */ + function bp_activity_feed_item_guid() + { + } + /** + * Returns the activity feed item guid. + * + * @since 1.2.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity feed item guid. + */ + function bp_get_activity_feed_item_guid() + { + } + /** + * Output the activity feed item title. + * + * @since 1.0.0 + * + */ + function bp_activity_feed_item_title() + { + } + /** + * Return the activity feed item title. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string $title The activity feed item title. + */ + function bp_get_activity_feed_item_title() + { + } + /** + * Output the activity feed item link. + * + * @since 1.0.0 + * + */ + function bp_activity_feed_item_link() + { + } + /** + * Return the activity feed item link. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity feed item link. + */ + function bp_get_activity_feed_item_link() + { + } + /** + * Output the activity feed item date. + * + * @since 1.0.0 + * + */ + function bp_activity_feed_item_date() + { + } + /** + * Return the activity feed item date. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity feed item date. + */ + function bp_get_activity_feed_item_date() + { + } + /** + * Output the activity feed item description. + * + * @since 1.0.0 + * + */ + function bp_activity_feed_item_description() + { + } + /** + * Return the activity feed item description. + * + * @since 1.0.0 + * + * @global BP_Activity_Template $activities_template The main activity template loop class. + * + * @return string The activity feed item description. + */ + function bp_get_activity_feed_item_description() + { + } + /** + * Template tag so we can hook activity feed to <head>. + * + * @since 1.5.0 + * + */ + function bp_activity_sitewide_feed() + { + } + /** + * Display available filters depending on the scope. + * + * @since 2.1.0 + * + * @param string $context The current context. 'activity', 'member', + * 'member_groups', 'group'. + */ + function bp_activity_show_filters($context = '') + { + } + /** + * Get available filters depending on the scope. + * + * @since 2.1.0 + * + * @param string $context The current context. 'activity', 'member', + * 'member_groups', 'group'. + * + * @return string HTML for <option> values. + */ + function bp_get_activity_show_filters($context = '') + { + } + /** + * Slurp up activitymeta for a specified set of activity items. + * + * It grabs all activitymeta associated with all of the activity items passed + * in $activity_ids and adds it to the WP cache. This improves efficiency when + * using querying activitymeta inline. + * + * @since 1.6.0 + * + * @param int|string|array|bool $activity_ids Accepts a single activity ID, or a comma- + * separated list or array of activity ids. + */ + function bp_activity_update_meta_cache($activity_ids = \false) + { + } + /** + * Clear a cached activity item when that item is updated. + * + * @since 2.0.0 + * + * @param BP_Activity_Activity $activity Activity object. + */ + function bp_activity_clear_cache_for_activity($activity) + { + } + /** + * Clear cached data for deleted activity items. + * + * @since 2.0.0 + * + * @param array $deleted_ids IDs of deleted activity items. + */ + function bp_activity_clear_cache_for_deleted_activity($deleted_ids) + { + } + /** + * Reset cache incrementor for the Activity component. + * + * Called whenever an activity item is created, updated, or deleted, this + * function effectively invalidates all cached results of activity queries. + * + * @since 2.7.0 + * + * @return bool + */ + function bp_activity_reset_cache_incrementor() + { + } + /** Functions *****************************************************************/ + /** + * Types of activity stream items to moderate. + * + * @since 1.6.0 + * + * @return array $types List of the activity types to moderate. + */ + function bp_activity_get_moderated_activity_types() + { + } + /** + * Moderate the posted activity item, if it contains moderate keywords. + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity object to check. + */ + function bp_activity_check_moderation_keys($activity) + { + } + /** + * Mark the posted activity as spam, if it contains disallowed keywords. + * + * @since 7.0.0 + * + * @param BP_Activity_Activity $activity The activity object to check. + */ + function bp_activity_check_disallowed_keys($activity) + { + } + /** + * Custom kses filtering for activity content. + * + * @since 1.1.0 + * + * @param string $content The activity content. + * @return string $content Filtered activity content. + */ + function bp_activity_filter_kses($content) + { + } + /** + * Find and link @-mentioned users in the contents of a given item. + * + * @since 1.2.0 + * + * @param string $content The contents of a given item. + * @param int $activity_id The activity id. Deprecated. + * @return string $content Content filtered for mentions. + */ + function bp_activity_at_name_filter($content, $activity_id = 0) + { + } + /** + * Catch mentions in an activity item before it is saved into the database. + * + * If mentions are found, replace @mention text with user links and add our + * hook to send mention notifications after the activity item is saved. + * + * @since 1.5.0 + * + * @param BP_Activity_Activity $activity Activity Object. + */ + function bp_activity_at_name_filter_updates($activity) + { + } + /** + * Sends emails and BP notifications for users @-mentioned in an activity item. + * + * @since 1.7.0 + * + * @param BP_Activity_Activity $activity The BP_Activity_Activity object. + */ + function bp_activity_at_name_send_emails($activity) + { + } + /** + * Catch links in activity text so rel=nofollow can be added. + * + * @since 1.2.0 + * + * @param string $text Activity text. + * @return string $text Text with rel=nofollow added to any links. + */ + function bp_activity_make_nofollow_filter($text) + { + } + /** + * Adds `rel="nofollow ugc"` to a link. + * + * @since 1.2.0 Adds the nofollow rel attribute. + * @since 7.0.0 Adds the ugc rel attribute. + * + * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter(). + * @return string $text Link with rel=nofollow added. + */ + function bp_activity_make_nofollow_filter_callback($matches) + { + } + /** + * Truncate long activity entries when viewed in activity streams. + * + * This method can only be used inside the Activity loop. + * + * @since 1.5.0 + * @since 2.6.0 Added $args parameter. + * + * @global BP_Activity_Template $activities_template The Activity template loop. + * + * @param string $text The original activity entry text. + * @param array $args { + * Optional parameters. See $options argument of {@link bp_create_excerpt()} + * for all available parameters. + * } + * @return string $excerpt The truncated text. + */ + function bp_activity_truncate_entry($text, $args = array()) + { + } + /** + * Include extra JavaScript dependencies for activity component. + * + * @since 2.0.0 + * + * @param array $js_handles The original dependencies. + * @return array $js_handles The new dependencies. + */ + function bp_activity_get_js_dependencies($js_handles = array()) + { + } + /** + * Add a just-posted classes to the most recent activity item. + * + * We use these classes to avoid pagination issues when items are loaded + * dynamically into the activity stream. + * + * @since 2.0.0 + * + * @param string $classes Array of classes for most recent activity item. + * @return string $classes + */ + function bp_activity_newest_class($classes = '') + { + } + /** + * Check if Activity Heartbeat feature i on to add a timestamp class. + * + * @since 2.0.0 + * + * @param string $classes Array of classes for timestamp. + * @return string $classes + */ + function bp_activity_timestamp_class($classes = '') + { + } + /** + * Use WordPress Heartbeat API to check for latest activity update. + * + * @since 2.0.0 + * + * @param array $response Array containing Heartbeat API response. + * @param array $data Array containing data for Heartbeat API response. + * @return array $response + */ + function bp_activity_heartbeat_last_recorded($response = array(), $data = array()) + { + } + /** + * Set the strings for WP HeartBeat API where needed. + * + * @since 2.0.0 + * + * @param array $strings Localized strings. + * @return array $strings + */ + function bp_activity_heartbeat_strings($strings = array()) + { + } + /** Scopes ********************************************************************/ + /** + * Set up activity arguments for use with the 'just-me' scope. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array $retval + */ + function bp_activity_filter_just_me_scope($retval = array(), $filter = array()) + { + } + /** + * Set up activity arguments for use with the 'favorites' scope. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array $retval + */ + function bp_activity_filter_favorites_scope($retval = array(), $filter = array()) + { + } + /** + * Set up activity arguments for use with the 'favorites' scope. + * + * @since 2.2.0 + * + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. + * @return array $retval + */ + function bp_activity_filter_mentions_scope($retval = array(), $filter = array()) + { + } + /** + * Registers Activity personal data exporter. + * + * @since 4.0.0 + * @since 5.0.0 adds an `exporter_bp_friendly_name` param to exporters. + * + * @param array $exporters An array of personal data exporters. + * @return array An array of personal data exporters. + */ + function bp_activity_register_personal_data_exporter($exporters) + { + } + /** + * Enqueue @mentions JS. + * + * @since 2.1.0 + */ + function bp_activity_mentions_script() + { + } + /** + * Bind the mentions listener to a wp_editor instance when TinyMCE initializes. + * + * @since 2.3.3 + * + * @param array $settings An array with TinyMCE config. + * @param string $editor_id Unique editor identifier, e.g. 'content'. + * @return array $mceInit An array with TinyMCE config. + */ + function bp_add_mentions_on_tinymce_init($settings, $editor_id) + { + } +} \ No newline at end of file diff --git a/compat/notification-stubs.php b/compat/notification-stubs.php new file mode 100644 index 0000000..72e99b7 --- /dev/null +++ b/compat/notification-stubs.php @@ -0,0 +1,13335 @@ +<?php + +namespace BracketSpace\Notification\Database\Queries { + /** + * Notification Queries class + * + * @deprecated 3.0.0 + */ + class NotificationQueries + { + /** + * Class constructor + */ + public function __construct() + { + } + /** + * Gets Notification posts. + * + * @param bool $includingDisabled If should include disabled notifications as well. + * @return array<Notification> + * @since 8.0.0 + */ + public static function all(bool $includingDisabled = false) : array + { + } + /** + * Gets Notification post by hash. + * + * @param string $hash Notification hash. + * @return ?Notification + * @since 8.0.0 + */ + public static function withHash(string $hash) + { + } + } +} +namespace BracketSpace\Notification\Traits { + /** + * Webhook trait + * + * @deprecated 3.0.0 + */ + trait Webhook + { + /** + * Carrier constructor + * + * @param string $name Webhook nice name. + * @return void + * @since 7.0.0 + */ + public function __construct($name) + { + } + /** + * Makes http request + * + * @param string $url URL to call. + * @param array<mixed> $args Arguments. Default: empty. + * @param array<mixed> $headers Headers. Default: empty. + * @param string $method HTTP request method. + * @return void + * @since 7.0.0 + */ + public function httpRequest($url, $args = [], $headers = [], $method = 'GET') + { + } + /** + * Parses args to be understand by the wp_remote_* functions + * + * @param array<mixed> $args Args from saved fields. + * @return array<mixed> Parsed args as key => value array + * @since 7.0.0 + */ + private function parseArgs($args) + { + } + } +} +namespace BracketSpace\Notification\Utils\Settings\CoreFields { + /** + * HTML class + */ + class HTML + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * HTML field + * + * @param Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value Saved value. + * @return string Sanitized text + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Utils\Cache { + /** + * Cache class + */ + class Cache + { + /** + * Cache unique key + * + * @var string + */ + protected $key; + /** + * Constructor + * + * @param string $key cache unique key. + */ + public function __construct($key) + { + } + } +} +namespace BracketSpace\Notification\Utils\Interfaces { + /** + * Cacheable interface + */ + interface Cacheable + { + /** + * Sets cache value + * + * @param mixed $value value to store. + */ + public function set($value); + /** + * Adds cache if it's not already set + * + * @param mixed $value value to store. + */ + public function add($value); + /** + * Gets value from cache + * + * @param boolean $force true if cache will be forced to get from storage. + * @return mixed cached value + */ + public function get($force); + /** + * Deletes value from cache + */ + public function delete(); + } +} +namespace BracketSpace\Notification\Utils\Cache { + /** + * Transient cache + */ + class Transient extends \BracketSpace\Notification\Utils\Cache\Cache implements \BracketSpace\Notification\Utils\Interfaces\Cacheable + { + /** + * Cache expiration in seconds + * + * @var integer + */ + protected $expiration; + /** + * Constructor + * + * @param string $key cache unique key. + * @param integer $expiration expiration in seconds. + */ + public function __construct($key, $expiration = 0) + { + } + /** + * Sets cache value + * + * @param mixed $value value to store. + * @return object $this + */ + public function set($value) + { + } + /** + * Adds cache if it's not already set + * + * @param mixed $value value to store. + * @return object $this + */ + public function add($value) + { + } + /** + * Gets value from cache + * + * @param boolean $force not used, transients are always get from storage. + * @return mixed cached value + */ + public function get($force = true) + { + } + /** + * Deletes value from cache + * + * @return object $this + */ + public function delete() + { + } + } + /** + * Object cache + */ + class ObjectCache extends \BracketSpace\Notification\Utils\Cache\Cache implements \BracketSpace\Notification\Utils\Interfaces\Cacheable + { + /** + * Cache group + * + * @var string + */ + protected $group; + /** + * Constructor + * + * @param string $key cache unique key. + * @param string $group cache group, optional. + */ + public function __construct($key, $group = '') + { + } + /** + * Sets cache value + * + * @param mixed $value value to store. + * @return object $this + */ + public function set($value) + { + } + /** + * Adds cache if it's not already set + * + * @param mixed $value value to store. + * @return object $this + */ + public function add($value) + { + } + /** + * Gets value from cache + * + * @param boolean $force not used, transients are always get from storage. + * @return mixed cached value + */ + public function get($force = false) + { + } + /** + * Deletes value from cache + * + * @return object $this + */ + public function delete() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Adaptable interface + * + * @mixin \BracketSpace\Notification\Core\Notification + */ + interface Adaptable + { + /** + * Reads the data + * + * @param mixed $input Input data. + * @return $this + */ + public function read($input = null); + /** + * Saves the data + * + * @return mixed + */ + public function save(); + /** + * Gets Notification object + * + * @return \BracketSpace\Notification\Core\Notification + */ + public function getNotification(); + } +} +namespace BracketSpace\Notification\Abstracts { + /** + * Adapter class + * + * @mixin \BracketSpace\Notification\Core\Notification + * @deprecated 3.0.0 + */ + abstract class Adapter implements \BracketSpace\Notification\Interfaces\Adaptable + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Notification object + * + * @var \BracketSpace\Notification\Core\Notification + */ + protected $notification; + /** + * Class constructor + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + */ + public function __construct(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Pass the method calls to Notification object + * + * @param string $methodName Method name. + * @param array<mixed> $arguments Arguments. + * @return mixed + * @since 6.0.0 + */ + public function __call($methodName, $arguments) + { + } + /** + * Gets Notification object + * + * @return \BracketSpace\Notification\Core\Notification + * @since 6.0.0 + */ + public function getNotification() + { + } + /** + * Sets up Notification object with data. + * + * phpcs:ignore SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName + * @param array<mixed> $data Data array. + * @return \BracketSpace\Notification\Core\Notification + * @since 6.0.0 + */ + public function setupNotification($data = []) + { + } + /** + * Checks if enabled + * + * @return bool + * @since 6.0.0 + */ + public function isEnabled() + { + } + /** + * Registers Notification + * + * @return void + * @since 6.0.0 + */ + public function registerNotification() + { + } + } +} +namespace BracketSpace\Notification\Defaults\Adapter { + /** + * JSON Adapter class + * + * @deprecated 3.0.0 + */ + class JSON extends \BracketSpace\Notification\Abstracts\Adapter + { + /** + * {@inheritdoc} + * + * @param string $input JSON string. + * @return $this + * @throws \Exception If wrong input param provided. + */ + public function read($input = null) + { + } + /** + * {@inheritdoc} + * + * @param int|null $jsonOptions JSON options, pass null to use default as well. + * @param bool $onlyEnabledCarriers If only enabled Carriers should be saved. + * @return mixed + */ + public function save($jsonOptions = JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE, $onlyEnabledCarriers = false) + { + } + } + /** + * WordPress Adapter class + * + * @mixin \BracketSpace\Notification\Core\Notification + * @deprecated 3.0.0 + */ + class WordPress extends \BracketSpace\Notification\Abstracts\Adapter + { + /** + * Notification post + * + * @var \WP_Post + */ + protected $post; + /** + * Notification post type slug + * + * @var string + */ + protected $postType = 'notification'; + /** + * {@inheritdoc} + * + * @param mixed $input Input data. + * @return $this|void + * @throws \Exception If wrong input param provided. + */ + public function read($input = null) + { + } + /** + * {@inheritdoc} + * + * @return $this|\WP_Error + */ + public function save() + { + } + /** + * Checks if notification post has been just started + * + * @return bool + * @since 6.0.0 + */ + public function isNew() + { + } + /** + * Gets notification post ID + * + * @return int post ID + * @since 6.0.0 + */ + public function getId() + { + } + /** + * Gets post + * + * @return \WP_Post|null + * @since 6.0.0 + */ + public function getPost() + { + } + /** + * Sets post + * + * @param \WP_Post $post WP Post to set. + * @return $this + * @since 6.0.0 + */ + public function setPost(\WP_Post $post) + { + } + /** + * Sets post type + * + * @param string $postType WP Post Type. + * @return $this + * @since 6.0.0 + */ + public function setPostType($postType) + { + } + /** + * Checks if adapter already have the post + * + * @return bool + * @since 6.0.0 + */ + public function hasPost() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Nameable interface + */ + interface Nameable + { + /** + * Gets name + * + * @return string name + */ + public function getName(); + /** + * Gets slug + * + * @return string slug + */ + public function getSlug(); + } + /** + * Receivable interface + */ + interface Receivable extends \BracketSpace\Notification\Interfaces\Nameable + { + /** + * Parses saved value something understood by notification + * Must be defined in the child class + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = ''); + /** + * Returns input object + * Must be defined in the child class + * + * @return object + */ + public function input(); + /** + * Gets default value + * + * @return string + */ + public function getDefaultValue(); + } +} +namespace BracketSpace\Notification\Traits { + /** + * ClassUtils trait + */ + trait ClassUtils + { + /** + * Get short class name without namespace + * + * @return string + */ + public function getShortClassName() + { + } + /** + * Get nice class names with title case and spaces + * + * @return string + */ + public function getNiceClassName() + { + } + /** + * Get class slug with dash separators + * + * @return string + */ + public function getClassSlug() + { + } + } + /** + * HasName trait + */ + trait HasName + { + /** + * Human readable, translated name + * + * @var string + */ + protected $name; + /** + * Gets name + * + * If the name is not set, automatically generated + * one is used with title case and spaces. + * + * @return string name + */ + public function getName() + { + } + /** + * Sets name + * + * @param string $name Name. + * @return $this + */ + public function setName(string $name) + { + } + } + /** + * HasSlug trait + */ + trait HasSlug + { + /** + * Object slug + * + * @var string + */ + protected $slug; + /** + * Gets slug + * + * If the slug is not set, automatically generated + * one is used with words separated by `-`. + * + * @return string slug + */ + public function getSlug() + { + } + /** + * Sets slug + * + * @param string $slug Slug. + * @return $this + */ + public function setSlug(string $slug) + { + } + } +} +namespace BracketSpace\Notification\Repository\Recipient { + /** + * Recipient abstract class + */ + abstract class BaseRecipient implements \BracketSpace\Notification\Interfaces\Receivable + { + use \BracketSpace\Notification\Traits\ClassUtils; + use \BracketSpace\Notification\Traits\HasName; + use \BracketSpace\Notification\Traits\HasSlug; + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * List of available return fields. + */ + protected const AVAILABLE_RETURN_FIELDS = ['ID', 'user_email']; + /** + * Return field key name. + * + * @var string + */ + protected $returnField = 'user_email'; + /** + * Recipient input default value + * + * @var string + */ + protected $defaultValue; + /** + * Recipient constructor + * + * @param array<mixed> $params recipient configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Parses saved value something understood by the Carrier + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * Returns input object + * + * @return \BracketSpace\Notification\Interfaces\Fillable + */ + public abstract function input(); + /** + * Gets default value + * + * @return string + */ + public function getDefaultValue() + { + } + } +} +namespace BracketSpace\Notification\Defaults\Recipient { + /** + * Webhook recipient + * + * @deprecated 3.0.0 + */ + class Webhook extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @param string $slug webook type slug. + * @param string $name webook type name. + * @since 5.0.0 + */ + public function __construct($slug, $name) + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Sendable interface + */ + interface Sendable extends \BracketSpace\Notification\Interfaces\Nameable + { + /** + * Activates the Carrier + * + * @return $this + */ + public function activate(); + /** + * Sends the carrier + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger trigger object. + * @return void + */ + public function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger); + /** + * Generates an unique hash for carrier instance + * + * @return string + */ + public function hash(); + /** + * Gets form fields array + * + * @return array<\BracketSpace\Notification\Interfaces\Fillable> fields + */ + public function getFormFields(); + /** + * Checks if Carrier is enabled + * + * @return bool + */ + public function isEnabled(); + /** + * Checks if Carrier is active + * + * @return bool + */ + public function isActive(); + /** + * Sets data from array + * + * @param array<string,mixed> $data Data with keys matched with Field names. + * @return $this + */ + public function setData($data); + /** + * Gets data + * + * @return array<string,mixed> + */ + public function getData(); + /** + * Enables the Carrier + * + * @return $this + */ + public function enable(); + /** + * Disables the Carrier + * + * @return $this + */ + public function disable(); + /** + * Gets form fields array + * + * @param string $fieldName Field name. + * @return mixed Field object or null. + */ + public function getFormField($fieldName); + /** + * Gets the saved recipients + * + * @return array<mixed> + */ + public function getRecipients(); + /** + * Gets field value + * + * @param string $fieldSlug field slug. + * @return mixed value or null if field not available + */ + public function getFieldValue($fieldSlug); + /** + * Gets the recipients field + * Calls the field closure. + * + * @return \BracketSpace\Notification\Repository\Field\RecipientsField|null + * @since 8.0.0 + */ + public function getRecipientsField(); + /** + * Checks if the recipients field was added + * + * @return bool + * @since 8.0.0 + */ + public function hasRecipientsField(); + } +} +namespace BracketSpace\Notification\Repository\Carrier { + /** + * Carrier abstract class + */ + abstract class BaseCarrier implements \BracketSpace\Notification\Interfaces\Sendable + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + use \BracketSpace\Notification\Traits\ClassUtils; + use \BracketSpace\Notification\Traits\HasName; + use \BracketSpace\Notification\Traits\HasSlug; + /** + * Form fields + * + * @var array<Interfaces\Fillable> + */ + public $formFields = []; + /** + * Recipients form field closure + * + * @var callable(): \BracketSpace\Notification\Repository\Field\RecipientsField|null + */ + protected $recipientsField; + /** + * Recipients form field index + * + * @var int + */ + public $recipientsFieldIndex = 0; + /** + * Recipients form field raw data + * + * @var mixed + */ + public $recipientsData; + /** + * Recipients form field resolved data + * + * @var array<mixed> + */ + public $recipientsResolvedData; + /** + * Fields data for send method + * + * @var array<mixed> + */ + public $data = []; + /** + * Restricted form field keys + * + * @var array<string> + */ + public $restrictedFields = ['_nonce', 'activated', 'enabled']; + /** + * If is suppressed + * + * @var bool + */ + protected $suppressed = false; + /** + * Carrier icon + * + * @var string SVG + */ + //phpcs:ignore Generic.Files.LineLength.TooLong + public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 143.3 152.5"><path d="M119.8,120.8V138a69.47,69.47,0,0,1-43.2,14.5q-32.4,0-55-22.2Q-1.05,108-1,75.9c0-15.6,3.9-29.2,11.8-40.7A82,82,0,0,1,40.7,8.3,74,74,0,0,1,75.6,0a71.79,71.79,0,0,1,31,6.6,69.31,69.31,0,0,1,25.3,21.8c6.9,9.6,10.4,21.2,10.4,34.8,0,13.8-3.3,25.5-9.9,35.3s-14.3,14.7-23.1,14.7c-10.6,0-16-6.9-16-20.6V82.3C93.3,63.4,86.4,54,72.5,54c-6.2,0-11.2,2.2-14.8,6.5a23.85,23.85,0,0,0-5.4,15.8,19.46,19.46,0,0,0,6.2,14.9,21.33,21.33,0,0,0,15.1,5.7,21.75,21.75,0,0,0,13.8-4.7v16.6a27.67,27.67,0,0,1-15.5,4.3q-15.3,0-25.8-10.2t-10.5-27c0-15.5,6.8-26.7,20.4-33.8a36.74,36.74,0,0,1,17.9-4.3c12.2,0,21.7,4.5,28.5,13.6,5.2,6.9,7.9,17.4,7.9,31.5v8.5c0,3.1,1,4.7,3,4.7,3,0,5.7-3.2,8.3-9.6A56.78,56.78,0,0,0,125.4,65q0-28.95-23.6-42.9h.2c-8.1-4.3-17.4-6.4-28.1-6.4a57.73,57.73,0,0,0-28.7,7.7A58.91,58.91,0,0,0,24,45.1a61.18,61.18,0,0,0-8.2,31.5c0,17.2,5.7,31.4,17,42.7s25.7,16.9,43,16.9c9.6,0,17.5-1.2,23.6-3.5S112.3,126.5,119.8,120.8Z" transform="translate(1)"/></svg>'; + /** + * Carrier constructor + * + * @param string $slug Slug, optional. + * @param string $name Nice name, optional. + */ + public function __construct($slug = null, $name = null) + { + } + /** + * Clone method + * Copies the fields to new Carrier instance + * + * @return void + * @since 5.1.6 + */ + public function __clone() + { + } + /** + * Used to register Carrier form fields + * Uses $this->addFormField(); + * + * @return void + */ + public function formFields() + { + } + /** + * Sends the Carrier + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger trigger object. + * @return void + */ + public abstract function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger); + /** + * Generates an unique hash for Carrier instance + * + * @return string + */ + public function hash() + { + } + /** + * Adds form field to collection + * + * @param \BracketSpace\Notification\Interfaces\Fillable $field Field object. + * @return $this + * @throws \Exception When restricted name is used. + * @since 6.0.0 Added restricted field check. + */ + public function addFormField(\BracketSpace\Notification\Interfaces\Fillable $field) + { + } + /** + * Adds recipients form field + * + * @param array<mixed> $params Recipients field params. + * @return $this + * @throws \Exception When recipients fields was already added. + * @since 8.0.0 + */ + public function addRecipientsField(array $params = []) + { + } + /** + * Checks if the recipients field was added + * + * @return bool + * @since 8.0.0 + */ + public function hasRecipientsField() + { + } + /** + * Gets the recipients field + * Calls the field closure. + * + * @return \BracketSpace\Notification\Repository\Field\RecipientsField|null + * @since 8.0.0 + */ + public function getRecipientsField() + { + } + /** + * Gets the saved recipients + * + * @return mixed + */ + public function getRecipients() + { + } + /** + * Gets form fields array + * + * @return array<\BracketSpace\Notification\Interfaces\Fillable> fields + */ + public function getFormFields() + { + } + /** + * Gets form fields array + * + * @param string $fieldName Field name. + * @return Interfaces\Fillable|null Field object or null. + * @since 6.0.0 + */ + public function getFormField($fieldName) + { + } + /** + * Gets field value + * + * @param string $fieldSlug field slug. + * @return mixed value or null if field not available + */ + public function getFieldValue($fieldSlug) + { + } + /** + * Resolves all fields + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return void + * @since 6.0.0 + */ + public function resolveFields(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Resolves Merge Tags in field value + * + * @param mixed $value String or array, field value. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return mixed + * @since 6.0.0 + */ + protected function resolveValue($value, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Prepares saved data for easy use in send() method + * Saves all the values in $data property + * + * @return void + * @since 5.0.0 + */ + public function prepareData() + { + } + /** + * Parses the recipients to a flat array. + * + * It needs recipients_resolved_data property so the + * resolve_fields method needs to be called beforehand. + * + * @return array<int,mixed> + * @since 8.0.0 + */ + public function parseRecipients() + { + } + /** + * Sets data from array + * + * @param array<mixed> $data Data with keys matched with Field names. + * @return $this + * @since 6.0.0 + */ + public function setData($data) + { + } + /** + * Sets field data + * + * @param \BracketSpace\Notification\Interfaces\Fillable $field Field. + * @param mixed $data Field data. + * @return void + * @since 8.0.0 + */ + protected function setFieldData(\BracketSpace\Notification\Interfaces\Fillable $field, $data) + { + } + /** + * Gets data + * + * @return array<string,mixed> + * @since 6.0.0 + */ + public function getData() + { + } + /** + * Checks if Carrier is active + * + * @return bool + * @since 6.3.0 + */ + public function isActive() + { + } + /** + * Activates the Carrier + * + * @return $this + * @since 6.3.0 + */ + public function activate() + { + } + /** + * Deactivates the Carrier + * + * @return $this + * @since 6.3.0 + */ + public function deactivate() + { + } + /** + * Checks if Carrier is enabled + * + * @return bool + * @since 6.0.0 + */ + public function isEnabled() + { + } + /** + * Enables the Carrier + * + * @return $this + * @since 6.0.0 + */ + public function enable() + { + } + /** + * Disables the Carrier + * + * @return $this + * @since 6.0.0 + */ + public function disable() + { + } + /** + * Checks if Carrier is suppressed + * + * @return bool + * @since 5.1.2 + */ + public function isSuppressed() + { + } + /** + * Suppresses the Carrier + * + * @return void + * @since 5.1.2 + */ + public function suppress() + { + } + } +} +namespace BracketSpace\Notification\Defaults\Carrier { + /** + * Webhook Carrier + * + * @deprecated 3.0.0 + */ + class WebhookJson extends \BracketSpace\Notification\Repository\Carrier\BaseCarrier + { + use \BracketSpace\Notification\Traits\Webhook; + /** + * Carrier icon + * + * @var string SVG + */ + //phpcs:ignore Generic.Files.LineLength.TooLong + public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 402.07 372.81"><path d="M100.7,239.8q23.25-38,46.9-76.5c-22.1-21.5-32.4-47.5-30.2-78,1.7-23.7,11.5-44,28.9-60.5C180-7,232.8-8.4,269,21.6c36.6,30.3,44.7,82.2,22.8,119.7-8.2-4.8-16.5-9.5-25.1-14.5,9.5-20.3,9.7-40.5-.5-60.5a63.54,63.54,0,0,0-34.4-31.1c-29.3-11.5-61.2.6-76.3,28.3-14.3,26.3-9.1,72,32.8,91.6-20.8,33.9-41.7,67.7-62.4,101.5,11.5,20,6.8,40.2-7.7,52.3-13,10.9-31.3,11.7-45.6,2.2A39.54,39.54,0,0,1,56.4,267C61.9,248.4,75.3,240.1,100.7,239.8Z" transform="translate(0.01 0.01)"/><path d="M90.9,184.8v28.9c-20.6,2.5-37.2,12.1-48.8,29.8-9,13.7-12.2,28.7-10.3,44.9a60.28,60.28,0,0,0,58.7,53.2c20.7.4,38-7.7,51.4-23.5s16.9-34.3,14.5-55.1H270.5c12.4-21.6,34-26.5,50.4-19.7a38.83,38.83,0,0,1,23.5,40.6c-2,16.7-15.6,31.2-32,33.9-18.9,3.2-34.1-5.5-43.3-24.9H186.4c-8.7,57.3-66.3,90.4-117.3,76.9-45.9-12.1-75.6-58-67.9-104.6C9.9,212.7,54.1,185,90.9,184.8Z" transform="translate(0.01 0.01)"/><path d="M212.7,132.1c-23.6-1.7-38-12.7-41.7-31.3a38.1,38.1,0,0,1,19.9-41.5A39.61,39.61,0,0,1,238,67.2c13.4,14.1,14,30.1,1.5,51.5q19.2,35.4,38.5,71.2c29.3-8.3,56.9-5.2,82.3,11.6,20,13.2,33.2,31.7,39,55a92.71,92.71,0,0,1-60.1,110c-47,16.2-94-6.4-113-40.9,8.2-4.8,16.5-9.6,24.7-14.3,25.6,36.5,69.8,35.9,94.6,17.6,25.2-18.6,33.1-52.5,17.8-79.5-9.8-17.2-24.7-27.7-44.1-31.8s-37,1.2-53.6,12.2C247.8,196.9,230.2,164.5,212.7,132.1Z" transform="translate(0.01 0.01)"/></svg>'; + /** + * Used to register Carrier form fields + * Uses $this->addFormField(); + * + * @return void + */ + public function formFields() + { + } + /** + * Sends the notification + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger trigger object. + * @return void + */ + public function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } + /** + * Webhook Carrier + * + * @deprecated 3.0.0 + */ + class Webhook extends \BracketSpace\Notification\Repository\Carrier\BaseCarrier + { + use \BracketSpace\Notification\Traits\Webhook; + /** + * Carrier icon + * + * @var string SVG + */ + //phpcs:ignore Generic.Files.LineLength.TooLong + public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 402.07 372.81"><path d="M100.7,239.8q23.25-38,46.9-76.5c-22.1-21.5-32.4-47.5-30.2-78,1.7-23.7,11.5-44,28.9-60.5C180-7,232.8-8.4,269,21.6c36.6,30.3,44.7,82.2,22.8,119.7-8.2-4.8-16.5-9.5-25.1-14.5,9.5-20.3,9.7-40.5-.5-60.5a63.54,63.54,0,0,0-34.4-31.1c-29.3-11.5-61.2.6-76.3,28.3-14.3,26.3-9.1,72,32.8,91.6-20.8,33.9-41.7,67.7-62.4,101.5,11.5,20,6.8,40.2-7.7,52.3-13,10.9-31.3,11.7-45.6,2.2A39.54,39.54,0,0,1,56.4,267C61.9,248.4,75.3,240.1,100.7,239.8Z" transform="translate(0.01 0.01)"/><path d="M90.9,184.8v28.9c-20.6,2.5-37.2,12.1-48.8,29.8-9,13.7-12.2,28.7-10.3,44.9a60.28,60.28,0,0,0,58.7,53.2c20.7.4,38-7.7,51.4-23.5s16.9-34.3,14.5-55.1H270.5c12.4-21.6,34-26.5,50.4-19.7a38.83,38.83,0,0,1,23.5,40.6c-2,16.7-15.6,31.2-32,33.9-18.9,3.2-34.1-5.5-43.3-24.9H186.4c-8.7,57.3-66.3,90.4-117.3,76.9-45.9-12.1-75.6-58-67.9-104.6C9.9,212.7,54.1,185,90.9,184.8Z" transform="translate(0.01 0.01)"/><path d="M212.7,132.1c-23.6-1.7-38-12.7-41.7-31.3a38.1,38.1,0,0,1,19.9-41.5A39.61,39.61,0,0,1,238,67.2c13.4,14.1,14,30.1,1.5,51.5q19.2,35.4,38.5,71.2c29.3-8.3,56.9-5.2,82.3,11.6,20,13.2,33.2,31.7,39,55a92.71,92.71,0,0,1-60.1,110c-47,16.2-94-6.4-113-40.9,8.2-4.8,16.5-9.6,24.7-14.3,25.6,36.5,69.8,35.9,94.6,17.6,25.2-18.6,33.1-52.5,17.8-79.5-9.8-17.2-24.7-27.7-44.1-31.8s-37,1.2-53.6,12.2C247.8,196.9,230.2,164.5,212.7,132.1Z" transform="translate(0.01 0.01)"/></svg>'; + /** + * Used to register Carrier form fields + * Uses $this->addFormField(); + * + * @return void + */ + public function formFields() + { + } + /** + * Sends the notification + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger trigger object. + * @return void + */ + public function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } +} +namespace { + /*! + * ISC License + * + * Copyright (c) 2018-2021, Andrea Giammarchi, @WebReflection + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + class FlattedString + { + public $value = ''; + public function __construct($value) + { + } + } + class Flatted + { + // public utilities + public static function parse($json, $assoc = \false, $depth = 512, $options = 0) + { + } + public static function stringify($value, $options = 0, $depth = 512) + { + } + } +} +namespace BracketSpace\Notification\Tests\Core { + /** + * Whitelabel test case. + */ + class TestWhitelabel extends \WP_UnitTestCase + { + /** + * Test enabling whitelabeling + * + * @since 8.0.0 + */ + public function test_enabling_whitelabeling() + { + } + } + /** + * Sync test case. + */ + class TestSync extends \WP_UnitTestCase + { + /** + * Test enabling syncing + * + * @since 8.0.0 + */ + public function test_enabling_syncing() + { + } + /** + * Test disabling syncing + * + * @since 8.0.0 + */ + public function test_disabling_syncing() + { + } + /** + * Test enabling syncing with default theme path + * + * @since 8.0.0 + */ + public function test_enabling_syncing_with_default_dir() + { + } + /** + * Test enabling syncing twice, which shouldn't be possible + * + * @since 8.0.0 + */ + public function test_enabling_syncing_twice() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } + /** + * Notification test case. + */ + class TestNotification extends \WP_UnitTestCase + { + /** + * Test hash creation + * + * @since 6.0.0 + */ + public function test_hash() + { + } + /** + * Test title + * + * @since 6.0.0 + */ + public function test_title() + { + } + /** + * Test trigger + * + * @since 6.0.0 + */ + public function test_trigger() + { + } + /** + * Test trigger exception + * + * @since 6.0.0 + */ + public function test_trigger_exception() + { + } + /** + * Test carriers + * + * @since 6.0.0 + */ + public function test_carriers() + { + } + /** + * Test carriers exception + * + * @since 6.0.0 + */ + public function test_carriers_exception() + { + } + /** + * Test enabled + * + * @since 6.0.0 + */ + public function test_enabled() + { + } + /** + * Test extras + * + * @since 6.0.0 + */ + public function test_extras() + { + } + /** + * Test extras exception + * + * @since 6.0.0 + */ + public function test_extras_exception() + { + } + /** + * Test version + * + * @since 6.0.0 + */ + public function test_version() + { + } + /** + * Test create_hash + * + * @since 6.0.0 + */ + public function test_create_hash() + { + } + /** + * Test add_carrier object + * + * @since 6.0.0 + */ + public function test_add_carrier_object() + { + } + /** + * Test add_carrier existing exception + * + * @since 6.0.0 + */ + public function test_add_notification_existing_exception() + { + } + /** + * Test add_carrier not-existing exception + * + * @since 6.0.0 + */ + public function test_add_carrier_not_existing_exception() + { + } + /** + * Test get_carrier + * + * @since 6.0.0 + */ + public function test_get_carrier() + { + } + /** + * Test enable_carrier + * + * @since 6.0.0 + */ + public function test_enable_carrier() + { + } + /** + * Test enable_carrier and adding + * + * @since 6.0.0 + */ + public function test_enable_carrier_adding() + { + } + /** + * Test disable_carrier + * + * @since 6.0.0 + */ + public function test_disable_carrier() + { + } + /** + * Test get_extra + * + * @since 6.0.0 + */ + public function test_get_extra() + { + } + /** + * Test from + */ + public function test_from() + { + } + /** + * Test to + */ + public function test_to() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } + /** + * Main test case. + */ + class TestMain extends \WP_UnitTestCase + { + /** + * Notification Runtime + */ + public $notification; + /** + * Setup test + * + * @since 5.2.3 + */ + public function setUp() : void + { + } + /** + * Test Runtime instance + * + * @since 5.2.3 + */ + public function test_runtime() + { + } + /** + * Test boot method + * + * @since 5.2.3 + */ + public function test_boot() + { + } + } +} +namespace BracketSpace\Notification\Tests\Recipient { + class TestRecipientStore extends \WP_UnitTestCase + { + /** + * Test recipient registration + * + * @since 6.3.0 + */ + public function test_recipient_registration_action() + { + } + /** + * Test getting recipients + * + * @since 6.3.0 + */ + public function test_getting_recipient() + { + } + /** + * Test getting recipients + * + * @since 6.3.0 + */ + public function test_getting_recipients() + { + } + /** + * Test getting carrier recipients + * + * @since 6.3.0 + */ + public function test_getting_carrier_recipients() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } +} +namespace BracketSpace\Notification\Tests\Traits { + /** + * Main test case. + */ + class TestClassUtils extends \WP_UnitTestCase + { + /** + * Dummy Class + */ + public $sut; + /** + * Setup test + * + * @since 5.2.3 + */ + public function setUp() : void + { + } + public function test_automatically_generated_name() + { + } + public function test_automatically_generated_slug() + { + } + } +} +namespace BracketSpace\Notification\Tests\Triggers { + /** + * Trigger Store test case. + */ + class TestTriggerStore extends \WP_UnitTestCase + { + /** + * Test getting trigger + * + * @since 6.3.0 + */ + public function test_getting_trigger() + { + } + public function test_getting_triggers() + { + } + /** + * Test getting triggers grouped + * + * @since 6.3.0 + */ + public function test_getting_triggers_grouped() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } + /** + * Trigger test case. + */ + class TestTrigger extends \WP_UnitTestCase + { + /** + * Tests trigger action + * + * @since 5.3.1 + * @since 6.0.0 Changed to Registerer class and used new naming convention. + */ + public function test_trigger_action() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } +} +namespace BracketSpace\Notification\Tests\Resolvers { + class TestResolverStore extends \WP_UnitTestCase + { + /** + * Test resolver registration + * + * @since 6.3.0 + */ + public function test_resolver_registration_action() + { + } + } +} +namespace BracketSpace\Notification\Tests\Carriers { + class TestCarierStore extends \WP_UnitTestCase + { + /** + * Test carier registration + * + * @since 6.3.0 + */ + public function test_carrier_registration_action() + { + } + /** + * Test getting carriers + * + * @since 6.3.0 + */ + public function test_getting_carriers() + { + } + /** + * Test getting carrier + * + * @since 6.3.0 + */ + public function test_getting_carrier() + { + } + /** + * Clears after the test + * + * @since 8.0.0 + * @return void + */ + public function tearDown() : void + { + } + } +} +namespace BracketSpace\Notification\Tests\Helpers { + /** + * NotificationPost helper class + */ + class NotificationPost + { + /** + * Inserts notification post based on trigger and carrier + * + * @since 5.3.1 + * @since 6.0.0 Changed to adapter implementation + * @param Triggerable $trigger Trigger class or slug. + * @param Sendable $carrier Carrier class or slug. + * @return Adaptable Notification WordPress adapter. + */ + public static function insert(\BracketSpace\Notification\Interfaces\Triggerable $trigger, \BracketSpace\Notification\Interfaces\Sendable $carrier) + { + } + } +} +namespace BracketSpace\Notification\Tests\Helpers\Objects { + /** + * Recipient class + */ + class Recipient extends \BracketSpace\Notification\Abstracts\Recipient + { + /** + * Recipient input default value + * + * @var string + */ + protected $default_value; + /** + * Recipient constructor + * + * @since 6.3.0 + */ + public function __construct() + { + } + /** + * Parses saved value something understood by the Carrier + * + * @param string $value raw value saved by the user. + * @return void + */ + public function parse_value($value = '') + { + } + /** + * Returns input object + * + * @return void + */ + public function input() + { + } + /** + * Gets default value + * + * @return string + */ + public function get_default_value() + { + } + } + /** + * Resolver class + */ + class Resolver extends \BracketSpace\Notification\Abstracts\Resolver + { + /** + * Dummy resolver slug + * + * @since 6.3.0 + * @return string + */ + public function get_slug() + { + } + /** + * Gets merge tag pattern + * + * @return void + */ + public function get_pattern() + { + } + /** + * Gets resolver priority + * + * @return void + */ + public function get_priority() + { + } + /** + * Resolves single matched merge tag + * + * @param array $match Match array. + * @param Triggerable $trigger Trigger object. + * @return void + */ + public function resolve_merge_tag($match, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } + /** + * PostponedTrigger class + */ + class PostponedTrigger extends \BracketSpace\Notification\Abstracts\Trigger + { + /** + * Constructor + */ + public function __construct($tag) + { + } + /** + * Trigger action + * + * @since 5.3.1 + * @return void + */ + public function action() + { + } + /** + * Registers merge tags + * + * @since 5.3.1 + * @return void + */ + public function merge_tags() + { + } + } + /** + * Carrier class + */ + class Carrier extends \BracketSpace\Notification\Abstracts\Carrier + { + /** + * Is sent flag + * + * @var boolean + */ + public $is_sent = false; + /** + * Dummy notification constructor + * + * @since 5.3.1 + */ + public function __construct($slug) + { + } + /** + * Used to register notification form fields + * + * @since 5.3.1 + * @return void + */ + public function formFields() + { + } + /** + * Sends the notification + * + * @since 5.3.1 + * @param Triggerable $trigger trigger object. + * @return void + */ + public function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } + /** + * SimpleTrigger class + */ + class SimpleTrigger extends \BracketSpace\Notification\Abstracts\Trigger + { + /** + * Constructor + */ + public function __construct($tag) + { + } + /** + * Registers merge tags + * + * @since 5.3.1 + * @return void + */ + public function merge_tags() + { + } + } + /** + * DummyClassName class + */ + class DummyClassName + { + use \BracketSpace\Notification\Traits\ClassUtils, \BracketSpace\Notification\Traits\HasName, \BracketSpace\Notification\Traits\HasSlug, \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + } +} +namespace BracketSpace\Notification\Tests\Helpers { + /** + * Registerer helper class + */ + class Registerer + { + /** + * Registers Trigger + * + * @since 6.0.0 + * @param bool $postponed If Trigger should be Postponed Trigger. + * @return Objects\Notification Registered Trigger. + */ + public static function register_trigger($tag = null, $postponed = false) + { + } + /** + * Clears all Triggers + * + * @since 8.0.0 + * @return void + */ + public static function clear_triggers() + { + } + /** + * Registers Carrier + * + * @since 6.0.0 + * @return Objects\Carrier Registered Carrier. + */ + public static function register_carrier($carrier_slug = 'dummmy') + { + } + /** + * Clears all Carriers + * + * @since 8.0.0 + * @return void + */ + public static function clear_carriers() + { + } + /** + * Registers Notification + * + * @since 6.0.0 + * @param mixed $trigger Trigger object or null + * @param array $carriers Array of Carrier objects + * @return Notification Registered Notification. + */ + public static function register_notification($trigger = null, $carriers = []) + { + } + /** + * Registers Default Notification + * + * @since 6.0.0 + * @param bool $postponed If trigger should be postponed. + * @return Notification Registered Notification. + */ + public static function register_default_notification($postponed = false) + { + } + /** + * Clears all Notifications + * + * @since 8.0.0 + * @return void + */ + public static function clear_notifications() + { + } + /** + * Register Resolver + * + * @since 6.3.0 + * @return Objects\Resolver Registered Resolver. + */ + public static function register_resolver() + { + } + /** + * Clears all Resolvers + * + * @since 8.0.0 + * @return void + */ + public static function clear_resolvers() + { + } + /** + * Register Recipient + * + * @since 6.3.0 + * @param string $carrier_slug Carrier slug. + * @return Objects\Recipient Registered Recipient. + */ + public static function register_recipient($carrier_slug = 'dummy_carrier') + { + } + /** + * Clears all Recipients + * + * @since 8.0.0 + * @return void + */ + public static function clear_recipients() + { + } + /** + * Clears all registered items + * + * @since 8.0.0 + * @return void + */ + public static function clear() + { + } + } +} +namespace BracketSpace\Notification\Tests\Notifications { + class TestNotificationStore extends \WP_UnitTestCase + { + /** + * Test notification registration + * + * @since 6.3.0 + */ + public function test_notification_registration_action() + { + } + } +} +namespace Tests { + class UnitTestCase extends \WP_UnitTestCase + { + use \Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; + /** + * Test set up. + * + * @since 3.0.0 + * @return void + */ + protected function setUp() : void + { + } + /** + * Test tear down. + * + * @since 3.0.0 + * @return void + */ + protected function tearDown() : void + { + } + } +} +namespace { + /** + * Notification class + */ + class Notification + { + /** + * Runtime object + * + * @var BracketSpace\Notification\Runtime + */ + protected static $runtime; + /** + * Initializes the plugin runtime + * + * @since 7.0.0 + * @param string $pluginFile Main plugin file. + * @return BracketSpace\Notification\Runtime + */ + public static function init($pluginFile) + { + } + /** + * Gets runtime component + * + * @since 7.0.0 + * @return array + */ + public static function components() + { + } + /** + * Gets runtime component + * + * @since 7.0.0 + * @param class-string $componentName Component name. + * @return mixed + */ + public static function component($componentName) + { + } + /** + * Gets runtime object + * + * @since 7.0.0 + * @return BracketSpace\Notification\Runtime + */ + public static function runtime() + { + } + /** + * Gets plugin version + * + * @since 7.0.0 + * @return string + */ + public static function version() + { + } + /** + * Gets plugin filesystem + * + * @since 8.0.0 + * @throws \Exception When settings class wasn't invoked yet. + * @return BracketSpace\Notification\Core\Settings + */ + public static function settings() + { + } + /** + * Gets plugin settings instance + * + * @since 3.0.0 + * @throws \Exception When runtime wasn't invoked yet. + * @return \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem + */ + public static function fs() + { + } + } +} +namespace BracketSpace\Notification { + /** + * Runtime class + */ + class Runtime + { + use \BracketSpace\Notification\Dependencies\Micropackage\DocHooks\HookTrait; + /** + * Plugin version + */ + const VERSION = '9.0.0'; + /** + * Main plugin file path + * + * @var string + */ + protected $pluginFile; + /** + * Flag for unmet requirements + * + * @var bool + */ + protected $requirementsUnmet; + /** + * Filesystems + * + * @var \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem + */ + protected $filesystem; + /** + * Components + * + * @var array<class-string,mixed> + */ + protected $components = []; + /** + * Class constructor + * + * @since 5.0.0 + * @param string $pluginFile plugin main file full path. + */ + public function __construct($pluginFile) + { + } + /** + * Loads needed files + * + * @since 5.0.0 + * @since 6.0.0 Added boot action. + * @since 7.0.0 All the defaults and init action are called on initialization. + * @return void + */ + public function init() + { + } + /** + * Registers WP CLI commands + * + * @since 8.0.0 + * @return void + */ + public function cliCommands() + { + } + /** + * Registers all the hooks with DocHooks + * + * @since 6.1.0 + * @return void + */ + public function registerHooks() + { + } + /** + * Gets filesystem + * + * @since 7.0.0 + * @since 8.0.0 Always return the root filesystem. + * @param string $deprecated Filesystem name. + * @return \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem + */ + public function getFilesystem($deprecated = 'root') + { + } + /** + * Adds runtime component + * + * @throws \Exception When component is already registered. + * @since 7.0.0 + * @since 3.0.0 Only the component name is accepter + * @param mixed $component Component. + * @param null $deprecated Deprecated since 3.0.0. + * @return $this + */ + public function addComponent($component, $deprecated = null) + { + } + /** + * Gets runtime component + * + * @since 7.0.0 + * @since 3.0.0 Components are referenced by FQCN. + * @param string $name Component name. + * @return mixed Component or null + */ + public function component($name) + { + } + /** + * Gets runtime components + * + * @since 7.0.0 + * @return array + */ + public function components() + { + } + /** + * Creates needed classes + * Singletons are used for a sake of performance + * + * @since 5.0.0 + * @return void + */ + public function singletons() + { + } + /** + * All WordPress actions this plugin utilizes + * + * @since 5.0.0 + * @return void + */ + public function actions() + { + } + /** + * Loads defaults + * + * @action notification/init 8 + * + * @since 6.0.0 + * @since 8.0.0 Is hooked to notification/init action. + * @return void + */ + public function defaults() + { + } + /** + * Loads default + * + * @since 6.0.0 + * @param string $default Default file slug. + * @param class-string $className Default class name. + * @return void + */ + public function loadDefault($default, $className) + { + } + /** + * Loads bundled extensions + * + * @since 7.0.0 + * @return void + */ + public function loadBundledExtensions() + { + } + } +} +namespace BracketSpace\Notification\Database\Queries { + /** + * Users Queries class + */ + class UserQueries + { + /** + * Gets all users. + * + * @return array<int,array{ID: string, user_email: string, display_name: string}> + */ + public static function all() + { + } + /** + * Gets users with role. + * + * @param string $role user role. + * @return array<int,array{ID: string, user_email: string, display_name: string}> + */ + public static function withRole(string $role) + { + } + } +} +namespace BracketSpace\Notification\Database { + /** + * This class describes a notification database service. + * + * @since 3.0.0 + */ + class NotificationDatabaseService + { + /** + * Indicates whether an operation is in progress. + * + * Returns string with the name of the operation + * or false if no operation is in progress. + * + * @var false|string + */ + protected static $doingOperation = false; + /** + * Last ID of the post that has been created or updated. + * + * @var int + */ + protected static $lastUpsertedPostId = 0; + /** + * Gets the notifications table name. + * + * @return string The notifications table name. + */ + public static function getNotificationsTableName() : string + { + } + /** + * Gets the notification carriers table name. + * + * @return string The notification carriers table name. + */ + public static function getNotificationCarriersTableName() : string + { + } + /** + * Gets the notification extras table name. + * + * @return string The notification extras table name. + */ + public static function getNotificationExtrasTableName() : string + { + } + /** + * Checks whether save process is in progress. + * + * @return false|string + */ + public static function doingOperation() + { + } + /** + * Gets last upserted Post ID. + * + * @return int + */ + public static function getLastUpsertedPostId() : int + { + } + /** + * Counts the Notifications in database + * + * @return int + */ + public static function count() : int + { + } + /** + * Translates post ID to Notification object + * + * @param int|\WP_Post $post Notification post object or post ID + * @return ?Notification + */ + public static function postToNotification($post) : ?\BracketSpace\Notification\Core\Notification + { + } + /** + * Translates Notification to WP_Post + * + * @param string|Notification $notification Notification object or hash. + * @return ?\WP_Post + */ + public static function notificationToPost($notification) : ?\WP_Post + { + } + /** + * Upserts the Notification database entry. + * + * @param \BracketSpace\Notification\Core\Notification $notification The notification + * @return void + */ + public static function upsert(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Checks if Notification exists in database. + * + * @param string $hash Notification hash + * @return bool + */ + public static function has($hash) + { + } + /** + * Gets the Notification from database. + * + * @param string $hash Notification hash + * @return Notification|null + */ + public static function get($hash) + { + } + /** + * Gets all the Notifications from database. + * + * @return array<string, Notification> + */ + public static function getAll() + { + } + /** + * Deletes the Notification from database. + * + * @param string $hash Notification hash + * @return void + */ + public static function delete($hash) + { + } + /** + * Deletes the Notification carriers. + * + * @param string $hash Notification hash + * @return void + */ + public static function deleteCarriers($hash) + { + } + /** + * Deletes the Notification extras. + * + * @param string $hash Notification hash + * @return void + */ + public static function deleteExtras($hash) + { + } + /** + * Gets the cache instance for single notification. + * + * @param string $hash Notification hash. + * @return CacheDriver\ObjectCache + */ + protected static function getCache($hash) + { + } + /** + * Gets the cache key for single notification. + * + * @param string $hash Notification hash. + * @return string + */ + protected static function getCacheKey($hash) + { + } + } + /** + * This class describes a database service. + */ + class DatabaseService + { + /** + * Gets wpdb object. + * + * @return \wpdb WPDB class instance + */ + public static function db() : \wpdb + { + } + /** + * Prefixes the table name. + * + * @param string $tableName The table name + * @return string The prefixed table name. + */ + public static function prefixTable(string $tableName) : string + { + } + } +} +namespace BracketSpace\Notification\Repository { + /** + * Trigger Repository. + */ + class TriggerRepository + { + /** + * @return void + */ + public static function register() + { + } + /** + * @return void + */ + public static function registerPostTriggers() + { + } + /** + * @return void + */ + public static function registerTaxonomyTriggers() + { + } + /** + * @return void + */ + public static function registerUserTriggers() + { + } + /** + * @return void + */ + public static function registerMediaTriggers() + { + } + /** + * @return void + */ + public static function registerCommentTriggers() + { + } + /** + * @return void + */ + public static function registerWpTriggers() + { + } + /** + * @return void + */ + public static function registerPluginTriggers() + { + } + /** + * @return void + */ + public static function registerThemeTriggers() + { + } + /** + * @return void + */ + public static function registerPrivacyTriggers() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Triggerable interface + */ + interface Triggerable extends \BracketSpace\Notification\Interfaces\Nameable + { + /** + * Sets up the merge tags + * + * @return void + */ + public function setupMergeTags(); + /** + * Gets Trigger's merge tags + * + * @param string $type Optional, all|visible|hidden, default: all. + * @param bool $grouped Optional, default: false. + * @return array<\BracketSpace\Notification\Interfaces\Taggable> + */ + public function getMergeTags($type = 'all', $grouped = false); + /** + * Clears the merge tags + * + * @return $this + */ + public function clearMergeTags(); + /** + * Stops the trigger. + * + * @return void + */ + public function stop(); + /** + * Checks if trigger has been stopped + * + * @return bool + */ + public function isStopped() : bool; + /** + * Gets Trigger actions + * + * @return array<int, array{tag: string, priority: int, accepted_args: int}> + * @since 8.0.0 + */ + public function getActions() : array; + /** + * Gets group + * + * @return string|null + */ + public function getGroup(); + } +} +namespace BracketSpace\Notification\Traits { + /** + * HasDescription trait + */ + trait HasDescription + { + /** + * Human readable, translated description + * + * @var string + */ + protected $description; + /** + * Gets description + * + * @return string|null Description + */ + public function getDescription() + { + } + /** + * Sets description + * + * @param string $description Description. + * @return $this + */ + public function setDescription(string $description) + { + } + } + /** + * HasGroup trait + */ + trait HasGroup + { + /** + * Human readable, translated group name + * + * @var string + */ + protected $group; + /** + * Gets group + * + * @return string|null Group name + */ + public function getGroup() + { + } + /** + * Sets group + * + * @param string $group Group name. + * @return $this + */ + public function setGroup(string $group) + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger { + /** + * Trigger abstract class + */ + abstract class BaseTrigger implements \BracketSpace\Notification\Interfaces\Triggerable + { + use \BracketSpace\Notification\Traits\ClassUtils; + use \BracketSpace\Notification\Traits\HasDescription; + use \BracketSpace\Notification\Traits\HasGroup; + use \BracketSpace\Notification\Traits\HasName; + use \BracketSpace\Notification\Traits\HasSlug; + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Flag indicating that trigger + * has been stopped + * + * @var bool + */ + protected $stopped = false; + /** + * Bound actions + * + * @var array<int, array{tag: string, priority: int, accepted_args: int}> + */ + protected $actions = []; + /** + * Merge tags + * + * @var array<mixed> + */ + protected $mergeTags = []; + /** + * Flag indicating that merge tags has been already added. + * + * @var bool + */ + protected $mergeTagsAdded = false; + /** + * Trigger constructor + * + * @param string $slug Slug, optional. + * @param string $name Nice name, optional. + */ + public function __construct($slug = null, $name = null) + { + } + /** + * Used to register trigger merge tags + * + * @return void + */ + public function mergeTags() + { + } + /** + * Sets up the merge tags + * + * @return void + */ + public function setupMergeTags() + { + } + /** + * Clears the merge tags + * + * @return $this + */ + public function clearMergeTags() + { + } + /** + * Adds an action listener + * + * @param string $tag action hook. + * @param int $priority action priority, default 10. + * @param int $acceptedArgs how many args the action accepts, default 1. + * @since 6.0.0 + * @since 6.3.0 Background processing action now accepts one more param for cache. + * @since 8.0.0 Only stores the action params in collection. + * @return void + * + */ + public function addAction($tag, $priority = 10, $acceptedArgs = 1) + { + } + /** + * Removes the action from the actions library. + * + * @param string $tag action hook. + * @param int $priority action priority, default 10. + * @param mixed $deprecated deprecated. + * @return void + */ + public function removeAction($tag, $priority = 10, $deprecated = null) + { + } + /** + * Gets Trigger actions + * + * @return array<int, array{tag: string, priority: int, accepted_args: int}> + * @since 8.0.0 + */ + public function getActions() : array + { + } + /** + * Adds Trigger's Merge Tag + * + * @param \BracketSpace\Notification\Interfaces\Taggable $mergeTag merge tag object. + * @return $this + */ + public function addMergeTag(\BracketSpace\Notification\Interfaces\Taggable $mergeTag) + { + } + /** + * Quickly adds new Merge Tag + * + * @param string $propertyName Trigger property name. + * @param string $label Nice, translatable Merge Tag label. + * @param string $group Optional, translatable group name. + * @since 6.0.0 + * @return $this + * + */ + public function addQuickMergeTag($propertyName, $label, $group = null) + { + } + /** + * Removes Trigger's merge tag + * + * @param string $mergeTagSlug Merge Tag slug. + * @return $this + */ + public function removeMergeTag($mergeTagSlug) + { + } + /** + * Gets Trigger's merge tags + * + * @param string $type Optional, all|visible|hidden, default: all. + * @param bool $grouped Optional, default: false. + * @return array<\BracketSpace\Notification\Interfaces\Taggable> + * @since 6.0.0 Added param $grouped which makes the array associative + * with merge tag slugs as keys. + */ + public function getMergeTags($type = 'all', $grouped = false) + { + } + /** + * Stops the trigger. + * + * @return void + * @since 6.2.0 + */ + public function stop() + { + } + /** + * Resumes the trigger. + * + * @return void + * @since 6.2.0 + */ + public function resume() + { + } + /** + * Checks if trigger has been stopped + * + * @return bool + */ + public function isStopped() : bool + { + } + /*********************************** + * DEPRECATED METHODS + ***********************************/ + /** + * All triggers can be considered postponed as of v8.0.0 + * as they are processed on the `shutdown` hook. + * + * @param string $tag action hook. + * @param int $priority action priority, default 10. + * @param int $acceptedArgs how many args the action accepts, default 1. + * @return void + * @since 6.2.0 Action cannot be postponed if background processing is active. + * @since 8.0.0 Deprecated + * @since 6.1.0 The postponed action have own method. + */ + public function postponeAction($tag, $priority = 10, $acceptedArgs = 1) + { + } + /** + * All triggers can be considered postponed as of v8.0.0 + * as they are processed on the `shutdown` hook. + * + * @return bool + * @since 8.0.0 Deprecated + */ + public function isPostponed() + { + } + /** + * Checks if this trigger has background processing active. + * + * @return bool + * @since 8.0.0 Deprecated + * @since 7.2.3 + */ + public function hasBackgroundProcessingEnabled() + { + } + /** + * Gets action arguments. + * + * @return array<mixed> + * @since 8.0.0 Deprecated + * @since 6.2.0 + */ + public function getActionArgs() + { + } + /** + * Always returns an empty array + * + * @return array<mixed> + * @since 8.0.0 Deprecated + * @since 6.3.0 + */ + public function getCache() + { + } + /** + * Doesn't do anything + * + * @param array<mixed> $cache Array with cached vars. + * @return $this + * @since 6.3.0 + * @since 8.0.0 Deprecated + */ + public function setCache($cache) + { + } + /** + * Always returns the $default value + * + * @param string $key Cache key. + * @param mixed $default Default value. + * @return mixed + * @since 8.0.0 Deprecated + * @since 6.3.0 + */ + public function cache($key, $default = '') + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Post { + /** + * Post trigger class + */ + abstract class PostTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Post Type slug + * + * @var string + */ + public $postType; + /** + * Post author user object + * + * @var \WP_User|false + */ + public $author; + /** + * Post last editor user object + * + * @var \WP_User|false + */ + public $lastEditor; + /** + * Post in subject. + * + * @var \WP_Post + */ + public $post; + /** + * Constructor + * + * @param array<mixed> $params trigger configuration params. + */ + public function __construct($params = []) + { + } + /** + * Lazy loads group name + * + * @return string|null Group name + */ + public function getGroup() + { + } + /** + * Gets Post Type slug + * + * @return string Post Type slug + */ + public function getPostType() : string + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + /** + * Gets the value of deprecated properties. + * + * @param string $property + * @return mixed + */ + public function __get($property) + { + } + } + /** + * Post approved trigger class. Approved means published after review. + */ + class PostApproved extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post approving user object + * + * @var \WP_User|false + */ + public $approvingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($post) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post published privately trigger class + */ + class PostPublishedPrivately extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Status name of published post + * + * @var string + */ + protected static $publishStatus = 'private'; + /** + * Post publishing user object + * + * @var \WP_User|false + */ + public $publishingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param string $newStatus New post status. + * @param string $oldStatus Old post status. + * @param \WP_Post $post Post object. + * @return false|void + */ + public function context($newStatus, $oldStatus, $post) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post updated trigger class + */ + class PostUpdated extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post updating user object + * + * @var \WP_User|false + */ + public $updatingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param int $postId Post ID. + * @param \WP_Post $post Post object. + * @param \WP_Post $postBefore Post before object. + * @return mixed void or false if no notifications should be sent + */ + public function context($postId, $post, $postBefore) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post added trigger class + */ + class PostAdded extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post publishing user object + * + * @var \WP_User|false + */ + public $publishingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * Return `false` if you want to abort the trigger execution + * + * @param int $postId Post ID. + * @param \WP_Post $post Post object. + * @param bool $update Whether this is an existing post being updated or not. + * @return mixed void or false if no notifications should be sent + */ + public function context($postId, $post, $update) + { + } + } + /** + * Post published trigger class + */ + class PostPublished extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Status name of published post + * + * @var string + */ + protected static $publishStatus = 'publish'; + /** + * Post publishing user object + * + * @var \WP_User|false + */ + public $publishingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param string $newStatus New post status. + * @param string $oldStatus Old post status. + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($newStatus, $oldStatus, $post) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post trashed trigger class + */ + class PostTrashed extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post trashing user object + * + * @var \WP_User|false + */ + public $trashingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param int $postId Post ID. + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($postId, $post) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post sent for review trigger class + */ + class PostScheduled extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post scheduling user object + * + * @var \WP_User|false + */ + public $schedulingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param string $newStatus New post status. + * @param string $oldStatus Old post status. + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($newStatus, $oldStatus, $post) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Post drafted trigger class + */ + class PostDrafted extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Post publishing user object + * + * @var \WP_User|false + */ + public $publishingUser; + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param string $newStatus New post status. + * @param string $oldStatus Old post status. + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($newStatus, $oldStatus, $post) + { + } + } + /** + * Post sent for review trigger class + */ + class PostPending extends \BracketSpace\Notification\Repository\Trigger\Post\PostTrigger + { + /** + * Constructor + * + * @param string $postType optional, default: post. + */ + public function __construct($postType = 'post') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param string $newStatus New post status. + * @param string $oldStatus Old post status. + * @param \WP_Post $post Post object. + * @return mixed void or false if no notifications should be sent + */ + public function context($newStatus, $oldStatus, $post) + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Privacy { + /** + * Privacy trigger abstract class + */ + abstract class PrivacyTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * User request object + * + * @var \WP_User_Request + */ + public $request; + /** + * Request user object + * + * @var \WP_User|false + */ + public $userObject; + /** + * Data operation date and time + * + * @var string + */ + public $dataOperationTime; + /** + * Constructor + * + * @param string $slug Slug. + * @param string $name Name. + */ + public function __construct($slug, $name) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Data exported trigger class + */ + class DataExported extends \BracketSpace\Notification\Repository\Trigger\Privacy\PrivacyTrigger + { + /** + * Archive package path + * + * @var string + */ + public $archivePath; + /** + * Archive package URL + * + * @var string + */ + public $archiveUrl; + /** + * HTML report path + * + * @var string + */ + public $htmlReportPath; + /** + * JSON report pathname + * + * @var string + */ + public $jsonReportPathname; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param string $archivePathname Archive pathname. + * @param string $archiveUrl Archive url. + * @param string $htmlReportPathname Html report pathname. + * @param int $requestId Request id. + * @param string $jsonReportPathname Json report pathname. + */ + public function context($archivePathname, $archiveUrl, $htmlReportPathname, $requestId, $jsonReportPathname = null) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Data export request trigger class + */ + class DataExportRequest extends \BracketSpace\Notification\Repository\Trigger\Privacy\PrivacyTrigger + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $requestId Request id. + */ + public function context($requestId) + { + } + } + /** + * Data erased trigger class + */ + class DataErased extends \BracketSpace\Notification\Repository\Trigger\Privacy\PrivacyTrigger + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $requestId Request id. + */ + public function context($requestId) + { + } + } + /** + * Data erase request trigger class + */ + class DataEraseRequest extends \BracketSpace\Notification\Repository\Trigger\Privacy\PrivacyTrigger + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $requestId Request id. + */ + public function context($requestId) + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\WordPress { + /** + * Site Email Change Request + */ + class EmailChangeRequest extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * User object + * + * @var \WP_User + */ + public $userObject; + /** + * Old admin email + * + * @var string + */ + public $oldAdminEmail; + /** + * New admin email + * + * @var string + */ + public $newAdminEmail; + /** + * Site URL. + * + * @var string + */ + public $siteUrl; + /** + * Confirmation URL. + * + * @var string + */ + public $confirmationUrl; + /** + * Email change timestamp + * + * @var int + */ + public $emailChangeDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param mixed $_unused Unused. + * @param string $newEmail New email value. + * + * @return mixed + * @since 8.0.0 + */ + public function context($_unused, $newEmail) + { + } + /** + * Registers attached merge tags + * + * @return void + * @since 8.0.0 + */ + public function mergeTags() + { + } + } + /** + * Site email changed trigger + */ + class EmailChanged extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * User object + * + * @var \WP_User + */ + public $userObject; + /** + * Old admin email + * + * @var string + */ + public $oldAdminEmail; + /** + * New admin email + * + * @var string + */ + public $newAdminEmail; + /** + * Site URL. + * + * @var string + */ + public $siteUrl; + /** + * Email changed timestamp + * + * @var int + */ + public $emailChangedDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param string $oldEmail Old email value. + * @param string $newEmail New email value. + * + * @return mixed + */ + public function context($oldEmail, $newEmail) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Updated WordPress trigger class. + */ + class Updated extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * WordPress previous version + * + * @var string + */ + public $previousVersion; + /** + * WordPress new version + * + * @var string + */ + public $newVersion; + /** + * WordPress update date and time + * + * @var string + */ + public $wordpressUpdateDateTime; + /** + * Constructor. + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param string $newVersion New WordPress version number. + * @return void|false + */ + public function context($newVersion) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * WordPress Updates Available trigger class + */ + class UpdatesAvailable extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Update types + * + * @var array<mixed> + */ + public $updateTypes; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @return mixed + */ + public function context() + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + /** + * Checks if specific updates are available + * + * @param string $updateType update type, core | plugin | theme. + * @return bool + * @since 5.1.5 + */ + public function hasUpdates($updateType) + { + } + /** + * Gets specific update type title + * + * @param string $updateType update type, core | plugin | theme. + * @return string + * @since 5.1.5 + */ + public function getListTitle($updateType) + { + } + /** + * Gets core updates list + * + * @return string + * @since 5.1.5 + */ + public function getCoreUpdatesList() + { + } + /** + * Gets plugin updates list + * + * @return string + * @since 5.1.5 + */ + public function getPluginUpdatesList() + { + } + /** + * Gets theme updates list + * + * @return string + * @since 5.1.5 + */ + public function getThemeUpdatesList() + { + } + /** + * Gets updates count + * + * @param string $updateType optional, update type, core | plugin | theme | all, default: all. + * @return int + * @since 5.1.5 + */ + public function getUpdatesCount($updateType = 'all') + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Comment { + /** + * Comment trigger class + */ + abstract class CommentTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Comment Type slug + * + * @var string + */ + public $commentType; + /** + * Comment object + * + * @var \WP_Comment + */ + public $comment; + /** + * Comment author user object + * + * @var \stdClass + */ + public $userObject; + /** + * Post object + * + * @var \WP_Post + */ + public $post; + /** + * Post Type slug + * + * @var string + */ + public $postType; + /** + * Post creation date and time + * + * @var int|false + */ + public $postCreationDatetime; + /** + * Post modification date and time + * + * @var int|false + */ + public $postModificationDatetime; + /** + * Comment date and time + * + * @var int|false + */ + public $commentDatetime; + /** + * Post author user object + * + * @var \WP_User + */ + public $postAuthor; + /** + * Constructor + * + * @param array<mixed> $params trigger configuration params. + */ + public function __construct($params = []) + { + } + /** + * Sets trigger's context + * + * @return void + */ + public function assignProperties() + { + } + /** + * Check if comment is correct type + * + * @param mixed $comment Comment object or Comment ID. + * @return bool + */ + public function isCorrectType($comment) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Comment spammed trigger class + */ + class CommentSpammed extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param int $commentId Comment ID. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentId, $comment) + { + } + } + /** + * Comment replied trigger class + */ + class CommentReplied extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Parent comment object + * + * @var \WP_Comment|null + */ + public $parentComment; + /** + * Parent comment user object + * + * @var \stdClass + */ + public $parentCommentUserObject; + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param string $commentNewStatus New comment status. + * @param string $commentOldStatus Old comment status. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentNewStatus, $commentOldStatus, $comment) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Comment added trigger class + */ + class CommentAdded extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param int $commentId Comment ID. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentId, $comment) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Comment published trigger class + */ + class CommentPublished extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($comment) + { + } + } + /** + * Comment trashed trigger class + */ + class CommentTrashed extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param int $commentId Comment ID. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentId, $comment) + { + } + } + /** + * Comment unapproved trigger class + */ + class CommentUnapproved extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param string $commentNewStatus New comment status. + * @param string $commentOldStatus Old comment status. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentNewStatus, $commentOldStatus, $comment) + { + } + } + /** + * Comment added trigger class + */ + class CommentApproved extends \BracketSpace\Notification\Repository\Trigger\Comment\CommentTrigger + { + /** + * Constructor + * + * @param string $commentType optional, default: comment. + */ + public function __construct($commentType = 'comment') + { + } + /** + * Sets trigger's context + * + * @param string $commentNewStatus New comment status. + * @param string $commentOldStatus Old comment status. + * @param object $comment Comment object. + * @return mixed void or false if no notifications should be sent + */ + public function context($commentNewStatus, $commentOldStatus, $comment) + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Plugin { + /** + * Plugin trigger class + */ + abstract class PluginTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Plugin details array + * + * @var array<mixed> + */ + public $plugin; + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Activated plugin trigger class + */ + class Activated extends \BracketSpace\Notification\Repository\Trigger\Plugin\PluginTrigger + { + /** + * Plugin activation date and time + * + * @var string + */ + public $pluginActivationDateTime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Trigger action + * + * @param string $pluginRelPath Plugin path. + * @return void + */ + public function context($pluginRelPath) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Deactivated plugin trigger class + */ + class Deactivated extends \BracketSpace\Notification\Repository\Trigger\Plugin\PluginTrigger + { + /** + * Plugin deactivation date and time + * + * @var string + */ + public $pluginDeactivationDateTime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Trigger action + * + * @param string $pluginRelPath Plugin path. + * @return void + */ + public function context($pluginRelPath) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Removed plugin trigger class. + */ + class Removed extends \BracketSpace\Notification\Repository\Trigger\Plugin\PluginTrigger + { + /** + * Plugin deletion date and time + * + * @var string + */ + public $pluginDeletionDateTime; + /** + * Constructor. + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param string $pluginRelPath Plugin path. + * @return mixed void or false if no notifications should be sent. + */ + public function context($pluginRelPath) + { + } + /** + * Registers attached merge tags. + * + * @return void. + */ + public function mergeTags() + { + } + } + /** + * Installed plugin trigger class. + */ + class Installed extends \BracketSpace\Notification\Repository\Trigger\Plugin\PluginTrigger + { + /** + * Plugin installation date and time + * + * @var string + */ + public $pluginInstallationDateTime; + /** + * Constructor. + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param \Plugin_Upgrader $upgrader Plugin_Upgrader class. + * @param array<mixed> $data Update data information. + * @return mixed Void or false if no notifications should be sent. + */ + public function context($upgrader, $data) + { + } + /** + * Registers attached merge tags. + * + * @return void. + */ + public function mergeTags() + { + } + } + /** + * Updated plugin trigger class. + */ + class Updated extends \BracketSpace\Notification\Repository\Trigger\Plugin\PluginTrigger + { + /** + * Plugin previous version + * + * @var string + */ + public $previousVersion; + /** + * Plugin update date and time + * + * @var string + */ + public $pluginUpdateDateTime; + /** + * Constructor. + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param \Plugin_Upgrader $upgrader Plugin_Upgrader class. + * @param array<mixed> $data Update data information. + * @return void|false + */ + public function context($upgrader, $data) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\User { + /** + * User trigger class + */ + abstract class UserTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * User ID + * + * @var int + */ + public $userId; + /** + * User object + * + * @var \WP_User + */ + public $userObject; + /** + * User registration date and time + * + * @var int|false + */ + public $userRegisteredDatetime; + /** + * Constructor + * + * @param string $slug $params trigger slug. + * @param string $name $params trigger name. + */ + public function __construct($slug, $name) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User profile updated trigger class + */ + class UserProfileUpdated extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * User profile update date and time + * + * @var int|false + */ + public $userProfileUpdatedDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @return void + */ + public function context($userId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User login failed trigger class + */ + class UserLoginFailed extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User login failure date and time + * + * @var int|false + */ + public $userLoginFailedDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param string $username username. + * @return mixed + */ + public function context($username) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User logout trigger class + */ + class UserLogout extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * User logout date and time + * + * @var int|false + */ + public $userLogoutDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @return void + */ + public function context($userId = 0) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User password changed trigger class + */ + class UserPasswordChanged extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * Password change date and time + * + * @var int|false + */ + public $passwordChangeDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param object $user User object. + * @return void + */ + public function context($user) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User role changed trigger class + */ + class UserRoleChanged extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * New role + * + * @var string + */ + public $newRole; + /** + * Old role + * + * @var string + */ + public $oldRole; + /** + * User role change date and time + * + * @var int|false + */ + public $userRoleChangeDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @param string $role User new role. + * @param array<mixed> $oldRoles User previous roles. + * @return mixed + */ + public function context($userId, $role, $oldRoles) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User registered trigger class + */ + class UserRegistered extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @return void + */ + public function context($userId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + /** + * Gets password reset key + * + * @return string + * @since 5.1.5 + */ + public function getPasswordResetKey() + { + } + } + /** + * User deleted trigger class + */ + class UserDeleted extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * User deletion date and time + * + * @var int|false + */ + public $userDeletedDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @return void + */ + public function context($userId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User email changed class + */ + class UserEmailChanged extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * Old user email + * + * @var string + */ + public $oldUserEmail; + /** + * New user email + * + * @var string + */ + public $newUserEmail; + /** + * Site URL. + * + * @var string + */ + public $siteUrl; + /** + * Email changed timestamp + * + * @var int + */ + public $emailChangedDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId Updated user ID. + * @param \WP_User $oldUser Old user instance. + * @param array<string, mixed> $newData New user data. + * @return false|void + */ + public function context($userId, $oldUser, $newData) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User login trigger class + */ + class UserLogin extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * User meta data + * + * @var array<mixed> + */ + public $userMeta; + /** + * User login date and time + * + * @var int|false + */ + public $userLoggedInDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param string $userLogin Logged in user login. + * @param object $user User object. + * @return void + */ + public function context($userLogin, $user) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * User Email Change Request + */ + class UserEmailChangeRequest extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * Old user email + * + * @var string + */ + public $oldUserEmail; + /** + * New user email + * + * @var string + */ + public $newUserEmail; + /** + * Site URL. + * + * @var string + */ + public $siteUrl; + /** + * Confirmation URL. + * + * @var string + */ + public $confirmationUrl; + /** + * Email change timestamp + * + * @var int + */ + public $emailChangeDatetime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $userId User ID. + * @return mixed + * @since 8.0.0 + */ + public function context($userId) + { + } + /** + * Registers attached merge tags + * + * @return void + * @since 8.0.0 + */ + public function mergeTags() + { + } + } + /** + * User password change requested trigger class + */ + class UserPasswordResetRequest extends \BracketSpace\Notification\Repository\Trigger\User\UserTrigger + { + /** + * Password reset request date and time + * + * @var int|false + */ + public $passwordResetRequestDatetime; + /** + * Password reset key + * + * @var string + */ + public $passwordResetKey; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param string $username username. + * @param string $resetKey password reset key. + * @return mixed + */ + public function context($username, $resetKey) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Theme { + /** + * Theme trigger class + */ + abstract class ThemeTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Theme object + * + * @var \WP_Theme + */ + public $theme; + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Switched theme trigger class + */ + class Switched extends \BracketSpace\Notification\Repository\Trigger\Theme\ThemeTrigger + { + /** + * Old theme object + * + * @var \WP_Theme + */ + public $oldTheme; + /** + * Theme switch date and time + * + * @var string + */ + public $themeSwitchDateTime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param string $name Name of the new theme. + * @param \WP_Theme $theme Instance of the new theme. + * @param \WP_Theme $oldTheme Instance of the old theme. + * @return mixed Void or false if no notifications should be sent. + */ + public function context($name, $theme, $oldTheme) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Installed theme trigger class + */ + class Installed extends \BracketSpace\Notification\Repository\Trigger\Theme\ThemeTrigger + { + /** + * Theme installation date and time + * + * @var string + */ + public $themeInstallationDateTime; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param \Theme_Upgrader $upgrader Theme_Upgrader class. + * @param array<mixed> $data Update data information. + * @return mixed Void or false if no notifications should be sent. + */ + public function context($upgrader, $data) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Updated theme trigger class + */ + class Updated extends \BracketSpace\Notification\Repository\Trigger\Theme\ThemeTrigger + { + /** + * Theme update date and time + * + * @var string + */ + public $themeUpdateDateTime; + /** + * Theme previous version + * + * @var string + */ + public $themePreviousVersion; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Trigger action. + * + * @param \Theme_Upgrader $upgrader Theme_Upgrader class. + * @param array<mixed> $data Update data information. + * @return mixed Void or false if no notifications should be sent. + */ + public function context($upgrader, $data) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Taxonomy { + /** + * Taxonomy trigger class + */ + abstract class TermTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Taxonomy slug + * + * @var \WP_Taxonomy|null + */ + public $taxonomy; + /** + * Term object + * + * @var \WP_Term + */ + public $term; + /** + * Term permalink + * + * @var string + */ + public $termPermalink = ''; + /** + * Constructor + * + * @param array<mixed> $params trigger configuration params. + */ + public function __construct($params = []) + { + } + /** + * Lazy loads group name + * + * @return string|null Group name + */ + public function getGroup() + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Taxonomy updated trigger class + */ + class TermUpdated extends \BracketSpace\Notification\Repository\Trigger\Taxonomy\TermTrigger + { + /** + * Term modification date and time + * + * @var string + */ + public $termModificationDatetime; + /** + * Constructor + * + * @param string $taxonomy optional, default: category. + */ + public function __construct($taxonomy = 'category') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param int $termId Term ID used only due to lack of taxonomy param. + * @return mixed void or false if no notifications should be sent + */ + public function context($termId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Taxonomy term added trigger class + */ + class TermAdded extends \BracketSpace\Notification\Repository\Trigger\Taxonomy\TermTrigger + { + /** + * Term creation date and time + * + * @var string + */ + public $termCreationDatetime; + /** + * Constructor + * + * @param string $taxonomy optional default category. + */ + public function __construct($taxonomy = 'category') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * Return `false` if you want to abort the trigger execution + * + * @param int $termId Term ID. + * @return mixed void or false if no notifications should be sent + */ + public function context($termId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Taxonomy term deleted trigger class + */ + class TermDeleted extends \BracketSpace\Notification\Repository\Trigger\Taxonomy\TermTrigger + { + /** + * Term deletion date and time + * + * @var string + */ + public $termDeletionDatetime; + /** + * Constructor + * + * @param string $taxonomy optional, default: category. + */ + public function __construct($taxonomy = 'category') + { + } + /** + * Lazy loads the name + * + * @return string name + */ + public function getName() : string + { + } + /** + * Lazy loads the description + * + * @return string description + */ + public function getDescription() : string + { + } + /** + * Sets trigger's context + * + * @param int $termId Term ID. + * @return mixed void or false if no notifications should be sent + */ + public function context($termId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } +} +namespace BracketSpace\Notification\Repository\Trigger\Media { + /** + * Media trigger class + */ + abstract class MediaTrigger extends \BracketSpace\Notification\Repository\Trigger\BaseTrigger + { + /** + * Attachment post object + * + * @var \WP_Post + */ + public $attachment; + /** + * User ID + * + * @var int + */ + public $userId; + /** + * User object + * + * @var \WP_User + */ + public $userObject; + /** + * Attachment creation date and time + * + * @var int|false + */ + public $attachmentCreationDate; + /** + * Constructor + * + * @param string $slug $params trigger slug. + * @param string $name $params trigger name. + */ + public function __construct($slug, $name) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Media added trigger class + */ + class MediaUpdated extends \BracketSpace\Notification\Repository\Trigger\Media\MediaTrigger + { + /** + * Updating user object + * + * @var \WP_User + */ + public $updatingUser; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $attachmentId Attachment Post ID. + * @return void + */ + public function context($attachmentId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Media trashed trigger class + */ + class MediaTrashed extends \BracketSpace\Notification\Repository\Trigger\Media\MediaTrigger + { + /** + * Trashing user object + * + * @var \WP_User + */ + public $trashingUser; + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $attachmentId Attachment Post ID. + * @return void + */ + public function context($attachmentId) + { + } + /** + * Registers attached merge tags + * + * @return void + */ + public function mergeTags() + { + } + } + /** + * Media added trigger class + */ + class MediaAdded extends \BracketSpace\Notification\Repository\Trigger\Media\MediaTrigger + { + /** + * Constructor + */ + public function __construct() + { + } + /** + * Sets trigger's context + * + * @param int $attachmentId Attachment Post ID. + * @return void + */ + public function context($attachmentId) + { + } + } +} +namespace BracketSpace\Notification\Repository { + /** + * Recipient Repository. + */ + class RecipientRepository + { + /** + * Webhook recipient types. + * + * @var array<string,string> + */ + public static $webhookRecipientTypes = ['post' => 'POST', 'get' => 'GET', 'put' => 'PUT', 'delete' => 'DELETE', 'patch' => 'PATCH']; + /** + * @return void + */ + public static function register() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Convertable interface + */ + interface Convertable + { + /** + * Creates Notification from a specific representation + * + * @since 3.0.0 + * @param string|array<mixed,mixed> $data The notification representation + * @return Notification + */ + public function from($data) : \BracketSpace\Notification\Core\Notification; + /** + * Converts the notification to another type of representation + * + * @since 3.0.0 + * @param Notification $notification Notification instance + * @param array<string|int,mixed> $config The additional configuration of the converter + * @return mixed + */ + public function to(\BracketSpace\Notification\Core\Notification $notification, array $config = []); + } +} +namespace BracketSpace\Notification\Repository\Converter { + /** + * Array Converter class + * + * @since 3.0.0 + */ + class ArrayConverter implements \BracketSpace\Notification\Interfaces\Convertable + { + /** + * Creates Notification from a specific representation + * + * @filter notification/from/array + * + * @since 3.0.0 + * @param NotificationUnconvertedData $data The notification representation + * @return Notification + */ + public function from($data) : \BracketSpace\Notification\Core\Notification + { + } + /** + * Converts the notification to another type of representation + * + * @filter notification/to/array + * + * @since 3.0.0 + * @param Notification $notification Notification instance + * @param array<string|int,mixed> $config The additional configuration of the converter + * @return NotificationAsArray + */ + public function to(\BracketSpace\Notification\Core\Notification $notification, array $config = []) + { + } + } + /** + * JSON Converter class + * + * @since 3.0.0 + */ + class JsonConverter implements \BracketSpace\Notification\Interfaces\Convertable + { + /** + * Creates Notification from a specific representation + * + * @filter notification/from/json + * + * @since 3.0.0 + * @param string $data The notification representation + * @return Notification + */ + public function from($data) : \BracketSpace\Notification\Core\Notification + { + } + /** + * Converts the notification to another type of representation + * + * @filter notification/to/json + * + * @since 3.0.0 + * @param Notification $notification Notification instance + * @param array<string|int,mixed> $config The additional configuration of the converter + * @return mixed + */ + public function to(\BracketSpace\Notification\Core\Notification $notification, array $config = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\Recipient { + /** + * Email recipient + */ + class Email extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } + /** + * User recipient + */ + class User extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @since 5.0.0 + * @param array<mixed> $params recipient configuration params. + */ + public function __construct($params = []) + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } + /** + * Role recipient + */ + class Role extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @since 5.0.0 + * @param array<mixed> $params recipient configuration params. + */ + public function __construct($params = []) + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } + /** + * User ID recipient + */ + class UserID extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @since 5.0.0 + * @param array<mixed> $params recipient configuration params. + */ + public function __construct($params = []) + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } + /** + * Administrator recipient + */ + class Administrator extends \BracketSpace\Notification\Repository\Recipient\BaseRecipient + { + /** + * Recipient constructor + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * {@inheritdoc} + * + * @param string $value raw value saved by the user. + * @return array<mixed> array of resolved values + */ + public function parseValue($value = '') + { + } + /** + * {@inheritdoc} + * + * @return object + */ + public function input() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Fillable interface + */ + interface Fillable + { + /** + * Gets field value + * + * @return mixed + */ + public function getValue(); + /** + * Sets field value + * + * @param mixed $value value from DB. + * @return void + */ + public function setValue($value); + /** + * Gets field section name + * + * @return string + */ + public function getSection(); + /** + * Sets field section name + * + * @param string $value assigned value + * @return void + */ + public function setSection($value); + /** + * Gets field name + * + * @return string + */ + public function getName(); + /** + * Gets raw field name + * + * @return string + */ + public function getRawName(); + /** + * Gets field label + * + * @return string + */ + public function getLabel(); + /** + * Gets field ID + * + * @return string + */ + public function getId(); + /** + * Gets field description + * + * @return string + */ + public function getDescription(); + /** + * Returns the additional field's css classes + * + * @return string + */ + public function cssClass(); + /** + * Checks if field should be resolved with merge tags + * + * @return bool + */ + public function isResolvable(); + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value); + } +} +namespace BracketSpace\Notification\Repository\Field { + /** + * Field abstract class + */ + abstract class BaseField implements \BracketSpace\Notification\Interfaces\Fillable + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Field unique ID + * + * @var string + */ + public $id; + /** + * Field value + * + * @var mixed + */ + public $value; + /** + * Field label + * + * @var mixed + */ + protected $label; + /** + * Field name + * + * @var mixed + */ + protected $name; + /** + * Short description + * Limited HTML support + * + * @var string + */ + protected $description = ''; + /** + * If field is resolvable with merge tags + * Default: true + * + * @var bool + */ + protected $resolvable = true; + /** + * Field section name + * + * @var string + */ + protected $section = ''; + /** + * If field is disabled + * + * @var bool + */ + public $disabled = false; + /** + * Additional css classes for field + * + * @var string + */ + public $cssClass = 'widefat notification-field '; + // space here on purpose. + /** + * If field can be used multiple times in Section Repeater row + * + * @var bool + */ + public $multipleSection = false; + /** + * Field type used in HTML attribute. + * + * @var string + */ + public $fieldTypeHtml = ''; + /** + * Field constructor + * + * @param array<mixed> $params field configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field data + * + * @param string $param Field data name. + * @return array + * @since 7.0.0 + */ + public function __get($param) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public abstract function field(); + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public abstract function sanitize($value); + /** + * Gets description + * + * @return string description + */ + public function getDescription() + { + } + /** + * Gets field value + * + * @return mixed + */ + public function getValue() + { + } + /** + * Sets field value + * + * @param mixed $value value from DB. + * @return void + */ + public function setValue($value) + { + } + /** + * Gets field section name + * + * @return string + */ + public function getSection() + { + } + /** + * Sets field section name + * + * @param string $value assigned value + * @return void + */ + public function setSection($value) + { + } + /** + * Gets field name + * + * @return string + */ + public function getName() + { + } + /** + * Gets field raw name + * + * @return string + */ + public function getRawName() + { + } + /** + * Gets field label + * + * @return string + */ + public function getLabel() + { + } + /** + * Gets field ID + * + * @return string + */ + public function getId() + { + } + /** + * Checks if field should be resolved with merge tags + * + * @return bool + */ + public function isResolvable() + { + } + /** + * Checks if field is disabled + * + * @return bool + */ + public function isDisabled() + { + } + /** + * Returns the disable HTML tag if field is disabled + * + * @return string + */ + public function maybeDisable() + { + } + /** + * Returns the additional field's css classes + * + * @return string + */ + public function cssClass() + { + } + /** + * Returns rest API error message + * + * @return string + * @since 7.1.0 + */ + public function restApiError() + { + } + } + /** + * Repeater field class + */ + class SectionRepeater extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Current repeater row + * + * @var int + */ + protected $currentRow = 0; + /** + * Fields to repeat + * + * @var array<\BracketSpace\Notification\Abstracts\Field> + */ + public $fields = []; + /** + * Add new button label + * + * @var string + */ + protected $addButtonLabel = ''; + /** + * Data attributes + * + * @var array<mixed> + */ + protected $dataAttr = []; + /** + * Row headers + * + * @var array<mixed> + */ + protected $headers = []; + /** + * If table is sortable + * + * @var bool + */ + protected $sortable = true; + /** + * Repeater field type + * + * @var string + */ + public $fieldType = 'section-repeater'; + /** + * Carrier object + * + * @var \BracketSpace\Notification\Interfaces\Sendable + */ + protected $carrier; + /** + * Sections + * + * @var array<mixed> + */ + public $sections = []; + /** + * Section labels + * + * @var array<mixed> + */ + protected $sectionLabels = []; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Prints repeater row + * + * @return string row HTML + * @since 5.0.0 + */ + public function row() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + /** + * Returns the additional field's css classes + * + * @return string + */ + public function cssClass() + { + } + } + /** + * Editor field class + */ + class CodeEditorField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Editor settings + * + * @see https://codex.wordpress.org/Function_Reference/wp_editor#Arguments + * @var string + */ + protected $settings = 'text'; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * The code is not sanitized + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Repeater field class + */ + class RepeaterField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Current repeater row + * + * @var int + */ + protected $currentRow = 0; + /** + * Fields to repeat + * + * @var array<\BracketSpace\Notification\Abstracts\Field> + */ + public $fields = []; + /** + * Add new button label + * + * @var string + */ + protected $addButtonLabel = ''; + /** + * Data attributes + * + * @var array<mixed> + */ + protected $dataAttr = []; + /** + * Row headers + * + * @var array<mixed> + */ + protected $headers = []; + /** + * If table is sortable + * + * @var bool + */ + protected $sortable = true; + /** + * Repeater field type + * + * @var string + */ + public $fieldType = 'repeater'; + /** + * Carrier object + * + * @var \BracketSpace\Notification\Interfaces\Sendable + */ + protected $carrier; + /** + * If the global description in the header should be printed + * + * @var bool + */ + public $printHeaderDescription = true; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Prints repeater row + * + * @return string row HTML + * @since 5.0.0 + */ + public function row() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + /** + * Returns the additional field's css classes + * + * @return string + */ + public function cssClass() + { + } + } + /** + * Input field class + */ + class InputField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Field type + * possible values are valid HTML5 types except file or checkbox + * + * @var string + */ + public $type = 'text'; + /** + * Field placeholder + * + * @var string + */ + protected $placeholder = ''; + /** + * Field attributes + * + * @var string + */ + protected $atts = ''; + /** + * Allow for line breaks while sanitizing + * + * @since 6.3.1 + * @var bool + */ + protected $allowLinebreaks = false; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 6.3.1 Allow for whitespace characters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Color Picker field class + */ + class ColorPickerField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Image field class + */ + class ImageField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param string $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Input field class + */ + class MessageField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Message + * + * @var string + */ + protected $message = ''; + /** + * Field type + * + * @var string + */ + protected $type = ''; + /** + * Field placeholder + * + * @var string + */ + protected $placeholder = ''; + /** + * Field attributes + * + * @var string + */ + protected $atts = ''; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 6.3.1 Allow for whitespace characters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return null + */ + public function sanitize($value) + { + } + } + /** + * Recipients field class + */ + class SectionsField extends \BracketSpace\Notification\Repository\Field\InputField + { + /** + * Possible values + * + * @var array<mixed> + */ + protected $sections = []; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Prints repeater row + * + * @return string row HTML + * @since 5.0.0 + */ + public function row() + { + } + } + /** + * Recipients field class + */ + class RecipientsField extends \BracketSpace\Notification\Repository\Field\RepeaterField + { + /** + * If the global description in the header should be printed + * + * @var bool + */ + public $printHeaderDescription = false; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Prints repeater row + * + * @return string + * @since 5.0.0 + * @since 7.0.0 Added vue template. + */ + public function row() + { + } + } + /** + * Nonce field class + */ + class NonceField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Nonce key + * + * @var string + */ + protected $nonceKey = ''; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Editor field class + */ + class EditorField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Editor settings + * + * @see https://codex.wordpress.org/Function_Reference/wp_editor#Arguments + * @var string + */ + protected $settings = 'text'; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Checkbox field class + */ + class CheckboxField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Checkbox label text + * Default: Enable + * + * @var string + */ + protected $checkboxLabel = ''; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Select field class + */ + class SelectField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Field options + * value => label array + * + * @var array<mixed> + */ + protected $options = []; + /** + * Class for pretty select + * Will be used by JS to print Selectize input + * + * @var string + */ + protected $pretty = ''; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Textarea field class + */ + class TextareaField extends \BracketSpace\Notification\Repository\Field\BaseField + { + /** + * Field placeholder + * + * @var string + */ + protected $placeholder = ''; + /** + * Textarea rows + * + * @var int + */ + protected $rows = 10; + /** + * If unfiltered value is allowed + * + * @var bool + */ + protected $allowedUnfiltered = false; + /** + * Field constructor + * + * @param array<mixed> $params field configuration parameters. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Returns field HTML + * + * @return string html + */ + public function field() + { + } + /** + * Sanitizes the value sent by user + * + * @param mixed $value value to sanitize. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Taggable interface + */ + interface Taggable extends \BracketSpace\Notification\Interfaces\Nameable + { + /** + * Resolves the merge tag value + * + * @return mixed + */ + public function resolve(); + /** + * Gets merge tag resolved value + * + * @return mixed + */ + public function getValue(); + /** + * Cleans merge tag value + * + * @return void + */ + public function cleanValue(); + /** + * Checks if merge tag is already resolved + * + * @return bool + */ + public function isResolved(); + /** + * Gets value type + * + * @return string + */ + public function getValueType(); + /** + * Sets trigger object + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return $this|void + */ + public function setTrigger(\BracketSpace\Notification\Interfaces\Triggerable $trigger); + /** + * Gets group + * + * @return string|null Group name + */ + public function getGroup(); + /** + * Sets group + * + * @param string $group Group name. + * @return $this + */ + public function setGroup(string $group); + } +} +namespace BracketSpace\Notification\Repository\MergeTag { + /** + * MergeTag abstract class + */ + abstract class BaseMergeTag implements \BracketSpace\Notification\Interfaces\Taggable + { + use \BracketSpace\Notification\Traits\ClassUtils; + use \BracketSpace\Notification\Traits\HasDescription; + use \BracketSpace\Notification\Traits\HasGroup; + use \BracketSpace\Notification\Traits\HasName; + use \BracketSpace\Notification\Traits\HasSlug; + /** + * MergeTag resolved value + * + * @var mixed + */ + protected $value; + /** + * MergeTag value type + * + * @var string + */ + protected $valueType; + /** + * Function which resolve the merge tag value + * + * @var callable + */ + protected $resolver; + /** + * Resolving status + * + * @var bool + */ + protected $resolved = false; + /** + * Trigger object, the Merge tag is assigned to + * + * @var \BracketSpace\Notification\Interfaces\Triggerable + */ + protected $trigger; + /** + * If description is an example + * + * @var bool + */ + protected $descriptionExample = false; + /** + * If merge tag is hidden + * + * @var bool + */ + protected $hidden = false; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 7.0.0 The resolver closure context is static. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + /** + * Checks if the value is the correct type + * + * @param mixed $value tag value. + * @return bool + */ + public abstract function validate($value); + /** + * Sanitizes the merge tag value + * + * @param mixed $value tag value. + * @return mixed sanitized value + */ + public abstract function sanitize($value); + /** + * Resolves the merge tag value + * It also check if the value is correct type + * and sanitizes it + * + * @return mixed the resolved value + */ + public function resolve() + { + } + /** + * Checks if merge tag is already resolved + * + * @return bool + */ + public function isResolved() + { + } + /** + * Checks if description is an example + * If yes, there will be displayed additional label and type + * + * @return bool + */ + public function isDescriptionExample() + { + } + /** + * Gets merge tag resolved value + * + * @return mixed + */ + public function getValue() + { + } + /** + * Sets trigger object + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @since 5.0.0 + * @return void + */ + public function setTrigger(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Sets resolver function + * + * @param mixed $resolver Resolver, can be either a closure or array or string. + * @since 5.2.2 + * @return void + */ + public function setResolver($resolver) + { + } + /** + * Sets resolver function + * + * @param string $triggerPropertyName merge tag trigger property name. + * + * @return void + * @since 8.0.12 + * + */ + public function setTriggerProp(string $triggerPropertyName) + { + } + /** + * Get trigger property + * + * @return string + * @since 8.0.12 + * + */ + public function getTriggerProp() : string + { + } + /** + * Gets trigger object + * + * @return \BracketSpace\Notification\Interfaces\Triggerable|null + * @since 5.0.0 + */ + public function getTrigger() + { + } + /** + * Gets value type + * + * @return string + * @since 5.0.0 + */ + public function getValueType() + { + } + /** + * Checks if merge tag is hidden + * + * @return bool + * @since 5.1.3 + */ + public function isHidden() + { + } + /** + * Cleans the value + * + * @return void + * @since 5.2.2 + */ + public function cleanValue() + { + } + } + /** + * String merge tag class + */ + class StringTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'string'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } + /** + * Integer merge tag class + */ + class IntegerTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'integer'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param string $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } + /** + * Email merge tag class + */ + class EmailTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'string'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Post { + /** + * Post type merge tag class + */ + class PostType extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag { + /** + * URL merge tag class + */ + class UrlTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'string'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Post { + /** + * Post thumbnail url merge tag class + */ + class ThumbnailUrl extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 6.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post title merge tag class + */ + class PostTitle extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post content merge tag class + */ + class PostContent extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag { + /** + * HTML merge tag class + */ + class HtmlTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'string'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Post { + /** + * Post content HTML merge tag class + */ + class PostContentHtml extends \BracketSpace\Notification\Repository\MergeTag\HtmlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.4 + */ + public function __construct($params = []) + { + } + } + /** + * Post excerpt merge tag class + */ + class PostExcerpt extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post terms merge tag class + */ + class PostTerms extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Post Taxonomy Object + * + * @var object + */ + protected $taxonomy; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.1.3 + */ + public function __construct($params = []) + { + } + } + /** + * Post status merge tag class + */ + class PostStatus extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post ID merge tag class + */ + class PostID extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Revision link merge tag class + */ + class RevisionLink extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post slug merge tag class + */ + class PostSlug extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post featured image id merge tag class + */ + class FeaturedImageId extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params Merge tag configuration params. + * @since 6.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post permalink merge tag class + */ + class PostPermalink extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Post featured image url merge tag class + */ + class FeaturedImageUrl extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 6.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\DateTime { + /** + * DateTime merge tag class + */ + class DateTime extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 3.0.0 The automatic property lookup searches for camelCase prop first. + * @since 7.0.0 Expects the timestamp without an offset. + * You can pass timezone argument as well, use GMT if timestamp is with offset. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Time merge tag class + */ + class Time extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 3.0.0 The automatic property lookup searches for camelCase prop first. + * @since 7.0.0 Expects the timestamp without an offset. + * You can pass timezone argument as well, use GMT if timestamp is with offset. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Date merge tag class + */ + class Date extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 3.0.0 The automatic property lookup searches for camelCase prop first. + * @since 7.0.0 Expects the timestamp without an offset. + * You can pass timezone argument as well, use GMT if timestamp is with offset. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Comment { + /** + * Comment action trash URL merge tag class + */ + class CommentActionTrash extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment action delete URL merge tag class + */ + class CommentActionDelete extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment author URL merge tag class + */ + class CommentAuthorUrl extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag { + /** + * IP merge tag class + */ + class IPTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'string'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Comment { + /** + * Comment author IP merge tag class + */ + class CommentAuthorIP extends \BracketSpace\Notification\Repository\MergeTag\IPTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment content merge tag class + */ + class CommentContent extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment status merge tag class + */ + class CommentStatus extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment type merge tag class + */ + class CommentType extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment author user agent tag class + */ + class CommentAuthorUserAgent extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment action spam URL merge tag class + */ + class CommentActionSpam extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment is reply merge tag class + */ + class CommentIsReply extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment action approve URL merge tag class + */ + class CommentActionApprove extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment content html merge tag class + */ + class CommentContentHtml extends \BracketSpace\Notification\Repository\MergeTag\HtmlTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Comment ID merge tag class + */ + class CommentID extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Trigger property to get the comment data from + * + * @var string + */ + protected $commentType = 'comment'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag { + /** + * Float merge tag class + */ + class FloatTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'float'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param string $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } + /** + * Boolean merge tag class + */ + class BooleanTag extends \BracketSpace\Notification\Repository\MergeTag\BaseMergeTag + { + /** + * MergeTag value type + * + * @var string + */ + protected $valueType = 'boolean'; + /** + * Check the merge tag value type + * + * @param mixed $value value. + * @return bool + */ + public function validate($value) + { + } + /** + * Sanitizes the merge tag value + * + * @param mixed $value value. + * @return mixed + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\User { + /** + * User nicename merge tag class + */ + class UserNicename extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Avatar merge tag class + */ + class Avatar extends \BracketSpace\Notification\Repository\MergeTag\HtmlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 6.3.0 + */ + public function __construct($params = []) + { + } + } + /** + * User ID merge tag class + */ + class UserID extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Avatar Url merge tag class + */ + class AvatarUrl extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct(array $params = []) + { + } + } + /** + * User login merge tag class + */ + class UserPasswordResetLink extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Trigger property to get the reset key from + * + * @var string + */ + protected $keyPropertyName = 'password_reset_key'; + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * User login merge tag class + */ + class UserLogin extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User Email merge tag class + */ + class UserEmail extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User first name merge tag class + */ + class UserFirstName extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User role merge tag class + */ + class UserRole extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User Bio merge tag class + */ + class UserBio extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User Display name merge tag class + */ + class UserDisplayName extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User last name merge tag class + */ + class UserLastName extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * User nickname merge tag class + */ + class UserNickname extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Taxonomy { + /** + * Taxonomy term description merge tag class + */ + class TermDescription extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy term ID merge tag class + */ + class TermID extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy term slug merge tag class + */ + class TermSlug extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy term permalink merge tag class + */ + class TermPermalink extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy name merge tag class + */ + class TaxonomyName extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy slug merge tag class + */ + class TaxonomySlug extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } + /** + * Taxonomy term name merge tag class + */ + class TermName extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.2.2 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository\MergeTag\Media { + /** + * Attachment direct URL merge tag class + */ + class AttachmentDirectUrl extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Attachment page merge tag class + */ + class AttachmentPage extends \BracketSpace\Notification\Repository\MergeTag\UrlTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Attachment ID merge tag class + */ + class AttachmentID extends \BracketSpace\Notification\Repository\MergeTag\IntegerTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Attachment title merge tag class + */ + class AttachmentTitle extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } + /** + * Attachment MIME type merge tag class + */ + class AttachmentMimeType extends \BracketSpace\Notification\Repository\MergeTag\StringTag + { + /** + * Merge tag constructor + * + * @param array<mixed> $params merge tag configuration params. + * @since 5.0.0 + */ + public function __construct($params = []) + { + } + } +} +namespace BracketSpace\Notification\Repository { + /** + * Converter Repository. + */ + class ConverterRepository + { + /** + * @return void + */ + public static function register() + { + } + } + /** + * Carrier Repository. + */ + class CarrierRepository + { + /** + * @return void + */ + public static function register() + { + } + } + /** + * Resolver Repository. + */ + class ResolverRepository + { + /** + * @return void + */ + public static function register() + { + } + } +} +namespace BracketSpace\Notification\Repository\Carrier { + /** + * Email Carrier + */ + class Email extends \BracketSpace\Notification\Repository\Carrier\BaseCarrier + { + /** + * Carrier icon + * + * @var string SVG + */ + //phpcs:ignore Generic.Files.LineLength.TooLong + public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 384"><path d="M448,64H64A64,64,0,0,0,0,128V384a64,64,0,0,0,64,64H448a64,64,0,0,0,64-64V128A64,64,0,0,0,448,64ZM342.66,234.78,478.13,118.69A31.08,31.08,0,0,1,480,128V384c0,2.22-.84,4.19-1.28,6.28ZM448,96c2.13,0,4,.81,6,1.22L256,266.94,58,97.22c2-.41,3.88-1.22,6-1.22ZM33.27,390.25c-.44-2.09-1.27-4-1.27-6.25V128a30.79,30.79,0,0,1,1.89-9.31L169.31,234.75ZM64,416a31,31,0,0,1-9.12-1.84L193.63,255.59l52,44.53a15.92,15.92,0,0,0,20.82,0l52-44.54L457.13,414.16A30.82,30.82,0,0,1,448,416Z" transform="translate(0 -64)"/></svg>'; + /** + * Carrier constructor + * + * @since 5.0.0 + */ + public function __construct() + { + } + /** + * Gets the default name for "From" header. + * + * @return string + */ + public static function getDefaultFromName() : string + { + } + /** + * Gets the default email for "From" header. + * + * @return string + */ + public static function getDefaultFromEmail() : string + { + } + /** + * Used to register Carrier form fields + * Uses $this->addFormField(); + * + * @return void + */ + public function formFields() + { + } + /** + * Sets mail type to text/html for wp_mail + * + * @return string mail type + */ + public function setMailType() + { + } + /** + * Sends the notification + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger trigger object. + * @return void + */ + public function send(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Replaces the filtered body with the unfiltered one if + * the notifications/email/unfiltered_html setting is set to true. + * + * @filter notification/carrier/form/data/values + * + * @param array<mixed> $carrierData Carrier data from PostData. + * @param array<mixed> $rawData Raw data from PostData, it contains the unfiltered message body. + * @return array<mixed> Carrier data with the unfiltered body, + * if notifications/email/unfiltered_html setting is true. + **/ + public function allowUnfilteredHtmlBody($carrierData, $rawData) + { + } + /** + * Gets the list of headers. + * + * @return array<string> + */ + protected function getHeaders() : array + { + } + /** + * Gets organized list of carrier headers. + * + * @return array<string, string> + */ + protected function getCarrierHeaders() : array + { + } + /** + * Gets the default "From" header value. + * + * @return string + */ + protected function getDefaultFromHeader() : string + { + } + } +} +namespace BracketSpace\Notification\Repository { + /** + * Global Merge Tag Repository. + */ + class GlobalMergeTagRepository + { + /** + * @return void + */ + public static function register() + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Resolvable interface + */ + interface Resolvable + { + /** + * Gets slug + * + * @return string Slug + */ + public function getSlug(); + /** + * Gets merge tag pattern + * + * @return string Pattern + */ + public function getPattern(); + /** + * Gets resolver priority + * + * @return int Priority + */ + public function getPriority(); + /** + * Resolves single matched merge tag + * + * @param array<mixed> $match Match array. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return string Resolved value + */ + public function resolveMergeTag($match, \BracketSpace\Notification\Interfaces\Triggerable $trigger); + } +} +namespace BracketSpace\Notification\Repository\Resolver { + /** + * Resolver class + */ + abstract class BaseResolver implements \BracketSpace\Notification\Interfaces\Resolvable + { + /** + * Resolver priority + * Higher number means later execution + */ + const PRIORITY = 100; + /** + * Resolver pattern + */ + const PATTERN = ''; + /** + * Gets resolver slug + * Note: it's automatically generated from the class name. + * + * @return string + * @since 6.0.0 + */ + public function getSlug() + { + } + /** + * Gets merge tag pattern + * + * @return string + * @since 6.0.0 + */ + public function getPattern() + { + } + /** + * Gets resolver priority + * + * @return int + * @since 6.0.0 + */ + public function getPriority() + { + } + /** + * {@inheritdoc} + * + * @param array<mixed> $match Match array. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @returns string + */ + public function resolveMergeTag($match, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } + /** + * Basic resolver + */ + class Basic extends \BracketSpace\Notification\Repository\Resolver\BaseResolver + { + /** + * Resolver priority + * Higher number means later execution + */ + const PRIORITY = 100; + /** + * Resolver pattern + */ + const PATTERN = '/(?<!\\!)\\{(?:[^{}])*\\}/'; + /** + * {@inheritdoc} + * + * @param array<mixed> $match Match array. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return mixed Resolved value + */ + public function resolveMergeTag($match, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + } +} +namespace BracketSpace\Notification\Compat { + /** + * RestApi compat class + */ + class RestApiCompat + { + /** + * Method sends request to API, based on response checks whether REST API works correctly + * + * @action admin_notices + * + * @return void + * @since 8.0.12 + */ + public function testRestApi() + { + } + } + /** + * WebhookCompat class + * + * @since 3.0.0 + */ + class WebhookCompat + { + /** + * Checks wether webhook carriers are in th database + * + * @return bool + */ + public static function hasDeprecatedWebhookCarriers() : bool + { + } + /** + * Displays a notice message when someone is + * using the deprecated webhooks. + * + * @action admin_notices + * + * @return void + */ + public function displayNotice() + { + } + } +} +namespace BracketSpace\Notification\Core { + /** + * Resolver class + */ + class Resolver + { + /** + * Resolves value with all the resolvers + * + * @param string $value Unresolved string with tags. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return string Resolved value + * @since 8.0.0 Method is static + * @since 6.0.0 + */ + public static function resolve($value, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Clears any Merge Tags + * + * @param string $value Unresolved string with tags. + * @return string + * @since 6.0.0 + * @since 8.0.0 Method is static + */ + public static function clear($value) + { + } + } +} +namespace BracketSpace\Notification\Utils { + /** + * Settings class + */ + class Settings + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Settings handle, used as a prefix for options + * + * @var string + */ + public $handle; + /** + * Textdomain for all strings, if not provided the handle is used + * + * @var string + */ + public $textdomain; + /** + * Library root path + * + * @var string + */ + protected $path; + /** + * Library root URI + * + * @var string + */ + public $uri = ''; + /** + * Settings page hook + * Should be set outside the class + * Typically result of add_menu_page function + * + * @var string + */ + public $pageHook = ''; + /** + * Settings constructor + * + * @param string $handle settings handle. + * @param string|bool $textdomain textdomain. + * @throws \Exception Exception. + * @since 5.0.0 + */ + public function __construct($handle, $textdomain = false) + { + } + /** + * Settings page output + * + * @return void + */ + public function settingsPage() + { + } + /** + * Add new section + * + * @param string $name Section name. + * @param string $slug Section slug. + * @return \BracketSpace\Notification\Utils\Settings\Section + */ + public function addSection($name, $slug) + { + } + /** + * Get all registered sections + * + * @return array<mixed> + */ + public function getSections() + { + } + /** + * Get section by section slug + * + * @param string $slug section slug. + * @return mixed section object or false if no section defined + */ + public function getSection($slug = '') + { + } + /** + * Save Settings + * + * @return void + */ + public function saveSettings() + { + } + /** + * Get all settings + * + * @return array<mixed> settings + */ + public function getSettings() + { + } + /** + * Sets up the field values for Settings form + * + * @return void + * @since 5.0.0 + */ + public function setupFieldValues() + { + } + /** + * Get single setting value + * + * @param string $setting setting section/group/field separated with /. + * @return mixed field value or null if name not found + * @throws \Exception Exception. + */ + public function getSetting($setting) + { + } + /** + * Update single settings value. + * + * @param string $setting setting name in `a/b/c` format. + * @param mixed $value setting value. + * @return mixed + * @throws \Exception Exception. + */ + public function updateSetting($setting, $value) + { + } + /** + * Set Library variables like path and URI + * + * @return void + */ + public function setVariables() + { + } + } +} +namespace BracketSpace\Notification\Core { + /** + * Settings class + */ + class Settings extends \BracketSpace\Notification\Utils\Settings + { + /** + * Settings constructor + */ + public function __construct() + { + } + /** + * Registers Settings page under plugin's menu + * + * @action admin_menu 20 + * + * @return void + */ + public function registerPage() + { + } + /** + * Registers Settings + * + * @action notification/init 5 + * + * @return void + */ + public function registerSettings() + { + } + } + /** + * Templates class + */ + class Templates + { + /** + * Templates storage name. + */ + const TEMPLATE_STORAGE = 'templates'; + /** + * Renders the template + * + * @param string $name Template name. + * @param array<mixed> $vars Template variables. + * @return void + * @since 8.0.0 + */ + public static function render(string $name, array $vars = []) + { + } + /** + * Gets the template string + * + * @param string $name Template name. + * @param array<mixed> $vars Template variables. + * @return string + * @since 8.0.0 + */ + public static function get(string $name, array $vars = []) + { + } + /** + * Creates the Template object + * + * @param string $name Template name. + * @param array<mixed> $vars Template variables. + * @return \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template + * @since 8.0.0 + */ + public static function create(string $name, array $vars = []) : \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template + { + } + /** + * Renders the template + * + * @return void + * @since 8.0.0 + */ + public static function registerStorage() + { + } + } + /** + * Debugging class + */ + class Debugging + { + /** + * Constructor + * + * @since 6.0.0 + */ + public function __construct() + { + } + /** + * Logs the message in database + * + * @since 3.0.0 + * @param string $component Component nice name, like `Core` or `Any Plugin Name`. + * @param string $type Log type, values: notification|error|warning. + * @param string $message Log formatted message. + * @return bool|\WP_Error + */ + public static function log($component, $type, $message) + { + } + /** + * Adds log to the database + * + * @param array<mixed> $logData Log data, must contain keys: type, component and message. + * @return bool + * @throws \Exception If any of the arguments is wrong. + * @since 6.0.0 + */ + public function addLog($logData = []) + { + } + /** + * Gets logs from database + * + * @param int $page Page number, default: 1. + * @param array<mixed> $types Array of log types to get, default: all. + * @param string $component Component name, default: all. + * @return array<mixed> * @since 6.0.0 + */ + public function getLogs($page = 1, $types = null, $component = null) + { + } + /** + * Removes logs + * + * @param array<mixed> $types Array of log types to remove, default: all. + * @return void + * @since 6.0.0 + */ + public function removeLogs($types = null) + { + } + /** + * Get logs count from previous query + * You have to call `get_logs` method first + * + * @param string $type Type of count, values: total|pages. + * @return int + * @since 6.0.0 + */ + public function getLogsCount($type = 'total') + { + } + /** + * Catches the Carrier into log. + * + * @action notification/carrier/pre-send 1000000 + * + * @param \BracketSpace\Notification\Abstracts\Carrier $carrier Carrier object. + * @param \BracketSpace\Notification\Abstracts\Trigger $trigger Trigger object. + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return void + * @since 5.3.0 + * @since 6.0.4 Using 3rd parameter for Notification object. + */ + public function catchNotification($carrier, $trigger, $notification) + { + } + } + /** + * Queue class + */ + class Queue + { + /** + * Items + * + * @var array<int, array{ + * notification: \BracketSpace\Notification\Core\Notification, + * trigger: \BracketSpace\Notification\Interfaces\Triggerable} + * > + */ + protected static $items = []; + /** + * Adds the item to the queue + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger. + * @param int|null $index Index at which to put the item. + * @return void + * @since 8.0.0 + */ + //phpcs:ignore SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilitySymbolRequired + public static function add(\BracketSpace\Notification\Core\Notification $notification, \BracketSpace\Notification\Interfaces\Triggerable $trigger, int $index = null) + { + } + /** + * Replaces the items if they are already in the queue + * or adds new queue item + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger. + * @return void + * @since 8.0.0 + */ + public static function addReplace(\BracketSpace\Notification\Core\Notification $notification, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Checks if the items are already in the queue + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger. + * @return bool + * @since 8.0.0 + */ + public static function has(\BracketSpace\Notification\Core\Notification $notification, \BracketSpace\Notification\Interfaces\Triggerable $trigger) : bool + { + } + /** + * Gets items added to the queue + * + * @return array<int,array{ + * notification: \BracketSpace\Notification\Core\Notification, + * trigger: \BracketSpace\Notification\Interfaces\Triggerable} + * > + * @since 8.0.0 + */ + public static function get() : array + { + } + /** + * Iterates over the queue items + * + * @param callable $callback Callback for each item. + * @return void + * @since 8.0.0 + */ + public static function iterate(callable $callback) + { + } + /** + * Clears the queue entirely + * + * @return void + * @since 8.0.9 + */ + public static function clear() + { + } + /** + * Removes an item from the queue + * + * @param int $index Index of an item to remove. + * @return void + * @since 8.0.9 + */ + public static function remove(int $index) + { + } + } + /** + * Upgrade class + */ + class Upgrade + { + /** + * Current data version + * + * @var int + */ + public static $dataVersion = 3; + /** + * Version of database tables + * + * @var int + */ + public static $dbVersion = 3; + /** + * Data version setting key name + * + * @var string + */ + public static $dataSettingName = 'notification_data_version'; + /** + * Database version setting key name + * + * @var string + */ + public static $dbSettingName = 'notification_db_version'; + /** + * Checks if an upgrade is required + * + * @action notification/init 100 + * + * @return void + * @since 6.0.0 + */ + public function checkUpgrade() + { + } + /** + * -------------------------------------------------- + * Database. + * -------------------------------------------------- + */ + /** + * Install database tables + * + * @action notification/init + * @return void + */ + public function upgradeDb() + { + } + /** + * -------------------------------------------------- + * Helper methods. + * -------------------------------------------------- + */ + /** + * Populates Carrier with field values pulled from meta + * + * @param string|\BracketSpace\Notification\Interfaces\Sendable $carrier Sendable object or Carrier slug. + * @param int $postId Notification post ID. + * @return \BracketSpace\Notification\Interfaces\Sendable + * @throws \Exception If Carrier hasn't been found. + * @since 6.0.0 + */ + protected function populateCarrier($carrier, $postId) + { + } + /** + * Gets new trigger slug replacements + * + * @return array<mixed> + * @since 7.0.0 + */ + public function triggerSlugReplacements() + { + } + /** + * -------------------------------------------------- + * Upgrader methods. + * -------------------------------------------------- + */ + /** + * Upgrades data to v1. + * - 1. Saves the Notification cache in post_content field. + * - 2. Deletes trashed Notifications. + * - 3. Removes old debug log. + * + * @return void + * @since 6.0.0 + */ + public function upgradeToV1() + { + } + /** + * Upgrades data to v2. + * - 1. Changes the Trigger slugs. + * - 2. Changes the settings section `notifications` to `carriers`. + * + * @return void + * @since 6.0.0 + */ + public function upgradeToV2() + { + } + /** + * Upgrades data to v3. + * - 1. Moves the notifications to custom table. + * - 2. Clears notifications cache. + * + * @since 3.0.0 + * @return void + */ + public function upgradeToV3() + { + } + } + /** + * Cron class + */ + class Cron + { + /** + * Registers custom intervals for Cron + * + * @filter cron_schedules + * + * @param array<mixed> $intervals intervals. + * @return array<mixed> + * @since 5.1.5 + */ + public function registerIntervals($intervals) + { + } + /** + * Registers and reschedules the check updates event + * + * @action admin_init + * + * @return void + * @since 5.1.5 + */ + public function registerCheckUpdatesEvent() + { + } + /** + * Schedules the event + * + * @param string $schedule schedule name. + * @param string $eventName event name. + * @param bool $once if schedule only one. + * @return void + * @since 5.1.5 + */ + public function schedule($schedule, $eventName, $once = false) + { + } + /** + * Unschedules the event + * + * @param string $eventName event name. + * @return void + * @since 5.1.5 + */ + public function unschedule($eventName) + { + } + } + /** + * Processor class + */ + class Processor + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Processes the Queue + * + * @action shutdown + * + * @return void + * @since 8.0.0 + */ + public function processQueue() + { + } + /** + * Scheduled the Notification submission in Cron. + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return void + * @since 8.0.0 + */ + public static function schedule(\BracketSpace\Notification\Core\Notification $notification, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Dispatches all the Carriers attached for Notification. + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return void + * @since 8.0.0 + */ + public static function processNotification(\BracketSpace\Notification\Core\Notification $notification, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Handles cron request + * + * @action notification_background_processing + * + * @param string $notificationJson Notification JSON. + * @param string $triggerKey Trigger key. + * @return void + * @since 8.0.0 + */ + public static function handleCron($notificationJson, $triggerKey) + { + } + /** + * Sends the Carrier in context of Trigger + * + * @param \BracketSpace\Notification\Interfaces\Sendable $carrier Carrier object. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return void + * @since 8.0.0 + */ + public static function send(\BracketSpace\Notification\Interfaces\Sendable $carrier, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Gets cache instance + * + * @param string $triggerKey Trigger key. + * @return \BracketSpace\Notification\Dependencies\Micropackage\Cache\Cache + * @since 8.0.11 + */ + public static function getCache($triggerKey) + { + } + } + /** + * License class + */ + class License + { + /** + * Extension data + * + * @var array<mixed> + */ + protected $extension; + /** + * License storage key + * + * @var string + */ + protected $licenseStorage = 'notification_licenses'; + /** + * Class constructor + * + * @param array<mixed> $extension extension data. + * @since 5.1.0 + */ + public function __construct(array $extension) + { + } + /** + * Gets all licenses from database + * + * @return array<mixed> licenses + * @since 5.1.0 + */ + public function getLicenses() + { + } + /** + * Gets single license info + * + * @return mixed license data or false + * @since 5.1.0 + */ + public function get() + { + } + /** + * Checks if license is valid + * + * @return bool + * @since 5.1.0 + */ + public function isValid() + { + } + /** + * Gets the license key + * + * @return string + * @since 7.1.1 + */ + public function getKey() + { + } + /** + * Saves single license info + * + * @param object $licenseData license data from API. + * @return void + * @since 5.1.0 + */ + public function save($licenseData) + { + } + /** + * Removes single license from database + * + * @return void + * @since 5.1.0 + */ + public function remove() + { + } + /** + * Activates the license + * + * @param string $licenseKey license key. + * @return mixed WP_Error or License data + * @since 5.1.0 + */ + public function activate($licenseKey = '') + { + } + /** + * Deactivates the license + * + * @return mixed WP_Error or License data + * @since 5.1.0 + */ + public function deactivate() + { + } + /** + * Checks the license + * + * @param string $licenseKey license key. + * @return object WP_Error or license object + * @since 5.1.0 + */ + public function check($licenseKey = '') + { + } + } + /** + * Whitelabel class + */ + class Whitelabel + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * If plugin is in whitelabel mode. + * + * @var bool + */ + protected static $isWhitelabeled = false; + /** + * Removes defaults: + * - triggers + * + * @action notification/init 1000 + * + * @return void + */ + public function removeDefaults() + { + } + /** + * Sets the plugin in white label mode. + * + * @param array<string,mixed> $args white label args. + * @return void + * @since 8.0.0 + */ + public static function enable(array $args = []) + { + } + /** + * Checks if the plugin is in white label mode. + * + * @return bool + * @since 8.0.0 + */ + public static function isWhitelabeled() : bool + { + } + } + /** + * Sync class + */ + class Sync + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Sync path + * + * @var string|null + */ + protected static $syncPath; + /** + * Gets all Notifications from JSON files + * + * @return array<int,string> + * @since 6.0.0 + */ + public static function getAllJson() + { + } + /** + * Loads local JSON files + * + * @action notification/init 100 + * + * @return void + * @since 6.0.0 + */ + public function loadLocalJson() + { + } + /** + * Saves local JSON file + * + * @action notification/data/saved + * + * @since 6.0.0 + * @param Notification $notification Notification. + * @return void + */ + public static function saveLocalJson($notification) + { + } + /** + * Deletes local JSON file + * + * @action delete_post + * + * @param int $postId Deleted Post ID. + * @return void + * @since 6.0.0 + */ + public function deleteLocalJson($postId) + { + } + /** + * Enables the notification syncing + * By default path used is current theme's `notifications` dir. + * + * @param string $path full json directory path or null to use default. + * @return void + * @throws \Exception If provided path is not a directory. + * @since 8.0.0 + */ + //phpcs:ignore SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilitySymbolRequired + public static function enable(string $path = null) + { + } + /** + * Disables the synchronization. + * + * @return void + * @since 8.0.0 + */ + public static function disable() + { + } + /** + * Gets the synchronization path. + * + * @return string|null + * @since 8.0.0 + */ + public static function getSyncPath() + { + } + /** + * Gets the sync dir filesystem. + * + * @return \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem|null + * @since 8.0.2 + */ + public static function getSyncFs() + { + } + /** + * Gets the synchronization path. + * + * @return bool + * @since 8.0.0 + */ + public static function isSyncing() : bool + { + } + } + /** + * Binder class + */ + class Binder + { + /** + * Binds the trigger registered actions + * + * @action notification/trigger/registered 100 + * + * @param array<\BracketSpace\Notification\Interfaces\Triggerable> $triggers Array of Triggers or single Trigger. + * @return void + * @since 8.0.0 + */ + public static function bind($triggers) + { + } + } + class Notification + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Constructor + * + * @param NotificationData $data Notification data. + * @since 6.0.0 + */ + public function __construct($data = []) + { + } + /** + * Clone method + * Copies the Trigger and Carriers to new Carrier instance + * + * @return void + * @since 6.0.0 + */ + public function __clone() + { + } + /** + * Sets up Notification data from array. + * + * @param NotificationData $data Data array. + * @return $this + * @throws \Exception If wrong arguments has been passed. + * @since 6.0.0 + */ + public function setup($data = []) + { + } + /** + * Checks if enabled + * Alias for `get_enabled()` method + * + * @return boolean + * @since 6.0.0 + */ + public function isEnabled() + { + } + /** + * Creates hash + * + * @return string hash + * @since 6.0.0 + */ + public static function createHash() + { + } + /** + * Gets single Carrier object + * + * @param string $carrierSlug Carrier slug. + * @return Interfaces\Sendable|null + * @since 6.0.0 + */ + public function getCarrier($carrierSlug) + { + } + /** + * Gets enabled Carriers + * + * @return array<string,Interfaces\Sendable> + * @since 6.0.0 + */ + public function getEnabledCarriers() + { + } + /** + * Add Carrier to the set + * + * @param Interfaces\Sendable|string $carrier Carrier object or slug. + * @return Interfaces\Sendable + * @throws \Exception If you try to add already added Carrier. + * @throws \Exception If you try to add non-existing Carrier. + * @since 6.0.0 + */ + public function addCarrier($carrier) + { + } + /** + * Enables Carrier + * + * @param string $carrierSlug Carrier slug. + * @return void + * @since 6.0.0 + */ + public function enableCarrier($carrierSlug) + { + } + /** + * Disables Carrier + * + * @param string $carrierSlug Carrier slug. + * @return void + * @since 6.0.0 + */ + public function disableCarrier($carrierSlug) + { + } + /** + * Sets Carriers + * Makes sure that the Notification slug is used as key. + * + * @param array<string,Interfaces\Sendable> $carriers Array of Carriers. + * @return void + * @since 6.0.0 + */ + public function setCarriers($carriers = []) + { + } + /** + * Sets Carrier data + * + * @param string $carrierSlug Carrier slug. + * @param array<mixed> $data Carrier data. + * @return void + * @since 6.0.0 + */ + public function setCarrierData($carrierSlug, $data) + { + } + /** + * Gets Carrier data + * + * @param string $carrierSlug Carrier slug. + * @return void + * @since 6.0.0 + */ + public function getCarrierData($carrierSlug) + { + } + /** + * Gets single extra data value. + * + * @param string $key Extra data key. + * @return array<mixed>|bool|float|int|string|null Extra data value or null + * @since 6.0.0 + */ + public function getExtra($key) + { + } + /** + * Removes single extra data. + * + * @param string $key Extra data key. + * @return void + * @since 6.0.0 + */ + public function removeExtra($key) + { + } + /** + * Add extra data + * + * @param string $key Extra data key. + * @param array<mixed>|bool|float|int|string $value Extra data value. + * @return $this + * @throws \Exception If extra is not type of array, string or number or boolean. + * @since 6.0.0 + */ + public function addExtra($key, $value) + { + } + /** + * Refreshes the hash + * + * @return $this + * @since 6.1.4 + */ + public function refreshHash() + { + } + /** + * @return string + */ + public function getHash() : string + { + } + /** + * @param string $hash + * @return Notification + */ + public function setHash(string $hash) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return string + */ + public function getTitle() : string + { + } + /** + * @param string $title + * @return Notification + */ + public function setTitle(string $title) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return Interfaces\Triggerable|null + */ + public function getTrigger() + { + } + /** + * @param Interfaces\Triggerable|null $trigger + * @return Notification + */ + public function setTrigger($trigger) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return array<string, array<mixed>|bool|float|int|string> + */ + public function getExtras() : array + { + } + /** + * @param array<string, array<mixed>|bool|float|int|string> $extras + * @return Notification + */ + public function setExtras(array $extras) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return int + */ + public function getVersion() : int + { + } + /** + * @param int $version + * @return Notification + */ + public function setVersion(int $version) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return string + */ + public function getSource() : string + { + } + /** + * @param string $source + * @return Notification + */ + public function setSource(string $source) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return array<string,Interfaces\Sendable> + */ + public function getCarriers() + { + } + /** + * @param bool $enabled + * @return Notification + */ + public function setEnabled(bool $enabled) : \BracketSpace\Notification\Core\Notification + { + } + /** + * @return bool + */ + public function getEnabled() + { + } + /** + * Sets the source post identifier. + * + * @param int $postId The post identifier + * @return void + */ + public function setSourcePostId($postId) + { + } + /** + * Dumps the object to array + * + * @since 6.0.0 + * @deprecated 3.0.0 Use Converter instead, via $notification->to('array') method + * @param bool $onlyEnabledCarriers If only enabled Carriers should be saved. + * @return NotificationData|null + */ + public function toArray($onlyEnabledCarriers = false) + { + } + /** + * Creates Notification from a specific representation + * + * @since 3.0.0 + * @throws \Exception When no Notification object comes back from the filter + * @param string $type The type of representation, ie. array or json + * @param string|array<mixed,mixed> $data The notification representation + * @return self + */ + public static function from(string $type, $data) : \BracketSpace\Notification\Core\Notification + { + } + /** + * Converts the notification to another type of representation. + * + * @since 3.0.0 + * @param string $type The type of representation, ie. array or json + * @param array<string|int,mixed> $config The additional configuration of the converter + * @return mixed + */ + public function to(string $type, array $config = []) + { + } + /** + * Serialized Notification instance. + * + * @return NotificationAsArray + */ + public function __serialize() : array + { + } + /** + * Unserializes Notification instance. + * + * @param NotificationAsArray $data Notification data as array. + * @return void + */ + public function __unserialize(array $data) : void + { + } + } + /** + * Runner class + */ + class Runner + { + /** + * Trigger instance + * + * @var \BracketSpace\Notification\Interfaces\Triggerable + */ + protected $trigger; + /** + * Run ID + * + * @var string + */ + protected $id; + /** + * Storage for Trigger's Notifications + * + * @var array<\BracketSpace\Notification\Core\Notification> + */ + protected $notifications = []; + /** + * Constructor + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger in subject. + * @since 8.0.0 + */ + public final function __construct(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Runs the action by setting the context. + * + * Adds the specific Carrier and corresponding Trigger + * to the Queue for later execution. + * + * @param array<mixed> ...$context Callback args setting context. + * @return void + * @since 8.0.0 + */ + public function run(...$context) + { + } + /** + * Attaches the Notifications to Trigger + * + * @return void + */ + public function setNotifications() + { + } + /** + * Gets attached Notifications + * + * @return array<\BracketSpace\Notification\Core\Notification> + */ + public function getNotifications() + { + } + /** + * Gets the copy of attached Trigger. + * + * @return \BracketSpace\Notification\Interfaces\Triggerable + */ + public function getTrigger() + { + } + /** + * Check if Trigger has attached Notifications + * + * @return bool + */ + public function hasNotifications() + { + } + /** + * Attaches the Notification + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification class. + * @return void + */ + public function attachNotification(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Detaches the Notification + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification class. + * @return void + */ + public function detachNotification(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Detaches all the Notifications + * + * @return $this + */ + public function detachAllNotifications() + { + } + } +} +namespace BracketSpace\Notification\Traits { + /** + * Storage trait + * + * @template TItem + */ + trait Storage + { + /** + * Stored items + * + * @var array<TItem> + */ + protected static $items = []; + /** + * Adds an item to the Store + * + * @param TItem $item Item to add. + * @return void + * @since 8.0.0 + */ + public static function add($item) + { + } + /** + * Inserts an item at a specific index. + * + * @since 8.0.0 + * @since 3.0.0 Has third `$replace` param + * @param int|string $index Item index. + * @param TItem $item Item to add. + * @param bool $replace If should be replaced if exists, default: false. + * @return void + */ + public static function insert($index, $item, $replace = false) + { + } + /** + * Gets all items + * + * @return array<TItem> + * @since 8.0.0 + */ + public static function all() : array + { + } + /** + * Removes all items from the store + * + * @return void + * @since 8.0.0 + */ + public static function clear() + { + } + /** + * Get item by index + * + * @param mixed $index Intex of an item. + * @return TItem|null + * @since 8.0.0 + */ + public static function get($index) + { + } + /** + * Checks if the Storage has item + * + * @param mixed $index Intex of an item. + * @return bool + * @since 8.0.0 + */ + public static function has($index) : bool + { + } + } +} +namespace BracketSpace\Notification\Integration { + /** + * Two Factor plugin integration class + */ + class TwoFactor + { + /** + * Adds another authentication action + * + * @action notification/trigger/registered + * + * @param \BracketSpace\Notification\Abstracts\Trigger $trigger Trigger instance. + * @return void + * @since 7.0.0 + */ + public function addTriggerAction($trigger) + { + } + /** + * Proxies the 2FA action to change parameters + * + * @action two_factor_user_authenticated + * + * @param \WP_User $user User instance. + * @return void + * @since 7.0.0 + */ + public function userLoginWith2fa($user) + { + } + } + /** + * WordPress integration class + */ + class WordPressEmails + { + /** + * Replaces the default hooks for the new user notification + * + * @action notification/init + * + * @return void + * @since 6.1.0 + */ + public function replaceNewUserNotifyHooks() + { + } + /** + * Disables send the new user notification + * + * @param int $userId ID of the newly registered user. + * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' + * or an empty string (admin only), 'user', or 'both' (admin and user). + * @return void + * @since 6.1.0 + */ + public function disableNewUserNotify($userId, $notify = 'both') + { + } + /** + * Disables send the post author new comment notification emails + * + * @filter notify_post_author + * + * @param bool $maybeNotify Whether to notify the post author about the new comment. + * @param int $commentId The ID of the comment for the notification. + * @return bool $maybeNotify + * @since 6.1.0 + */ + public function disablePostAuthorNotify($maybeNotify, $commentId) + { + } + /** + * Disables send the site moderator email notifications about new comment + * + * @filter notify_moderator + * + * @param bool $maybeNotify Whether to notify blog moderator. + * @param int $commentId The id of the comment for the notification. + * @return bool $maybeNotify + * @since 6.1.0 + */ + public function disableCommentModeratorNotify($maybeNotify, $commentId) + { + } + /** + * Disables send the email change email notification to admin + * + * @action notification/init + * + * @return void + * @since 6.1.0 + */ + public function disablePasswordChangeNotifyToAdmin() + { + } + /** + * Disables confirmation email on profile email address change + * + * @action notification/init + * + * @return void + * @since 8.0.0 + */ + public function disableSendConfirmationOnProfileEmail() + { + } + /** + * Disables confirmation email on admin email address change + * + * @action notification/init + * + * @return void + * @since 8.0.0 + */ + public function disableSendConfirmationOnAdminEmail() + { + } + /** + * Disables email on admin email address changed + * + * @filter send_site_admin_email_change_email + * + * @since 3.0.0 + * @return bool + */ + public function disableSendConfirmationOnAdminEmailChanged() + { + } + /** + * Disables send the email change email to user + * + * @filter send_password_change_email + * + * @param bool $send Whether to send the email. + * @param array<mixed> $user The original user array. + * @param array<mixed> $userdata The updated user array. + * @return bool $send + * @since 6.1.0 + */ + public function disablePasswordChangeNotifyToUser($send, $user, $userdata) + { + } + /** + * Disables email to user when password reset is requested + * + * @filter retrieve_password_message 100 + * + * @param string $message Message send to user. + * @return string + * @since 6.3.1 + */ + public function disablePasswordResetNotifyToUser($message) + { + } + /** + * Disables send the email change email + * + * @filter send_email_change_email + * + * @param bool $send Whether to send the email. + * @param array<mixed> $user The original user array. + * @param array<mixed> $userdata The updated user array. + * @return bool $send + * @since 6.1.0 + */ + public function disableEmailChangeNotifyToUser($send, $user, $userdata) + { + } + /** + * Disables send an email following an automatic background core update + * + * @filter auto_core_update_send_email + * + * @param bool $send Whether to send the email. Default true. + * @param string $type The type of email to send. Can be one of 'success', 'fail', 'critical'. + * @param object $coreUpdate The update offer that was attempted. + * @param mixed $result The result for the core update. Can be WP_Error. + * @return bool $send + * @since 6.1.0 + */ + public function disableAutomaticWpCoreUpdateNotify($send, $type, $coreUpdate, $result) + { + } + } + /** + * WordPress integration class + */ + class WordPressIntegration + { + /** + * -------------------------- + * Loaders & Cache + * -------------------------- + */ + /** + * Loads all Notifications from Database + * + * @action notification/init 9999999 + * + * @since 3.0.0 + * @return void + */ + public function loadDatabaseNotifications() + { + } + /** + * -------------------------- + * Duplicate prevention + * -------------------------- + */ + /** + * Prevents the duplicate notifications + * + * Gutenberg or other editors, especiallyu when used within other + * plugins which manipulate the data. + * + * @filter notification/background_processing/trigger_key + * + * @param string $triggerKey Trigger unique key. + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return string + * @since 8.0.0 + */ + public function identifyTrigger($triggerKey, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * -------------------------- + * Comment replied proxies + * -------------------------- + */ + /** + * Proxies the wp_insert_comment action to check + * if comment is a reply. + * + * @action wp_insert_comment + * + * @param int $commentId Comment ID. + * @param \WP_Comment $comment Comment object. + * @return void + * @since 5.3.1 + */ + public function proxyCommentReply($commentId, $comment) + { + } + /** + * -------------------------- + * Comment published proxies + * -------------------------- + */ + /** + * Proxies the comment_post action + * + * @action comment_post + * + * @param int $commentId Comment ID. + * @param int|string $approved 1 if the comment is approved, 0 if not, 'spam' if spam. + * @return void + * @since 6.2.0 + */ + public function proxyPostCommentToPublished($commentId, $approved) + { + } + /** + * Proxies the transition_comment_status action + * + * @action transition_comment_status + * + * @param string $commentNewStatus New comment status. + * @param string $commentOldStatus Old comment status. + * @param \WP_Comment $comment Comment object. + * @return void + * @since 6.2.0 + */ + public function proxyTransitionCommentStatusToPublished($commentNewStatus, $commentOldStatus, $comment) + { + } + } +} +namespace BracketSpace\Notification { + /** + * Register class + */ + class Register + { + /** + * Registers Notification + * + * @since 3.0.0 + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return \BracketSpace\Notification\Core\Notification + */ + public static function notification(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Creates new Notification from array + * + * Accepts both array with Trigger and Carriers objects or static values. + * + * @since 3.0.0 + * @param NotificationUnconvertedData $data Notification data. + * @return \WP_Error|true + */ + public static function notificationFromArray($data = []) + { + } + /** + * Registers Notification if newer version is provided or doesn't exist at all + * + * @since 3.0.0 + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return \BracketSpace\Notification\Core\Notification + */ + public static function notificationIfNewer(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Registers Carrier + * + * @param \BracketSpace\Notification\Interfaces\Sendable $carrier Carrier object. + * @return \BracketSpace\Notification\Interfaces\Sendable + * @since 8.0.0 + */ + public static function carrier(\BracketSpace\Notification\Interfaces\Sendable $carrier) + { + } + /** + * Registers Recipient + * + * @param string $carrierSlug Carrier slug. + * @param \BracketSpace\Notification\Interfaces\Receivable $recipient Recipient object. + * @return \BracketSpace\Notification\Interfaces\Receivable + * @since 8.0.0 + */ + public static function recipient(string $carrierSlug, \BracketSpace\Notification\Interfaces\Receivable $recipient) + { + } + /** + * Registers Recipient + * + * @param \BracketSpace\Notification\Interfaces\Resolvable $resolver Resolver object. + * @return \BracketSpace\Notification\Interfaces\Resolvable + * @since 8.0.0 + */ + public static function resolver(\BracketSpace\Notification\Interfaces\Resolvable $resolver) + { + } + /** + * Registers Trigger + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return \BracketSpace\Notification\Interfaces\Triggerable + * @since 8.0.0 + */ + public static function trigger(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Registers Global Merge Tag + * + * @param \BracketSpace\Notification\Interfaces\Taggable $mergeTag MergeTag object. + * @return \BracketSpace\Notification\Interfaces\Taggable + * @since 8.0.0 + */ + public static function globalMergeTag(\BracketSpace\Notification\Interfaces\Taggable $mergeTag) + { + } + } +} +namespace BracketSpace\Notification\Admin { + /** + * PostType class + */ + class PostType + { + /** + * TABLE OF CONTENTS: ------------------------------- + * - Post Type. + * - Delete. + * - Save. + * - AJAX. + * - Notifications. + * -------------------------------------------------- + */ + /** + * -------------------------------------------------- + * Post Type. + * -------------------------------------------------- + */ + /** + * Registers Notification post type + * + * @action init + * + * @return void + */ + public function register() + { + } + /** + * Filters the post updated messages + * + * @filter post_updated_messages + * + * @param array<mixed> $messages Messages. + * @return array<mixed> + * @since 5.2.0 + */ + public function postUpdatedMessages($messages) + { + } + /** + * Filters the bulk action messages + * + * @filter bulk_post_updated_messages + * + * @param array<mixed> $bulkMessages Messages. + * @param array<mixed> $bulkCounts Counters. + * @return array<mixed> + * @since 6.0.0 + */ + public function bulkActionMessages($bulkMessages, $bulkCounts) + { + } + /** + * Changes the notification post statuses above the post table + * + * @filter views_edit-notification + * + * @param array<mixed> $statuses Statuses array. + * @return array<mixed> + * @since 6.0.0 + */ + public function changePostStatuses($statuses) + { + } + /** + * -------------------------------------------------- + * Delete. + * -------------------------------------------------- + */ + /** + * Deletes the post entirely bypassing the trash + * And removes the Notification from custom table + * + * @action wp_trash_post 100 + * + * @since 6.0.0 + * @param int $postId Post ID. + * @return void + */ + public function bypassTrash($postId) + { + } + /** + * Removes the Notification from custom table upon WP Post deletion + * + * @action after_delete_post 100 + * + * @since 3.0.0 + * @param int $postId Post ID. + * @param \WP_Post $post WP Post object. + * @return void + */ + public function deleteNotification($postId, $post) + { + } + /** + * -------------------------------------------------- + * Save. + * -------------------------------------------------- + */ + /** + * Saves the Notification data + * + * @action save_post_notification + * + * @since 3.0.0 We're saving the Notification to custom table instead of Post Type. Post is just the shell. + * @param int $postId Current post ID. + * @param \WP_Post $post WP_Post object. + * @param bool $update If existing notification is updated. + * @return void + */ + public function save($postId, $post, $update) + { + } + /** + * -------------------------------------------------- + * AJAX. + * -------------------------------------------------- + */ + /** + * Changes notification status from AJAX call + * + * @action wp_ajax_change_notification_status + * + * @return void + */ + public function ajaxChangeNotificationStatus() + { + } + /** + * Gets all Notifications from database. + * + * @deprecated 3.0.0 Use BracketSpace\Notification\Database\NotificationDatabaseService::getAll(); + * @since 6.0.0 + * @return array<Notification> + */ + public static function getAllNotifications() + { + } + } + /** + * Settings class + */ + class Settings + { + /** + * Registers General settings + * + * @action notification/settings/register + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function generalSettings($settings) + { + } + /** + * Registers Triggers settings + * + * @action notification/settings/register 20 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function triggersSettings($settings) + { + } + /** + * Registers Carrier settings + * + * @action notification/settings/register 30 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function carriersSettings($settings) + { + } + /** + * Registers Emails settings + * + * @action notification/settings/register 40 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function emailsSettings($settings) + { + } + /** + * Filters post types from supported posts + * + * @filter notification/settings/triggers/valid_post_types + * + * @param array<mixed> $postTypes post types. + * @return array<mixed> + * @since 5.0.0 + */ + public function filterPostTypes($postTypes) + { + } + } + /** + * Scripts class + */ + class Scripts + { + /** + * Scripts constructor + * + * @param \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem $fs Assets filesystem object. + * @since 5.0.0 + */ + public function __construct(\BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem $fs) + { + } + /** + * Enqueue scripts and styles for admin + * + * @action admin_enqueue_scripts + * + * @param string $pageHook current page hook. + * @return void + */ + public function enqueueScripts($pageHook) + { + } + } + /** + * Wizard class + */ + class Wizard + { + /** + * Wizard page hook. + * + * @var string|false + */ + public $pageHook = 'none'; + /** + * Option name for dismissed Wizard. + * + * @var string + */ + protected $dismissedOption = 'notification_wizard_dismissed'; + /** + * Wizard constructor + * + * @param \BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem $fs Includes filesystem object. + * @since 7.0.0 Changed the Files util to Filesystem. + */ + public function __construct(\BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem $fs) + { + } + /** + * Register Wizard invisible page. + * + * @action admin_menu 30 + * + * @return void + */ + public function registerPage() + { + } + /** + * Redirects the user to Wizard screen. + * + * @action current_screen + * + * @return void + */ + public function maybeRedirect() + { + } + /** + * Displays the Wizard page. + * + * @return void + */ + public function wizardPage() + { + } + /** + * Gets settings for Wizard page. + * + * @return array<mixed> List of settings groups. + */ + public function getSettings() + { + } + /** + * Saves Wizard settings. + * + * @action admin_post_save_notification_wizard + * + * @return void + */ + public function saveSettings() + { + } + /** + * Checks if wizard should be displayed + * + * @return bool + * @since 8.0.0 + */ + public static function shouldDisplay() + { + } + } + /** + * Debugging class + */ + class Debugging + { + /** + * Registers Debugging settings + * + * @action notification/settings/register 70 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function debuggingSettings($settings) + { + } + /** + * Displays debug log warning + * + * @action admin_notices + * + * @return void + * @since 5.3.0 + */ + public function debugWarning() + { + } + /** + * Clears logs from database + * + * @action admin_post_notification_clear_logs + * + * @return void + * @since 6.0.0 + */ + public function actionClearLogs() + { + } + } + /** + * Upsell class + */ + class Upsell + { + /** + * Adds conditionals metabox + * + * @action add_meta_boxes + * + * @return void + * @since 8.0.0 + */ + public function addConditionalsMetaBox() + { + } + /** + * Conditionals metabox content + * + * @param object $post current WP_Post. + * @return void + * @since 8.0.0 + */ + public function conditionalsMetabox($post) + { + } + /** + * Prints additional Merge Tag group in Merge Tags metabox + * Note: Used when there are Merge Tag groups + * + * @action notification/metabox/trigger/tags/groups/after + * + * @return void + * @since 8.0.0 + */ + public function customFieldsMergeTagGroup() + { + } + /** + * Renders review queue switch + * + * @action notification/admin/metabox/save/post + * + * @return void + * @since 8.0.0 + */ + public function reviewQueueSwitch() + { + } + /** + * Registers Scheduled Triggers settings + * + * @action notification/settings/register 200 + * + * @param \BracketSpace\Notification\Core\Settings $settings Settings API object. + * @return void + * @since 8.0.0 + */ + public function scheduledTriggersSettings($settings) + { + } + /** + * Adds Trigger upselling. + * + * @action notification/settings/section/triggers/before + * + * @return void + * @since 8.0.0 + */ + public function triggersSettingsUpsell() + { + } + /** + * Adds Carrier upselling. + * + * @action notification/settings/section/carriers/before + * + * @return void + * @since 8.0.0 + */ + public function carriersSettingsUpsell() + { + } + /** + * Adds missing Carriers to the List. + * + * @action notification/carrier/list/after + * + * @return void + * @since 8.0.0 + */ + public function carriersList() + { + } + /** + * Adds custom development CTA + * + * @action notification/settings/sidebar/after + * + * @return void + * @since 8.0.0 + */ + public function customDevelopment() + { + } + /** + * Gets the missing carriers + * + * @return array<string,array{name: string, pro: bool, link: string, icon: string}> + * @since 8.0.0 + */ + public static function getMissingCarriers() + { + } + } + /** + * Import/Export class + */ + class ImportExport + { + /** + * Registers Import/Export settings + * + * @action notification/settings/register 60 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function settings($settings) + { + } + /** + * Handles export request + * + * @action admin_post_notification_export + * + * @return void + * @since 6.0.0 + */ + public function exportRequest() + { + } + /** + * Prepares notifications data for export + * + * @since 6.0.0 + * @since 8.0.2 Accepts the items argument, instead reading it from GET. + * @since 3.0.0 Uses NotificationDatabaseService instead of get_posts(). + * @param array<int,string> $items Items to export. + * @return array<int,string> + * @throws \Exception When no items selected for export. + */ + public function prepareNotificationsExportData(array $items = []) + { + } + /** + * Handles import request + * + * @action wp_ajax_notification_import_json + * + * @return void + * @since 6.0.0 + */ + public function importRequest() + { + } + /** + * Imports notifications + * + * @param array<mixed> $data Notifications data. + * @return string + * @since 6.0.0 + */ + public function processNotificationsImportRequest($data) + { + } + } + /** + * Screen class + */ + class Screen + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * TABLE OF CONTENTS: ------------------------------- + * - Helpers. + * - Setup. + * - Display. + * - Screen Help. + * - AJAX Renders. + * -------------------------------------------------- + */ + /** + * -------------------------------------------------- + * Helpers. + * -------------------------------------------------- + */ + /** + * Gets currently displayed Notification. + * + * @return ?Notification + */ + public static function getCurrentNotification() + { + } + /** + * -------------------------------------------------- + * Setup. + * -------------------------------------------------- + */ + /** + * Renders main column on the Notification edit screen. + * + * @action load-post.php + * + * @return void + */ + public function setupNotification() + { + } + /** + * -------------------------------------------------- + * Display. + * -------------------------------------------------- + */ + /** + * Renders main column on the Notification edit screen. + * + * @action edit_form_after_title 1 + * + * @param \WP_Post $post Post object. + * @return void + */ + public function renderMainColumn($post) + { + } + /** + * Renders the trigger metabox + * + * @action notification/post/column/main + * + * @param Notification $notification Notification object. + * @return void + */ + public function renderTriggerSelect($notification) + { + } + /** + * Adds Carriers section title on post edit screen, + * just under the Trigger and prints Carrier boxes + * + * @action notification/post/column/main 20 + * + * @param Notification $notification Notification object. + * @return void + */ + public function renderCarrierBoxes($notification) + { + } + /** + * Renders a widget for adding Carriers + * + * @action notification/admin/carriers + * + * @param Notification $notification Notification object. + * @return void + */ + public function renderCarriersWidget($notification) + { + } + /** + * Gets Carrier config form + * + * @param \BracketSpace\Notification\Interfaces\Sendable $carrier Carrier object. + * @return string Form HTML. + * @since 6.0.0 + */ + public function getCarrierForm(\BracketSpace\Notification\Interfaces\Sendable $carrier) + { + } + /** + * Adds metabox with Save button + * + * @action add_meta_boxes + * + * @return void + */ + public function addSaveMetaBox() + { + } + /** + * Renders Save metabox + * + * @param \WP_Post $post current WP_Post. + * @return void + */ + public function renderSaveMetabox($post) + { + } + /** + * Adds metabox with Merge Tags. + * + * @action add_meta_boxes + * + * @return void + */ + public function addMergeTagsMetaBox() + { + } + /** + * Renders Merge Tags metabox + * + * @param \WP_Post $post current WP_Post. + * @return void + */ + public function renderMergeTagsMetabox($post) + { + } + /** + * Renders Merge Tags list + * + * @param string $triggerSlug Trigger slug. + * @return void + */ + public function renderMergeTagsList($triggerSlug) + { + } + /** + * Prepares merge tag groups for provided Trigger. + * + * @param \BracketSpace\Notification\Interfaces\Triggerable $trigger Trigger object. + * @return array<mixed> $groups Grouped tags. + */ + public function prepareMergeTagGroups($trigger) + { + } + /** + * Cleans up all metaboxes to keep the screen nice and clean + * + * @action add_meta_boxes 999999999 + * + * @return void + */ + public function metaboxCleanup() + { + } + /** + * -------------------------------------------------- + * Screen Help. + * -------------------------------------------------- + */ + /** + * Adds help tabs and useful links + * + * @action current_screen + * + * @param object $screen current WP_Screen. + * @return void + */ + public function addHelp($screen) + { + } + /** + * -------------------------------------------------- + * AJAX Renders. + * -------------------------------------------------- + */ + /** + * Renders Merge Tags metabox for AJAX call. + * + * @action wp_ajax_get_merge_tags_for_trigger + * + * @return void + */ + public function ajaxRenderMergeTags() + { + } + } + /** + * Notification duplicator class + */ + class NotificationDuplicator + { + /** + * Adds duplicate link to row actions + * + * @filter post_row_actions 50 + * + * @param array<mixed> $rowActions array with action links. + * @param object $post WP_Post object. + * @return array<mixed> filtered actions + */ + public function addDuplicateRowAction($rowActions, $post) + { + } + /** + * Duplicates the notification + * + * @action admin_post_notification_duplicate + * + * @return void + * @since 5.2.3 + */ + public function notificationDuplicate() + { + } + } + /** + * Sync class + */ + class Sync + { + /** + * Registers synchronization settings + * Hooks into the Import / Export settings. + * + * @action notification/settings/register 50 + * + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. + * @return void + */ + public function settings($settings) + { + } + /** + * Gets the actions template + * + * @return string + * @since 6.0.0 + */ + public function templateActions() + { + } + /** + * Synchronizes the Notification + * + * @action wp_ajax_notification_sync + * + * @return void + */ + public function ajaxSync() + { + } + /** + * Loads the Notification to JSON + * + * @param string $hash Notification hash. + * @return void + * @since 6.0.0 + */ + public function loadNotificationToJson($hash) + { + } + /** + * Loads the Notification to JSON + * + * @param string $hash Notification hash. + * @return mixed + * @since 6.0.0 + */ + public function loadNotificationToWordpress($hash) + { + } + } + /** + * PostTable class + */ + class PostTable + { + /** + * Adds custom table columns + * + * @filter manage_notification_posts_columns + * + * @param array<mixed> $columns current columns. + * @return array<mixed> filtered columns + */ + public function tableColumns($columns) + { + } + /** + * Cleans up Notification table columns. + * + * @filter manage_edit-notification_columns 999999999 + * + * @param array<string,string> $columns Columns. + * @return array<string,string> + */ + public function columnCleanup($columns) + { + } + /** + * Content for custom columns + * + * @action manage_notification_posts_custom_column + * + * @param string $column Column slug. + * @param int $postId Post ID. + * @return void + */ + public function tableColumnContent($column, $postId) + { + } + /** + * Remove all inline states to be displayed on notifications table + * + * @filter display_post_states + * + * @param array<mixed> $postStates an array of post display states. + * @param \WP_Post $post the current post object. + * @return array<mixed> filtered states + */ + public function removeStatusDisplay($postStates, $post) + { + } + /** + * Removes quick edit from post inline actions + * + * @filter post_row_actions + * + * @param array<mixed> $rowActions array with action links. + * @param object $post WP_Post object. + * @return array<mixed> filtered actions + */ + public function removeQuickEdit($rowActions, $post) + { + } + /** + * Changes trash link to something more descriptive + * Notifications cannot be trashed, it can be only removed + * + * @filter post_row_actions + * + * @param array<mixed> $rowActions array with action links. + * @param object $post WP_Post object. + * @return array<mixed> filtered actions + */ + public function adjustTrashLink($rowActions, $post) + { + } + /** + * Changes the table bulk actions. + * + * @filter bulk_actions-edit-notification + * + * @param array<mixed> $actions Bulk actions array. + * @return array<mixed> Filtered actions + */ + public function adjustBulkActions($actions) + { + } + /** + * Handles status bulk actions + * + * @filter handle_bulk_actions-edit-notification 10 + * + * @param string $redirectTo Redirect to link. + * @param string $doaction Action to perform. + * @param array<int> $postIds Array with post ids. + * @return string Redirect link. + * @since 7.1.0 + */ + public function handleStatusBulkActions($redirectTo, $doaction, $postIds) + { + } + /** + * Prints notices for bulk status changes. + * + * @action admin_notices + * + * @return void + * @since 7.1.0 + */ + public function displayBulkActionsAdminNotices() + { + } + } + /** + * Extensions class + */ + class Extensions + { + /** + * Premium Extensions list + * + * @var array<mixed> + */ + public $premiumExtensions = []; + /** + * Extensions admin page hook + * + * @var string|false + */ + public $pageHook = 'none'; + /** + * Register Extensions page under plugin's menu + * + * @action admin_menu + * + * @return void + */ + public function registerPage() + { + } + /** + * Loads all extensions + * If you want to get your extension listed please send a message via + * https://bracketspace.com/contact/ contact form + * + * @return void + */ + public function loadExtensions() + { + } + /** + * Gets raw extensions data from API + * + * @return array<mixed> + */ + public function getRawExtensions() + { + } + /** + * Gets single raw extension data + * + * @param string $slug extension slug. + * @return array<mixed>|false + */ + public function getRawExtension($slug) + { + } + /** + * Outputs extensions page + * + * @return void + */ + public function extensionsPage() + { + } + /** + * Initializes the Updater for all the premium plugins + * + * @action admin_init + * + * @return void + */ + public function updater() + { + } + /** + * Activates the premium extension. + * + * @action admin_post_notification_activate_extension + * + * @return void + */ + public function activate() + { + } + /** + * Deactivates the premium extension. + * + * @action admin_post_notification_deactivate_extension + * + * @return void + */ + public function deactivate() + { + } + /** + * Displays activation notices + * + * @action admin_notices + * + * @return void + */ + public function activationNotices() + { + } + /** + * Gets extensions with invalid license + * + * @return array<string> + */ + public function getInvalidLicenseExtensions() + { + } + /** + * Displays activation notice nag + * + * @action admin_notices + * + * @return void + */ + public function activationNag() + { + } + /** + * Displays inactive license warning + * + * @action notification/admin/extensions/premium/pre + * + * @return void + */ + public function inactiveLicenseWarning() + { + } + } +} +namespace BracketSpace\Notification\Utils\Settings { + /** + * Group class + */ + class Group + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Group constructor + * + * @param string $handle Settings handle. + * @param string $name Group name. + * @param string $slug Group slug. + * @param string $section Section slug. + * @throws \Exception Exception. + */ + public function __construct($handle, $name, $slug, $section) + { + } + /** + * Get or set name + * + * @param string $name Name. Do not pass anything to get current value. + * @return string name + */ + public function name($name = null) + { + } + /** + * Get or set slug + * + * @param string $slug Slug. Do not pass anything to get current value. + * @return string slug + */ + public function slug($slug = null) + { + } + /** + * Get or set section + * + * @param string $section Section. Do not pass anything to get current value. + * @return string section + */ + public function section($section = null) + { + } + /** + * Set or get description + * + * @param mixed $description string to set description, null to get it. + * @return string|\BracketSpace\Notification\Utils\Settings\Group + * String when using getter and Group when using setter + */ + public function description($description = null) + { + } + /** + * Set or get collapsed + * + * @param bool|null $collapsed Bool to set collapsed, null to get it. + * @return bool|\BracketSpace\Notification\Utils\Settings\Group String when using getter and Group when using setter + */ + public function collapsed($collapsed = null) + { + } + /** + * Set collapsed alias + * + * @return \BracketSpace\Notification\Utils\Settings\Group $this + */ + public function collapse() + { + } + /** + * Add Field to the Group + * + * @param array<mixed> $args field args. + * @return \BracketSpace\Notification\Utils\Settings\Group $this + * @throws \Exception Exception. + */ + public function addField($args) + { + } + /** + * Get all registered Fields + * + * @return array<mixed> + */ + public function getFields() + { + } + } +} +namespace BracketSpace\Notification\Utils\Settings\CoreFields { + /** + * Number class + */ + class Number + { + /** + * Number field + * Accepts addons: min, max, step + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value saved value. + * @return int|float sanitized number + */ + public function sanitize($value) + { + } + } + /** + * Editor class + */ + class Editor + { + /** + * Editor field + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value Saved value. + * @return string Sanitized content + */ + public function sanitize($value) + { + } + } + /** + * Url class + */ + class Url + { + /** + * Url field + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value saved value. + * @return string sanitized url + */ + public function sanitize($value) + { + } + } + /** + * Select class + */ + class Select + { + /** + * Select field + * You can define `multiple` addon to make it multiple + * If you want to use Selectize.js, set `pretty` addon to true + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize select value + * Uses sanitize_text_field() + * + * @param mixed $value saved value. + * @return mixed sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Checkbox class + */ + class Checkbox + { + /** + * Checkbox field + * Requires 'label' addon + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize checkbox value + * Allows only for empty string and 'true' + * + * @param string $value saved value. + * @return string empty string or 'true' + */ + public function sanitize($value) + { + } + } + /** + * Range class + */ + class Range + { + /** + * Range field + * Accepts addons: min, max, step + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param mixed $value Saved value. + * @return float Sanitized number + */ + public function sanitize($value) + { + } + } + /** + * Message class + */ + class Message + { + /** + * Message field + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value Saved value. + * @return string Sanitized text + */ + public function sanitize($value) + { + } + } + /** + * Text class + */ + class Text + { + /** + * Text field + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize input value + * + * @param string $value Saved value. + * @return string Sanitized text + */ + public function sanitize($value) + { + } + } + /** + * Image field class + */ + class Image + { + /** + * Image Field field + * Requires 'label' addon + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + * @since 7.0.0 + */ + public function input($field) + { + } + /** + * Sanitize checkbox value + * Allows only for empty string and 'true' + * + * @param string $value saved value. + * @return string empty string or 'true' + * @since 7.0.0 + */ + public function sanitize($value) + { + } + } + /** + * Button class + */ + class Button + { + /** + * Button field + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + /** + * Sanitize button URL + * + * @param string $value URL. + * @return string Sanitized URL + */ + public function sanitize($value) + { + } + } +} +namespace BracketSpace\Notification\Utils\Settings { + /** + * Field class + */ + class Field + { + /** + * Group constructor + * + * @param string $handle Settings handle. + * @param string $name Field name. + * @param string $slug Field slug. + * @param string $section Section slug. + * @param string $group Group slug. + * @throws \Exception Exception. + */ + public function __construct($handle, $name, $slug, $section, $group) + { + } + /** + * Get or set name + * + * @param string $name Name. Do not pass anything to get current value. + * @return string name + */ + public function name($name = null) + { + } + /** + * Get or set slug + * + * @param string $slug Slug. Do not pass anything to get current value. + * @return string slug + */ + public function slug($slug = null) + { + } + /** + * Get or set section + * + * @param string $section Section. Do not pass anything to get current value. + * @return string section + */ + public function section($section = null) + { + } + /** + * Get or set group + * + * @param string $group Group. Do not pass anything to get current value. + * @return string group + */ + public function group($group = null) + { + } + /** + * Set or get description + * + * @param mixed $description string to set description, null to get it. + * @return string description + */ + public function description($description = null) + { + } + /** + * Get or set field value + * + * @param mixed $value field value or null to get current. + * @return string value + */ + public function value($value = null) + { + } + /** + * Set or get default value + * + * @param mixed $defaultValue field default value or null to get current. + * @return string default value + */ + public function defaultValue($defaultValue = null) + { + } + /** + * Set or get addons + * + * @param mixed $addons field additional settings or null to get them. + * @return array<mixed> addons + */ + public function addons($addons = null) + { + } + /** + * Get addon + * + * @param mixed $addon field additional settings or null to get them. + * @return mixed addon value or null + */ + public function addon($addon = null) + { + } + /** + * Get Field input name + * + * @return string name + */ + public function inputName() + { + } + /** + * Get Field input id + * + * @return string id + */ + public function inputId() + { + } + /** + * Set field renderer + * + * @param mixed $renderer array or string. + * @return \BracketSpace\Notification\Utils\Settings\Field + * @throws \Exception Exception. + */ + public function setRenderer($renderer) + { + } + /** + * Set field sanitizer + * + * @param mixed $sanitizer array or string. + * @return \BracketSpace\Notification\Utils\Settings\Field + * @throws \Exception Exception. + */ + public function setSanitizer($sanitizer) + { + } + /** + * Render field + * + * @return void + */ + public function render() + { + } + /** + * Sanitize field value + * + * @param mixed $value raw value for sanitization. + * @return string sanitized value + */ + public function sanitize($value) + { + } + } + /** + * Settings class + */ + class Section + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Section constructor + * + * @param string $handle Settings handle. + * @param string $name Section name. + * @param string $slug Section slug. + * @throws \Exception Exception. + */ + public function __construct($handle, $name, $slug) + { + } + /** + * Get or set name + * + * @param string $name Name. Do not pass anything to get current value. + * @return string name + */ + public function name($name = null) + { + } + /** + * Get or set slug + * + * @param string $slug Slug. Do not pass anything to get current value. + * @return string slug + */ + public function slug($slug = null) + { + } + /** + * Add Group to the section + * + * @param string $name Group name. + * @param string $slug Group slug. + * @return \BracketSpace\Notification\Utils\Settings\Group + * @throws \Exception Exception. + */ + public function addGroup($name, $slug) + { + } + /** + * Get all registered Groups + * + * @return array<mixed> + */ + public function getGroups() + { + } + /** + * Get group by group slug + * + * @param string $slug group slug. + * @return mixed group object or false if no group defined + */ + public function getGroup($slug = '') + { + } + } +} +namespace BracketSpace\Notification\Utils\Settings\Fields { + /** + * NotificationLog class + */ + class NotificationLog + { + /** + * Field markup. + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + } + /** + * Import class + */ + class Import + { + /** + * Field markup. + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + } + /** + * ErrorLog class + */ + class ErrorLog + { + /** + * Field markup. + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + } + /** + * Export class + */ + class Export + { + /** + * Field markup. + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + } + /** + * SyncTable class + */ + class SyncTable + { + /** + * Field markup. + * + * @param \BracketSpace\Notification\Utils\Settings\Field $field Field instance. + * @return void + */ + public function input($field) + { + } + } +} +namespace BracketSpace\Notification\Utils { + /** + * WpObjectHelper class + */ + class WpObjectHelper + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Gets post type object + * + * @param string $postTypeSlug Post type slug. + * @return \WP_Post_Type|null + * @since 8.0.0 + */ + public static function getPostType($postTypeSlug) + { + } + /** + * Gets registered post types in slug => name format + * + * @param array<mixed> $args Query args. + * @return array<string,string> + * @since 8.0.0 + */ + public static function getPostTypes($args = []) : array + { + } + /** + * Gets post type object name + * + * @param string $postTypeSlug Post type slug. + * @return string|null + * @since 8.0.0 + */ + public static function getPostTypeName($postTypeSlug) + { + } + /** + * Gets taxonomy object + * + * @param string $taxonomySlug Taxonomy slug. + * @return \WP_Taxonomy|null + * @since 8.0.0 + */ + public static function getTaxonomy($taxonomySlug) + { + } + /** + * Gets registered taxonomies in slug => name format + * + * @param array<mixed> $args Query args. + * @return array<string,\WP_Taxonomy> + * @since 8.0.0 + */ + public static function getTaxonomies($args = []) : array + { + } + /** + * Gets taxonomy object name + * + * @param string $taxonomySlug Taxonomy slug. + * @return string|null + * @since 8.0.0 + */ + public static function getTaxonomyName($taxonomySlug) + { + } + /** + * Gets comment type name + * + * @param string $commentTypeSlug Comment type slug. + * @return string|null + * @since 8.0.0 + */ + public static function getCommentTypeName($commentTypeSlug) + { + } + /** + * Gets comment types from database + * + * @return array<string,string> + * @since 8.0.0 + */ + public static function getCommentTypes() : array + { + } + } + /** + * Allows plugins to use their own update API. + * + * @author Easy Digital Downloads + * @version Release: 1.9.1 + */ + class EDDUpdater + { + /** + * Class constructor. + * + * @param string $apiUrl The URL pointing to the custom API endpoint. + * @param string $pluginFile Path to the plugin file. + * @param array<mixed> $apiData Optional data to send with API calls. + * @uses hook() + * + * @uses plugin_basename() + */ + public function __construct($apiUrl, $pluginFile, $apiData = null) + { + } + /** + * Set up WordPress filters to hook into WP's update process. + * + * @return void + * @uses add_filter() + * + */ + public function init() + { + } + /** + * Check for Updates at the defined API endpoint and modify the update array. + * + * This function dives into the update API just when WordPress creates its update array, + * then adds a custom API call and injects the custom plugin data retrieved from the API. + * It is reassembled from parts of the native WordPress plugin update code. + * See wp-includes/update.php line 121 for the original wp_update_plugins() function. + * + * @param array<mixed> $transientData Update array build by WordPress. + * @return array<mixed> Modified update array with custom plugin data. + * @uses api_request() + * + */ + public function checkUpdate($transientData) + { + } + /** + * Get repo API data from store. + * Save to cache. + * + * @return \stdClass|bool + */ + public function getRepoApiData() + { + } + /** + * Show the update notification on multisite subsites. + * + * @param string $file + * @param array<mixed> $plugin + */ + public function showUpdateNotification($file, $plugin) + { + } + /** + * Updates information on the "View version x.x details" page with custom data. + * + * @param mixed $_data + * @param string $_action + * @param object $_args + * @return object $_data + * @uses api_request() + * + */ + public function pluginsApiFilter($_data, $_action = '', $_args = null) + { + } + /** + * Disable SSL verification in order to prevent download update failures + * + * @param array<mixed> $args + * @param string $url + * @return object $array + */ + public function httpRequestArgs($args, $url) + { + } + /** + * If available, show the changelog for sites in a multisite install. + */ + public function showChangelog() + { + } + /** + * Get the version info from the cache, if it exists. + * + * @param string $cacheKey + * @return object + */ + public function getCachedVersionInfo($cacheKey = '') + { + } + /** + * Adds the plugin version information to the database. + * + * @param string $value + * @param string $cacheKey + */ + public function setVersionInfoCache($value = '', $cacheKey = '') + { + } + } +} +namespace BracketSpace\Notification\Cli { + /** + * Dump all hooks as add_filter() calls. + */ + class DumpHooks + { + /** + * Dump all the Dochooks. + * + * @param list<string> $args Arguments. + * @return void + */ + public function __invoke($args) + { + } + } +} +namespace BracketSpace\Notification\Api\Controller { + /** + * RepeaterHandler class + * + * @action + */ + class RepeaterController + { + /** + * Post ID + * + * @var int + */ + public $postId; + /** + * Carrier slug + * + * @var string + */ + public $carrier; + /** + * Field slug + * + * @var string + */ + public $field; + /** + * Forms field data + * + * @param array<mixed> $data Field data. + * @return array<mixed> + * @since 7.0.0 + */ + public function formFieldData($data = null) + { + } + /** + * Gets field values + * + * @param int $postId Post id. + * @param string $carrier Carrier slug. + * @param string $field Field slug. + * @return array<mixed> + * @since 7.0.0 + */ + public function getValues($postId, $carrier, $field) + { + } + /** + * Gets carrier fields + * + * @return array<mixed> + * @since 7.0.0 + */ + public function getCarrierFields() + { + } + /** + * Normalize values array + * + * @param array<mixed> $values Field values. + * @return array<mixed> + * @since 7.0.0 + */ + public function normalizeValues($values) + { + } + /** + * Gets request params + * + * @param array<mixed> $params Request params. + * @return void + */ + public function parseParams($params) + { + } + /** + * Forms response data + * + * @return array<mixed> + * @since 7.0.0 + */ + public function formData() + { + } + /** + * Sends response + * + * @param \WP_REST_Request $request WP request instance. + * @return void + * @since 7.0.0 + */ + public function sendResponse(\WP_REST_Request $request) + { + } + } + /** + * RepeaterHandler class + * + * @action + */ + class SectionRepeaterController extends \BracketSpace\Notification\Api\Controller\RepeaterController + { + /** + * Group fields in associative array + * + * @param array<mixed> $fields Fields data. + * @return array<mixed> Modified fields data. + * @since 7.0.0 + */ + public function groupFields($fields) + { + } + /** + * Forms field data for sections + * + * @param array<mixed> $sections Sections data. + * @return array<mixed> + */ + public function getSectionsFields($sections) + { + } + /** + * Forms response data + * + * @return array<mixed> + * @since 7.0.0 + */ + public function formData() + { + } + } + /** + * REST api check controller class + */ + class CheckRestApiController + { + /** + * Sends response + * + * @return void + * @since 8.0.12 + */ + public function sendResponse() + { + } + } + /** + * RepeaterHandler class + * + * @action + */ + class SelectInputController + { + /** + * Sends response + * + * @param \WP_REST_Request $request WP request instance. + * @return void + * @since 7.0.0 + */ + public function sendResponse(\WP_REST_Request $request) + { + } + } +} +namespace BracketSpace\Notification\Api { + /** + * Api class + */ + class Api + { + /** + * Endpoint namespace + * + * @var string + */ + public $namespace = 'notification/v1'; + /** + * Route configuration + * + * @var array<mixed> + */ + public $routes = []; + /** + * Constructor method + * + * @return void + * @since 7.0.0 + */ + public function __construct() + { + } + /** + * Registers rest api route. + * + * @action rest_api_init + * @return void + * @since 7.0.0 + */ + public function restApiInit() + { + } + /** + * Gets API endpoint + * + * @param string $endpoint Endopint name. + * @return string + * @since 8.0.13 + */ + public function getEndpoint($endpoint) + { + } + } +} +namespace BracketSpace\Notification { + /** + * Error Handler class + */ + class ErrorHandler + { + /** + * Checks if debug is enabled. + * + * @return bool + * @since 8.0.0 + */ + public static function debugEnabled() + { + } + /** + * Handles error + * When debug is disabled it converts to a Warning. + * + * @param string $message Message. + * @param string $exceptionClass Exception class name. + * @return void + * @throws \Exception If debug is enabled. + * @since 8.0.0 + */ + public static function error(string $message, string $exceptionClass = 'Exception') + { + } + } +} +namespace BracketSpace\Notification\Interfaces { + /** + * Storable interface + */ + interface Storable + { + } +} +namespace BracketSpace\Notification\Store { + /** + * Recipient Store + * + * @todo Refactor the class so it uses Storage trait. + */ + class Recipient implements \BracketSpace\Notification\Interfaces\Storable + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** + * Inserts a Recipient for specific Carrier. + * + * @param string $carrierSlug Carrier slug. + * @param string $slug Recipient slug. + * @param \BracketSpace\Notification\Interfaces\Receivable $recipient Recipient to add. + * @return void + * @since 8.0.0 + */ + public static function insert(string $carrierSlug, string $slug, \BracketSpace\Notification\Interfaces\Receivable $recipient) + { + } + /** + * Gets all items + * + * @return array<string, array<string, \BracketSpace\Notification\Interfaces\Receivable>> + * @since 8.0.0 + */ + public static function all() : array + { + } + /** + * Removes all items from the store + * + * @return void + * @since 8.0.0 + */ + public static function clear() + { + } + /** + * Gets all Recipients for specific Carrier + * + * @param string $carrierSlug Carrier slug. + * @return array<string, \BracketSpace\Notification\Interfaces\Receivable> + * @since 8.0.0 + */ + public static function allForCarrier(string $carrierSlug) : array + { + } + /** + * Gets Recipient for Carrier by a slug + * + * @param string $carrierSlug Carrier slug. + * @param string $slug Recipient slug. + * @return mixed + * @since 8.0.0 + */ + public static function get(string $carrierSlug, $slug) + { + } + } + /** + * Global Merge Tag Store + */ + class GlobalMergeTag implements \BracketSpace\Notification\Interfaces\Storable + { + /** @use Storage<Interfaces\Taggable> */ + use \BracketSpace\Notification\Traits\Storage; + } + /** + * Resolver Store + */ + class Resolver implements \BracketSpace\Notification\Interfaces\Storable + { + /** @use Storage<Interfaces\Resolvable> */ + use \BracketSpace\Notification\Traits\Storage; + /** + * Gets all Resolvers sorted by priority. + * + * @return array<Interfaces\Resolvable> + * @since 8.0.0 + */ + public static function sorted() : array + { + } + } + /** + * Carrier Store + */ + class Carrier implements \BracketSpace\Notification\Interfaces\Storable + { + /** @use Storage<Interfaces\Sendable> */ + use \BracketSpace\Notification\Traits\Storage; + } + /** + * Trigger Store + */ + class Trigger implements \BracketSpace\Notification\Interfaces\Storable + { + /** @use Storage<Interfaces\Triggerable> */ + use \BracketSpace\Notification\Traits\Storage; + /** + * Gets all Triggers grouped. + * + * @return array<string, array<string, Interfaces\Triggerable>> + * @since 8.0.0 + */ + public static function grouped() : array + { + } + } + /** + * Notification Store + */ + class Notification implements \BracketSpace\Notification\Interfaces\Storable + { + use \BracketSpace\Notification\Dependencies\Micropackage\Casegnostic\Casegnostic; + /** @use Storage<CoreNotification> */ + use \BracketSpace\Notification\Traits\Storage; + /** + * Gets the Notifications with specific Trigger + * + * @param string $triggerSlug Trigger slug. + * @return array<int,CoreNotification> + * @since 6.0.0 + * @since 8.0.0 Is static method + */ + public static function withTrigger($triggerSlug) + { + } + } +} +namespace { + /** + * Gets cached value or cache object + * + * @since 7.0.0 + * @deprecated 8.0.0 + * @return null + */ + function notification_cache() + { + } + /** + * Checks if the Wizard should be displayed. + * + * @since 6.3.0 + * @deprecated 8.0.0 + * @return bool + */ + function notification_display_wizard() + { + } + /** + * Creates new AJAX Handler object. + * + * @since 6.0.0 + * @since 7.0.0 Using Ajax Micropackage. + * @deprecated 8.0.0 + * @return BracketSpace\Notification\Dependencies\Micropackage\Ajax\Response + */ + function notification_ajax_handler() + { + } + /** + * Gets one of the plugin filesystems + * + * @since 7.0.0 + * @deprecated 8.0.0 + * @param string $deprecated Filesystem name. + * @return BracketSpace\Notification\Dependencies\Micropackage\Filesystem\Filesystem + */ + function notification_filesystem($deprecated) + { + } + /** + * Gets all notification posts with enabled trigger. + * + * @todo This function needs to be fixed because we are no longer storing + * the Trigger in Notification post meta. + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param mixed $trigger_slug Trigger slug or null if all posts should be returned. + * @param bool $all If get all posts or just active. + * @return array + */ + function notification_get_posts($trigger_slug = \null, $all = \false) + { + } + /** + * Gets notification post by its hash. + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $hash Notification unique hash. + * @return mixed null or Notification object + */ + function notification_get_post_by_hash($hash) + { + } + /** + * Checks if notification post has been just started + * + * @since 6.0.0 We are using Notification Post object. + * @deprecated 8.0.0 + * @param mixed $post Post ID or WP_Post. + * @return boolean True if notification has been just started + */ + function notification_post_is_new($post) + { + } + /** + * Prints the template + * Wrapper for micropackage's template function + * + * @since 7.0.0 + * @deprecated 8.0.0 + * @param string $template_name Template name. + * @param array $vars Template variables. + * Default: empty. + * @return void + */ + function notification_template($template_name, $vars = []) + { + } + /** + * Gets the template + * Wrapper for micropackage's get_template function + * + * @since 7.0.0 + * @deprecated 8.0.0 + * @param string $template_name Template name. + * @param array $vars Template variables. + * Default: empty. + * @return string + */ + function notification_get_template($template_name, $vars = []) + { + } + /** + * Enables the notification syncing + * By default path used is current theme's `notifications` dir. + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param mixed $path full json directory path or null to use default. + * @return void + */ + function notification_sync($path = \null) + { + } + /** + * Gets the synchronization path. + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @return string|null + */ + function notification_get_sync_path() + { + } + /** + * Checks if synchronization is active. + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @return boolean + */ + function notification_is_syncing() + { + } + /** + * Sets the plugin in white label mode. + * + * @since 5.0.0 + * @deprecated 8.0.0 + * @param array $args white label args. + * @return void + */ + function notification_whitelabel($args = []) + { + } + /** + * Checks if the plugin is in white label mode. + * + * @since 5.0.0 + * @deprecated 8.0.0 + * @return bool + */ + function notification_is_whitelabeled() + { + } + /** + * Registers Carrier + * + * @since 6.0.0 + * @since 6.3.0 Uses Carrier Store. + * @deprecated 8.0.0 + * @param Interfaces\Sendable $carrier Carrier object. + * @return void + */ + function notification_register_carrier(\BracketSpace\Notification\Interfaces\Sendable $carrier) + { + } + /** + * Gets all registered Carriers + * + * @since 6.0.0 + * @since 6.3.0 Uses Carrier Store. + * @deprecated 8.0.0 + * @return array<string,Interfaces\Sendable> + */ + function notification_get_carriers() + { + } + /** + * Gets single registered Carrier + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $carrier_slug Carrier slug. + * @return Interfaces\Sendable|null + */ + function notification_get_carrier($carrier_slug) + { + } + /** + * Registers recipient + * + * @since 6.0.0 + * @since 6.3.0 Uses Recipient Store + * @deprecated 8.0.0 + * @param string $carrier_slug Carrier slug. + * @param Interfaces\Receivable $recipient Recipient object. + * @return void + */ + function notification_register_recipient($carrier_slug, \BracketSpace\Notification\Interfaces\Receivable $recipient) + { + } + /** + * Gets all registered recipients + * + * @since 6.0.0 + * @since 6.3.0 Uses Recipient Store + * @deprecated 8.0.0 + * @return array<string,array<string,Interfaces\Receivable>> + */ + function notification_get_recipients() + { + } + /** + * Gets registered recipients for specific Carrier + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $carrier_slug Carrier slug. + * @return array<string,Interfaces\Receivable> + */ + function notification_get_carrier_recipients($carrier_slug) + { + } + /** + * Gets single registered recipient for specific Carrier + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $carrier_slug Carrier slug. + * @param string $recipient_slug Recipient slug. + * @return Interfaces\Receivable|null + */ + function notification_get_recipient($carrier_slug, $recipient_slug) + { + } + /** + * Parses recipient raw value to values which can be used by notifications + * + * @since 5.0.0 + * @since 6.0.0 Changed naming convention from Notification to Carrier. + * @deprecated 8.0.0 + * @param string $carrier_slug Slug of the Carrier. + * @param string $recipient_type Slug of the Recipient. + * @param mixed $recipient_raw_value Raw value. + * @return mixed Parsed value + */ + function notification_parse_recipient($carrier_slug, $recipient_type, $recipient_raw_value) + { + } + /** + * Adds Resolver to Store + * + * @since 6.0.0 + * @since 6.3.0 Uses Resolver Store. + * @deprecated 8.0.0 + * @param Interfaces\Resolvable $resolver Resolver object. + * @return void + */ + function notification_register_resolver(\BracketSpace\Notification\Interfaces\Resolvable $resolver) + { + } + /** + * Resolves the value + * + * @since 6.0.0 + * @since 6.3.0 Uses Resolver Store. + * @deprecated 8.0.0 + * @param string $value Unresolved string with tags. + * @param Interfaces\Triggerable $trigger Trigger object. + * @return string Resolved value + */ + function notification_resolve($value, \BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Clears all Merge Tags + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $value Unresolved string with tags. + * @return string Value without any tags + */ + function notification_clear_tags($value) + { + } + /** + * Adds Trigger to Store + * + * @since 6.0.0 + * @since 6.3.0 Uses Trigger Store + * @param Interfaces\Triggerable $trigger trigger object. + * @return void + */ + function notification_register_trigger(\BracketSpace\Notification\Interfaces\Triggerable $trigger) + { + } + /** + * Gets all registered triggers + * + * @since 6.0.0 + * @since 6.3.0 Uses Trigger Store + * @deprecated 8.0.0 + * @return array<string,Interfaces\Triggerable> + */ + function notification_get_triggers() + { + } + /** + * Gets single registered trigger + * + * @since 6.0.0 + * @deprecated 8.0.0 + * @param string $trigger_slug trigger slug. + * @return Interfaces\Triggerable|null + */ + function notification_get_trigger($trigger_slug) + { + } + /** + * Gets all registered triggers in a grouped array + * + * @since 5.0.0 + * @deprecated 8.0.0 + * @return array<string,array<string, Interfaces\Triggerable>> + */ + function notification_get_triggers_grouped() + { + } + /** + * Adds global Merge Tags for all Triggers + * + * @since 5.1.3 + * @deprecated 8.0.0 + * @param Interfaces\Taggable $merge_tag Merge Tag object. + * @return Interfaces\Taggable + */ + function notification_add_global_merge_tag(\BracketSpace\Notification\Interfaces\Taggable $merge_tag) + { + } + /** + * Gets all global Merge Tags + * + * @since 5.1.3 + * @deprecated 8.0.0 + * @return array<string,Interfaces\Taggable> + */ + function notification_get_global_merge_tags() + { + } + /** + * Adapts Notification object + * Default adapters are: WordPress || JSON + * + * @param string $adapterName Adapter class name. + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated 3.0.0 + */ + function notification_adapt($adapterName, \BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Adapts Notification from input data + * Default adapters are: WordPress || JSON + * + * @param string $adapterName Adapter class name. + * @param mixed $data Input data needed by adapter. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated 3.0.0 + */ + function notification_adapt_from($adapterName, $data) + { + } + /** + * Changes one adapter to another + * + * @param string $newAdapterName Adapter class name. + * @param \BracketSpace\Notification\Interfaces\Adaptable $adapter Adapter. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated 3.0.0 + */ + function notification_swap_adapter($newAdapterName, \BracketSpace\Notification\Interfaces\Adaptable $adapter) + { + } + /** + * Logs the message in database + * + * @since 6.0.0 + * @deprecated 3.0.0 + * @param string $component Component nice name, like `Core` or `Any Plugin Name`. + * @param string $type Log type, values: notification|error|warning. + * @param string $message Log formatted message. + * @return bool|\WP_Error + */ + function notification_log($component, $type, $message) + { + } + /** + * Adds Notification to Store + * + * @since 6.0.0 + * @deprecated 3.0.0 + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return void + */ + function notification_add(\BracketSpace\Notification\Core\Notification $notification) + { + } + /** + * Converts the static data to Trigger and Carrier objects + * + * If no `trigger` nor `carriers` keys are available it does nothing. + * If the data is already in form of objects it does nothing. + * + * @param array<mixed> $data Notification static data. + * @return array<mixed> Converted data. + * @since 6.0.0 + * @deprecated 3.0.0 + */ + function notification_convert_data($data = []) + { + } + /** + * Registers settings + * + * @param mixed $callback Callback for settings registration, array of string. + * @param int $priority Action priority. + * @return void + * @since 5.0.0 + * @deprecated 3.0.0 + */ + function notification_register_settings($callback, $priority = 10) + { + } + /** + * Gets setting values + * + * @return mixed + * @since 5.0.0 + * @deprecated 3.0.0 + */ + function notification_get_settings() + { + } + /** + * Gets single setting value + * + * @param string $setting setting name in `a/b/c` format. + * @return mixed + * @since 5.0.0 + * @since 7.0.0 The `notifications` section has been changed to `carriers`. + * @deprecated 3.0.0 + */ + function notification_get_setting($setting) + { + } + /** + * Updates single setting value. + * + * @deprecated 3.0.0 + * @param string $setting setting name in `a/b/c` format. + * @param mixed $value setting value. + * @return mixed + */ + function notification_update_setting($setting, $value) + { + } + /** + * Creates new Notification from array + * + * @since 6.0.0 + * @deprecated 3.0.0 + * @param NotificationUnconvertedData $data Notification data. + * @return void + */ + function notification($data = []) + { + } + /** + * Deprecation helpers + * + * @package notification + */ + /** + * Helper function. + * Throws a deprecation notice from deprecated class + * + * @since 6.0.0 + * @param string $class Deprecated class name. + * @param string $version Version since deprecated. + * @param string $replacement Replacement class. + * @return void + */ + function notification_deprecated_class($class, $version, $replacement = \null) + { + } + /** + * Form table row template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $field = $get('current_field'); + /** + * Extension box template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $ext = $get('extension'); + /** + * Premium Extension box template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $ext = $get('extension'); + /** @var mixed $license */ + $license = $ext['license']->get(); + /** + * Inactive license warning + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $extensionList = \implode(', ', \array_map(static fn($ext) => \str_replace('Notification : ', '', $ext), $get('extensions'))); + /** + * Save notification metabox + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + * @var \BracketSpace\Notification\Core\Notification $notification + */ + $notification = $get('notification'); + /** + * Merge tag template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $tag = $get('tag'); + /** + * Export notifications form + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + // phpcs:disable Squiz.NamingConventions.ValidVariableName.NotCamelCaps + /** @var array<\BracketSpace\Notification\Defaults\Adapter\WordPress> $notifications */ + $notifications = $get('notifications'); + /** + * Error log template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $logs = $get('logs'); + /** + * Notification log template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $logs = $get('logs'); + /** + * Log pagination template + * + * @package notification + * + * @var callable(string $varName, string $default=): mixed $get Variable getter. + * @var callable(string $varName, string $default=): void $the Variable printer. + * @var callable(string $varName, string $default=): void $the_esc Escaped variable printer. + * @var \BracketSpace\Notification\Dependencies\Micropackage\Templates\Template $this Template instance. + */ + $links = \paginate_links(['base' => \admin_url('edit.php?post_type=notification&page=settings§ion=debugging&' . $get('query_arg') . '=%#%'), 'current' => $get('current'), 'total' => $get('total')]); + function upsertAndGet($notification) + { + } + /** + * PHPUnit bootstrap file + * + * @package notification + */ + \define('NOTIFICATION_DOING_TESTS', \true); + \define('NOTIFICATION_DEBUG', \true); + \define('DOING_TESTS', \true); + \define('WP_TESTS_PHPUNIT_POLYFILLS_PATH', $_phpunit_polyfills_path); +} diff --git a/compat/register-hooks.php b/compat/register-hooks.php index a54005a..94a8050 100644 --- a/compat/register-hooks.php +++ b/compat/register-hooks.php @@ -2,7 +2,7 @@ /** * Hooks compatibilty file. * - * Automatically generated with `wp notification dump-hooks`. + * Automatically generated with `wp notification-buddypress dump-hooks`. * * @package notification/buddypress */ @@ -10,6 +10,9 @@ /** @var \BracketSpace\Notification\BuddyPress\Runtime $this */ // phpcs:disable -add_action( 'notification/init', [ $this, 'elements' ], 10, 0 ); -add_filter( 'bp_notifications_get_registered_components', [ $this->component( 'frontend/handler' ), 'register_component' ], 10, 1 ); -add_filter( 'bp_notifications_get_notifications_for_user', [ $this->component( 'frontend/handler' ), 'handle_notification' ], 10, 8 ); +add_action('notification/init', [$this, 'elements'], 10, 0); +add_action('init', [$this->component('BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Internationalization\Internationalization'), 'load_translation'], 10, 0); +add_action('notification/settings/register', [$this->component('BracketSpace\Notification\BuddyPress\Admin\Settings'), 'registerTriggerSettings'], 20, 1); +add_action('notification/settings/register', [$this->component('BracketSpace\Notification\BuddyPress\Admin\Settings'), 'registerCarrierSettings'], 30, 1); +add_filter('bp_notifications_get_registered_components', [$this->component('BracketSpace\Notification\BuddyPress\Frontend\NotificationHandler'), 'registerComponent'], 10, 1); +add_filter('bp_notifications_get_notifications_for_user', [$this->component('BracketSpace\Notification\BuddyPress\Frontend\NotificationHandler'), 'handleNotification'], 10, 8); diff --git a/composer.json b/composer.json index 7d47872..a9dbfea 100644 --- a/composer.json +++ b/composer.json @@ -4,30 +4,68 @@ "scripts": { "phpcbf": "phpcbf", "phpcs": "phpcs", - "phpcompat": "phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0 notification-buddypress.php load.php uninstall.php src/", - "phplint": "parallel-lint --exclude node_modules --exclude vendor ." + "phplint": "parallel-lint --exclude node_modules --exclude vendor --exclude dependencies .", + "phpstan": "phpstan analyze --memory-limit=-1", + "prefix-namespaces-dev": [ + "strauss", + "composer dump-autoload" + ], + "prefix-namespaces-prod": [ + "strauss --deleteVendorPackages=true", + "composer dump-autoload", + "rm -r vendor/bin", + "rm -r vendor/brianhenryie", + "find vendor -type d -empty -delete" + ], + "post-install-cmd": [ + "@prefix-namespaces-dev" + ], + "post-update-cmd": [ + "@prefix-namespaces-dev" + ] }, "autoload": { "psr-4": { "BracketSpace\\Notification\\BuddyPress\\": "src/" - } + }, + "classmap": [ + "dependencies/" + ] }, "require": { - "php": "^7.0", + "php": "^7.4 | ^8.0", + "composer-runtime-api": "^2.0", + "brianhenryie/strauss": "^0.19.1", + "micropackage/ajax": "^1.0", "micropackage/dochooks": "1.0.2", "micropackage/filesystem": "^1.1", + "micropackage/internationalization": "^1.0", "micropackage/requirements": "^1.0", - "typisttech/imposter-plugin": "^0.6.2" + "micropackage/templates": "^1.1" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "jakub-onderka/php-parallel-lint": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "php-stubs/wp-cli-stubs": "^2.4", "phpcompatibility/php-compatibility": "^9.3", - "wp-coding-standards/wpcs": "^2.0" + "phpcompatibility/phpcompatibility-wp": "*", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1", + "szepeviktor/phpstan-wordpress": "^1.3" }, "extra": { - "imposter": { - "namespace": "BracketSpace\\Notification\\BuddyPress\\Vendor" + "strauss": { + "namespace_prefix": "BracketSpace\\Notification\\BuddyPress\\Dependencies\\", + "target_directory": "dependencies", + "classmap_prefix": "BracketSpace_Notification_BuddyPress_Dependencies_" + } + }, + "config": { + "optimize-autoloader": true, + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": true, + "platform": { + "php": "7.4" } } } diff --git a/composer.lock b/composer.lock index 3cd3397..ef7f7b3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,326 +4,507 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8dc0efe2da7241d2f8e282fe60e9385d", + "content-hash": "1039d48e450c87c508f27cf91a9dbb91", "packages": [ { - "name": "micropackage/ajax", - "version": "1.0.1", + "name": "brianhenryie/strauss", + "version": "0.19.2", "source": { "type": "git", - "url": "https://github.com/micropackage/ajax.git", - "reference": "8bf2c0528776696208f53ce8c393da3aba7b24ac" + "url": "https://github.com/BrianHenryIE/strauss.git", + "reference": "7212a4dd8ec397095c59023591681b4cb0f8611d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/ajax/zipball/8bf2c0528776696208f53ce8c393da3aba7b24ac", - "reference": "8bf2c0528776696208f53ce8c393da3aba7b24ac", + "url": "https://api.github.com/repos/BrianHenryIE/strauss/zipball/7212a4dd8ec397095c59023591681b4cb0f8611d", + "reference": "7212a4dd8ec397095c59023591681b4cb0f8611d", "shasum": "" }, "require": { - "php": ">=5.6" + "composer/composer": "*", + "json-mapper/json-mapper": "^2.2", + "league/flysystem": "^2.1|^3.0", + "symfony/console": "^4|^5|^6|^7", + "symfony/finder": "^4|^5|^6|^7" + }, + "replace": { + "coenjacobs/mozart": "*" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "php-mock/php-mock-phpunit": "^2.6", - "phpcompatibility/php-compatibility": "^9.1", - "phpunit/phpunit": "^6.5.5", - "wp-coding-standards/wpcs": "^2.0" + "brianhenryie/php-diff-test": "dev-master", + "clue/phar-composer": "^1.2", + "ext-json": "*", + "jaschilz/php-coverage-badger": "^2.0", + "mheap/phpunit-github-actions-printer": "^1.4", + "mockery/mockery": "^1.6", + "php": "^7.4|^8.0", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9|^10", + "squizlabs/php_codesniffer": "^3.5" }, + "bin": [ + "bin/strauss" + ], "type": "library", "autoload": { "psr-4": { - "Micropackage\\Ajax\\": "src" + "BrianHenryIE\\Strauss\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Brian Henry", + "email": "BrianHenryIE@gmail.com" + }, + { + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" } ], - "description": "Wrapper for WordPress' AJAX", + "description": "Composes all dependencies as a package inside a WordPress plugin", "support": { - "issues": "https://github.com/micropackage/ajax/issues", - "source": "https://github.com/micropackage/ajax/tree/1.0.1" + "issues": "https://github.com/BrianHenryIE/strauss/issues", + "source": "https://github.com/BrianHenryIE/strauss/tree/0.19.2" }, - "time": "2020-02-11T09:58:59+00:00" + "time": "2024-06-10T20:51:59+00:00" }, { - "name": "micropackage/dochooks", - "version": "1.0.2", + "name": "composer/ca-bundle", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/micropackage/dochooks.git", - "reference": "9eddd9b480fce394d0123ebe806d542e6409105e" + "url": "https://github.com/composer/ca-bundle.git", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/dochooks/zipball/9eddd9b480fce394d0123ebe806d542e6409105e", - "reference": "9eddd9b480fce394d0123ebe806d542e6409105e", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", "shasum": "" }, "require": { - "php": ">=5.6" + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^7.2 || ^8.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.1", - "wp-coding-standards/wpcs": "^2.0" + "phpstan/phpstan": "^1.10", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Micropackage\\DocHooks\\": "src" + "Composer\\CaBundle\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "DocHooks - annotated WordPress hooks", + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], "support": { - "issues": "https://github.com/micropackage/dochooks/issues", - "source": "https://github.com/micropackage/dochooks/tree/1.0.2" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.5.1" }, - "time": "2020-03-10T10:11:47+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-07-08T15:28:20+00:00" }, { - "name": "micropackage/filesystem", - "version": "1.1.3", + "name": "composer/class-map-generator", + "version": "1.3.4", "source": { "type": "git", - "url": "https://github.com/micropackage/filesystem.git", - "reference": "a686c7c2d7c7443c4cf6dc55dbd2283a6e219b06" + "url": "https://github.com/composer/class-map-generator.git", + "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/filesystem/zipball/a686c7c2d7c7443c4cf6dc55dbd2283a6e219b06", - "reference": "a686c7c2d7c7443c4cf6dc55dbd2283a6e219b06", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", + "reference": "b1b3fd0b4eaf3ddf3ee230bc340bf3fff454a1a3", "shasum": "" }, "require": { - "php": ">=5.6" + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.1", - "phpunit/phpunit": "^6.5.5", - "wp-coding-standards/wpcs": "^2.0" + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/filesystem": "^5.4 || ^6", + "symfony/phpunit-bridge": "^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Micropackage\\Filesystem\\": "src" + "Composer\\ClassMapGenerator\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" } ], - "description": "Wrapper for WordPress' Filesystem for easier file manipulations.", + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], "support": { - "issues": "https://github.com/micropackage/filesystem/issues", - "source": "https://github.com/micropackage/filesystem/tree/master" + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.3.4" }, - "time": "2020-06-15T11:06:50+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:13:04+00:00" }, { - "name": "micropackage/internationalization", - "version": "1.0.1", + "name": "composer/composer", + "version": "2.7.7", "source": { "type": "git", - "url": "https://github.com/micropackage/internationalization.git", - "reference": "8de158b8fc71557a8310f0d98d2b8ad9f4f44dd5" + "url": "https://github.com/composer/composer.git", + "reference": "291942978f39435cf904d33739f98d7d4eca7b23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/internationalization/zipball/8de158b8fc71557a8310f0d98d2b8ad9f4f44dd5", - "reference": "8de158b8fc71557a8310f0d98d2b8ad9f4f44dd5", + "url": "https://api.github.com/repos/composer/composer/zipball/291942978f39435cf904d33739f98d7d4eca7b23", + "reference": "291942978f39435cf904d33739f98d7d4eca7b23", "shasum": "" }, "require": { - "php": ">=5.6" + "composer/ca-bundle": "^1.0", + "composer/class-map-generator": "^1.3.3", + "composer/metadata-minifier": "^1.0", + "composer/pcre": "^2.1 || ^3.1", + "composer/semver": "^3.3", + "composer/spdx-licenses": "^1.5.7", + "composer/xdebug-handler": "^2.0.2 || ^3.0.3", + "justinrainbow/json-schema": "^5.2.11", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "react/promise": "^2.8 || ^3", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.2", + "seld/signal-handler": "^2.0", + "symfony/console": "^5.4.11 || ^6.0.11 || ^7", + "symfony/filesystem": "^5.4 || ^6.0 || ^7", + "symfony/finder": "^5.4 || ^6.0 || ^7", + "symfony/polyfill-php73": "^1.24", + "symfony/polyfill-php80": "^1.24", + "symfony/polyfill-php81": "^1.24", + "symfony/process": "^5.4 || ^6.0 || ^7" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.1", - "wp-coding-standards/wpcs": "^2.0" + "phpstan/phpstan": "^1.11.0", + "phpstan/phpstan-deprecation-rules": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "phpstan/phpstan-symfony": "^1.4.0", + "symfony/phpunit-bridge": "^6.4.1 || ^7.0.1" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" }, + "bin": [ + "bin/composer" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.7-dev" + }, + "phpstan": { + "includes": [ + "phpstan/rules.neon" + ] + } + }, "autoload": { "psr-4": { - "Micropackage\\Internationalization\\": "src" + "Composer\\": "src/Composer/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "https://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" } ], - "description": "Internationalization (i18n) wrapper for WordPress plugins, themes or libraries", + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], "support": { - "issues": "https://github.com/micropackage/internationalization/issues", - "source": "https://github.com/micropackage/internationalization/tree/1.0.1" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/composer/issues", + "security": "https://github.com/composer/composer/security/policy", + "source": "https://github.com/composer/composer/tree/2.7.7" }, - "time": "2020-02-04T19:48:51+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-06-10T20:11:12+00:00" }, { - "name": "micropackage/requirements", - "version": "1.1.0", + "name": "composer/metadata-minifier", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/micropackage/requirements.git", - "reference": "855b21b6df8f48fa82528dd073ed1b29a645d2ee" + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/requirements/zipball/855b21b6df8f48fa82528dd073ed1b29a645d2ee", - "reference": "855b21b6df8f48fa82528dd073ed1b29a645d2ee", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", + "reference": "c549d23829536f0d0e984aaabbf02af91f443207", "shasum": "" }, "require": { - "micropackage/internationalization": "^1.0", - "php": ">=5.6" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "php-mock/php-mock-phpunit": "^2.5", - "phpcompatibility/php-compatibility": "^9.1", - "phpunit/phpunit": "^6.5.5", - "wp-coding-standards/wpcs": "^2.0" + "composer/composer": "^2", + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Micropackage\\Requirements\\": "src" + "Composer\\MetadataMinifier\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Requirements checker for WordPress plugins", + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], "support": { - "issues": "https://github.com/micropackage/requirements/issues", - "source": "https://github.com/micropackage/requirements/tree/1.1.0" + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" }, - "time": "2021-07-08T17:37:55+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-07T13:37:33+00:00" }, { - "name": "micropackage/templates", - "version": "1.1.3", + "name": "composer/pcre", + "version": "3.1.4", "source": { "type": "git", - "url": "https://github.com/micropackage/templates.git", - "reference": "2ed9aca818fd911183d5cbefb4aa10ff4e4794d9" + "url": "https://github.com/composer/pcre.git", + "reference": "04229f163664973f68f38f6f73d917799168ef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/templates/zipball/2ed9aca818fd911183d5cbefb4aa10ff4e4794d9", - "reference": "2ed9aca818fd911183d5cbefb4aa10ff4e4794d9", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", "shasum": "" }, "require": { - "micropackage/filesystem": "^1.0", - "php": ">=5.6" + "php": "^7.4 || ^8.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "phpcompatibility/php-compatibility": "^9.1", - "phpunit/phpunit": "^6.5.5", - "wp-coding-standards/wpcs": "^2.0" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "Micropackage\\Templates\\": "src" - }, - "files": [ - "src/functions/template.php" - ] + "Composer\\Pcre\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0-or-later" + "MIT" ], "authors": [ { - "name": "Jakub Mikita", - "email": "jakub@bracketspace.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Simple PHP template engine which is easy to use", + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], "support": { - "issues": "https://github.com/micropackage/templates/issues", - "source": "https://github.com/micropackage/templates/tree/1.1.3" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.4" }, - "time": "2021-04-21T19:08:39+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-27T13:40:54+00:00" }, { - "name": "typisttech/imposter", - "version": "0.6.1", + "name": "composer/semver", + "version": "3.4.2", "source": { "type": "git", - "url": "https://github.com/TypistTech/imposter.git", - "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83" + "url": "https://github.com/composer/semver.git", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TypistTech/imposter/zipball/f52b1a2289d2ea9c660cf9595085d0b11469af83", - "reference": "f52b1a2289d2ea9c660cf9595085d0b11469af83", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.3 || ^8.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "codeception/codeception": "^4.1", - "codeception/mockery-module": "^0.4.0", - "codeception/module-asserts": "^1.3", - "codeception/module-filesystem": "^1.0", - "squizlabs/php_codesniffer": "^3.5" - }, - "suggest": { - "typisttech/imposter-plugin": "Composer plugin to integrate composer and imposter" + "phpstan/phpstan": "^1.4", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.6.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "TypistTech\\Imposter\\": "src" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -332,85 +513,79 @@ ], "authors": [ { - "name": "Typist Tech", - "email": "imposter@typist.tech", - "homepage": "https://typist.tech" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Tang Rufus", - "email": "tangrufus@gmail.com", - "homepage": "https://typist.tech", - "role": "Developer" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.", - "homepage": "https://github.com/TypistTech/imposter", + "description": "Semver library that offers utilities, version constraint parsing and validation.", "keywords": [ - "composer", - "dependency", - "monkey-patching", - "namespace", - "wordpress" + "semantic", + "semver", + "validation", + "versioning" ], "support": { - "email": "imposter@typist.tech", - "issues": "https://github.com/TypistTech/imposter/issues", - "source": "https://github.com/TypistTech/imposter" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { - "url": "https://typist.tech/donation/", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.paypal.me/iAmTangRufus/30usd", - "type": "custom" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://github.com/tangrufus", - "type": "github" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "time": "2020-12-06T22:57:09+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { - "name": "typisttech/imposter-plugin", - "version": "0.6.2", + "name": "composer/spdx-licenses", + "version": "1.5.8", "source": { "type": "git", - "url": "https://github.com/TypistTech/imposter-plugin.git", - "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c" + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/TypistTech/imposter-plugin/zipball/15fa3c90aca3b79497f438b9e02a6176498de53c", - "reference": "15fa3c90aca3b79497f438b9e02a6176498de53c", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", + "reference": "560bdcf8deb88ae5d611c80a2de8ea9d0358cc0a", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1 || ^2.0", - "php": "^7.3 || ^8.0", - "typisttech/imposter": "^0.6.1" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "codeception/codeception": "^4.1", - "codeception/module-asserts": "^1.3", - "codeception/module-cli": "^1.1", - "codeception/module-filesystem": "^1.0", - "composer/composer": "^1.10.19 || ^2.0", - "squizlabs/php_codesniffer": "^3.5", - "typisttech/codeception-composer-project-module": "^0.1.1" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, - "type": "composer-plugin", + "type": "library", "extra": { "branch-alias": { - "dev-master": "0.6.x-dev" - }, - "class": "TypistTech\\Imposter\\Plugin\\ImposterPlugin" + "dev-main": "1.x-dev" + } }, "autoload": { "psr-4": { - "TypistTech\\Imposter\\Plugin\\": "src" + "Composer\\Spdx\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -419,81 +594,76 @@ ], "authors": [ { - "name": "Typist Tech", - "email": "imposter-plugin@typist.tech", - "homepage": "https://www.typist.tech" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Tang Rufus", - "email": "tangrufus@gmail.com", - "homepage": "https://www.typist.tech", - "role": "Developer" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Composer plugin that wraps all composer vendor packages inside your own namespace. Intended for WordPress plugins.", - "homepage": "https://github.com/TypistTech/imposter-plugin", + "description": "SPDX licenses list and validation library.", "keywords": [ - "composer", - "composer-plugin", - "dependency", - "monkey-patching", - "namespace", - "wordpress" + "license", + "spdx", + "validator" ], "support": { - "email": "imposter-plugin@typist.tech", - "issues": "https://github.com/TypistTech/imposter-plugin/issues", - "source": "https://github.com/TypistTech/imposter-plugin" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.8" }, "funding": [ { - "url": "https://typist.tech/donation/", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://www.paypal.me/iAmTangRufus/30usd", - "type": "custom" + "url": "https://github.com/composer", + "type": "github" }, { - "url": "https://github.com/tangrufus", - "type": "github" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "time": "2020-12-06T23:41:30+00:00" - } - ], - "packages-dev": [ + "time": "2023-11-20T07:44:33+00:00" + }, { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, + "type": "library", "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -502,164 +672,3295 @@ ], "authors": [ { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", + "description": "Restarts a process without Xdebug.", "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "json-mapper/json-mapper", + "version": "2.22.2", + "source": { + "type": "git", + "url": "https://github.com/JsonMapper/JsonMapper.git", + "reference": "cffe898d9fa034f8e633d7146a1f93bf7be52f2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/JsonMapper/JsonMapper/zipball/cffe898d9fa034f8e633d7146a1f93bf7be52f2e", + "reference": "cffe898d9fa034f8e633d7146a1f93bf7be52f2e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "myclabs/php-enum": "^1.7", + "nikic/php-parser": "^4.13 || ^5.0", + "php": "^7.1 || ^8.0", + "psr/log": "^1.1 || ^2.0 || ^3.0", + "psr/simple-cache": " ^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0", + "symfony/polyfill-php73": "^1.18" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5 || ^7.0", + "php-coveralls/php-coveralls": "^2.4", + "phpstan/phpstan": "^0.12.14", + "phpstan/phpstan-phpunit": "^0.12.17", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0", + "vimeo/psalm": "^4.10 || ^5.0" + }, + "suggest": { + "json-mapper/laravel-package": "Use JsonMapper directly with Laravel", + "json-mapper/symfony-bundle": "Use JsonMapper directly with Symfony" + }, + "type": "library", + "autoload": { + "psr-4": { + "JsonMapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Map JSON structures to PHP classes", + "homepage": "https://jsonmapper.net", + "keywords": [ + "json", + "jsonmapper", + "mapper", + "middleware" + ], + "support": { + "docs": "https://jsonmapper.net", + "issues": "https://github.com/JsonMapper/JsonMapper/issues", + "source": "https://github.com/JsonMapper/JsonMapper" + }, + "funding": [ + { + "url": "https://github.com/DannyvdSluijs", + "type": "github" + } + ], + "time": "2024-05-14T09:24:45+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" + }, + "time": "2024-07-06T21:00:26+00:00" + }, + { + "name": "league/flysystem", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "8aaffb653c5777781b0f7f69a5d937baf7ab6cdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8aaffb653c5777781b0f7f69a5d937baf7ab6cdb", + "reference": "8aaffb653c5777781b0f7f69a5d937baf7ab6cdb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "league/mime-type-detection": "^1.0.0", + "php": "^7.2 || ^8.0" + }, + "conflict": { + "guzzlehttp/ringphp": "<1.1.1" + }, + "require-dev": { + "async-aws/s3": "^1.5", + "async-aws/simple-s3": "^1.0", + "aws/aws-sdk-php": "^3.132.4", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "friendsofphp/php-cs-fixer": "^3.2", + "google/cloud-storage": "^1.23", + "phpseclib/phpseclib": "^2.0", + "phpstan/phpstan": "^0.12.26", + "phpunit/phpunit": "^8.5 || ^9.4", + "sabre/dav": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/2.5.0" + }, + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2022-09-17T21:02:32+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.15.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "reference": "ce0f4d1e8a6f4eb0ddff33f57c69c50fd09f4301", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.15.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-01-28T23:22:08+00:00" + }, + { + "name": "micropackage/ajax", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/micropackage/ajax.git", + "reference": "8bf2c0528776696208f53ce8c393da3aba7b24ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/ajax/zipball/8bf2c0528776696208f53ce8c393da3aba7b24ac", + "reference": "8bf2c0528776696208f53ce8c393da3aba7b24ac", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "php-mock/php-mock-phpunit": "^2.6", + "phpcompatibility/php-compatibility": "^9.1", + "phpunit/phpunit": "^6.5.5", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\Ajax\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "Wrapper for WordPress' AJAX", + "support": { + "issues": "https://github.com/micropackage/ajax/issues", + "source": "https://github.com/micropackage/ajax/tree/1.0.1" + }, + "time": "2020-02-11T09:58:59+00:00" + }, + { + "name": "micropackage/dochooks", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/micropackage/dochooks.git", + "reference": "9eddd9b480fce394d0123ebe806d542e6409105e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/dochooks/zipball/9eddd9b480fce394d0123ebe806d542e6409105e", + "reference": "9eddd9b480fce394d0123ebe806d542e6409105e", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.1", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\DocHooks\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "DocHooks - annotated WordPress hooks", + "support": { + "issues": "https://github.com/micropackage/dochooks/issues", + "source": "https://github.com/micropackage/dochooks/tree/1.0.2" + }, + "time": "2020-03-10T10:11:47+00:00" + }, + { + "name": "micropackage/filesystem", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/micropackage/filesystem.git", + "reference": "dddb63d0f90428c788734ce61e089ba2b5910daa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/filesystem/zipball/dddb63d0f90428c788734ce61e089ba2b5910daa", + "reference": "dddb63d0f90428c788734ce61e089ba2b5910daa", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.1", + "phpunit/phpunit": "^6.5.5", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\Filesystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "Wrapper for WordPress' Filesystem for easier file manipulations.", + "support": { + "issues": "https://github.com/micropackage/filesystem/issues", + "source": "https://github.com/micropackage/filesystem/tree/1.1.5" + }, + "time": "2023-06-23T08:33:34+00:00" + }, + { + "name": "micropackage/internationalization", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/micropackage/internationalization.git", + "reference": "cb140d4c4cbf9828bfcb20242b202517379381df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/internationalization/zipball/cb140d4c4cbf9828bfcb20242b202517379381df", + "reference": "cb140d4c4cbf9828bfcb20242b202517379381df", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "phpcompatibility/php-compatibility": "^9.1", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\Internationalization\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "Internationalization (i18n) wrapper for WordPress plugins, themes or libraries", + "support": { + "issues": "https://github.com/micropackage/internationalization/issues", + "source": "https://github.com/micropackage/internationalization/tree/1.0.2" + }, + "time": "2023-06-23T08:54:05+00:00" + }, + { + "name": "micropackage/requirements", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/micropackage/requirements.git", + "reference": "c2fa8c2df7cefa3c7016a6e0ad755b8bdc73f519" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/requirements/zipball/c2fa8c2df7cefa3c7016a6e0ad755b8bdc73f519", + "reference": "c2fa8c2df7cefa3c7016a6e0ad755b8bdc73f519", + "shasum": "" + }, + "require": { + "micropackage/internationalization": "^1.0", + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "php-mock/php-mock-phpunit": "^2.5", + "phpcompatibility/php-compatibility": "^9.1", + "phpunit/phpunit": "^6.5.5", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\Requirements\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "Requirements checker for WordPress plugins", + "support": { + "issues": "https://github.com/micropackage/requirements/issues", + "source": "https://github.com/micropackage/requirements/tree/1.2.2" + }, + "time": "2023-06-23T09:01:05+00:00" + }, + { + "name": "micropackage/templates", + "version": "1.1.6", + "source": { + "type": "git", + "url": "https://github.com/micropackage/templates.git", + "reference": "c29a59437d5a027ac4dd80ef87c1350f5186986a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/templates/zipball/c29a59437d5a027ac4dd80ef87c1350f5186986a", + "reference": "c29a59437d5a027ac4dd80ef87c1350f5186986a", + "shasum": "" + }, + "require": { + "micropackage/filesystem": "^1.0", + "php": ">=5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "phpcompatibility/php-compatibility": "^9.1", + "phpunit/phpunit": "^6.5.5", + "wp-coding-standards/wpcs": "^2.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions/template.php" + ], + "psr-4": { + "Micropackage\\Templates\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Jakub Mikita", + "email": "jakub@bracketspace.com" + } + ], + "description": "Simple PHP template engine which is easy to use", + "support": { + "issues": "https://github.com/micropackage/templates/issues", + "source": "https://github.com/micropackage/templates/tree/1.1.6" + }, + "time": "2021-11-15T21:12:41+00:00" + }, + { + "name": "myclabs/php-enum", + "version": "1.8.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/a867478eae49c9f59ece437ae7f9506bfaa27483", + "reference": "a867478eae49c9f59ece437ae7f9506bfaa27483", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "1.*", + "vimeo/psalm": "^4.6.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/1.8.4" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum", + "type": "tidelift" + } + ], + "time": "2022-08-04T09:53:51+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.1.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + }, + "time": "2024-07-01T20:03:41+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "react/promise", + "version": "v3.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.11.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2024-07-11T14:55:45+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + }, + "time": "2022-08-31T10:31:18+00:00" + }, + { + "name": "seld/signal-handler", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/signal-handler.git", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", + "psr/log": "^1 || ^2 || ^3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\Signal\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", + "keywords": [ + "posix", + "sigint", + "signal", + "sigterm", + "unix" + ], + "support": { + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" + }, + "time": "2023-09-03T09:24:00+00:00" + }, + { + "name": "symfony/cache", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "89005bc368ca02ed0433c592e4d27670d0844a66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/89005bc368ca02ed0433c592e4d27670d0844a66", + "reference": "89005bc368ca02ed0433c592e4d27670d0844a66", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "conflict": { + "doctrine/dbal": "<2.13.1", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0|2.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6|^2.0", + "doctrine/dbal": "^2.13.1|^3|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/fee6db04d913094e2fb55ff8e7db5685a8134463", + "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0|^3.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-23T13:51:25+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.41" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T07:48:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-24T14:02:46+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "symfony/process": "^5.4|^6.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T09:36:24+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/f51cff4687547641c7d8180d74932ab40b2205ce", + "reference": "f51cff4687547641c7d8180d74932ab40b2205ce", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-19T12:30:46+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "reference": "deedcb3bb4669cae2148bc920eafd2b16dc7c046", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-04-21T15:04:16+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.41", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/065a9611e0b1fd2197a867e1fb7f2238191b7096", + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.41" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T09:20:55+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v5.4.40", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "6a13d37336d512927986e09f19a4bed24178baa6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/6a13d37336d512927986e09f19a4bed24178baa6", + "reference": "6a13d37336d512927986e09f19a4bed24178baa6", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v5.4.40" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:33:22+00:00" + } + ], + "packages-dev": [ + { + "name": "automattic/phpcs-neutron-ruleset", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/phpcs-neutron-ruleset.git", + "reference": "0d79b6016a274d1bb8cbb359592e8dad7ffa47ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/phpcs-neutron-ruleset/zipball/0d79b6016a274d1bb8cbb359592e8dad7ffa47ca", + "reference": "0d79b6016a274d1bb8cbb359592e8dad7ffa47ca", + "shasum": "" + }, + "require": { + "automattic/phpcs-neutron-standard": "^1.5.3", + "php": "^7.0 || ^8.0", + "sirbrillig/phpcs-import-detection": "^1.1.4", + "sirbrillig/phpcs-variable-analysis": "^2.6.1", + "wp-coding-standards/wpcs": "^2.1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "squizlabs/php_codesniffer": "^3.4.2" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHPCS meta-ruleset for WordPress development", + "support": { + "issues": "https://github.com/Automattic/phpcs-neutron-ruleset/issues", + "source": "https://github.com/Automattic/phpcs-neutron-ruleset/tree/v3.4.0" + }, + "time": "2021-03-15T19:18:33+00:00" + }, + { + "name": "automattic/phpcs-neutron-standard", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/phpcs-neutron-standard.git", + "reference": "566ad70534296073afa9143858671356444ddead" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/phpcs-neutron-standard/zipball/566ad70534296073afa9143858671356444ddead", + "reference": "566ad70534296073afa9143858671356444ddead", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "squizlabs/php_codesniffer": "^3.3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6 || ^0.7", + "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", + "sirbrillig/phpcs-variable-analysis": "^2.0.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "NeutronStandard\\": "NeutronStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A set of phpcs sniffs for modern php development.", + "support": { + "issues": "https://github.com/sirbrillig/phpcs-neutron-standard/issues", + "source": "https://github.com/sirbrillig/phpcs-neutron-standard", + "wiki": "https://github.com/sirbrillig/phpcs-neutron-standard/wiki" + }, + "time": "2021-02-15T22:42:03+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", "plugin", "qa", "quality", "standard", "standards", - "style guide", - "stylecheck", - "tests" + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v6.6.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "reference": "86e8753e89d59849276dcdd91b9a7dd78bb4abe2", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ^8.0", + "php-stubs/generator": "^0.8.3", + "phpdocumentor/reflection-docblock": "^5.4.1", + "phpstan/phpstan": "^1.10.49", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.6.0" + }, + "time": "2024-07-17T08:50:38+00:00" + }, + { + "name": "php-stubs/wp-cli-stubs", + "version": "v2.10.0", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wp-cli-stubs.git", + "reference": "fbd7ff47393c9478e0f557d0b4caadaed20986fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wp-cli-stubs/zipball/fbd7ff47393c9478e0f557d0b4caadaed20986fb", + "reference": "fbd7ff47393c9478e0f557d0b4caadaed20986fb", + "shasum": "" + }, + "require": { + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0" + }, + "require-dev": { + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.0" + }, + "suggest": { + "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WP-CLI function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wp-cli-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress", + "wp-cli" + ], + "support": { + "issues": "https://github.com/php-stubs/wp-cli-stubs/issues", + "source": "https://github.com/php-stubs/wp-cli-stubs/tree/v2.10.0" + }, + "time": "2024-02-09T02:10:10+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2020-12-07T18:04:37+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { - "name": "jakub-onderka/php-parallel-lint", - "version": "v1.0.0", + "name": "phpstan/phpdoc-parser", + "version": "0.4.9", "source": { "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Parallel-Lint.git", - "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Parallel-Lint/zipball/04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", - "reference": "04fbd3f5fb1c83f08724aa58a23db90bd9086ee8", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/98a088b17966bdf6ee25c8a4b634df313d8aa531", + "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1 || ^8.0" }, "require-dev": { - "jakub-onderka/php-console-highlighter": "~0.3", - "nette/tester": "~1.3", - "squizlabs/php_codesniffer": "~2.7" + "consistence/coding-standard": "^3.5", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.26", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^4.7.2", + "symfony/process": "^4.0" }, - "suggest": { - "jakub-onderka/php-console-highlighter": "Highlight syntax in code snippet" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + }, + "time": "2020-08-03T20:32:43+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.11.7", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" }, "bin": [ - "parallel-lint" + "phpstan", + "phpstan.phar" ], "type": "library", "autoload": { - "classmap": [ - "./" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-07-06T11:17:41+00:00" + }, + { + "name": "sirbrillig/phpcs-import-detection", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-import-detection.git", + "reference": "7035ef6f3a15db182b59664d2c060918aa827e16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-import-detection/zipball/7035ef6f3a15db182b59664d2c060918aa827e16", + "reference": "7035ef6f3a15db182b59664d2c060918aa827e16", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "squizlabs/php_codesniffer": "^3.5.8" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "phpunit/phpunit": "^9.0", + "sirbrillig/phpcs-variable-analysis": "^2.0.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "ImportDetection\\": "ImportDetection/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", + "description": "A set of phpcs sniffs to look for unused or unimported symbols.", + "keywords": [ + "phpcs", + "static analysis" + ], "support": { - "issues": "https://github.com/JakubOnderka/PHP-Parallel-Lint/issues", - "source": "https://github.com/JakubOnderka/PHP-Parallel-Lint/tree/master" + "issues": "https://github.com/sirbrillig/phpcs-import-detection/issues", + "source": "https://github.com/sirbrillig/phpcs-import-detection/tree/v1.3.3" }, - "abandoned": "php-parallel-lint/php-parallel-lint", - "time": "2018-02-24T15:31:20+00:00" + "time": "2022-10-30T19:04:13+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.19", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" }, "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-2-Clause" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "A PHPCS sniff to detect problems with variables.", "keywords": [ - "compatibility", "phpcs", - "standards" + "static analysis" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2024-06-26T20:08:34+00:00" + }, + { + "name": "slevomat/coding-standard", + "version": "6.4.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "696dcca217d0c9da2c40d02731526c1e25b65346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/696dcca217d0c9da2c40d02731526c1e25b65346", + "reference": "696dcca217d0c9da2c40d02731526c1e25b65346", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", + "php": "^7.1 || ^8.0", + "phpstan/phpdoc-parser": "0.4.5 - 0.4.9", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "phing/phing": "2.16.3", + "php-parallel-lint/php-parallel-lint": "1.2.0", + "phpstan/phpstan": "0.12.48", + "phpstan/phpstan-deprecation-rules": "0.12.5", + "phpstan/phpstan-phpunit": "0.12.16", + "phpstan/phpstan-strict-rules": "0.12.5", + "phpunit/phpunit": "7.5.20|8.5.5|9.4.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/6.4.1" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2020-10-05T12:39:37+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.10.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -669,11 +3970,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -688,21 +3989,146 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2021-10-11T04:00:11+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-07-21T23:26:44+00:00" + }, + { + "name": "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset.git", + "reference": "9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/zipball/9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41", + "reference": "9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41", + "shasum": "" + }, + "require": { + "automattic/phpcs-neutron-ruleset": "^3.4.0", + "php": "^7.1 || ^8.0", + "slevomat/coding-standard": "^6.0.0", + "squizlabs/php_codesniffer": "^3.5.3" + }, + "require-dev": { + "phpcsstandards/phpcsdevcs": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hybrid PHPCS ruleset for OOP WordPress development", + "support": { + "issues": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/issues", + "source": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/tree/v0.6.1" + }, + "time": "2021-07-01T07:23:18+00:00" + }, + { + "name": "szepeviktor/phpstan-wordpress", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpstan-wordpress.git", + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/7f8cfe992faa96b6a33bbd75c7bace98864161e7", + "reference": "7f8cfe992faa96b6a33bbd75c7bace98864161e7", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.31", + "symfony/polyfill-php73": "^1.12.0" + }, + "require-dev": { + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.0", + "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "SzepeViktor\\PHPStan\\WordPress\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress extensions for PHPStan", + "keywords": [ + "PHPStan", + "code analyse", + "code analysis", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.5" + }, + "time": "2024-06-28T22:27:19+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -762,8 +4188,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.0" + "php": "^7.4 | ^8.0", + "composer-runtime-api": "^2.0" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "platform-overrides": { + "php": "7.4" + }, + "plugin-api-version": "2.2.0" } diff --git a/dependencies/.gitkeep b/dependencies/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/load.php b/load.php index ae708bf..f47af99 100644 --- a/load.php +++ b/load.php @@ -5,6 +5,8 @@ * @package notification/buddypress */ +declare(strict_types=1); + /** * Load the main plugin file. */ @@ -13,6 +15,10 @@ /** * Initialize early. */ -add_action( 'notification/init', function() { - NotificationBuddyPress::init( __FILE__ )->init(); -}, 1 ); +add_action( + 'notification/init', + static function () { + NotificationBuddyPress::init(__FILE__)->init(); + }, + 1 +); diff --git a/notification-buddypress.php b/notification-buddypress.php index 5bfb059..46bd4eb 100644 --- a/notification-buddypress.php +++ b/notification-buddypress.php @@ -5,25 +5,32 @@ * Plugin URI: http://wordpress.org/plugins/notification-buddypress/ * Author: BracketSpace * Author URI: https://bracketspace.com - * Version: 2.0.0 + * Version: 3.0.0 * License: GPL3 * Text Domain: notification-buddypress * Domain Path: /languages + * Requires Plugins: notification, buddypress * * @package notification/buddypress + * + * phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols + * phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace + * phpcs:disable Squiz.Classes.ClassFileName.NoMatch */ -if ( ! class_exists( 'NotificationBuddyPress' ) ) : +declare(strict_types=1); + +if (! class_exists('NotificationBuddyPress')) : /** * NotificationBuddyPress class */ - class NotificationBuddyPress { - + class NotificationBuddyPress + { /** * Runtime object * - * @var BracketSpace\Notification\BuddyPress\Runtime + * @var ?BracketSpace\Notification\BuddyPress\Runtime */ protected static $runtime; @@ -31,14 +38,15 @@ class NotificationBuddyPress { * Initializes the plugin runtime * * @since 2.0.0 - * @param string $plugin_file Main plugin file. + * @param string $pluginFile Main plugin file. * @return BracketSpace\Notification\BuddyPress\Runtime */ - public static function init( $plugin_file ) { - if ( ! isset( self::$runtime ) ) { + public static function init($pluginFile) + { + if (self::$runtime === null) { // Autoloading. - require_once dirname( $plugin_file ) . '/vendor/autoload.php'; - self::$runtime = new BracketSpace\Notification\BuddyPress\Runtime( $plugin_file ); + require_once dirname($pluginFile) . '/vendor/autoload.php'; + self::$runtime = new BracketSpace\Notification\BuddyPress\Runtime($pluginFile); } return self::$runtime; @@ -48,30 +56,33 @@ public static function init( $plugin_file ) { * Gets runtime component * * @since 2.0.0 - * @return array + * @return array<class-string,mixed> */ - public static function components() { - return isset( self::$runtime ) ? self::$runtime->components() : []; + public static function components() + { + return self::$runtime !== null ? self::$runtime->components() : []; } /** * Gets runtime component * * @since 2.0.0 - * @param string $component_name Component name. + * @param string $componentName Component name. * @return mixed */ - public static function component( $component_name ) { - return isset( self::$runtime ) ? self::$runtime->component( $component_name ) : null; + public static function component($componentName) + { + return self::$runtime !== null ? self::$runtime->component($componentName) : null; } /** * Gets runtime object * * @since 2.0.0 - * @return BracketSpace\Notification\Runtime + * @return ?BracketSpace\Notification\BuddyPress\Runtime */ - public static function runtime() { + public static function runtime() + { return self::$runtime; } @@ -80,20 +91,24 @@ public static function runtime() { * * @since 2.0.0 * @throws \Exception When runtime wasn't invoked yet. - * @return \BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Filesystem\Filesystem + * @return \BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Filesystem\Filesystem */ - public static function fs() { - if ( ! isset( self::$runtime ) ) { - throw new Exception( 'Runtime has not been invoked yet.' ); + public static function fs() + { + if (self::$runtime === null) { + throw new \Exception('Runtime has not been invoked yet.'); } - return self::$runtime->get_filesystem(); + return self::$runtime->getFilesystem(); } - } endif; -add_action( 'notification/init', function() { - NotificationBuddyPress::init( __FILE__ )->init(); -}, 2 ); +add_action( + 'notification/init', + static function () { + NotificationBuddyPress::init(__FILE__)->init(); + }, + 2 +); diff --git a/phpcs.xml b/phpcs.xml index 3082eab..7de369b 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,38 +1,99 @@ <?xml version="1.0"?> -<ruleset name="WordPress Coding Standards for Plugins"> - <description>Sniffs for Notification WordPress plugin</description> - - <rule ref="WordPress"> - <exclude name="Generic.Commenting.DocComment.MissingShort" /> - <exclude name="Generic.Files.LowercasedFilename" /> - <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" /> - <exclude name="WordPress.Files.FileName" /> - <exclude name="WordPress.Files.FileName.UnderscoresNotAllowed" /> - <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores" /> - <exclude name="WordPress.PHP.DevelopmentFunctions.error_log_trigger_error" /> - <exclude name="WordPress.VIP.SuperGlobalInputUsage.AccessDetected" /> - <exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification" /> - <exclude name="WordPress.Security.NonceVerification.NoNonceVerification" /> - <exclude name="WordPress.DB.SlowDBQuery" /> - <exclude name="WordPress.WP.I18n.NonSingularStringLiteralText" /> - <exclude name="WordPress.VIP.RestrictedVariables.cache_constraints___SERVER__REMOTE_ADDR__" /> - <exclude name="WordPress.WP.AlternativeFunctions.file_system_read_file_get_contents" /> - <exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain" /> - <exclude name="WordPress.WP.GlobalVariablesOverride" /> - <exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" /> - <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" /> - <exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" /> +<ruleset name="BracketSpace Coding Style"> + <config name="minimum_supported_wp_version" value="5.7"/> + + <rule ref="PSR12NeutronRuleset"> + <!-- NeutronStandard bug --> + <exclude name="NeutronStandard.Functions.TypeHint.NoReturnType"/> + <!-- https://github.com/sirbrillig/phpcs-import-detection/issues/45 --> + <exclude name="ImportDetection.Imports.RequireImports"/> + <!-- We write Composer packages --> + <exclude name="PEAR.Commenting.FileComment.InvalidPackage"/> + <exclude name="PEAR.Commenting.FileComment.MissingAuthorTag"/> + <exclude name="PEAR.Commenting.FileComment.MissingLicenseTag"/> + <exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/> + + <exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/> + <exclude name="PSR12.Properties.ConstantVisibility.NotFound"/> + + <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/> + <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/> + <exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant"/> + <exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion.RequiredExplicitAssertion"/> + + <exclude name="WordPress.NamingConventions.ValidHookName.UseUnderscores"/> + <exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited"/> + + <exclude name="NeutronStandard.Functions.LongFunction.LongFunction"/> + + <exclude name="NeutronStandard.Functions.DisallowCallUserFunc.CallUserFunc"/> + <exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction.DisallowedArrowFunction"/> + + <exclude name="NeutronStandard.MagicMethods.RiskyMagicMethod.RiskyMagicMethod"/> + <exclude name="NeutronStandard.Globals.DisallowGlobalFunctions.GlobalFunctions"/> + <exclude name="NeutronStandard.Functions.VariableFunctions.VariableFunction"/> + <exclude name="NeutronStandard.MagicMethods.DisallowMagicGet.MagicGet"/> + + <exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty.DisallowedEmpty"/> + <exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility.MissingConstantVisibility"/> + <exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/> + <exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter"/> + <exclude name="SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable"/> + <exclude name="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation.ImplicitArrayCreationUsed"/> + <exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable"/> + + <exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/> + + <exclude name="WordPress.WP.I18n.NonSingularStringLiteralDomain"/> + <exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/> + <exclude name="WordPress.Security.NonceVerification.Recommended"/> + <exclude name="PEAR.Commenting.ClassComment.InvalidAuthors"/> + + <exclude name="Generic.Files.ExecutableFile.Executable"/> </rule> - <rule ref="Squiz.Commenting.FunctionComment"> - <exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint" /> + + <rule ref="Generic.WhiteSpace.DisallowSpaceIndent" /> + <rule ref="Generic.WhiteSpace.ScopeIndent"> + <properties> + <property name="tabIndent" value="true" /> + </properties> </rule> - <rule ref="PSR2.Methods.MethodDeclaration"> - <exclude name="PSR2.Methods.MethodDeclaration.Underscore" /> + + <arg name="extensions" value="php" /> + <arg name="tab-width" value="4" /> + + <rule ref="Squiz.PHP.DiscouragedFunctions"> + <properties> + <!-- + * ini_set() environment belongs to the server + * env() does not work in production (artisan config:cache) + * eval() is dangerous! + * print and print_r() disturb templating, see wilderborn/partyline + * dump(), dd(), var_dump() - consider using barryvdh/laravel-debugbar + * error_log() has special use + * define() is for global constants + Defaults: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php + See https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/WordPress/Sniffs/PHP/DiscouragedPHPFunctionsSniff.php + --> + <property name="forbiddenFunctions" type="array"> + <element key="ini_set" value="null"/> + <element key="env" value="null"/> + <element key="list" value="null"/> + <element key="extract" value="null"/> + <element key="eval" value="null"/> + <element key="print" value="null"/> + <element key="print_r" value="null"/> + <element key="dump" value="null"/> + <element key="dd" value="null"/> + <element key="var_dump" value="null"/> + <element key="error_log" value="null"/> + <element key="define" value="null"/> + </property> + </properties> </rule> - <!-- PHPCompatibility --> - <rule ref="PHPCompatibility" /> - <config name="testVersion" value="7.4-" /> + <rule ref="PHPCompatibilityWP"/> + <config name="testVersion" value="7.4-"/> <!-- Check all PHP files in directory tree by default. --> <arg name="extensions" value="php"/> @@ -41,11 +102,11 @@ <!-- Show progress and sniff codes in all reports --> <arg value="ps"/> - <exclude-pattern>dist/*</exclude-pattern> <exclude-pattern>node_modules/*</exclude-pattern> + <exclude-pattern>resources/js.*</exclude-pattern> + <exclude-pattern>resources/css.*</exclude-pattern> <exclude-pattern>tests/*</exclude-pattern> <exclude-pattern>vendor/*</exclude-pattern> - <exclude-pattern>resources/css/*</exclude-pattern> - <exclude-pattern>resources/js/*</exclude-pattern> - <exclude-pattern>resources/languages/*</exclude-pattern> + <exclude-pattern>dependencies/*</exclude-pattern> + <exclude-pattern>compat/*</exclude-pattern> </ruleset> diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..5fa5340 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,40 @@ +includes: + - vendor/szepeviktor/phpstan-wordpress/extension.neon +parameters: + level: max + inferPrivatePropertyTypeFromConstructor: true + treatPhpDocTypesAsCertain: false + scanFiles: + - compat/notification-stubs.php + - compat/buddypress-stubs.php + - vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php + paths: + - notification-buddypress.php + - load.php + - uninstall.php + - src/ + typeAliases: + NotificationData: ''' + array{ + hash?: string, + title?: string, + trigger?: BracketSpace\Notification\Interfaces\Triggerable, + carriers?: array<string,BracketSpace\Notification\Interfaces\Sendable>, + enabled?: bool, + extras?: array<string, array<mixed>|bool|float|int|string>, + version?: int, + } + ''' + NotificationUnconvertedData: ''' + array{ + hash?: string, + title?: string, + trigger?: BracketSpace\Notification\Interfaces\Triggerable|string, + carriers?: array<string,BracketSpace\Notification\Interfaces\Sendable|array<string,mixed>>, + enabled?: bool, + extras?: array<string, array<mixed>|bool|float|int|string>, + version?: int, + } + ''' + excludePaths: + - dependencies/ diff --git a/readme.txt b/readme.txt index 9621a8a..07a7830 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: notification, bracketspace, Kubitomakita, insejn Tags: notification, notify, email, mail, buddypress Requires at least: 4.9 Tested up to: 5.8 -Stable tag: 1.2.1 +Stable tag: 3.0.0 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -11,7 +11,7 @@ Notification triggers for BuddyPress == Description == -This is an extension for [Notification plugin](https://wordpress.org/plugins/notification/). +This is an extension for the [Notification WordPress plugin](https://bracketspace.com/notification/). See the list of all available triggers below. @@ -50,6 +50,10 @@ See the list of all available triggers below. This plugin also integrates with BuddyPress notification system with which you can distribute the notifications within your website. += Custom development = + +BracketSpace - the company behind this plugin provides [custom WordPress plugin development services](https://bracketspace.com/custom-development/). We can create any custom plugin for you. + == Installation == = Requirements = @@ -58,10 +62,25 @@ This plugin requires at least PHP 7.0. = Plugin install = +Make sure you have the [Notification plugin](https://wordpress.org/plugins/notification/) active. + Download and install this plugin from Plugins -> Add New admin screen. +== Frequently Asked Questions == + += Does this plugin need any other plugins? = + +Yes, this plugin is an extension for [Notification plugin](https://wordpress.org/plugins/notification/) so you need it active. You also need the BuddyPress plugin. + += Can you create a plugin for me? = + +Yes! We're offering a [custom plugin development](https://bracketspace.com/custom-development/) services. Feel free to contact us to find out how we can help you. + == Changelog == += 3.0.0 = +* [Changed] Plugin codebase to match Notification v9 internal API. + = 2.0.0 = * [Changed] Plugin codebase to match Notification v8 internal API. diff --git a/resources/languages/notification-buddypress.pot b/resources/languages/notification-buddypress.pot new file mode 100644 index 0000000..777a9b6 --- /dev/null +++ b/resources/languages/notification-buddypress.pot @@ -0,0 +1,977 @@ +# Copyright (C) 2024 BracketSpace +# This file is distributed under the GPL3. +msgid "" +msgstr "" +"Project-Id-Version: Notification : BuddyPress 2.0.0\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"POT-Creation-Date: 2024-07-24T15:48:46+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.10.0\n" +"X-Domain: notification-buddypress\n" + +#. Plugin Name of the plugin +#: notification-buddypress.php +#: src/Runtime.php:81 +msgid "Notification : BuddyPress" +msgstr "" + +#. Plugin URI of the plugin +#: notification-buddypress.php +msgid "http://wordpress.org/plugins/notification-buddypress/" +msgstr "" + +#. Description of the plugin +#: notification-buddypress.php +msgid "BuddyPress integration with Notification plugin. Add Triggers for all BuddyPress actions." +msgstr "" + +#. Author of the plugin +#: notification-buddypress.php +msgid "BracketSpace" +msgstr "" + +#. Author URI of the plugin +#: notification-buddypress.php +msgid "https://bracketspace.com" +msgstr "" + +#: src/Admin/Settings.php:30 +msgid "Triggers" +msgstr "" + +#: src/Admin/Settings.php:32 +#: src/Admin/Settings.php:84 +msgid "BuddyPress" +msgstr "" + +#: src/Admin/Settings.php:35 +msgid "Activity Triggers" +msgstr "" + +#: src/Admin/Settings.php:39 +msgid "Enable activity triggers" +msgstr "" + +#: src/Admin/Settings.php:47 +msgid "Friendship Triggers" +msgstr "" + +#: src/Admin/Settings.php:51 +msgid "Enable friendship triggers" +msgstr "" + +#: src/Admin/Settings.php:59 +msgid "Group Triggers" +msgstr "" + +#: src/Admin/Settings.php:63 +msgid "Enable group triggers" +msgstr "" + +#: src/Admin/Settings.php:82 +msgid "Carriers" +msgstr "" + +#: src/Admin/Settings.php:87 +msgid "Enable" +msgstr "" + +#: src/Admin/Settings.php:91 +msgid "Enable BuddyPress Carrier" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:35 +msgid "BuddyPress Notification" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:49 +msgid "Content" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:59 +msgid "Link" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:68 +msgid "State" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:71 +msgid "Unread" +msgstr "" + +#: src/Repository/Carrier/BuddyPressNotification.php:72 +msgid "Read" +msgstr "" + +#: src/Repository/Recipient/Role.php:27 +msgid "Role" +msgstr "" + +#: src/Repository/Recipient/Role.php:75 +#: src/Repository/Recipient/User.php:65 +#: src/Repository/Recipient/UserEmail.php:74 +#: src/Repository/Recipient/UserID.php:55 +msgid "Recipient" +msgstr "" + +#: src/Repository/Recipient/User.php:27 +#: src/Repository/Trigger/Group/BanMember.php:77 +#: src/Repository/Trigger/Group/BanMember.php:88 +#: src/Repository/Trigger/Group/BanMember.php:99 +#: src/Repository/Trigger/Group/BanMember.php:110 +#: src/Repository/Trigger/Group/BanMember.php:121 +#: src/Repository/Trigger/Group/BanMember.php:132 +#: src/Repository/Trigger/Group/DemoteMember.php:78 +#: src/Repository/Trigger/Group/DemoteMember.php:89 +#: src/Repository/Trigger/Group/DemoteMember.php:100 +#: src/Repository/Trigger/Group/DemoteMember.php:111 +#: src/Repository/Trigger/Group/DemoteMember.php:122 +#: src/Repository/Trigger/Group/DemoteMember.php:133 +#: src/Repository/Trigger/Group/InviteUser.php:78 +#: src/Repository/Trigger/Group/InviteUser.php:89 +#: src/Repository/Trigger/Group/InviteUser.php:100 +#: src/Repository/Trigger/Group/InviteUser.php:111 +#: src/Repository/Trigger/Group/InviteUser.php:122 +#: src/Repository/Trigger/Group/InviteUser.php:133 +#: src/Repository/Trigger/Group/Join.php:78 +#: src/Repository/Trigger/Group/Join.php:89 +#: src/Repository/Trigger/Group/Join.php:100 +#: src/Repository/Trigger/Group/Join.php:111 +#: src/Repository/Trigger/Group/Join.php:122 +#: src/Repository/Trigger/Group/Join.php:133 +#: src/Repository/Trigger/Group/Leave.php:78 +#: src/Repository/Trigger/Group/Leave.php:89 +#: src/Repository/Trigger/Group/Leave.php:100 +#: src/Repository/Trigger/Group/Leave.php:111 +#: src/Repository/Trigger/Group/Leave.php:122 +#: src/Repository/Trigger/Group/Leave.php:133 +#: src/Repository/Trigger/Group/MembershipAccepted.php:77 +#: src/Repository/Trigger/Group/MembershipAccepted.php:88 +#: src/Repository/Trigger/Group/MembershipAccepted.php:99 +#: src/Repository/Trigger/Group/MembershipAccepted.php:110 +#: src/Repository/Trigger/Group/MembershipAccepted.php:121 +#: src/Repository/Trigger/Group/MembershipAccepted.php:132 +#: src/Repository/Trigger/Group/MembershipRejected.php:77 +#: src/Repository/Trigger/Group/MembershipRejected.php:88 +#: src/Repository/Trigger/Group/MembershipRejected.php:99 +#: src/Repository/Trigger/Group/MembershipRejected.php:110 +#: src/Repository/Trigger/Group/MembershipRejected.php:121 +#: src/Repository/Trigger/Group/MembershipRejected.php:132 +#: src/Repository/Trigger/Group/MembershipRequested.php:94 +#: src/Repository/Trigger/Group/MembershipRequested.php:105 +#: src/Repository/Trigger/Group/MembershipRequested.php:116 +#: src/Repository/Trigger/Group/MembershipRequested.php:127 +#: src/Repository/Trigger/Group/MembershipRequested.php:138 +#: src/Repository/Trigger/Group/MembershipRequested.php:149 +#: src/Repository/Trigger/Group/PromoteMember.php:99 +#: src/Repository/Trigger/Group/PromoteMember.php:110 +#: src/Repository/Trigger/Group/PromoteMember.php:121 +#: src/Repository/Trigger/Group/PromoteMember.php:132 +#: src/Repository/Trigger/Group/PromoteMember.php:143 +#: src/Repository/Trigger/Group/PromoteMember.php:154 +#: src/Repository/Trigger/Group/PromoteMember.php:165 +#: src/Repository/Trigger/Group/RemoveMember.php:77 +#: src/Repository/Trigger/Group/RemoveMember.php:88 +#: src/Repository/Trigger/Group/RemoveMember.php:99 +#: src/Repository/Trigger/Group/RemoveMember.php:110 +#: src/Repository/Trigger/Group/RemoveMember.php:121 +#: src/Repository/Trigger/Group/RemoveMember.php:132 +#: src/Repository/Trigger/Group/UnbanMember.php:77 +#: src/Repository/Trigger/Group/UnbanMember.php:88 +#: src/Repository/Trigger/Group/UnbanMember.php:99 +#: src/Repository/Trigger/Group/UnbanMember.php:110 +#: src/Repository/Trigger/Group/UnbanMember.php:121 +#: src/Repository/Trigger/Group/UnbanMember.php:132 +#: src/Repository/Trigger/Group/UninviteUser.php:77 +#: src/Repository/Trigger/Group/UninviteUser.php:88 +#: src/Repository/Trigger/Group/UninviteUser.php:99 +#: src/Repository/Trigger/Group/UninviteUser.php:110 +#: src/Repository/Trigger/Group/UninviteUser.php:121 +#: src/Repository/Trigger/Group/UninviteUser.php:132 +msgid "User" +msgstr "" + +#: src/Repository/Recipient/UserEmail.php:30 +msgid "User by email" +msgstr "" + +#: src/Repository/Recipient/UserEmail.php:78 +msgid "admin@example.com or {user_email}" +msgstr "" + +#: src/Repository/Recipient/UserEmail.php:79 +msgid "You can use any valid email merge tag." +msgstr "" + +#: src/Repository/Recipient/UserID.php:26 +msgid "User by ID" +msgstr "" + +#: src/Repository/Trigger/Activity.php:58 +msgid "BuddyPress : Activity" +msgstr "" + +#: src/Repository/Trigger/Activity.php:73 +msgid "Activity primary link" +msgstr "" + +#: src/Repository/Trigger/Activity.php:74 +#: src/Repository/Trigger/Activity.php:87 +msgid "Activity" +msgstr "" + +#: src/Repository/Trigger/Activity.php:86 +msgid "Activity content" +msgstr "" + +#: src/Repository/Trigger/Activity.php:102 +msgid "Activity user ID" +msgstr "" + +#: src/Repository/Trigger/Activity.php:104 +#: src/Repository/Trigger/Activity.php:115 +#: src/Repository/Trigger/Activity.php:126 +#: src/Repository/Trigger/Activity.php:137 +#: src/Repository/Trigger/Activity.php:148 +#: src/Repository/Trigger/Activity.php:159 +msgid "Activity author" +msgstr "" + +#: src/Repository/Trigger/Activity.php:113 +msgid "Activity user login" +msgstr "" + +#: src/Repository/Trigger/Activity.php:124 +msgid "Activity user email" +msgstr "" + +#: src/Repository/Trigger/Activity.php:135 +msgid "Activity user display name" +msgstr "" + +#: src/Repository/Trigger/Activity.php:146 +msgid "Activity user first name" +msgstr "" + +#: src/Repository/Trigger/Activity.php:157 +msgid "Activity user last name" +msgstr "" + +#: src/Repository/Trigger/Activity.php:177 +msgid "Favoring user ID" +msgstr "" + +#: src/Repository/Trigger/Activity.php:179 +#: src/Repository/Trigger/Activity.php:190 +#: src/Repository/Trigger/Activity.php:201 +#: src/Repository/Trigger/Activity.php:212 +#: src/Repository/Trigger/Activity.php:223 +#: src/Repository/Trigger/Activity.php:234 +msgid "Favoring user" +msgstr "" + +#: src/Repository/Trigger/Activity.php:188 +msgid "Favoring user login" +msgstr "" + +#: src/Repository/Trigger/Activity.php:199 +msgid "Favoring user email" +msgstr "" + +#: src/Repository/Trigger/Activity.php:210 +msgid "Favoring user display name" +msgstr "" + +#: src/Repository/Trigger/Activity.php:221 +msgid "Favoring user first name" +msgstr "" + +#: src/Repository/Trigger/Activity.php:232 +msgid "Favoring user last name" +msgstr "" + +#: src/Repository/Trigger/Activity/Added.php:28 +msgid "Activity added" +msgstr "" + +#: src/Repository/Trigger/Activity/Added.php:73 +msgid "Activity added date and time" +msgstr "" + +#: src/Repository/Trigger/Activity/Added.php:74 +#: src/Repository/Trigger/Activity/AddToFavorities.php:74 +#: src/Repository/Trigger/Activity/AddToFavoritiesFail.php:74 +#: src/Repository/Trigger/Activity/Deleted.php:76 +#: src/Repository/Trigger/Activity/RemoveFromFavorities.php:74 +#: src/Repository/Trigger/Friendship/Accepted.php:70 +#: src/Repository/Trigger/Friendship/Deleted.php:69 +#: src/Repository/Trigger/Friendship/Requested.php:70 +#: src/Repository/Trigger/Group/BanMember.php:142 +#: src/Repository/Trigger/Group/CreateComplete.php:60 +#: src/Repository/Trigger/Group/Deleted.php:61 +#: src/Repository/Trigger/Group/DemoteMember.php:143 +#: src/Repository/Trigger/Group/DetailsUpdated.php:66 +#: src/Repository/Trigger/Group/InviteUser.php:143 +#: src/Repository/Trigger/Group/Join.php:143 +#: src/Repository/Trigger/Group/Leave.php:143 +#: src/Repository/Trigger/Group/MembershipAccepted.php:142 +#: src/Repository/Trigger/Group/MembershipRejected.php:142 +#: src/Repository/Trigger/Group/MembershipRequested.php:159 +#: src/Repository/Trigger/Group/PromoteMember.php:178 +#: src/Repository/Trigger/Group/RemoveMember.php:142 +#: src/Repository/Trigger/Group/SettingsUpdated.php:60 +#: src/Repository/Trigger/Group/UnbanMember.php:142 +#: src/Repository/Trigger/Group/UninviteUser.php:142 +msgid "Date" +msgstr "" + +#: src/Repository/Trigger/Activity/AddToFavorities.php:28 +msgid "Activity added to favorites" +msgstr "" + +#: src/Repository/Trigger/Activity/AddToFavorities.php:73 +msgid "Activity favorited date and time" +msgstr "" + +#: src/Repository/Trigger/Activity/AddToFavoritiesFail.php:28 +msgid "Activity failed to add to favorites" +msgstr "" + +#: src/Repository/Trigger/Activity/AddToFavoritiesFail.php:73 +msgid "Activity favorited fail date and time" +msgstr "" + +#: src/Repository/Trigger/Activity/Deleted.php:28 +msgid "Activity deleted" +msgstr "" + +#: src/Repository/Trigger/Activity/Deleted.php:75 +msgid "Activity deletion date and time" +msgstr "" + +#: src/Repository/Trigger/Activity/RemoveFromFavorities.php:28 +msgid "Activity removed from favorites" +msgstr "" + +#: src/Repository/Trigger/Activity/RemoveFromFavorities.php:73 +msgid "Activity removal from favorities date and time" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:51 +msgid "BuddyPress : Friendship" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:66 +msgid "Initiator user ID" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:68 +#: src/Repository/Trigger/Friendship.php:79 +#: src/Repository/Trigger/Friendship.php:90 +#: src/Repository/Trigger/Friendship.php:101 +#: src/Repository/Trigger/Friendship.php:112 +#: src/Repository/Trigger/Friendship.php:123 +msgid "Initiator" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:77 +msgid "Initiator user login" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:88 +msgid "Initiator user email" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:99 +msgid "Initiator user display name" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:110 +msgid "Initiator user first name" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:121 +msgid "Initiator user last name" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:133 +msgid "Friend user ID" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:135 +#: src/Repository/Trigger/Friendship.php:146 +#: src/Repository/Trigger/Friendship.php:157 +#: src/Repository/Trigger/Friendship.php:168 +#: src/Repository/Trigger/Friendship.php:179 +#: src/Repository/Trigger/Friendship.php:190 +#: src/Repository/Trigger/Friendship/Requested.php:84 +msgid "Friend" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:144 +msgid "Friend user login" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:155 +msgid "Friend user email" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:166 +msgid "Friend user display name" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:177 +msgid "Friend user first name" +msgstr "" + +#: src/Repository/Trigger/Friendship.php:188 +msgid "Friend user last name" +msgstr "" + +#: src/Repository/Trigger/Friendship/Accepted.php:28 +msgid "Friendship accepted" +msgstr "" + +#: src/Repository/Trigger/Friendship/Accepted.php:69 +msgid "Friendship acceptance date and time" +msgstr "" + +#: src/Repository/Trigger/Friendship/Deleted.php:28 +msgid "Friendship deleted" +msgstr "" + +#: src/Repository/Trigger/Friendship/Deleted.php:68 +msgid "Friendship deletion date and time" +msgstr "" + +#: src/Repository/Trigger/Friendship/Requested.php:28 +msgid "Friendship requested" +msgstr "" + +#: src/Repository/Trigger/Friendship/Requested.php:69 +msgid "Friendship request date and time" +msgstr "" + +#: src/Repository/Trigger/Friendship/Requested.php:82 +msgid "Friend requests URL" +msgstr "" + +#: src/Repository/Trigger/Friendship/Requested.php:83 +msgid "Leads to friend requests page of the invited user" +msgstr "" + +#: src/Repository/Trigger/Group.php:44 +msgid "BuddyPress : Group" +msgstr "" + +#: src/Repository/Trigger/Group.php:58 +msgid "Group ID" +msgstr "" + +#: src/Repository/Trigger/Group.php:59 +#: src/Repository/Trigger/Group.php:74 +#: src/Repository/Trigger/Group.php:89 +#: src/Repository/Trigger/Group.php:105 +#: src/Repository/Trigger/Group.php:119 +#: src/Repository/Trigger/Group.php:134 +#: src/Repository/Trigger/Group.php:149 +#: src/Repository/Trigger/Group.php:162 +#: src/Repository/Trigger/Group/MembershipRequested.php:77 +msgid "Group" +msgstr "" + +#: src/Repository/Trigger/Group.php:73 +msgid "Group parent ID" +msgstr "" + +#: src/Repository/Trigger/Group.php:88 +msgid "Group creator ID" +msgstr "" + +#: src/Repository/Trigger/Group.php:103 +msgid "Group name" +msgstr "" + +#: src/Repository/Trigger/Group.php:104 +msgid "My Super Example Group" +msgstr "" + +#: src/Repository/Trigger/Group.php:118 +msgid "Group slug" +msgstr "" + +#: src/Repository/Trigger/Group.php:133 +msgid "Group description" +msgstr "" + +#: src/Repository/Trigger/Group.php:148 +msgid "Group status" +msgstr "" + +#: src/Repository/Trigger/Group.php:161 +msgid "Group forum enabled" +msgstr "" + +#: src/Repository/Trigger/Group.php:163 +msgid "Returns: Enabled or Disabled" +msgstr "" + +#: src/Repository/Trigger/Group.php:167 +msgid "Enabled" +msgstr "" + +#: src/Repository/Trigger/Group.php:168 +msgid "Disabled" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:35 +msgid "Ban group member" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:75 +msgid "Banned user ID" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:86 +msgid "Banned user login" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:97 +msgid "Banned user email" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:108 +msgid "Banned user display name" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:119 +msgid "Banned user first name" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:130 +msgid "Banned user last name" +msgstr "" + +#: src/Repository/Trigger/Group/BanMember.php:141 +msgid "Ban date and time" +msgstr "" + +#: src/Repository/Trigger/Group/CreateComplete.php:28 +msgid "Group created" +msgstr "" + +#: src/Repository/Trigger/Group/CreateComplete.php:59 +msgid "Creation date and time" +msgstr "" + +#: src/Repository/Trigger/Group/Deleted.php:29 +msgid "Group deleted" +msgstr "" + +#: src/Repository/Trigger/Group/Deleted.php:60 +msgid "Deletion date and time" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:36 +msgid "Demote group member" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:76 +msgid "Demoted user ID" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:87 +msgid "Demoted user login" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:98 +msgid "Demoted user email" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:109 +msgid "Demoted user display name" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:120 +msgid "Demoted user first name" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:131 +msgid "Demoted user last name" +msgstr "" + +#: src/Repository/Trigger/Group/DemoteMember.php:142 +msgid "Demotion date and time" +msgstr "" + +#: src/Repository/Trigger/Group/DetailsUpdated.php:28 +msgid "Group details updated" +msgstr "" + +#: src/Repository/Trigger/Group/DetailsUpdated.php:65 +msgid "Details update date and time" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:36 +msgid "Invite user to group" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:76 +msgid "Invited user ID" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:87 +msgid "Invited user login" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:98 +msgid "Invited user email" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:109 +msgid "Invited user display name" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:120 +msgid "Invited user first name" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:131 +msgid "Invited user last name" +msgstr "" + +#: src/Repository/Trigger/Group/InviteUser.php:142 +msgid "Invitation date and time" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:36 +msgid "User joined to group" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:76 +msgid "Joined user ID" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:87 +msgid "Joined user login" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:98 +msgid "Joined user email" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:109 +msgid "Joined user display name" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:120 +msgid "Joined user first name" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:131 +msgid "Joined user last name" +msgstr "" + +#: src/Repository/Trigger/Group/Join.php:142 +msgid "Join date and time" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:36 +msgid "User leaves group" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:76 +msgid "Leaving user ID" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:87 +msgid "Leaving user login" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:98 +msgid "Leaving user email" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:109 +msgid "Leaving user display name" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:120 +msgid "Leaving user first name" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:131 +msgid "Leaving user last name" +msgstr "" + +#: src/Repository/Trigger/Group/Leave.php:142 +msgid "Leave date and time" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:35 +msgid "Membership accepted" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:75 +msgid "Accepted user ID" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:86 +msgid "Accepted user login" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:97 +msgid "Accepted user email" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:108 +msgid "Accepted user display name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:119 +msgid "Accepted user first name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:130 +msgid "Accepted user last name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipAccepted.php:141 +msgid "Membership acceptance date and time" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:35 +msgid "Membership rejected" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:75 +msgid "Rejected user ID" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:86 +msgid "Rejected user login" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:97 +msgid "Rejected user email" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:108 +msgid "Rejected user display name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:119 +msgid "Rejected user first name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:130 +msgid "Rejected user last name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRejected.php:141 +msgid "Membership rejection date and time" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:35 +msgid "Membership requested" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:75 +msgid "Group requests link" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:76 +msgid "Leads to group membership requests page" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:92 +msgid "Requesting user ID" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:103 +msgid "Requesting user login" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:114 +msgid "Requesting user email" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:125 +msgid "Requesting user display name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:136 +msgid "Requesting user first name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:147 +msgid "Requesting user last name" +msgstr "" + +#: src/Repository/Trigger/Group/MembershipRequested.php:158 +msgid "Membership request date and time" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:42 +msgid "Promote group member" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:70 +msgid "Moderator" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:74 +msgid "Administrator" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:78 +msgid "Undefined" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:97 +msgid "Promoted user ID" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:108 +msgid "Promoted user login" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:119 +msgid "Promoted user email" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:130 +msgid "Promoted user display name" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:141 +msgid "Promoted user first name" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:152 +msgid "Promoted user last name" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:163 +msgid "Promoted user status in group" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:164 +msgid "Either Moderator or Administrator" +msgstr "" + +#: src/Repository/Trigger/Group/PromoteMember.php:177 +msgid "Promotion date and time" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:35 +msgid "Remove group member" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:75 +msgid "Removed user ID" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:86 +msgid "Removed user login" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:97 +msgid "Removed user email" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:108 +msgid "Removed user display name" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:119 +msgid "Removed user first name" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:130 +msgid "Removed user last name" +msgstr "" + +#: src/Repository/Trigger/Group/RemoveMember.php:141 +msgid "Member removal date and time" +msgstr "" + +#: src/Repository/Trigger/Group/SettingsUpdated.php:28 +msgid "Group settings updated" +msgstr "" + +#: src/Repository/Trigger/Group/SettingsUpdated.php:59 +msgid "Settings update date and time" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:35 +msgid "Unban group member" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:75 +msgid "Unbanned user ID" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:86 +msgid "Unbanned user login" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:97 +msgid "Unbanned user email" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:108 +msgid "Unbanned user display name" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:119 +msgid "Unbanned user first name" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:130 +msgid "Unbanned user last name" +msgstr "" + +#: src/Repository/Trigger/Group/UnbanMember.php:141 +msgid "Unban date and time" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:35 +msgid "Uninvite user to group" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:75 +msgid "Uninvited user ID" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:86 +msgid "Uninvited user login" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:97 +msgid "Uninvited user email" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:108 +msgid "Uninvited user display name" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:119 +msgid "Uninvited user first name" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:130 +msgid "Uninvited user last name" +msgstr "" + +#: src/Repository/Trigger/Group/UninviteUser.php:141 +msgid "Uninvite date and time" +msgstr "" + +#. Translators: 1. Required Notification version, 2. Used Notification version. +#: src/Requirements/BasePlugin.php:46 +msgid "Minimum required version of Notification plugin is %1$s. Your version is %2$s" +msgstr "" diff --git a/src/Admin/Settings.php b/src/Admin/Settings.php index 5f5ec5c..dc3a174 100644 --- a/src/Admin/Settings.php +++ b/src/Admin/Settings.php @@ -5,6 +5,8 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Admin; use BracketSpace\Notification\Utils\Settings\CoreFields; @@ -12,72 +14,85 @@ /** * Settings class */ -class Settings { - +class Settings +{ /** * Registers trigger settings * + * @action notification/settings/register 20 + * * @since 2.0.0 - * @param object $settings Settings API object. + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. * @return void */ - public function register_trigger_settings( $settings ) { - $triggers = $settings->add_section( __( 'Triggers', 'notification-buddypress' ), 'triggers' ); + public function registerTriggerSettings($settings) + { + $triggers = $settings->addSection(__('Triggers', 'notification-buddypress'), 'triggers'); - $triggers->add_group( __( 'BuddyPress', 'notification-buddypress' ), 'buddypress' ) - ->add_field( [ - 'name' => __( 'Activity Triggers', 'notification-buddypress' ), - 'slug' => 'activity_enable', - 'default' => true, - 'addons' => [ - 'label' => __( 'Enable activity triggers', 'notification-buddypress' ), - ], - 'render' => [ new CoreFields\Checkbox(), 'input' ], - 'sanitize' => [ new CoreFields\Checkbox(), 'sanitize' ], - ] ) - ->add_field( [ - 'name' => __( 'Friendship Triggers', 'notification-buddypress' ), - 'slug' => 'friendship_enable', - 'default' => true, - 'addons' => [ - 'label' => __( 'Enable friendship triggers', 'notification-buddypress' ), - ], - 'render' => [ new CoreFields\Checkbox(), 'input' ], - 'sanitize' => [ new CoreFields\Checkbox(), 'sanitize' ], - ] ) - ->add_field( [ - 'name' => __( 'Group Triggers', 'notification-buddypress' ), - 'slug' => 'group_enable', - 'default' => true, - 'addons' => [ - 'label' => __( 'Enable group triggers', 'notification-buddypress' ), - ], - 'render' => [ new CoreFields\Checkbox(), 'input' ], - 'sanitize' => [ new CoreFields\Checkbox(), 'sanitize' ], - ] ); + $triggers->addGroup(__('BuddyPress', 'notification-buddypress'), 'buddypress') + ->addField( + [ + 'name' => __('Activity Triggers', 'notification-buddypress'), + 'slug' => 'activity_enable', + 'default' => true, + 'addons' => [ + 'label' => __('Enable activity triggers', 'notification-buddypress'), + ], + 'render' => [new CoreFields\Checkbox(), 'input'], + 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], + ] + ) + ->addField( + [ + 'name' => __('Friendship Triggers', 'notification-buddypress'), + 'slug' => 'friendship_enable', + 'default' => true, + 'addons' => [ + 'label' => __('Enable friendship triggers', 'notification-buddypress'), + ], + 'render' => [new CoreFields\Checkbox(), 'input'], + 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], + ] + ) + ->addField( + [ + 'name' => __('Group Triggers', 'notification-buddypress'), + 'slug' => 'group_enable', + 'default' => true, + 'addons' => [ + 'label' => __('Enable group triggers', 'notification-buddypress'), + ], + 'render' => [new CoreFields\Checkbox(), 'input'], + 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], + ] + ); } /** * Registers carrier settings * + * @action notification/settings/register 30 + * * @since 2.0.0 - * @param object $settings Settings API object. + * @param \BracketSpace\Notification\Utils\Settings $settings Settings API object. * @return void */ - public function register_carrier_settings( $settings ) { - $carriers = $settings->add_section( __( 'Carriers', 'notification-buddypress' ), 'carriers' ); + public function registerCarrierSettings($settings) + { + $carriers = $settings->addSection(__('Carriers', 'notification-buddypress'), 'carriers'); - $carriers->add_group( __( 'BuddyPress', 'notification-buddypress' ), 'buddypress' ) - ->add_field( [ - 'name' => __( 'Enable', 'notification-buddypress' ), - 'slug' => 'enable', - 'default' => 'true', - 'addons' => [ - 'label' => __( 'Enable BuddyPress Carrier', 'notification-buddypress' ), - ], - 'render' => [ new CoreFields\Checkbox(), 'input' ], - 'sanitize' => [ new CoreFields\Checkbox(), 'sanitize' ], - ] ); + $carriers->addGroup(__('BuddyPress', 'notification-buddypress'), 'buddypress') + ->addField( + [ + 'name' => __('Enable', 'notification-buddypress'), + 'slug' => 'enable', + 'default' => 'true', + 'addons' => [ + 'label' => __('Enable BuddyPress Carrier', 'notification-buddypress'), + ], + 'render' => [new CoreFields\Checkbox(), 'input'], + 'sanitize' => [new CoreFields\Checkbox(), 'sanitize'], + ] + ); } - } diff --git a/src/Cli/DumpHooks.php b/src/Cli/DumpHooks.php index c592e59..be63554 100644 --- a/src/Cli/DumpHooks.php +++ b/src/Cli/DumpHooks.php @@ -9,6 +9,8 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Cli; use NotificationBuddyPress as MainClass; @@ -17,51 +19,61 @@ /** * Dump all hooks */ -class DumpHooks { - +class DumpHooks +{ /** * Dump all the Dochooks. * * @param list<string> $args Arguments. * @return void */ - public function __invoke( $args ) { + public function __invoke($args) + { + $runtime = MainClass::runtime(); + + if ($runtime === null) { + throw new \Exception('Runtime has not been invoked yet.'); + } - $runtime = MainClass::runtime(); - $filesystem = $runtime->get_filesystem(); - $hooks_file = 'compat/register-hooks.php'; + $filesystem = $runtime->getFilesystem(); + $hooksFile = 'compat/register-hooks.php'; // Build an array of searchable instances. $objects = []; - foreach ( MainClass::components() as $component_name => $instance ) { - if ( is_object( $instance ) ) { - $objects[ $component_name ] = get_class( $instance ); + foreach (MainClass::components() as $componentName => $instance) { + if (! is_object($instance)) { + continue; } + + $objects[$componentName] = get_class($instance); } - $hook_functions = []; + $hookFunctions = []; // Loop over each class registering hooks. - foreach ( $runtime->get_calls() as $class_name => $hooks ) { + foreach ($runtime->get_calls() as $className => $hooks) { $count = 0; - if ( 'BracketSpace\\Notification\\BuddyPress\\Runtime' === $class_name ) { - $callback_object_name = '$this'; + if ($className === 'BracketSpace\\Notification\\BuddyPress\\Runtime') { + $callbackObjectName = '$this'; } else { - $component_name = array_search( $class_name, $objects, true ); - if ( ! $component_name ) { - WP_CLI::warning( str_replace( 'BracketSpace\\Notification\\BuddyPress\\', '', $class_name ) . ' skipped, no instance available' ); + $componentName = array_search($className, $objects, true); + if (! $componentName) { + WP_CLI::warning( + str_replace('BracketSpace\\Notification\\BuddyPress\\', '', $className) . + ' skipped, no instance available' + ); continue; } - $callback_object_name = "\$this->component( '" . $component_name . "' )"; + $callbackObjectName = "\$this->component('" . $componentName . "')"; } - foreach ( $hooks as $hook ) { - $hook_functions[] = sprintf( - "add_%s( '%s', [ %s, '%s' ], %d, %d );", + foreach ($hooks as $hook) { + $hookFunctions[] = sprintf( + "add_%s('%s', [%s, '%s'], %d, %d);", $hook['type'], $hook['name'], - $callback_object_name, + $callbackObjectName, $hook['callback'], $hook['priority'], $hook['arg_count'] @@ -70,19 +82,22 @@ public function __invoke( $args ) { $count++; } - WP_CLI::log( str_replace( 'BracketSpace\\Notification\\BuddyPress\\', '', $class_name ) . ' added ' . $count . ' hooks' ); + WP_CLI::log( + str_replace('BracketSpace\\Notification\\BuddyPress\\', '', $className) + . ' added ' . $count . ' hooks' + ); } // Clear the hooks file. - if ( $filesystem->exists( $hooks_file ) ) { - $filesystem->delete( $hooks_file ); + if ($filesystem->exists($hooksFile)) { + $filesystem->delete($hooksFile); } - $file_header = '<?php + $fileHeader = '<?php /** * Hooks compatibilty file. * - * Automatically generated with `wp notification dump-hooks`. + * Automatically generated with `wp notification-buddypress dump-hooks`. * * @package notification/buddypress */ @@ -93,9 +108,8 @@ public function __invoke( $args ) { '; // Save the content. - $filesystem->put_contents( $hooks_file, $file_header . implode( "\n", $hook_functions ) . "\n" ); + $filesystem->put_contents($hooksFile, $fileHeader . implode("\n", $hookFunctions) . "\n"); - WP_CLI::success( 'All hooks dumped!' ); + WP_CLI::success('All hooks dumped!'); } - } diff --git a/src/Core/Templates.php b/src/Core/Templates.php deleted file mode 100644 index c661468..0000000 --- a/src/Core/Templates.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -/** - * Templates class - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Core; - -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Templates\Storage; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Templates\Template; - -/** - * Templates class - */ -class Templates { - - /** - * Templates storage name. - */ - const TEMPLATE_STORAGE = 'templates'; - - /** - * Renders the template - * - * @since 2.0.0 - * @param string $name Template name. - * @param array<mixed> $vars Template variables. - * @return void - */ - public static function render( string $name, array $vars = [] ) { - self::create( $name, $vars )->render(); - } - - /** - * Gets the template string - * - * @since 2.0.0 - * @param string $name Template name. - * @param array<mixed> $vars Template variables. - * @return string - */ - public static function get( string $name, array $vars = [] ) { - return self::create( $name, $vars )->output(); - } - - /** - * Creates the Template object - * - * @since 2.0.0 - * @param string $name Template name. - * @param array<mixed> $vars Template variables. - * @return Template - */ - public static function create( string $name, array $vars = [] ) : Template { - return new Template( self::TEMPLATE_STORAGE, $name, $vars ); - } - - /** - * Renders the template - * - * @since 2.0.0 - * @return void - */ - public static function register_storage() { - Storage::add( self::TEMPLATE_STORAGE, \NotificationBuddyPress::fs()->path( 'resources/templates' ) ); - } - -} diff --git a/src/Frontend/NotificationHandler.php b/src/Frontend/NotificationHandler.php index f4e7700..437de30 100644 --- a/src/Frontend/NotificationHandler.php +++ b/src/Frontend/NotificationHandler.php @@ -5,24 +5,27 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Frontend; /** * NotificationHandler class */ -class NotificationHandler { - +class NotificationHandler +{ /** * Registers BuddyPress Component. * * @filter bp_notifications_get_registered_components * * @since 1.2.1 - * @param array $components Registered components. - * @return array + * @param array<string> $components Registered components. + * @return array<string> */ - public function register_component( $components = [] ) { - array_push( $components, 'notification-buddypress' ); + public function registerComponent($components = []) + { + array_push($components, 'notification-buddypress'); return $components; } @@ -34,30 +37,35 @@ public function register_component( $components = [] ) { * * @since 1.2.1 * @param string $content Notification content. - * @param int $item_id Notifiable item ID. - * @param int $secondary_item_id Notifiable secondary item ID. - * @param int $total_items Total items. + * @param int $itemId Notifiable item ID. + * @param int $secondaryItemId Notifiable secondary item ID. + * @param int $totalItems Total items. * @param string $format Notification format. - * @param string $component_action_name Component action name. - * @param string $component_name Component name. + * @param string $componentActionName Component action name. + * @param string $componentName Component name. * @param int $id Notification ID. - * @return void + * @return string|array<mixed> */ - public function handle_notification( $content, $item_id, $secondary_item_id, $total_items, $format = 'string', $component_action_name, $component_name, $id ) { - - if ( 'notification-buddypress' !== $component_name ) { - return; + public function handleNotification( + $content, + $itemId, + $secondaryItemId, + $totalItems, + $format, + $componentActionName, + $componentName, + $id + ) { + if ($componentName !== 'notification-buddypress') { + return $content; } - $text = bp_notifications_get_meta( $id, 'notification_content', true ); - $link = bp_notifications_get_meta( $id, 'notification_link', true ); + /** @var string */ + $text = bp_notifications_get_meta($id, 'notification_content', true); + $link = bp_notifications_get_meta($id, 'notification_link', true); - if ( 'string' === $format ) { - if ( $link ) { - $content = '<a href="' . $link . '">' . $text . '</a>'; - } else { - $content = $text; - } + if ($format === 'string') { + $content = $link ? '<a href="' . $link . '">' . $text . '</a>' : $text; } else { $content = [ 'text' => $text, @@ -66,7 +74,5 @@ public function handle_notification( $content, $item_id, $secondary_item_id, $to } return $content; - } - } diff --git a/src/Repository/Carrier/BuddyPressNotification.php b/src/Repository/Carrier/BuddyPressNotification.php index 54770b9..ab7b155 100644 --- a/src/Repository/Carrier/BuddyPressNotification.php +++ b/src/Repository/Carrier/BuddyPressNotification.php @@ -5,63 +5,77 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Carrier; use BracketSpace\Notification\Interfaces\Triggerable; -use BracketSpace\Notification\Abstracts\Carrier as AbstractCarrier; -use BracketSpace\Notification\Defaults\Field; +use BracketSpace\Notification\Repository\Carrier\BaseCarrier; +use BracketSpace\Notification\Repository\Field; /** * BuddyPress Notification Carrier */ -class BuddyPressNotification extends AbstractCarrier { - +class BuddyPressNotification extends BaseCarrier +{ /** * Carrier icon * * @var string SVG */ - public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet" enable-background="new 0 0 128 128"><g transform="translate(0,-924.36218)"><path d="m 126.5,988.37986 a 62.5,62.5 0 0 1 -124.999995,0 62.5,62.5 0 1 1 124.999995,0 z" style="fill:#ffffff" /><g transform="matrix(0.02335871,0,0,-0.02334121,-0.11965895,1052.4471)" style="fill:#d84800"><path d="M 2515,5484 C 1798,5410 1171,5100 717,4595 332,4168 110,3689 23,3105 -1,2939 -1,2554 24,2385 111,1783 363,1266 774,842 1492,102 2529,-172 3521,116 c 448,130 858,379 1195,726 413,426 667,949 751,1548 24,173 24,548 -1,715 -91,625 -351,1150 -781,1580 -425,425 -943,685 -1555,780 -101,16 -520,29 -615,19 z m 611,-143 C 4158,5186 4999,4440 5275,3435 5501,2611 5302,1716 4747,1055 4319,547 3693,214 3028,141 c -125,-14 -441,-14 -566,0 -140,15 -338,55 -468,95 C 722,621 -58,1879 161,3188 c 41,249 115,474 234,717 310,631 860,1110 1528,1330 213,70 374,102 642,129 96,10 436,-4 561,-23 z" /><path d="M 2575,5090 C 1629,5020 813,4386 516,3490 384,3089 362,2641 456,2222 643,1386 1307,696 2134,479 c 233,-61 337,-73 611,-73 274,0 378,12 611,73 548,144 1038,500 1357,986 193,294 315,629 363,995 20,156 15,513 -10,660 -42,241 -108,448 -215,665 -421,857 -1325,1375 -2276,1305 z m 820,-491 c 270,-48 512,-261 608,-537 26,-76 31,-104 35,-222 4,-115 1,-149 -17,-220 -62,-250 -237,-457 -467,-553 -63,-27 -134,-48 -134,-41 0,2 15,35 34,72 138,274 138,610 0,883 -110,220 -334,412 -564,483 -30,10 -62,20 -70,23 -21,7 77,56 175,88 126,41 255,49 400,24 z m -610,-285 c 310,-84 541,-333 595,-641 18,-101 8,-278 -20,-368 -75,-236 -220,-401 -443,-505 -109,-51 -202,-70 -335,-70 -355,0 -650,217 -765,563 -28,84 -31,104 -31,232 -1,118 3,152 22,220 89,306 335,528 650,585 67,13 257,3 327,-16 z M 4035,2940 c 301,-95 484,-325 565,-710 21,-103 47,-388 37,-414 -6,-14 -30,-16 -182,-16 -96,0 -175,3 -175,6 0,42 -37,236 -60,313 -99,334 -315,586 -567,661 -24,7 -43,17 -43,21 0,5 32,45 72,90 l 72,82 106,-6 c 67,-3 130,-13 175,-27 z m -1703,-510 258,-255 92,90 c 51,49 183,178 293,286 l 200,197 75,-9 c 207,-26 404,-116 547,-252 170,-161 267,-361 308,-632 15,-100 21,-394 9,-454 l -6,-31 -1519,0 c -1074,0 -1520,3 -1524,11 -14,21 -18,297 -6,407 59,561 364,896 866,950 97,10 55,41 407,-308 z" /></g></g></svg>'; + public $icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet" enable-background="new 0 0 128 128"><g transform="translate(0,-924.36218)"><path d="m 126.5,988.37986 a 62.5,62.5 0 0 1 -124.999995,0 62.5,62.5 0 1 1 124.999995,0 z" style="fill:#ffffff" /><g transform="matrix(0.02335871,0,0,-0.02334121,-0.11965895,1052.4471)" style="fill:#d84800"><path d="M 2515,5484 C 1798,5410 1171,5100 717,4595 332,4168 110,3689 23,3105 -1,2939 -1,2554 24,2385 111,1783 363,1266 774,842 1492,102 2529,-172 3521,116 c 448,130 858,379 1195,726 413,426 667,949 751,1548 24,173 24,548 -1,715 -91,625 -351,1150 -781,1580 -425,425 -943,685 -1555,780 -101,16 -520,29 -615,19 z m 611,-143 C 4158,5186 4999,4440 5275,3435 5501,2611 5302,1716 4747,1055 4319,547 3693,214 3028,141 c -125,-14 -441,-14 -566,0 -140,15 -338,55 -468,95 C 722,621 -58,1879 161,3188 c 41,249 115,474 234,717 310,631 860,1110 1528,1330 213,70 374,102 642,129 96,10 436,-4 561,-23 z" /><path d="M 2575,5090 C 1629,5020 813,4386 516,3490 384,3089 362,2641 456,2222 643,1386 1307,696 2134,479 c 233,-61 337,-73 611,-73 274,0 378,12 611,73 548,144 1038,500 1357,986 193,294 315,629 363,995 20,156 15,513 -10,660 -42,241 -108,448 -215,665 -421,857 -1325,1375 -2276,1305 z m 820,-491 c 270,-48 512,-261 608,-537 26,-76 31,-104 35,-222 4,-115 1,-149 -17,-220 -62,-250 -237,-457 -467,-553 -63,-27 -134,-48 -134,-41 0,2 15,35 34,72 138,274 138,610 0,883 -110,220 -334,412 -564,483 -30,10 -62,20 -70,23 -21,7 77,56 175,88 126,41 255,49 400,24 z m -610,-285 c 310,-84 541,-333 595,-641 18,-101 8,-278 -20,-368 -75,-236 -220,-401 -443,-505 -109,-51 -202,-70 -335,-70 -355,0 -650,217 -765,563 -28,84 -31,104 -31,232 -1,118 3,152 22,220 89,306 335,528 650,585 67,13 257,3 327,-16 z M 4035,2940 c 301,-95 484,-325 565,-710 21,-103 47,-388 37,-414 -6,-14 -30,-16 -182,-16 -96,0 -175,3 -175,6 0,42 -37,236 -60,313 -99,334 -315,586 -567,661 -24,7 -43,17 -43,21 0,5 32,45 72,90 l 72,82 106,-6 c 67,-3 130,-13 175,-27 z m -1703,-510 258,-255 92,90 c 51,49 183,178 293,286 l 200,197 75,-9 c 207,-26 404,-116 547,-252 170,-161 267,-361 308,-632 15,-100 21,-394 9,-454 l -6,-31 -1519,0 c -1074,0 -1520,3 -1524,11 -14,21 -18,297 -6,407 59,561 364,896 866,950 97,10 55,41 407,-308 z" /></g></g></svg>'; // phpcs:ignore Generic.Files.LineLength.TooLong /** * Carrier constructor * * @since 1.1.0 */ - public function __construct() { - parent::__construct( 'buddypress-notification', __( 'BuddyPress Notification', 'notification-buddypress' ) ); + public function __construct() + { + parent::__construct('buddypress-notification', __('BuddyPress Notification', 'notification-buddypress')); } /** * Used to register Carrier form fields - * Uses $this->add_form_field(); * * @return void */ - public function form_fields() { - - $this->add_form_field( new Field\TextareaField( [ - 'label' => __( 'Content', 'notification-buddypress' ), - 'name' => 'content', - 'rows' => 2, - ] ) ); - - $this->add_form_field( new Field\InputField( [ - 'label' => __( 'Link', 'notification-buddypress' ), - 'name' => 'link', - ] ) ); - - $this->add_form_field( new Field\SelectField( [ - 'label' => __( 'State', 'notification-buddypress' ), - 'name' => 'state', - 'options' => [ - 'unread' => __( 'Unread', 'notification-buddypress' ), - 'read' => __( 'Read', 'notification-buddypress' ), - ], - ] ) ); - - $this->add_recipients_field(); - + public function formFields() + { + + $this->addFormField( + new Field\TextareaField( + [ + 'label' => __('Content', 'notification-buddypress'), + 'name' => 'content', + 'rows' => 2, + ] + ) + ); + + $this->addFormField( + new Field\InputField( + [ + 'label' => __('Link', 'notification-buddypress'), + 'name' => 'link', + ] + ) + ); + + $this->addFormField( + new Field\SelectField( + [ + 'label' => __('State', 'notification-buddypress'), + 'name' => 'state', + 'options' => [ + 'unread' => __('Unread', 'notification-buddypress'), + 'read' => __('Read', 'notification-buddypress'), + ], + ] + ) + ); + + $this->addRecipientsField(); } /** @@ -70,27 +84,32 @@ public function form_fields() { * @param Triggerable $trigger trigger object. * @return void */ - public function send( Triggerable $trigger ) { - + public function send(Triggerable $trigger) + { + /** @var array{parsed_recipients: array<int>, state: string, content: string, link: string} */ $data = $this->data; - foreach ( $data['parsed_recipients'] as $receiver_id ) { - $notification_id = bp_notifications_add_notification( [ - 'user_id' => $receiver_id, - 'component_name' => 'notification-buddypress', - 'component_action' => $trigger->get_slug(), - 'is_new' => 'unread' === $data['state'], - 'allow_duplicate' => true, - ] ); + foreach ($data['parsed_recipients'] as $receiverId) { + $notificationId = bp_notifications_add_notification( + [ + 'user_id' => $receiverId, + 'component_name' => 'notification-buddypress', + 'component_action' => $trigger->getSlug(), + 'is_new' => $data['state'] === 'unread', + 'allow_duplicate' => true, + ] + ); + + if (!is_int($notificationId)) { + continue; + } + + bp_notifications_add_meta($notificationId, 'notification_content', $data['content']); - if ( $notification_id ) { - bp_notifications_add_meta( $notification_id, 'notification_content', $data['content'] ); - if ( ! empty( $data['link'] ) ) { - bp_notifications_add_meta( $notification_id, 'notification_link', $data['link'] ); - } + // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed + if (!empty($data['link'])) { + bp_notifications_add_meta($notificationId, 'notification_link', $data['link']); } } - } - } diff --git a/src/Repository/CarrierRepository.php b/src/Repository/CarrierRepository.php index c68af5d..b982b2e 100644 --- a/src/Repository/CarrierRepository.php +++ b/src/Repository/CarrierRepository.php @@ -5,23 +5,26 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\DocHooks\Helper as DocHooksHelper; use BracketSpace\Notification\Register; /** * Carrier Repository. */ -class CarrierRepository { - +class CarrierRepository +{ /** * @return void */ - public static function register() { - if ( notification_get_setting( 'carriers/buddypress/enable' ) ) { - Register::carrier( DocHooksHelper::hook( new Carrier\BuddyPressNotification() ) ); + public static function register() + { + if (! \Notification::settings()->getSetting('carriers/buddypress/enable')) { + return; } - } + Register::carrier(new Carrier\BuddyPressNotification()); + } } diff --git a/src/Repository/MergeTag/Activity/Content.php b/src/Repository/MergeTag/Activity/Content.php deleted file mode 100644 index a655d5e..0000000 --- a/src/Repository/MergeTag/Activity/Content.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Activity content merge tag - * - * Requirements: - * - `activity` property with BP_Activity_Activity object. - * - * @package notification-buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Activity; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Activity content merge tag class - */ -class Content extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'activity_content', - 'name' => __( 'Activity content' ), - 'group' => __( 'Activity' ), - 'description' => 'My Super News is awesome!', - 'example' => true, - 'resolver' => function() { - return $this->trigger->activity->content; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->activity ); - } -} diff --git a/src/Repository/MergeTag/Activity/PrimaryLink.php b/src/Repository/MergeTag/Activity/PrimaryLink.php deleted file mode 100644 index 9eb3fe3..0000000 --- a/src/Repository/MergeTag/Activity/PrimaryLink.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Activity primary link merge tag - * - * Requirements: - * - `activity` property with BP_Activity_Activity object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Activity; - -use BracketSpace\Notification\Defaults\MergeTag\UrlTag; - - -/** - * Activity primary link merge tag class - */ -class PrimaryLink extends UrlTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'activity_primary_link', - 'name' => __( 'Activity primary link' ), - 'group' => __( 'Activity' ), - 'resolver' => function() { - return bp_activity_get_permalink( $this->trigger->activity->id ); - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->activity ); - } -} diff --git a/src/Repository/MergeTag/Group/CreatorID.php b/src/Repository/MergeTag/Group/CreatorID.php deleted file mode 100644 index b1fbab3..0000000 --- a/src/Repository/MergeTag/Group/CreatorID.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group Creator ID merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\IntegerTag; - - -/** - * Group creator ID merge tag class - */ -class CreatorID extends IntegerTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_creator_ID', - 'name' => __( 'Group creator ID' ), - 'group' => __( 'Group' ), - 'description' => 123, - 'example' => true, - 'resolver' => function() { - return $this->trigger->buddy_group->creator_id; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/Description.php b/src/Repository/MergeTag/Group/Description.php deleted file mode 100644 index beb93d0..0000000 --- a/src/Repository/MergeTag/Group/Description.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group description merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Group description merge tag class - */ -class Description extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_description', - 'name' => __( 'Group description' ), - 'group' => __( 'Group' ), - 'description' => 'My Super Example Group is awesome!', - 'example' => true, - 'resolver' => function() { - return $this->trigger->buddy_group->description; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/ForumEnabled.php b/src/Repository/MergeTag/Group/ForumEnabled.php deleted file mode 100644 index 39a3b6a..0000000 --- a/src/Repository/MergeTag/Group/ForumEnabled.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group forum enabled merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Group forum enabled merge tag class - */ -class ForumEnabled extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_forum_enabled', - 'name' => __( 'Group forum enabled' ), - 'group' => __( 'Group' ), - 'description' => __( 'Returns: Enabled or Disabled' ), - 'example' => true, - 'resolver' => function() { - return ( '1' === $this->trigger->buddy_group->enable_forum ) ? __( 'Enabled' ) : __( 'Disabled' ); - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/ID.php b/src/Repository/MergeTag/Group/ID.php deleted file mode 100644 index 68714db..0000000 --- a/src/Repository/MergeTag/Group/ID.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group ID merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\IntegerTag; - - -/** - * Group ID merge tag class - */ -class ID extends IntegerTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_ID', - 'name' => __( 'Group ID' ), - 'group' => __( 'Group' ), - 'description' => 123, - 'example' => true, - 'resolver' => function() { - return $this->trigger->group_id; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/Name.php b/src/Repository/MergeTag/Group/Name.php deleted file mode 100644 index b9fbad7..0000000 --- a/src/Repository/MergeTag/Group/Name.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group name merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Group name merge tag class - */ -class Name extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_name', - 'name' => __( 'Group name' ), - 'description' => __( 'My Super Example Group' ), - 'group' => __( 'Group' ), - 'example' => true, - 'resolver' => function() { - return $this->trigger->buddy_group->name; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/ParentID.php b/src/Repository/MergeTag/Group/ParentID.php deleted file mode 100644 index 9e7a348..0000000 --- a/src/Repository/MergeTag/Group/ParentID.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group parent ID merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\IntegerTag; - - -/** - * Group parent ID merge tag class - */ -class ParentID extends IntegerTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_parent_ID', - 'name' => __( 'Group parent ID' ), - 'group' => __( 'Group' ), - 'description' => 123, - 'example' => true, - 'resolver' => function() { - return $this->trigger->buddy_group->parent_id; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/Slug.php b/src/Repository/MergeTag/Group/Slug.php deleted file mode 100644 index 8ac4dc0..0000000 --- a/src/Repository/MergeTag/Group/Slug.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Group slug merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Group slug merge tag class - */ -class Slug extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_slug', - 'name' => __( 'Group slug' ), - 'group' => __( 'Group' ), - 'description' => 'my-super-example-group', - 'example' => true, - 'resolver' => function() { - return $this->trigger->buddy_group->slug; - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/MergeTag/Group/Status.php b/src/Repository/MergeTag/Group/Status.php deleted file mode 100644 index e3e187d..0000000 --- a/src/Repository/MergeTag/Group/Status.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Group status merge tag - * - * Requirements: - * - `buddy_group` property with BP_Groups_Group group object. - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group; - -use BracketSpace\Notification\Defaults\MergeTag\StringTag; - - -/** - * Group status merge tag class - */ -class Status extends StringTag { - - /** - * Merge tag constructor - * - * @since 1.0.0 - */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'group_status', - 'name' => __( 'Group status' ), - 'group' => __( 'Group' ), - 'resolver' => function() { - return ucfirst( $this->trigger->buddy_group->status ); - }, - ) ); - - } - - /** - * Checks the requirements - * - * @return boolean - */ - public function check_requirements() { - return isset( $this->trigger->buddy_group ); - } -} diff --git a/src/Repository/Recipient/Role.php b/src/Repository/Recipient/Role.php deleted file mode 100644 index b388642..0000000 --- a/src/Repository/Recipient/Role.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * Role recipient - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\Recipient; - -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\Field; -use BracketSpace\Notification\Queries\UserQueries; - -/** - * Role recipient - */ -class Role extends Abstracts\Recipient { - - /** - * Recipient constructor - * - * @since 5.0.0 - */ - public function __construct() { - parent::__construct( [ - 'slug' => 'role', - 'name' => __( 'Role', 'notification-buddypress' ), - 'default_value' => 'administrator', - ] ); - } - - /** - * {@inheritdoc} - * - * @param string $value raw value saved by the user. - * @return array array of resolved values - */ - public function parse_value( $value = '' ) { - if ( empty( $value ) ) { - $value = $this->get_default_value(); - } - - $emails = []; - - foreach ( UserQueries::with_role( $value ) as $user ) { - $emails[] = $user['user_email']; - } - - return $emails; - } - - /** - * {@inheritdoc} - * - * @return object - */ - public function input() { - if ( ! function_exists( 'get_editable_roles' ) ) { - require_once ABSPATH . 'wp-admin/includes/user.php'; - } - - $roles = get_editable_roles(); - $opts = []; - - foreach ( $roles as $role_slug => $role ) { - $num_users = count( UserQueries::with_role( $role_slug ) ); - - // Translators: %s numer of users. - $label = translate_user_role( $role['name'] ) . ' (' . sprintf( _n( '%s user', '%s users', $num_users, 'notification' ), $num_users ) . ')'; - - $opts[ $role_slug ] = esc_html( $label ); - } - - return new Field\SelectField( [ - 'label' => __( 'Recipient', 'notification-buddypress' ), // don't edit this! - 'name' => 'recipient', // don't edit this! - 'css_class' => 'recipient-value', // don't edit this! - 'value' => $this->get_default_value(), - 'pretty' => true, - 'options' => $opts, - ] ); - - } - -} diff --git a/src/Repository/Recipient/User.php b/src/Repository/Recipient/User.php deleted file mode 100644 index 185f292..0000000 --- a/src/Repository/Recipient/User.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * User recipient - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\Recipient; - -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\Field; -use BracketSpace\Notification\Queries\UserQueries; - -/** - * User recipient - */ -class User extends Abstracts\Recipient { - - /** - * Recipient constructor - * - * @since 5.0.0 - */ - public function __construct() { - parent::__construct( [ - 'slug' => 'user', - 'name' => __( 'User', 'notification-buddypress' ), - 'default_value' => get_current_user_id(), - ] ); - } - - /** - * {@inheritdoc} - * - * @param string $value raw value saved by the user. - * @return array array of resolved values - */ - public function parse_value( $value = '' ) { - if ( empty( $value ) ) { - $value = [ $this->get_default_value() ]; - } - - $user = get_userdata( $value ); - - if ( $user ) { - return [ $user->ID ]; - } - - return []; - } - - /** - * {@inheritdoc} - * - * @return object - */ - public function input() { - $opts = []; - - foreach ( UserQueries::all() as $user ) { - $opts[ $user['ID'] ] = esc_html( $user['display_name'] ) . ' (' . $user['user_email'] . ')'; - } - - return new Field\SelectField( [ - 'label' => __( 'Recipient', 'notification-buddypress' ), // don't edit this! - 'name' => 'recipient', // don't edit this! - 'css_class' => 'recipient-value', // don't edit this! - 'value' => $this->get_default_value(), - 'pretty' => true, - 'options' => $opts, - ] ); - } - -} diff --git a/src/Repository/Recipient/UserEmail.php b/src/Repository/Recipient/UserEmail.php index 9c0a006..a97ba18 100644 --- a/src/Repository/Recipient/UserEmail.php +++ b/src/Repository/Recipient/UserEmail.php @@ -5,51 +5,60 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Recipient; -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\Field; +use BracketSpace\Notification\Repository\Recipient\BaseRecipient; +use BracketSpace\Notification\Repository\Field; /** * User Email recipient */ -class UserEmail extends Abstracts\Recipient { - +class UserEmail extends BaseRecipient +{ /** * Recipient constructor * * @since 5.0.0 */ - public function __construct() { - parent::__construct( [ - 'slug' => 'user_email', - 'name' => __( 'User by email', 'notification-buddypress' ), - 'default_value' => '', - ] ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'user_email', + 'name' => __('User by email', 'notification-buddypress'), + 'default_value' => '', + ] + ); } /** * {@inheritdoc} * * @param string $value raw value saved by the user. - * @return array array of resolved values + * @return array<int> array of resolved values */ - public function parse_value( $value = '' ) { - - if ( empty( $value ) ) { + public function parseValue($value = '') + { + if (empty($value)) { return []; } - $emails = array_map( 'trim', explode( ',', $value ) ); - $ids = []; + $emails = array_map('trim', explode(',', $value)); + $ids = []; + + foreach ($emails as $email) { + $user = get_user_by('email', $email); + + if (!$user instanceof \WP_User) { + continue; + } - foreach ( $emails as $email ) { - $user = get_user_by( 'email', $email ); $ids[] = $user->ID; } return $ids; - } /** @@ -57,15 +66,18 @@ public function parse_value( $value = '' ) { * * @return object */ - public function input() { - - return new Field\InputField( [ - 'label' => __( 'Recipient', 'notification-buddypress' ), - 'name' => 'recipient', - 'css_class' => 'recipient-value', - 'value' => $this->get_default_value(), - ] ); + public function input() + { + return new Field\InputField( + [ + 'label' => __('Recipient', 'notification-buddypress'), + 'name' => 'recipient', + 'css_class' => 'recipient-value', + 'value' => $this->getDefaultValue(), + 'placeholder' => __('admin@example.com or {user_email}', 'notification-buddypress'), + 'description' => __('You can use any valid email merge tag.', 'notification-buddypress'), + ] + ); } - } diff --git a/src/Repository/Recipient/UserID.php b/src/Repository/Recipient/UserID.php deleted file mode 100644 index ab6680b..0000000 --- a/src/Repository/Recipient/UserID.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * User ID recipient - * - * @package notification/buddypress - */ - -namespace BracketSpace\Notification\BuddyPress\Repository\Recipient; - -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\Field; - -/** - * User ID recipient - */ -class UserID extends Abstracts\Recipient { - - /** - * Recipient constructor - * - * @since 5.0.0 - */ - public function __construct() { - parent::__construct( [ - 'slug' => 'user_id', - 'name' => __( 'User by ID', 'notification-buddypress' ), - 'default_value' => '', - ] ); - } - - /** - * {@inheritdoc} - * - * @param string $value raw value saved by the user. - * @return array array of resolved values - */ - public function parse_value( $value = '' ) { - - if ( empty( $value ) ) { - return []; - } - - return array_map( 'trim', explode( ',', $value ) ); - - } - - /** - * {@inheritdoc} - * - * @return object - */ - public function input() { - - return new Field\InputField( [ - 'label' => __( 'Recipient', 'notification-buddypress' ), - 'name' => 'recipient', - 'css_class' => 'recipient-value', - 'value' => $this->get_default_value(), - ] ); - - } - -} diff --git a/src/Repository/RecipientRepository.php b/src/Repository/RecipientRepository.php index a286410..33691e6 100644 --- a/src/Repository/RecipientRepository.php +++ b/src/Repository/RecipientRepository.php @@ -5,23 +5,26 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository; use BracketSpace\Notification\Register; +use BracketSpace\Notification\Repository\Recipient as BaseRecipient; /** * Recipient Repository. */ -class RecipientRepository { - +class RecipientRepository +{ /** * @return void */ - public static function register() { - Register::recipient( 'buddypress-notification', new Recipient\User() ); - Register::recipient( 'buddypress-notification', new Recipient\UserID() ); - Register::recipient( 'buddypress-notification', new Recipient\UserEmail() ); - Register::recipient( 'buddypress-notification', new Recipient\Role() ); + public static function register() + { + Register::recipient('buddypress-notification', new BaseRecipient\Role(['return_field' => 'ID'])); + Register::recipient('buddypress-notification', new BaseRecipient\User(['return_field' => 'ID'])); + Register::recipient('buddypress-notification', new BaseRecipient\UserID(['return_field' => 'ID'])); + Register::recipient('buddypress-notification', new Recipient\UserEmail()); } - } diff --git a/src/Repository/Trigger/Activity.php b/src/Repository/Trigger/Activity.php index 3d43f82..de18137 100644 --- a/src/Repository/Trigger/Activity.php +++ b/src/Repository/Trigger/Activity.php @@ -5,32 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger; -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\MergeTag; -use BracketSpace\Notification\BuddyPress\Repository\MergeTag\Activity as ActivityMergeTag; +use BracketSpace\Notification\Repository\Trigger\BaseTrigger; +use BracketSpace\Notification\Repository\MergeTag; /** * Activity trigger class */ -abstract class Activity extends Abstracts\Trigger { +abstract class Activity extends BaseTrigger +{ + /** + * Activity instance. + * + * @var \BP_Activity_Activity + */ + public $activity; /** - * Constructor + * User instance that relates to activity by "favorite" action. * - * @param array $params Trigger configuration params. + * @var \WP_User */ - public function __construct( $params = array() ) { + public $favoringUserObject; - if ( ! isset( $params['slug'], $params['name'] ) ) { - trigger_error( 'Activity trigger requires slug and name params.', E_USER_ERROR ); - } + /** + * User instance related to activity. + * + * @var \WP_User + */ + public $activityUserObject; - parent::__construct( $params['slug'], $params['name'] ); + /** + * Constructor + * + * @param array<string, mixed> $params Trigger configuration params. + */ + public function __construct($params = []) + { + if ( + !isset($params['slug'], $params['name']) || + !is_string($params['slug']) || + !is_string($params['name']) + ) { + trigger_error('Activity trigger requires slug and name params.', E_USER_ERROR); + } - $this->set_group( __( 'BuddyPress : Activity', 'notification-buddypress' ) ); + parent::__construct($params['slug'], $params['name']); + $this->setGroup(__('BuddyPress : Activity', 'notification-buddypress')); } /** @@ -38,107 +63,177 @@ public function __construct( $params = array() ) { * * @return void */ - public function merge_tags() { - + public function mergeTags() + { // Activity. - $this->add_merge_tag( new ActivityMergeTag\PrimaryLink() ); - $this->add_merge_tag( new ActivityMergeTag\Content() ); + $this->addMergeTag( + new MergeTag\UrlTag( + [ + 'slug' => 'activity_primary_link', + 'name' => __('Activity primary link', 'notification-buddypress'), + 'group' => __('Activity', 'notification-buddypress'), + 'resolver' => static function (Activity $trigger) { + return bp_activity_get_permalink($trigger->activity->id); + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'activity_content', + 'name' => __('Activity content', 'notification-buddypress'), + 'group' => __('Activity', 'notification-buddypress'), + 'description' => 'My Super News is awesome!', + 'example' => true, + 'resolver' => static function (Activity $trigger) { + return $trigger->activity->content; + }, + ] + ) + ); // Activity author. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'activity_user_ID', - 'name' => __( 'Activity user ID', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'activity_user_login', - 'name' => __( 'Activity user login', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'activity_user_email', - 'name' => __( 'Activity user email', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'activity_user_display_name', - 'name' => __( 'Activity user display name', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'activity_user_first_name', - 'name' => __( 'Activity user first name', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'activity_user_last_name', - 'name' => __( 'Activity user last name', 'notification-buddypress' ), - 'property_name' => 'activity_user_object', - 'group' => __( 'Activity author', 'notification-buddypress' ), - ] ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'activity_user_ID', + 'name' => __('Activity user ID', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'activity_user_login', + 'name' => __('Activity user login', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'activity_user_email', + 'name' => __('Activity user email', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'activity_user_display_name', + 'name' => __('Activity user display name', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'activity_user_first_name', + 'name' => __('Activity user first name', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'activity_user_last_name', + 'name' => __('Activity user last name', 'notification-buddypress'), + 'property_name' => 'activityUserObject', + 'group' => __('Activity author', 'notification-buddypress'), + ] + ) + ); } /** * Registers favoring user merge tags * - * @uses $this->favoring_user_object User object property. + * @uses $this->favoringUserObject User object property. * @return void */ - public function favoring_user_merge_tags() { - - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'favoring_user_ID', - 'name' => __( 'Favoring user ID', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'favoring_user_login', - 'name' => __( 'Favoring user login', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'favoring_user_email', - 'name' => __( 'Favoring user email', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'favoring_user_display_name', - 'name' => __( 'Favoring user display name', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'favoring_user_first_name', - 'name' => __( 'Favoring user first name', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'favoring_user_last_name', - 'name' => __( 'Favoring user last name', 'notification-buddypress' ), - 'property_name' => 'favoring_user_object', - 'group' => __( 'Favoring user', 'notification-buddypress' ), - ] ) ); - + public function favoringUserMergeTags() + { + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'favoring_user_ID', + 'name' => __('Favoring user ID', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'favoring_user_login', + 'name' => __('Favoring user login', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'favoring_user_email', + 'name' => __('Favoring user email', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'favoring_user_display_name', + 'name' => __('Favoring user display name', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'favoring_user_first_name', + 'name' => __('Favoring user first name', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'favoring_user_last_name', + 'name' => __('Favoring user last name', 'notification-buddypress'), + 'property_name' => 'favoringUserObject', + 'group' => __('Favoring user', 'notification-buddypress'), + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Activity/AddToFavorities.php b/src/Repository/Trigger/Activity/AddToFavorities.php index f0093bc..ef333c9 100644 --- a/src/Repository/Trigger/Activity/AddToFavorities.php +++ b/src/Repository/Trigger/Activity/AddToFavorities.php @@ -5,44 +5,54 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity as ActivityTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Add to favorites trigger class */ -class AddToFavorities extends ActivityTrigger { - +class AddToFavorities extends ActivityTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/activity/favorities/add', - 'name' => __( 'Activity added to favorites', 'notification-buddypress' ), - ) ); - - $this->add_action( 'bp_activity_add_user_favorite', 100, 2 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/activity/favorities/add', + 'name' => __('Activity added to favorites', 'notification-buddypress'), + ] + ); + + $this->addAction('bp_activity_add_user_favorite', 100, 2); } /** * Hooks to the action. * - * @param int $activity_id ID of the activity item being favorited. - * @param int $user_id ID of the user doing the favoriting. + * @param int $activityId ID of the activity item being favorited. + * @param int $userId ID of the user doing the favoriting. * @return mixed */ - public function context( $activity_id, $user_id ) { - - $this->activity = new \BP_Activity_Activity( $activity_id ); - $this->favoring_user_object = get_user_by( 'id', $user_id ); - $this->activity_user_object = get_user_by( 'id', $this->activity->user_id ); - - $this->activity_favorited_datetime = $this->cache( 'activity_favorited_datetime', time() ); - + public function context($activityId, $userId) + { + $activity = new \BP_Activity_Activity($activityId); + $favoringUser = get_user_by('id', $userId); + // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps + $activityUser = get_user_by('id', $activity->user_id); + + if (!$favoringUser instanceof \WP_User || !$activityUser instanceof \WP_User) { + return false; + } + + $this->activity = $activity; + $this->favoringUserObject = $favoringUser; + $this->activityUserObject = $activityUser; } /** @@ -50,18 +60,23 @@ public function context( $activity_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - parent::favoring_user_merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'activity_favorited_datetime', - 'name' => __( 'Activity favorited date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->favoringUserMergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'activity_favorited_datetime', + 'name' => __('Activity favorited date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Activity/AddToFavoritiesFail.php b/src/Repository/Trigger/Activity/AddToFavoritiesFail.php index f536ce3..2c116a6 100644 --- a/src/Repository/Trigger/Activity/AddToFavoritiesFail.php +++ b/src/Repository/Trigger/Activity/AddToFavoritiesFail.php @@ -5,44 +5,54 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity as ActivityTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Add to favorites fail trigger class */ -class AddToFavoritiesFail extends ActivityTrigger { - +class AddToFavoritiesFail extends ActivityTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/activity/favorities/fail', - 'name' => __( 'Activity failed to add to favorites', 'notification-buddypress' ), - ) ); - - $this->add_action( 'bp_activity_add_user_favorite_fail', 100, 2 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/activity/favorities/fail', + 'name' => __('Activity failed to add to favorites', 'notification-buddypress'), + ] + ); + + $this->addAction('bp_activity_add_user_favorite_fail', 100, 2); } /** * Hooks to the action. * - * @param int $activity_id ID of the activity item being favorited. - * @param int $user_id ID of the user doing the favoriting. + * @param int $activityId ID of the activity item being favorited. + * @param int $userId ID of the user doing the favoriting. * @return mixed */ - public function context( $activity_id, $user_id ) { - - $this->activity = new \BP_Activity_Activity( $activity_id ); - $this->favoring_user_object = get_user_by( 'id', $user_id ); - $this->activity_user_object = get_user_by( 'id', $this->activity->user_id ); - - $this->activity_favorited_fail_datetime = $this->cache( 'activity_favorited_fail_datetime', time() ); - + public function context($activityId, $userId) + { + $activity = new \BP_Activity_Activity($activityId); + $favoringUser = get_user_by('id', $userId); + // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps + $activityUser = get_user_by('id', $activity->user_id); + + if (!$favoringUser instanceof \WP_User || !$activityUser instanceof \WP_User) { + return false; + } + + $this->activity = $activity; + $this->favoringUserObject = $favoringUser; + $this->activityUserObject = $activityUser; } /** @@ -50,18 +60,23 @@ public function context( $activity_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - parent::favoring_user_merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'activity_favorited_fail_datetime', - 'name' => __( 'Activity favorited fail date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->favoringUserMergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'activity_favorited_fail_datetime', + 'name' => __('Activity favorited fail date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Activity/Added.php b/src/Repository/Trigger/Activity/Added.php index e462670..e38ffb3 100644 --- a/src/Repository/Trigger/Activity/Added.php +++ b/src/Repository/Trigger/Activity/Added.php @@ -5,48 +5,56 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity as ActivityTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Activity added trigger class */ -class Added extends ActivityTrigger { - +class Added extends ActivityTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/activity/added', - 'name' => __( 'Activity added', 'notification-buddypress' ), - ) ); - - $this->add_action( 'bp_activity_add', 10, 2 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/activity/added', + 'name' => __('Activity added', 'notification-buddypress'), + ] + ); + + $this->addAction('bp_activity_add', 10, 2); } /** * Hooks to the action. * - * @param array $r Array of parsed arguments for the activity item being added. - * @param int $activity_id The id of the activity item being added. + * @param array<string, mixed> $activityData Activity data. + * @param int $activityId The id of the activity item being added. * @return mixed */ - public function context( $r, $activity_id ) { - - if ( 'activity_update' !== $r['type'] ) { + public function context($activityData, $activityId) + { + if ($activityData['type'] !== 'activity_update') { return false; } - $this->activity = new \BP_Activity_Activity( $activity_id ); - $this->activity_user_object = get_user_by( 'id', $r['user_id'] ); + $activityUser = is_numeric($activityData['user_id']) + ? get_user_by('id', (int)$activityData['user_id']) + : null; - $this->activty_added_datetime = $this->cache( 'activty_added_datetime', time() ); + if (!$activityUser instanceof \WP_User) { + return false; + } + $this->activity = new \BP_Activity_Activity($activityId); + $this->activityUserObject = $activityUser; } /** @@ -54,16 +62,21 @@ public function context( $r, $activity_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'activty_added_datetime', - 'name' => __( 'Activity added date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'activity_added_datetime', + 'name' => __('Activity added date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Activity/Deleted.php b/src/Repository/Trigger/Activity/Deleted.php index 8295393..9232566 100644 --- a/src/Repository/Trigger/Activity/Deleted.php +++ b/src/Repository/Trigger/Activity/Deleted.php @@ -5,48 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity as ActivityTrigger; -use BracketSpace\Notification\Defaults\MergeTag; -use BracketSpace\Notification\BuddyPress\Repository\MergeTag\Activity as ActivityMergeTag; - +use BracketSpace\Notification\Repository\MergeTag; /** * Activity deleted trigger class */ -class Deleted extends ActivityTrigger { - +class Deleted extends ActivityTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/activity/deleted', - 'name' => __( 'Activity deleted', 'notification-buddypress' ), - ) ); - - $this->add_action( 'bp_activity_delete', 10 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/activity/deleted', + 'name' => __('Activity deleted', 'notification-buddypress'), + ] + ); + + $this->addAction('bp_activity_delete', 10); } /** * Hooks to the action. * - * @param array $deleted_activity Array of deleted activity. + * @param array<string, mixed> $activityData Array of deleted activity. * @return mixed */ - public function context( $deleted_activity ) { - - if ( 'activity_update' !== $deleted_activity['type'] ) { + public function context($activityData) + { + if ($activityData['type'] !== 'activity_update') { return false; } - $this->activity = new \BP_Activity_Activity( $deleted_activity['id'] ); - $this->activity_user_object = get_user_by( 'id', $deleted_activity['user_id'] ); + $activity = is_numeric($activityData['id']) + ? new \BP_Activity_Activity((int)$activityData['id']) + : null; + $activityUser = is_numeric($activityData['user_id']) + ? get_user_by('id', (int)$activityData['user_id']) + : null; - $this->activty_deletion_datetime = $this->cache( 'activty_deletion_datetime', time() ); + if (!$activity instanceof \BP_Activity_Activity || !$activityUser instanceof \WP_User) { + return false; + } + $this->activity = $activity; + $this->activityUserObject = $activityUser; } /** @@ -54,16 +64,21 @@ public function context( $deleted_activity ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'activty_deletion_datetime', - 'name' => __( 'Activity deletion date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'activty_deletion_datetime', + 'name' => __('Activity deletion date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Activity/RemoveFromFavorities.php b/src/Repository/Trigger/Activity/RemoveFromFavorities.php index f0fcfd4..5ff750c 100644 --- a/src/Repository/Trigger/Activity/RemoveFromFavorities.php +++ b/src/Repository/Trigger/Activity/RemoveFromFavorities.php @@ -5,44 +5,54 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Activity as ActivityTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Remove from favorites trigger class */ -class RemoveFromFavorities extends ActivityTrigger { - +class RemoveFromFavorities extends ActivityTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/activity/favorities/remove', - 'name' => __( 'Activity removed from favorites', 'notification-buddypress' ), - ) ); - - $this->add_action( 'bp_activity_remove_user_favorite', 100, 2 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/activity/favorities/remove', + 'name' => __('Activity removed from favorites', 'notification-buddypress'), + ] + ); + + $this->addAction('bp_activity_remove_user_favorite', 100, 2); } /** * Hooks to the action. * - * @param int $activity_id ID of the activity item being favorited. - * @param int $user_id ID of the user doing the favoriting. + * @param int $activityId ID of the activity item being favorited. + * @param int $userId ID of the user doing the favoriting. * @return mixed */ - public function context( $activity_id, $user_id ) { - - $this->activity = new \BP_Activity_Activity( $activity_id ); - $this->favoring_user_object = get_user_by( 'id', $user_id ); - $this->activity_user_object = get_user_by( 'id', $this->activity->user_id ); - - $this->activity_removal_from_favorities_datetime = $this->cache( 'activity_removal_from_favorities_datetime', time() ); - + public function context($activityId, $userId) + { + $activity = new \BP_Activity_Activity($activityId); + $favoringUser = get_user_by('id', $userId); + // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps + $activityUser = get_user_by('id', $activity->user_id); + + if (!$favoringUser instanceof \WP_User || !$activityUser instanceof \WP_User) { + return false; + } + + $this->activity = $activity; + $this->favoringUserObject = $favoringUser; + $this->activityUserObject = $activityUser; } /** @@ -50,18 +60,23 @@ public function context( $activity_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - parent::favoring_user_merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'activity_removal_from_favorities_datetime', - 'name' => __( 'Activity removal from favorities date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->favoringUserMergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'activity_removal_from_favorities_datetime', + 'name' => __('Activity removal from favorities date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Friendship.php b/src/Repository/Trigger/Friendship.php index ed2f8db..18444fa 100644 --- a/src/Repository/Trigger/Friendship.php +++ b/src/Repository/Trigger/Friendship.php @@ -5,31 +5,50 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger; -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\Trigger\BaseTrigger; +use BracketSpace\Notification\Repository\MergeTag; /** * Friendship trigger class */ -abstract class Friendship extends Abstracts\Trigger { +abstract class Friendship extends BaseTrigger +{ + /** + * User instance that initiated the friendship. + * + * @var \WP_User + */ + public $friendshipInitiatorUserObject; /** - * Constructor + * User instance that friendship was requested to. * - * @param array $params Trigger configuration params. + * @var \WP_User */ - public function __construct( $params = array() ) { + public $friendshipFriendUserObject; - if ( ! isset( $params['slug'], $params['name'] ) ) { - trigger_error( 'Friendship trigger requires slug and name params.', E_USER_ERROR ); + /** + * Constructor + * + * @param array<string, mixed> $params Trigger configuration params. + */ + public function __construct($params = []) + { + if ( + !isset($params['slug'], $params['name']) || + !is_string($params['slug']) || + !is_string($params['name']) + ) { + trigger_error('Friendship trigger requires slug and name params.', E_USER_ERROR); } - parent::__construct( $params['slug'], $params['name'] ); - - $this->set_group( __( 'BuddyPress : Friendship', 'notification-buddypress' ) ); + parent::__construct($params['slug'], $params['name']); + $this->setGroup(__('BuddyPress : Friendship', 'notification-buddypress')); } /** @@ -37,91 +56,140 @@ public function __construct( $params = array() ) { * * @return void */ - public function merge_tags() { + public function mergeTags() + { // Initiator user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'initiator_user_ID', - 'name' => __( 'Initiator user ID', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'initiator_user_login', - 'name' => __( 'Initiator user login', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'initiator_user_email', - 'name' => __( 'Initiator user email', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'initiator_user_display_name', - 'name' => __( 'Initiator user display name', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'initiator_user_first_name', - 'name' => __( 'Initiator user first name', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'initiator_user_last_name', - 'name' => __( 'Initiator user last name', 'notification-buddypress' ), - 'property_name' => 'friendship_initiator_user_object', - 'group' => __( 'Initiator', 'notification-buddypress' ), - ] ) ); + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'initiator_user_ID', + 'name' => __('Initiator user ID', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'initiator_user_login', + 'name' => __('Initiator user login', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'initiator_user_email', + 'name' => __('Initiator user email', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'initiator_user_display_name', + 'name' => __('Initiator user display name', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'initiator_user_first_name', + 'name' => __('Initiator user first name', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'initiator_user_last_name', + 'name' => __('Initiator user last name', 'notification-buddypress'), + 'property_name' => 'friendshipInitiatorUserObject', + 'group' => __('Initiator', 'notification-buddypress'), + ] + ) + ); // Friend user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'friend_user_ID', - 'name' => __( 'Friend user ID', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'friend_user_login', - 'name' => __( 'Friend user login', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'friend_user_email', - 'name' => __( 'Friend user email', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'friend_user_display_name', - 'name' => __( 'Friend user display name', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'friend_user_first_name', - 'name' => __( 'Friend user first name', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'friend_user_last_name', - 'name' => __( 'Friend user last name', 'notification-buddypress' ), - 'property_name' => 'friendship_friend_user_object', - 'group' => __( 'Friend', 'notification-buddypress' ), - ] ) ); + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'friend_user_ID', + 'name' => __('Friend user ID', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'friend_user_login', + 'name' => __('Friend user login', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'friend_user_email', + 'name' => __('Friend user email', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'friend_user_display_name', + 'name' => __('Friend user display name', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'friend_user_first_name', + 'name' => __('Friend user first name', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'friend_user_last_name', + 'name' => __('Friend user last name', 'notification-buddypress'), + 'property_name' => 'friendshipFriendUserObject', + 'group' => __('Friend', 'notification-buddypress'), + ] + ) + ); } } diff --git a/src/Repository/Trigger/Friendship/Accepted.php b/src/Repository/Trigger/Friendship/Accepted.php index df7877a..69134c6 100644 --- a/src/Repository/Trigger/Friendship/Accepted.php +++ b/src/Repository/Trigger/Friendship/Accepted.php @@ -5,45 +5,52 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship as FriendshipTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Friendship accepted trigger class */ -class Accepted extends FriendshipTrigger { - +class Accepted extends FriendshipTrigger +{ /** * Constructor */ - public function __construct() { + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/friendship/accepted', + 'name' => __('Friendship accepted', 'notification-buddypress'), + ] + ); - parent::__construct( array( - 'slug' => 'buddypress/friendship/accepted', - 'name' => __( 'Friendship accepted', 'notification-buddypress' ), - ) ); - - $this->add_action( 'friends_friendship_accepted', 10, 3 ); + $this->addAction('friends_friendship_accepted', 10, 3); } /** * Hooks to the action. * - * @param int $friendship_id ID of the pending friendship object. - * @param int $friendship_initiator_user_id ID of the friendship initiator. - * @param int $friendship_friend_user_id ID of the user requested friendship with. + * @param int $friendshipId ID of the pending friendship object. + * @param int $friendshipInitiatorUserId ID of the friendship initiator. + * @param int $friendshipFriendUserId ID of the user requested friendship with. * @return mixed */ - public function context( $friendship_id, $friendship_initiator_user_id, $friendship_friend_user_id ) { - - $this->friendship_id = $friendship_id; - $this->friendship_initiator_user_object = get_user_by( 'id', $friendship_initiator_user_id ); - $this->friendship_friend_user_object = get_user_by( 'id', $friendship_friend_user_id ); + public function context($friendshipId, $friendshipInitiatorUserId, $friendshipFriendUserId) + { + $friendshipInitiatorUser = get_user_by('id', $friendshipInitiatorUserId); + $friendshipFriendUser = get_user_by('id', $friendshipFriendUserId); - $this->friendship_acceptance_datetime = $this->cache( 'friendship_acceptance_datetime', time() ); + if (!$friendshipInitiatorUser instanceof \WP_User || !$friendshipFriendUser instanceof \WP_User) { + return false; + } + $this->friendshipInitiatorUserObject = $friendshipInitiatorUser; + $this->friendshipFriendUserObject = $friendshipFriendUser; } /** @@ -51,16 +58,21 @@ public function context( $friendship_id, $friendship_initiator_user_id, $friends * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'friendship_acceptance_datetime', - 'name' => __( 'Friendship acceptance date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); + public function mergeTags() + { + parent::mergeTags(); + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'friendship_acceptance_datetime', + 'name' => __('Friendship acceptance date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Friendship/Deleted.php b/src/Repository/Trigger/Friendship/Deleted.php index f49b6e6..87a4ec1 100644 --- a/src/Repository/Trigger/Friendship/Deleted.php +++ b/src/Repository/Trigger/Friendship/Deleted.php @@ -5,43 +5,51 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship as FriendshipTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Friendship deleted trigger class */ -class Deleted extends FriendshipTrigger { - +class Deleted extends FriendshipTrigger +{ /** * Constructor */ - public function __construct() { + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/friendship/deleted', + 'name' => __('Friendship deleted', 'notification-buddypress'), + ] + ); - parent::__construct( array( - 'slug' => 'buddypress/friendship/deleted', - 'name' => __( 'Friendship deleted', 'notification-buddypress' ), - ) ); - - $this->add_action( 'friends_friendship_post_delete', 10, 2 ); + $this->addAction('friends_friendship_post_delete', 10, 2); } /** * Hooks to the action. * - * @param int $friendship_initiator_user_id ID of the friendship initiator. - * @param int $friendship_friend_user_id ID of the user requested friendship with. + * @param int $friendshipInitiatorUserId ID of the friendship initiator. + * @param int $friendshipFriendUserId ID of the user requested friendship with. * @return mixed */ - public function context( $friendship_initiator_user_id, $friendship_friend_user_id ) { - - $this->friendship_initiator_user_object = get_user_by( 'id', $friendship_initiator_user_id ); - $this->friendship_friend_user_object = get_user_by( 'id', $friendship_friend_user_id ); + public function context($friendshipInitiatorUserId, $friendshipFriendUserId) + { + $friendshipInitiatorUser = get_user_by('id', $friendshipInitiatorUserId); + $friendshipFriendUser = get_user_by('id', $friendshipFriendUserId); - $this->friendship_deletion_datetime = $this->cache( 'friendship_deletion_datetime', time() ); + if (!$friendshipInitiatorUser instanceof \WP_User || !$friendshipFriendUser instanceof \WP_User) { + return false; + } + $this->friendshipInitiatorUserObject = $friendshipInitiatorUser; + $this->friendshipFriendUserObject = $friendshipFriendUser; } /** @@ -49,16 +57,21 @@ public function context( $friendship_initiator_user_id, $friendship_friend_user_ * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'friendship_deletion_datetime', - 'name' => __( 'Friendship deletion date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); + public function mergeTags() + { + parent::mergeTags(); + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'friendship_deletion_datetime', + 'name' => __('Friendship deletion date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Friendship/Requested.php b/src/Repository/Trigger/Friendship/Requested.php index 8fca98d..66f9181 100644 --- a/src/Repository/Trigger/Friendship/Requested.php +++ b/src/Repository/Trigger/Friendship/Requested.php @@ -5,45 +5,52 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Friendship as FriendshipTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Friendship requested trigger class */ -class Requested extends FriendshipTrigger { - +class Requested extends FriendshipTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/friendship/requested', - 'name' => __( 'Friendship requested', 'notification-buddypress' ), - ) ); - - $this->add_action( 'friends_friendship_requested', 10, 3 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/friendship/requested', + 'name' => __('Friendship requested', 'notification-buddypress'), + ] + ); + + $this->addAction('friends_friendship_requested', 10, 3); } /** * Hooks to the action. * - * @param int $friendship_id ID of the pending friendship object. - * @param int $friendship_initiator_user_id ID of the friendship initiator. - * @param int $friendship_friend_user_id ID of the user requested friendship with. + * @param int $friendshipId ID of the pending friendship object. + * @param int $friendshipInitiatorUserId ID of the friendship initiator. + * @param int $friendshipFriendUserId ID of the user requested friendship with. * @return mixed */ - public function context( $friendship_id, $friendship_initiator_user_id, $friendship_friend_user_id ) { - - $this->friendship_id = $friendship_id; - $this->friendship_initiator_user_object = get_user_by( 'id', $friendship_initiator_user_id ); - $this->friendship_friend_user_object = get_user_by( 'id', $friendship_friend_user_id ); + public function context($friendshipId, $friendshipInitiatorUserId, $friendshipFriendUserId) + { + $friendshipInitiatorUser = get_user_by('id', $friendshipInitiatorUserId); + $friendshipFriendUser = get_user_by('id', $friendshipFriendUserId); - $this->friendship_request_datetime = $this->cache( 'friendship_request_datetime', time() ); + if (!$friendshipInitiatorUser instanceof \WP_User || !$friendshipFriendUser instanceof \WP_User) { + return false; + } + $this->friendshipInitiatorUserObject = $friendshipInitiatorUser; + $this->friendshipFriendUserObject = $friendshipFriendUser; } /** @@ -51,26 +58,41 @@ public function context( $friendship_id, $friendship_initiator_user_id, $friends * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'friendship_request_datetime', - 'name' => __( 'Friendship request date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - - $this->add_merge_tag( new MergeTag\UrlTag( [ - 'slug' => 'friend_requests_url', - 'name' => __( 'Friend requests URL', 'notification-buddypress' ), - 'description' => __( 'Leads to friend requests page of the invited user', 'notification-buddypress' ), - 'group' => __( 'Friend', 'notification-buddypress' ), - 'resolver' => function( $trigger ) { - return esc_url( bp_core_get_user_domain( $trigger->friendship_friend_user_object->ID ) . bp_get_friends_slug() . '/requests/' ); - }, - ] ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'friendship_request_datetime', + 'name' => __('Friendship request date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\UrlTag( + [ + 'slug' => 'friend_requests_url', + 'name' => __('Friend requests URL', 'notification-buddypress'), + 'description' => __('Leads to friend requests page of the invited user', 'notification-buddypress'), + 'group' => __('Friend', 'notification-buddypress'), + 'resolver' => static function ($trigger) { + $url = sprintf( + '%s%s/requests/', + bp_core_get_user_domain($trigger->friendshipFriendUserObject->ID), + bp_get_friends_slug() + ); + + return esc_url($url); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group.php b/src/Repository/Trigger/Group.php index 45d1f31..73c1bfb 100644 --- a/src/Repository/Trigger/Group.php +++ b/src/Repository/Trigger/Group.php @@ -5,32 +5,43 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger; -use BracketSpace\Notification\Abstracts; -use BracketSpace\Notification\Defaults\MergeTag; -use BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group as GroupMergeTag; +use BracketSpace\Notification\Repository\Trigger\BaseTrigger; +use BracketSpace\Notification\Repository\MergeTag; /** * Group trigger class */ -abstract class Group extends Abstracts\Trigger { +abstract class Group extends BaseTrigger +{ + /** + * Group instance. + * + * @var \BP_Groups_Group + */ + public $buddyGroup; /** * Constructor * - * @param array $params Trigger configuration params. + * @param array<mixed> $params Trigger configuration params. */ - public function __construct( $params = array() ) { - - if ( ! isset( $params['slug'], $params['name'] ) ) { - trigger_error( 'Group trigger requires slug and name params.', E_USER_ERROR ); + public function __construct($params = []) + { + if ( + !isset($params['slug'], $params['name']) || + !is_string($params['slug']) || + !is_string($params['name']) + ) { + trigger_error('Group trigger requires slug and name params.', E_USER_ERROR); } - parent::__construct( $params['slug'], $params['name'] ); - - $this->set_group( __( 'BuddyPress : Group', 'notification-buddypress' ) ); + parent::__construct($params['slug'], $params['name']); + $this->setGroup(__('BuddyPress : Group', 'notification-buddypress')); } /** @@ -38,18 +49,126 @@ public function __construct( $params = array() ) { * * @return void */ - public function merge_tags() { - - // Group. - $this->add_merge_tag( new GroupMergeTag\ID() ); - $this->add_merge_tag( new GroupMergeTag\ParentID() ); - $this->add_merge_tag( new GroupMergeTag\CreatorID() ); - $this->add_merge_tag( new GroupMergeTag\Name() ); - $this->add_merge_tag( new GroupMergeTag\Slug() ); - $this->add_merge_tag( new GroupMergeTag\Description() ); - $this->add_merge_tag( new GroupMergeTag\Status() ); - $this->add_merge_tag( new GroupMergeTag\ForumEnabled() ); + public function mergeTags() + { + $this->addMergeTag( + new MergeTag\IntegerTag( + [ + 'slug' => 'group_ID', + 'name' => __('Group ID', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => 123, + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->id; + }, + ] + ) + ); - } + $this->addMergeTag( + new MergeTag\IntegerTag( + [ + 'slug' => 'group_parent_ID', + 'name' => __('Group parent ID', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => 123, + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->parent_id; + }, + ] + ) + ); + $this->addMergeTag( + new MergeTag\IntegerTag( + [ + 'slug' => 'group_creator_ID', + 'name' => __('Group creator ID', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => 123, + 'example' => true, + 'resolver' => static function ($trigger) { + return $trigger->buddyGroup->creator_id; + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'group_name', + 'name' => __('Group name', 'notification-buddypress'), + 'description' => __('My Super Example Group', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->name; + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'group_slug', + 'name' => __('Group slug', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => 'my-super-example-group', + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->slug; + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'group_description', + 'name' => __('Group description', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => 'My Super Example Group is awesome!', + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->description; + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'group_status', + 'name' => __('Group status', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'resolver' => static function (Group $trigger) { + return ucfirst($trigger->buddyGroup->status); + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'group_forum_enabled', + 'name' => __('Group forum enabled', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'description' => __('Returns: Enabled or Disabled', 'notification-buddypress'), + 'example' => true, + 'resolver' => static function (Group $trigger) { + return $trigger->buddyGroup->enable_forum === '1' + ? __('Enabled', 'notification-buddypress') + : __('Disabled', 'notification-buddypress'); + }, + ] + ) + ); + } } diff --git a/src/Repository/Trigger/Group/BanMember.php b/src/Repository/Trigger/Group/BanMember.php index c8054ef..45b7613 100644 --- a/src/Repository/Trigger/Group/BanMember.php +++ b/src/Repository/Trigger/Group/BanMember.php @@ -5,44 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Ban group member trigger class */ -class BanMember extends GroupTrigger { +class BanMember extends GroupTrigger +{ + /** + * Banned user instance. + * + * @var \WP_User + */ + public $bannedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/ban_member', - 'name' => __( 'Ban group member', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_ban_member', 100, 2 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/ban_member', + 'name' => __('Ban group member', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_ban_member', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being banned from. - * @param int $user_id ID of the user being banned. + * @param int $groupId ID of the group being banned from. + * @param int $userId ID of the user being banned. * @return mixed */ - public function context( $group_id, $user_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->banned_user_object = get_user_by( 'id', $user_id ); + public function context($groupId, $userId) + { + $bannedUser = get_user_by('id', $userId); - $this->ban_datetime = $this->cache( 'ban_datetime', time() ); + if (!$bannedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->bannedUserObject = $bannedUser; } /** @@ -50,59 +63,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Banned user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'banned_user_ID', - 'name' => __( 'Banned user ID', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'banned_user_login', - 'name' => __( 'Banned user login', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'banned_user_email', - 'name' => __( 'Banned user email', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'banned_user_display_name', - 'name' => __( 'Banned user display name', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'banned_user_first_name', - 'name' => __( 'Banned user first name', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'banned_user_last_name', - 'name' => __( 'Banned user last name', 'notification-buddypress' ), - 'property_name' => 'banned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'ban_datetime', - 'name' => __( 'Ban date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'banned_user_ID', + 'name' => __('Banned user ID', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'banned_user_login', + 'name' => __('Banned user login', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'banned_user_email', + 'name' => __('Banned user email', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'banned_user_display_name', + 'name' => __('Banned user display name', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'banned_user_first_name', + 'name' => __('Banned user first name', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'banned_user_last_name', + 'name' => __('Banned user last name', 'notification-buddypress'), + 'property_name' => 'bannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'ban_datetime', + 'name' => __('Ban date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/CreateComplete.php b/src/Repository/Trigger/Group/CreateComplete.php index d469b69..3490d5a 100644 --- a/src/Repository/Trigger/Group/CreateComplete.php +++ b/src/Repository/Trigger/Group/CreateComplete.php @@ -5,42 +5,42 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Group created trigger class */ -class CreateComplete extends GroupTrigger { - +class CreateComplete extends GroupTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/new', - 'name' => __( 'Group created', 'notification-buddypress' ), - ) ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/new', + 'name' => __('Group created', 'notification-buddypress'), + ] + ); - $this->add_action( 'groups_group_create_complete', 10 ); + $this->addAction('groups_group_create_complete', 10); } /** * Hooks to the action. * - * @param int $group Newly created group ID. + * @param int $groupId Newly created group ID. * @return mixed */ - public function context( $group ) { - - $this->group_id = $group; - $this->buddy_group = groups_get_group( $group ); - - $this->creation_datetime = $this->cache( 'creation_datetime', time() ); - + public function context($groupId) + { + $this->buddyGroup = groups_get_group($groupId); } /** @@ -48,16 +48,21 @@ public function context( $group ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'creation_datetime', - 'name' => __( 'Creation date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); + public function mergeTags() + { + parent::mergeTags(); + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'creation_datetime', + 'name' => __('Creation date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/Deleted.php b/src/Repository/Trigger/Group/Deleted.php index d02a6a9..5c60f85 100644 --- a/src/Repository/Trigger/Group/Deleted.php +++ b/src/Repository/Trigger/Group/Deleted.php @@ -5,43 +5,43 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; -use BracketSpace\Notification\BuddyPress\Repository\MergeTag\Group as GroupMergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Group created trigger class */ -class Deleted extends GroupTrigger { - +class Deleted extends GroupTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/deleted', - 'name' => __( 'Group deleted', 'notification-buddypress' ), - ) ); + public function __construct() + { - $this->add_action( 'groups_before_delete_group', 10 ); + parent::__construct( + [ + 'slug' => 'buddypress/group/deleted', + 'name' => __('Group deleted', 'notification-buddypress'), + ] + ); + $this->addAction('groups_before_delete_group', 10); } /** * Hooks to the action. * - * @param int $group Newly created group ID. + * @param int $groupId Newly created group ID. * @return mixed */ - public function context( $group ) { - - $this->buddy_group = groups_get_group( $group ); - - $this->deletion_datetime = $this->cache( 'deletion_datetime', time() ); - + public function context($groupId) + { + $this->buddyGroup = groups_get_group($groupId); } /** @@ -49,16 +49,21 @@ public function context( $group ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'deletion_datetime', - 'name' => __( 'Deletion date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'deletion_datetime', + 'name' => __('Deletion date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/DemoteMember.php b/src/Repository/Trigger/Group/DemoteMember.php index 08e0e40..deedba6 100644 --- a/src/Repository/Trigger/Group/DemoteMember.php +++ b/src/Repository/Trigger/Group/DemoteMember.php @@ -5,45 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Demote group member trigger class */ -class DemoteMember extends GroupTrigger { +class DemoteMember extends GroupTrigger +{ + /** + * Demoted user instance. + * + * @var \WP_User + */ + public $demotedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/demote_member', - 'name' => __( 'Demote group member', 'notification-buddypress' ), - ) ); + public function __construct() + { - $this->add_action( 'groups_demote_member', 10, 2 ); + parent::__construct( + [ + 'slug' => 'buddypress/group/demote_member', + 'name' => __('Demote group member', 'notification-buddypress'), + ] + ); + $this->addAction('groups_demote_member', 10, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being demoted from. - * @param int $user_id ID of the user being demoted. + * @param int $groupId ID of the group being banned from. + * @param int $userId ID of the user being banned. * @return mixed */ - public function context( $group_id, $user_id ) { + public function context($groupId, $userId) + { + $demotedUser = get_user_by('id', $userId); - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->demoted_user = get_user_by( 'id', $user_id ); - - $this->demotion_datetime = $this->cache( 'demotion_datetime', time() ); + if (!$demotedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->demotedUserObject = $demotedUser; } /** @@ -51,59 +64,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Demoted user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'demoted_user_ID', - 'name' => __( 'Demoted user ID', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'demoted_user_login', - 'name' => __( 'Demoted user login', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'demoted_user_email', - 'name' => __( 'Demoted user email', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'demoted_user_display_name', - 'name' => __( 'Demoted user display name', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'demoted_user_first_name', - 'name' => __( 'Demoted user first name', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'demoted_user_last_name', - 'name' => __( 'Demoted user last name', 'notification-buddypress' ), - 'property_name' => 'demoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'demotion_datetime', - 'name' => __( 'Demotion date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'demoted_user_ID', + 'name' => __('Demoted user ID', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'demoted_user_login', + 'name' => __('Demoted user login', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'demoted_user_email', + 'name' => __('Demoted user email', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'demoted_user_display_name', + 'name' => __('Demoted user display name', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'demoted_user_first_name', + 'name' => __('Demoted user first name', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'demoted_user_last_name', + 'name' => __('Demoted user last name', 'notification-buddypress'), + 'property_name' => 'demotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'demotion_datetime', + 'name' => __('Demotion date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/DetailsUpdated.php b/src/Repository/Trigger/Group/DetailsUpdated.php index b2569c8..d5d591f 100644 --- a/src/Repository/Trigger/Group/DetailsUpdated.php +++ b/src/Repository/Trigger/Group/DetailsUpdated.php @@ -5,48 +5,48 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Group details updated trigger class */ -class DetailsUpdated extends GroupTrigger { - +class DetailsUpdated extends GroupTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/details_updated', - 'name' => __( 'Group details updated', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_details_updated', 10, 3 ); + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/details_updated', + 'name' => __('Group details updated', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_details_updated', 10, 3); } /** * Hooks to the action. * - * @param int $group_id Group ID. + * @param int $groupId Group ID. * @param object $group Old Group object. * @param bool $notify If notify users. * @return mixed */ - public function context( $group_id, $group, $notify ) { - - if ( ! $notify ) { + public function context($groupId, $group, $notify) + { + if (! $notify) { return false; } - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - - $this->details_update_datetime = $this->cache( 'details_update_datetime', time() ); - + $this->buddyGroup = groups_get_group($groupId); } /** @@ -54,16 +54,21 @@ public function context( $group_id, $group, $notify ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'details_update_datetime', - 'name' => __( 'Details update date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'details_update_datetime', + 'name' => __('Details update date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/InviteUser.php b/src/Repository/Trigger/Group/InviteUser.php index c3b8e36..5fddb3f 100644 --- a/src/Repository/Trigger/Group/InviteUser.php +++ b/src/Repository/Trigger/Group/InviteUser.php @@ -5,44 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Invite user to group trigger class */ -class InviteUser extends GroupTrigger { +class InviteUser extends GroupTrigger +{ + /** + * Invited user instance. + * + * @var \WP_User + */ + public $invitedUserObject; /** * Constructor */ - public function __construct() { + public function __construct() + { - parent::__construct( array( - 'slug' => 'buddypress/group/invite_user', - 'name' => __( 'Invite user to group', 'notification-buddypress' ), - ) ); + parent::__construct( + [ + 'slug' => 'buddypress/group/invite_user', + 'name' => __('Invite user to group', 'notification-buddypress'), + ] + ); - $this->add_action( 'notification_buddypress_group_invite', 10, 2 ); + $this->addAction('notification_buddypress_group_invite', 10, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being invited to. - * @param int $user_id ID of the user being invited. + * @param int $groupId ID of the group being banned from. + * @param int $userId ID of the user being banned. * @return mixed */ - public function context( $group_id, $user_id ) { + public function context($groupId, $userId) + { + $invitedUser = get_user_by('id', $userId); - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->invited_user_object = get_user_by( 'id', $user_id ); - - $this->invitation_datetime = $this->cache( 'invitation_datetime', time() ); + if (!$invitedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->invitedUserObject = $invitedUser; } /** @@ -50,59 +64,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Invited user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'invited_user_ID', - 'name' => __( 'Invited user ID', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'invited_user_login', - 'name' => __( 'Invited user login', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'invited_user_email', - 'name' => __( 'Invited user email', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'invited_user_display_name', - 'name' => __( 'Invited user display name', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'invited_user_first_name', - 'name' => __( 'Invited user first name', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'invited_user_last_name', - 'name' => __( 'Invited user last name', 'notification-buddypress' ), - 'property_name' => 'invited_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'invitation_datetime', - 'name' => __( 'Invitation date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'invited_user_ID', + 'name' => __('Invited user ID', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'invited_user_login', + 'name' => __('Invited user login', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'invited_user_email', + 'name' => __('Invited user email', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'invited_user_display_name', + 'name' => __('Invited user display name', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'invited_user_first_name', + 'name' => __('Invited user first name', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'invited_user_last_name', + 'name' => __('Invited user last name', 'notification-buddypress'), + 'property_name' => 'invitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'invitation_datetime', + 'name' => __('Invitation date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/Join.php b/src/Repository/Trigger/Group/Join.php index 2ed31ca..0caacd0 100644 --- a/src/Repository/Trigger/Group/Join.php +++ b/src/Repository/Trigger/Group/Join.php @@ -5,45 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Join group trigger class */ -class Join extends GroupTrigger { +class Join extends GroupTrigger +{ + /** + * Joined user instance. + * + * @var \WP_User + */ + public $joinedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/join', - 'name' => __( 'User joined to group', 'notification-buddypress' ), - ) ); + public function __construct() + { - $this->add_action( 'groups_join_group', 100, 2 ); + parent::__construct( + [ + 'slug' => 'buddypress/group/join', + 'name' => __('User joined to group', 'notification-buddypress'), + ] + ); + $this->addAction('groups_join_group', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being invited to. - * @param int $user_id ID of the user being invited. + * @param int $groupId ID of the group being banned from. + * @param int $userId ID of the user being banned. * @return mixed */ - public function context( $group_id, $user_id ) { + public function context($groupId, $userId) + { + $joinedUser = get_user_by('id', $userId); - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->joined_user_object = get_user_by( 'id', $user_id ); - - $this->join_datetime = $this->cache( 'join_datetime', time() ); + if (!$joinedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->joinedUserObject = $joinedUser; } /** @@ -51,59 +64,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Joining user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'joined_user_ID', - 'name' => __( 'Joined user ID', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'joined_user_login', - 'name' => __( 'Joined user login', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'joined_user_email', - 'name' => __( 'Joined user email', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'joined_user_display_name', - 'name' => __( 'Joined user display name', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'joined_user_first_name', - 'name' => __( 'Joined user first name', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'joined_user_last_name', - 'name' => __( 'Joined user last name', 'notification-buddypress' ), - 'property_name' => 'joined_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'join_datetime', - 'name' => __( 'Join date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'joined_user_ID', + 'name' => __('Joined user ID', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'joined_user_login', + 'name' => __('Joined user login', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'joined_user_email', + 'name' => __('Joined user email', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'joined_user_display_name', + 'name' => __('Joined user display name', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'joined_user_first_name', + 'name' => __('Joined user first name', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'joined_user_last_name', + 'name' => __('Joined user last name', 'notification-buddypress'), + 'property_name' => 'joinedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'join_datetime', + 'name' => __('Join date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/Leave.php b/src/Repository/Trigger/Group/Leave.php index 96fe34f..2f59f2c 100644 --- a/src/Repository/Trigger/Group/Leave.php +++ b/src/Repository/Trigger/Group/Leave.php @@ -5,45 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Leave group trigger class */ -class Leave extends GroupTrigger { +class Leave extends GroupTrigger +{ + /** + * Leaving user instance. + * + * @var \WP_User + */ + public $leavingUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/leave', - 'name' => __( 'User leaves group', 'notification-buddypress' ), - ) ); + public function __construct() + { - $this->add_action( 'groups_leave_group', 100, 2 ); + parent::__construct( + [ + 'slug' => 'buddypress/group/leave', + 'name' => __('User leaves group', 'notification-buddypress'), + ] + ); + $this->addAction('groups_leave_group', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being invited to. - * @param int $user_id ID of the user being invited. + * @param int $groupId ID of the group being banned from. + * @param int $userId ID of the user being banned. * @return mixed */ - public function context( $group_id, $user_id ) { + public function context($groupId, $userId) + { + $leavingUser = get_user_by('id', $userId); - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->leaving_user_object = get_user_by( 'id', $user_id ); - - $this->leave_datetime = $this->cache( 'leave_datetime', time() ); + if (!$leavingUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->leavingUserObject = $leavingUser; } /** @@ -51,59 +64,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Leaving user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'leaving_user_ID', - 'name' => __( 'Leaving user ID', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'leaving_user_login', - 'name' => __( 'Leaving user login', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'leaving_user_email', - 'name' => __( 'Leaving user email', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'leaving_user_display_name', - 'name' => __( 'Leaving user display name', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'leaving_user_first_name', - 'name' => __( 'Leaving user first name', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'leaving_user_last_name', - 'name' => __( 'Leaving user last name', 'notification-buddypress' ), - 'property_name' => 'leaving_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'leave_datetime', - 'name' => __( 'Leave date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'leaving_user_ID', + 'name' => __('Leaving user ID', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'leaving_user_login', + 'name' => __('Leaving user login', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'leaving_user_email', + 'name' => __('Leaving user email', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'leaving_user_display_name', + 'name' => __('Leaving user display name', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'leaving_user_first_name', + 'name' => __('Leaving user first name', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'leaving_user_last_name', + 'name' => __('Leaving user last name', 'notification-buddypress'), + 'property_name' => 'leavingUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'leave_datetime', + 'name' => __('Leave date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/MembershipAccepted.php b/src/Repository/Trigger/Group/MembershipAccepted.php index 6447f59..229ca7a 100644 --- a/src/Repository/Trigger/Group/MembershipAccepted.php +++ b/src/Repository/Trigger/Group/MembershipAccepted.php @@ -5,46 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Membership accepted trigger class */ -class MembershipAccepted extends GroupTrigger { +class MembershipAccepted extends GroupTrigger +{ + /** + * Accepted user instance. + * + * @var \WP_User + */ + public $acceptedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/membership_accepted', - 'name' => __( 'Membership accepted', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_membership_accepted', 100, 3 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/membership_accepted', + 'name' => __('Membership accepted', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_membership_accepted', 100, 2); } /** * Hooks to the action. * - * @param int $user_id ID of the user who accepted membership. - * @param int $group_id ID of the group that was accepted membership to. - * @param bool $status If membership was accepted. + * @param int $userId ID of the user who accepted membership. + * @param int $groupId ID of the group that was accepted membership to. * @return mixed */ - public function context( $user_id, $group_id, $status ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->accepted_user = get_user_by( 'id', $user_id ); + public function context($userId, $groupId) + { + $acceptedUser = get_user_by('id', $userId); - $this->membership_acceptance_datetime = $this->cache( 'membership_acceptance_datetime', time() ); + if (!$acceptedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->acceptedUserObject = $acceptedUser; } /** @@ -52,59 +63,88 @@ public function context( $user_id, $group_id, $status ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Accepted user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'accepted_user_ID', - 'name' => __( 'Accepted user ID', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'accepted_user_login', - 'name' => __( 'Accepted user login', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'accepted_user_email', - 'name' => __( 'Accepted user email', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'accepted_user_display_name', - 'name' => __( 'Accepted user display name', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'accepted_user_first_name', - 'name' => __( 'Accepted user first name', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'accepted_user_last_name', - 'name' => __( 'Accepted user last name', 'notification-buddypress' ), - 'property_name' => 'accepted_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'membership_acceptance_datetime', - 'name' => __( 'Membership acceptance date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'accepted_user_ID', + 'name' => __('Accepted user ID', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'accepted_user_login', + 'name' => __('Accepted user login', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'accepted_user_email', + 'name' => __('Accepted user email', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'accepted_user_display_name', + 'name' => __('Accepted user display name', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'accepted_user_first_name', + 'name' => __('Accepted user first name', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'accepted_user_last_name', + 'name' => __('Accepted user last name', 'notification-buddypress'), + 'property_name' => 'acceptedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'membership_acceptance_datetime', + 'name' => __('Membership acceptance date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/MembershipRejected.php b/src/Repository/Trigger/Group/MembershipRejected.php index c490360..9ff1bda 100644 --- a/src/Repository/Trigger/Group/MembershipRejected.php +++ b/src/Repository/Trigger/Group/MembershipRejected.php @@ -5,47 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Membership rejected trigger class */ -class MembershipRejected extends GroupTrigger { +class MembershipRejected extends GroupTrigger +{ + /** + * Rejected user instance. + * + * @var \WP_User + */ + public $rejectedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/membership_rejected', - 'name' => __( 'Membership rejected', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_membership_rejected', 100, 3 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/membership_rejected', + 'name' => __('Membership rejected', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_membership_rejected', 100, 3); } /** * Hooks to the action. * - * @param int $user_id ID of the user who rejected membership. - * @param int $group_id ID of the group that was rejected membership to. - * @param bool $status If membership was rejected. + * @param int $userId ID of the user who rejected membership. + * @param int $groupId ID of the group that was rejected membership to. * @return mixed */ - public function context( $user_id, $group_id, $status ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->rejected_user_object = get_user_by( 'id', $user_id ); - $this->membership_status = $status; + public function context($userId, $groupId) + { + $rejectedUser = get_user_by('id', $userId); - $this->membership_rejection_datetime = $this->cache( 'membership_rejection_datetime', time() ); + if (!$rejectedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->rejectedUserObject = $rejectedUser; } /** @@ -53,59 +63,88 @@ public function context( $user_id, $group_id, $status ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Rejected user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'rejected_user_ID', - 'name' => __( 'Rejected user ID', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'rejected_user_login', - 'name' => __( 'Rejected user login', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'rejected_user_email', - 'name' => __( 'Rejected user email', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'rejected_user_display_name', - 'name' => __( 'Rejected user display name', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'rejected_user_first_name', - 'name' => __( 'Rejected user first name', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'rejected_user_last_name', - 'name' => __( 'Rejected user last name', 'notification-buddypress' ), - 'property_name' => 'rejected_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'membership_rejection_datetime', - 'name' => __( 'Membership rejection date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'rejected_user_ID', + 'name' => __('Rejected user ID', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'rejected_user_login', + 'name' => __('Rejected user login', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'rejected_user_email', + 'name' => __('Rejected user email', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'rejected_user_display_name', + 'name' => __('Rejected user display name', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'rejected_user_first_name', + 'name' => __('Rejected user first name', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'rejected_user_last_name', + 'name' => __('Rejected user last name', 'notification-buddypress'), + 'property_name' => 'rejectedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'membership_rejection_datetime', + 'name' => __('Membership rejection date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/MembershipRequested.php b/src/Repository/Trigger/Group/MembershipRequested.php index 5beaee8..2f2c042 100644 --- a/src/Repository/Trigger/Group/MembershipRequested.php +++ b/src/Repository/Trigger/Group/MembershipRequested.php @@ -5,47 +5,58 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Membership requested trigger class */ -class MembershipRequested extends GroupTrigger { +class MembershipRequested extends GroupTrigger +{ + /** + * Requesting user instance. + * + * @var \WP_User + */ + public $requestingUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/membership_requested', - 'name' => __( 'Membership requested', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_membership_requested', 100, 4 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/membership_requested', + 'name' => __('Membership requested', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_membership_requested', 100, 3); } /** * Hooks to the action. * - * @param int $user_id ID of the user requesting membership. - * @param array $admins Array of group admins. - * @param int $group_id ID of the group being requested to. - * @param int $membership_id ID of the membership. + * @param int $userId ID of the user requesting membership. + * @param array<mixed> $admins Array of group admins. + * @param int $groupId ID of the group being requested to. * @return mixed */ - public function context( $user_id, $admins, $group_id, $membership_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->requesting_user_object = get_user_by( 'id', $user_id ); + public function context($userId, $admins, $groupId) + { + $requestingUser = get_user_by('id', $userId); - $this->membership_request_datetime = $this->cache( 'membership_request_datetime', time() ); + if (!$requestingUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->requestingUserObject = $requestingUser; } /** @@ -53,69 +64,104 @@ public function context( $user_id, $admins, $group_id, $membership_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\UrlTag( [ - 'slug' => 'group_requests_url', - 'name' => __( 'Group requests link', 'notification-buddypress' ), - 'description' => __( 'Leads to group membership requests page', 'notification-buddypress' ), - 'group' => __( 'Group', 'notification-buddypress' ), - 'resolver' => function( $trigger ) { - return esc_url( bp_get_group_permalink( $trigger->buddy_group ) . 'admin/membership-requests' ); - }, - ] ) ); + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\UrlTag( + [ + 'slug' => 'group_requests_url', + 'name' => __('Group requests link', 'notification-buddypress'), + 'description' => __('Leads to group membership requests page', 'notification-buddypress'), + 'group' => __('Group', 'notification-buddypress'), + 'resolver' => static function (MembershipRequested $trigger) { + $url = bp_get_group_permalink($trigger->buddyGroup) . 'admin/membership-requests'; + + return esc_url($url); + }, + ] + ) + ); // Requesting user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'requesting_user_ID', - 'name' => __( 'Requesting user ID', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'requesting_user_login', - 'name' => __( 'Requesting user login', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'requesting_user_email', - 'name' => __( 'Requesting user email', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'requesting_user_display_name', - 'name' => __( 'Requesting user display name', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'requesting_user_first_name', - 'name' => __( 'Requesting user first name', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'requesting_user_last_name', - 'name' => __( 'Requesting user last name', 'notification-buddypress' ), - 'property_name' => 'requesting_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'membership_request_datetime', - 'name' => __( 'Membership request date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'requesting_user_ID', + 'name' => __('Requesting user ID', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'requesting_user_login', + 'name' => __('Requesting user login', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'requesting_user_email', + 'name' => __('Requesting user email', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'requesting_user_display_name', + 'name' => __('Requesting user display name', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'requesting_user_first_name', + 'name' => __('Requesting user first name', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'requesting_user_last_name', + 'name' => __('Requesting user last name', 'notification-buddypress'), + 'property_name' => 'requestingdUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'membership_request_datetime', + 'name' => __('Membership request date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/PromoteMember.php b/src/Repository/Trigger/Group/PromoteMember.php index 10d6439..3fe8a77 100644 --- a/src/Repository/Trigger/Group/PromoteMember.php +++ b/src/Repository/Trigger/Group/PromoteMember.php @@ -5,60 +5,79 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Promote group member trigger class */ -class PromoteMember extends GroupTrigger { - +class PromoteMember extends GroupTrigger +{ /** - * Constructor + * Promoted user instance. + * + * @var \WP_User */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/promote_member', - 'name' => __( 'Promote group member', 'notification-buddypress' ), - ) ); + public $promotedUserObject; - $this->add_action( 'groups_promote_member', 1000, 3 ); + /** + * Promotion status. + * + * @var string + */ + public $promotionStatus; + /** + * Constructor + */ + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/promote_member', + 'name' => __('Promote group member', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_promote_member', 1000, 3); } /** * Hooks to the action. * - * @param int $group_id ID of the group being promoted in. - * @param int $user_id ID of the user being promoted. + * @param int $groupId ID of the group being promoted in. + * @param int $userId ID of the user being promoted. * @param string $status New status being promoted to. * @return mixed */ - public function context( $group_id, $user_id, $status ) { + public function context($groupId, $userId, $status) + { + $promotedUser = get_user_by('id', $userId); - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->promoted_user_object = get_user_by( 'id', $user_id ); + if (!$promotedUser instanceof \WP_User) { + return false; + } - switch ( $status ) { + $this->buddyGroup = groups_get_group($groupId); + $this->promotedUserObject = $promotedUser; + + switch ($status) { case 'mod': - $this->promotion_status = __( 'Moderator', 'notification-buddypress' ); + $this->promotionStatus = __('Moderator', 'notification-buddypress'); break; case 'admin': - $this->promotion_status = __( 'Administrator', 'notification-buddypress' ); + $this->promotionStatus = __('Administrator', 'notification-buddypress'); break; default: - $this->promotion_status = __( 'Undefined', 'notification-buddypress' ); + $this->promotionStatus = __('Undefined', 'notification-buddypress'); break; } - - $this->promotion_datetime = $this->cache( 'promotion_datetime', time() ); - } /** @@ -66,69 +85,102 @@ public function context( $group_id, $user_id, $status ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Promoted user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'promoted_user_ID', - 'name' => __( 'Promoted user ID', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'promoted_user_login', - 'name' => __( 'Promoted user login', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'promoted_user_email', - 'name' => __( 'Promoted user email', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'promoted_user_display_name', - 'name' => __( 'Promoted user display name', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'promoted_user_first_name', - 'name' => __( 'Promoted user first name', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'promoted_user_last_name', - 'name' => __( 'Promoted user last name', 'notification-buddypress' ), - 'property_name' => 'promoted_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\StringTag( [ - 'slug' => 'promoted_user_status', - 'name' => __( 'Promoted user status in group', 'notification-buddypress' ), - 'description' => __( 'Either Moderator or Administrator', 'notification-buddypress' ), - 'group' => __( 'User', 'notification-buddypress' ), - 'resolver' => function( $trigger ) { - return $trigger->promotion_status; - }, - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'promotion_datetime', - 'name' => __( 'Promotion date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'promoted_user_ID', + 'name' => __('Promoted user ID', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'promoted_user_login', + 'name' => __('Promoted user login', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'promoted_user_email', + 'name' => __('Promoted user email', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'promoted_user_display_name', + 'name' => __('Promoted user display name', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'promoted_user_first_name', + 'name' => __('Promoted user first name', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'promoted_user_last_name', + 'name' => __('Promoted user last name', 'notification-buddypress'), + 'property_name' => 'promotedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\StringTag( + [ + 'slug' => 'promoted_user_status', + 'name' => __('Promoted user status in group', 'notification-buddypress'), + 'description' => __('Either Moderator or Administrator', 'notification-buddypress'), + 'group' => __('User', 'notification-buddypress'), + 'resolver' => static function (PromoteMember $trigger) { + return $trigger->promotionStatus; + }, + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'promotion_datetime', + 'name' => __('Promotion date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/RemoveMember.php b/src/Repository/Trigger/Group/RemoveMember.php index 19a8b53..b7fb3e4 100644 --- a/src/Repository/Trigger/Group/RemoveMember.php +++ b/src/Repository/Trigger/Group/RemoveMember.php @@ -5,45 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Remove group member trigger class */ -class RemoveMember extends GroupTrigger { +class RemoveMember extends GroupTrigger +{ + /** + * Removed user instance. + * + * @var \WP_User + */ + public $removedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/remove_member', - 'name' => __( 'Remove group member', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_remove_member', 100, 2 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/remove_member', + 'name' => __('Remove group member', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_remove_member', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being removed from. - * @param int $user_id ID of the user being removed. + * @param int $groupId ID of the group being removed from. + * @param int $userId ID of the user being removed. * @return mixed */ - public function context( $group_id, $user_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->removed_user = get_user_by( 'id', $user_id ); + public function context($groupId, $userId) + { + $removedUser = get_user_by('id', $userId); - $this->removal_datetime = $this->cache( 'removal_datetime', time() ); + if (!$removedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->removedUserObject = $removedUser; } /** @@ -51,59 +63,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Removed user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'removed_user_ID', - 'name' => __( 'Removed user ID', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'removed_user_login', - 'name' => __( 'Removed user login', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'removed_user_email', - 'name' => __( 'Removed user email', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'removed_user_display_name', - 'name' => __( 'Removed user display name', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'removed_user_first_name', - 'name' => __( 'Removed user first name', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'removed_user_last_name', - 'name' => __( 'Removed user last name', 'notification-buddypress' ), - 'property_name' => 'removed_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'removal_datetime', - 'name' => __( 'Member removal date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'removed_user_ID', + 'name' => __('Removed user ID', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'removed_user_login', + 'name' => __('Removed user login', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'removed_user_email', + 'name' => __('Removed user email', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'removed_user_display_name', + 'name' => __('Removed user display name', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'removed_user_first_name', + 'name' => __('Removed user first name', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'removed_user_last_name', + 'name' => __('Removed user last name', 'notification-buddypress'), + 'property_name' => 'removedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'removal_datetime', + 'name' => __('Member removal date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/SettingsUpdated.php b/src/Repository/Trigger/Group/SettingsUpdated.php index 4f4ccaa..1a46e78 100644 --- a/src/Repository/Trigger/Group/SettingsUpdated.php +++ b/src/Repository/Trigger/Group/SettingsUpdated.php @@ -5,43 +5,42 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Group settings updated trigger class */ -class SettingsUpdated extends GroupTrigger { - +class SettingsUpdated extends GroupTrigger +{ /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/settings_updated', - 'name' => __( 'Group settings updated', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_settings_updated', 10 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/settings_updated', + 'name' => __('Group settings updated', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_settings_updated', 10); } /** * Hooks to the action. * - * @param int $group_id Newly created group ID. + * @param int $groupId Newly created group ID. * @return mixed */ - public function context( $group_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $this->group_id ); - - $this->settings_update_datetime = $this->cache( 'settings_update_datetime', time() ); - + public function context($groupId) + { + $this->buddyGroup = groups_get_group($groupId); } /** @@ -49,16 +48,21 @@ public function context( $group_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'settings_update_datetime', - 'name' => __( 'Settings update date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + public function mergeTags() + { + parent::mergeTags(); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'settings_update_datetime', + 'name' => __('Settings update date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/UnbanMember.php b/src/Repository/Trigger/Group/UnbanMember.php index b11d87b..49fae9d 100644 --- a/src/Repository/Trigger/Group/UnbanMember.php +++ b/src/Repository/Trigger/Group/UnbanMember.php @@ -5,45 +5,57 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Unban group member trigger class */ -class UnbanMember extends GroupTrigger { +class UnbanMember extends GroupTrigger +{ + /** + * Unbanned user instance. + * + * @var \WP_User + */ + public $unbannedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/unban_member', - 'name' => __( 'Unban group member', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_unban_member', 100, 2 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/unban_member', + 'name' => __('Unban group member', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_unban_member', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being unbanned from. - * @param int $user_id ID of the user being unbanned. + * @param int $groupId ID of the group being unbanned from. + * @param int $userId ID of the user being unbanned. * @return mixed */ - public function context( $group_id, $user_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->unbanned_user_object = get_user_by( 'id', $user_id ); + public function context($groupId, $userId) + { + $unbannedUser = get_user_by('id', $userId); - $this->unban_datetime = $this->cache( 'unban_datetime', time() ); + if (!$unbannedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->unbannedUserObject = $unbannedUser; } /** @@ -51,59 +63,88 @@ public function context( $group_id, $user_id ) { * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Banned user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'unbanned_user_ID', - 'name' => __( 'Unbanned user ID', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'unbanned_user_login', - 'name' => __( 'Unbanned user login', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'unbanned_user_email', - 'name' => __( 'Unbanned user email', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'unbanned_user_display_name', - 'name' => __( 'Unbanned user display name', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'unbanned_user_first_name', - 'name' => __( 'Unbanned user first name', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'unbanned_user_last_name', - 'name' => __( 'Unbanned user last name', 'notification-buddypress' ), - 'property_name' => 'unbanned_user_object', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'unban_datetime', - 'name' => __( 'Unban date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'unbanned_user_ID', + 'name' => __('Unbanned user ID', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'unbanned_user_login', + 'name' => __('Unbanned user login', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'unbanned_user_email', + 'name' => __('Unbanned user email', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'unbanned_user_display_name', + 'name' => __('Unbanned user display name', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'unbanned_user_first_name', + 'name' => __('Unbanned user first name', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'unbanned_user_last_name', + 'name' => __('Unbanned user last name', 'notification-buddypress'), + 'property_name' => 'unbannedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'unban_datetime', + 'name' => __('Unban date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/Trigger/Group/UninviteUser.php b/src/Repository/Trigger/Group/UninviteUser.php index d45ad4f..00610a8 100644 --- a/src/Repository/Trigger/Group/UninviteUser.php +++ b/src/Repository/Trigger/Group/UninviteUser.php @@ -5,106 +5,146 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository\Trigger\Group; use BracketSpace\Notification\BuddyPress\Repository\Trigger\Group as GroupTrigger; -use BracketSpace\Notification\Defaults\MergeTag; +use BracketSpace\Notification\Repository\MergeTag; /** * Uninvite user to group trigger class */ -class UninviteUser extends GroupTrigger { +class UninviteUser extends GroupTrigger +{ + /** + * Uninvited user instance. + * + * @var \WP_User + */ + public $uninvitedUserObject; /** * Constructor */ - public function __construct() { - - parent::__construct( array( - 'slug' => 'buddypress/group/uninvite_user', - 'name' => __( 'Uninvite user to group', 'notification-buddypress' ), - ) ); - - $this->add_action( 'groups_uninvite_user', 100, 2 ); - + public function __construct() + { + parent::__construct( + [ + 'slug' => 'buddypress/group/uninvite_user', + 'name' => __('Uninvite user to group', 'notification-buddypress'), + ] + ); + + $this->addAction('groups_uninvite_user', 100, 2); } /** * Hooks to the action. * - * @param int $group_id ID of the group being uninvited to. - * @param int $user_id ID of the user being uninvited. + * @param int $groupId ID of the group being uninvited to. + * @param int $userId ID of the user being uninvited. * @return mixed */ - public function context( $group_id, $user_id ) { - - $this->group_id = $group_id; - $this->buddy_group = groups_get_group( $group_id ); - $this->uninvited_user = get_user_by( 'id', $user_id ); + public function context($groupId, $userId) + { + $uninvitedUser = get_user_by('id', $userId); - $this->uninvite_datetime = $this->cache( 'uninvite_datetime', time() ); + if (!$uninvitedUser instanceof \WP_User) { + return false; + } + $this->buddyGroup = groups_get_group($groupId); + $this->uninvitedUserObject = $uninvitedUser; } - /** * Registers attached merge tags * * @return void */ - public function merge_tags() { - - parent::merge_tags(); + public function mergeTags() + { + parent::mergeTags(); // Invited user. - $this->add_merge_tag( new MergeTag\User\UserID( [ - 'slug' => 'uninvited_user_ID', - 'name' => __( 'Uninvited user ID', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLogin( [ - 'slug' => 'uninvited_user_login', - 'name' => __( 'Uninvited user login', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserEmail( [ - 'slug' => 'uninvited_user_email', - 'name' => __( 'Uninvited user email', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserDisplayName( [ - 'slug' => 'uninvited_user_display_name', - 'name' => __( 'Uninvited user display name', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserFirstName( [ - 'slug' => 'uninvited_user_first_name', - 'name' => __( 'Uninvited user first name', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\User\UserLastName( [ - 'slug' => 'uninvited_user_last_name', - 'name' => __( 'Uninvited user last name', 'notification-buddypress' ), - 'property_name' => 'uninvited_user', - 'group' => __( 'User', 'notification-buddypress' ), - ] ) ); - - $this->add_merge_tag( new MergeTag\DateTime\DateTime( array( - 'slug' => 'uninvite_datetime', - 'name' => __( 'Uninvite date and time', 'notification-buddypress' ), - 'group' => __( 'Date', 'notification-buddypress' ), - ) ) ); - + $this->addMergeTag( + new MergeTag\User\UserID( + [ + 'slug' => 'uninvited_user_ID', + 'name' => __('Uninvited user ID', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLogin( + [ + 'slug' => 'uninvited_user_login', + 'name' => __('Uninvited user login', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserEmail( + [ + 'slug' => 'uninvited_user_email', + 'name' => __('Uninvited user email', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserDisplayName( + [ + 'slug' => 'uninvited_user_display_name', + 'name' => __('Uninvited user display name', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserFirstName( + [ + 'slug' => 'uninvited_user_first_name', + 'name' => __('Uninvited user first name', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\User\UserLastName( + [ + 'slug' => 'uninvited_user_last_name', + 'name' => __('Uninvited user last name', 'notification-buddypress'), + 'property_name' => 'uninvitedUserObject', + 'group' => __('User', 'notification-buddypress'), + ] + ) + ); + + $this->addMergeTag( + new MergeTag\DateTime\DateTime( + [ + 'slug' => 'uninvite_datetime', + 'name' => __('Uninvite date and time', 'notification-buddypress'), + 'group' => __('Date', 'notification-buddypress'), + 'timestamp' => static function () { + return time(); + }, + ] + ) + ); } - } diff --git a/src/Repository/TriggerRepository.php b/src/Repository/TriggerRepository.php index 86b7201..fcdf725 100644 --- a/src/Repository/TriggerRepository.php +++ b/src/Repository/TriggerRepository.php @@ -5,6 +5,8 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Repository; use BracketSpace\Notification\Register; @@ -12,51 +14,52 @@ /** * Trigger Repository. */ -class TriggerRepository { - +class TriggerRepository +{ /** * @return void */ - public static function register() { + public static function register() + { // Activity. - if ( notification_get_setting( 'triggers/buddypress/activity_enable' ) ) { - Register::trigger( new Trigger\Activity\Added() ); - Register::trigger( new Trigger\Activity\Deleted() ); - Register::trigger( new Trigger\Activity\AddToFavorities() ); - Register::trigger( new Trigger\Activity\AddToFavoritiesFail() ); - Register::trigger( new Trigger\Activity\RemoveFromFavorities() ); + if (\Notification::settings()->getSetting('triggers/buddypress/activity_enable')) { + Register::trigger(new Trigger\Activity\Added()); + Register::trigger(new Trigger\Activity\Deleted()); + Register::trigger(new Trigger\Activity\AddToFavorities()); + Register::trigger(new Trigger\Activity\AddToFavoritiesFail()); + Register::trigger(new Trigger\Activity\RemoveFromFavorities()); } // Friendship. - if ( notification_get_setting( 'triggers/buddypress/friendship_enable' ) ) { - Register::trigger( new Trigger\Friendship\Accepted() ); - Register::trigger( new Trigger\Friendship\Requested() ); - Register::trigger( new Trigger\Friendship\Deleted() ); + if (\Notification::settings()->getSetting('triggers/buddypress/friendship_enable')) { + Register::trigger(new Trigger\Friendship\Accepted()); + Register::trigger(new Trigger\Friendship\Requested()); + Register::trigger(new Trigger\Friendship\Deleted()); } // Group. - if ( notification_get_setting( 'triggers/buddypress/group_enable' ) ) { - Register::trigger( new Trigger\Group\CreateComplete() ); - Register::trigger( new Trigger\Group\DetailsUpdated() ); - Register::trigger( new Trigger\Group\SettingsUpdated() ); - Register::trigger( new Trigger\Group\Deleted() ); - - Register::trigger( new Trigger\Group\InviteUser() ); - Register::trigger( new Trigger\Group\UninviteUser() ); - Register::trigger( new Trigger\Group\Join() ); - Register::trigger( new Trigger\Group\Leave() ); - Register::trigger( new Trigger\Group\RemoveMember() ); - - Register::trigger( new Trigger\Group\BanMember() ); - Register::trigger( new Trigger\Group\UnbanMember() ); - - Register::trigger( new Trigger\Group\PromoteMember() ); - Register::trigger( new Trigger\Group\DemoteMember() ); - - Register::trigger( new Trigger\Group\MembershipRequested() ); - Register::trigger( new Trigger\Group\MembershipAccepted() ); - Register::trigger( new Trigger\Group\MembershipRejected() ); + // phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed + if (!\Notification::settings()->getSetting('triggers/buddypress/group_enable')) { + Register::trigger(new Trigger\Group\CreateComplete()); + Register::trigger(new Trigger\Group\DetailsUpdated()); + Register::trigger(new Trigger\Group\SettingsUpdated()); + Register::trigger(new Trigger\Group\Deleted()); + + Register::trigger(new Trigger\Group\InviteUser()); + Register::trigger(new Trigger\Group\UninviteUser()); + Register::trigger(new Trigger\Group\Join()); + Register::trigger(new Trigger\Group\Leave()); + Register::trigger(new Trigger\Group\RemoveMember()); + + Register::trigger(new Trigger\Group\BanMember()); + Register::trigger(new Trigger\Group\UnbanMember()); + + Register::trigger(new Trigger\Group\PromoteMember()); + Register::trigger(new Trigger\Group\DemoteMember()); + + Register::trigger(new Trigger\Group\MembershipRequested()); + Register::trigger(new Trigger\Group\MembershipAccepted()); + Register::trigger(new Trigger\Group\MembershipRejected()); } } - } diff --git a/src/Requirements/BasePlugin.php b/src/Requirements/BasePlugin.php index 929b18b..a3a9af8 100644 --- a/src/Requirements/BasePlugin.php +++ b/src/Requirements/BasePlugin.php @@ -5,15 +5,17 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress\Requirements; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Requirements; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Requirements; /** * BasePlugin checker */ -class BasePlugin extends Requirements\Abstracts\Checker { - +class BasePlugin extends Requirements\Abstracts\Checker +{ /** * Checker name * @@ -27,21 +29,27 @@ class BasePlugin extends Requirements\Abstracts\Checker { * @param string $value Requirement. * @return void */ - public function check( $value ) { + public function check($value) + { + + if (! class_exists('Notification')) { + $this->add_error('The Notification plugin is required to be active.'); + } - if ( ! class_exists( 'Notification' ) ) { - $this->add_error( 'The Notification plugin is required to be active.' ); + if (! version_compare(\Notification::version(), $value, '<')) { + return; } - if ( version_compare( \Notification::version(), $value, '<' ) ) { - $this->add_error( sprintf( + $this->add_error( + sprintf( // Translators: 1. Required Notification version, 2. Used Notification version. - __( 'Minimum required version of Notification plugin is %1$s. Your version is %2$s', 'notification-buddypress' ), + __( + 'Minimum required version of Notification plugin is %1$s. Your version is %2$s', + 'notification-buddypress' + ), $value, \Notification::version() - ) ); - } - + ) + ); } - } diff --git a/src/Runtime.php b/src/Runtime.php index 0507427..8df850d 100644 --- a/src/Runtime.php +++ b/src/Runtime.php @@ -5,18 +5,23 @@ * @package notification/buddypress */ +declare(strict_types=1); + namespace BracketSpace\Notification\BuddyPress; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Requirements\Requirements as RequirementsEngine; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\DocHooks\HookTrait; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\DocHooks\Helper as DocHooksHelper; -use BracketSpace\Notification\BuddyPress\Vendor\Micropackage\Filesystem\Filesystem; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Requirements\Requirements as RequirementsEngine; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\DocHooks\HookTrait; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\DocHooks\Helper as DocHooksHelper; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Filesystem\Filesystem; +use BracketSpace\Notification\BuddyPress\Dependencies\Micropackage\Internationalization\Internationalization; /** * Runtime class + * + * @since 2.0.0 */ -class Runtime { - +class Runtime +{ use HookTrait; /** @@ -24,14 +29,14 @@ class Runtime { * * @var string */ - protected $plugin_file; + protected $pluginFile; /** * Flag for unmet requirements * * @var bool */ - protected $requirements_unmet; + protected $requirementsUnmet; /** * Filesystems @@ -43,18 +48,19 @@ class Runtime { /** * Components * - * @var array<string,mixed> + * @var array<class-string, object> */ protected $components = []; /** * Class constructor * - * @since 2.0.0 - * @param string $plugin_file Plugin main file full path. + * @since 2.0.0 + * @param string $pluginFile Plugin main file full path. */ - public function __construct( $plugin_file ) { - $this->plugin_file = $plugin_file; + public function __construct($pluginFile) + { + $this->pluginFile = $pluginFile; } /** @@ -63,42 +69,44 @@ public function __construct( $plugin_file ) { * @since 2.0.0 * @return void */ - public function init() { - + public function init() + { // Plugin has been already initialized. - if ( did_action( 'notification/buddypress/init ' ) || $this->requirements_unmet ) { + if (did_action('notification/buddypress/init') || $this->requirementsUnmet) { return; } // Requirements check. - $requirements = new RequirementsEngine( __( 'Notification : BuddyPress', 'notification-buddypress' ), [ - 'php' => '7.0', - 'wp' => '5.3', - 'notification' => '8.0.0', - 'plugins' => [ - [ - 'file' => 'buddypress/bp-loader.php', - 'name' => 'BuddyPress', - 'version' => '5.1', + $requirements = new RequirementsEngine( + __('Notification : BuddyPress', 'notification-buddypress'), + [ + 'php' => '7.4', + 'wp' => '5.3', + 'notification' => '9.0.0', + 'plugins' => [ + [ + 'file' => 'buddypress/bp-loader.php', + 'name' => 'BuddyPress', + 'version' => '5.1', + ], ], - ], - ] ); + ] + ); - $requirements->register_checker( Requirements\BasePlugin::class ); + $requirements->register_checker(Requirements\BasePlugin::class); - if ( ! $requirements->satisfied() ) { + if (! $requirements->satisfied()) { $requirements->print_notice(); - $this->requirements_unmet = true; + $this->requirementsUnmet = true; return; } - $this->filesystem = new Filesystem( dirname( $this->plugin_file ) ); + $this->filesystem = new Filesystem(dirname($this->pluginFile)); $this->singletons(); - $this->cli_commands(); + $this->cliCommands(); $this->actions(); - do_action( 'notification/buddypress/init' ); - + do_action('notification/buddypress/init'); } /** @@ -107,12 +115,13 @@ public function init() { * @since 2.0.0 * @return void */ - public function cli_commands() { - if ( ! defined( 'WP_CLI' ) || \WP_CLI !== true ) { + public function cliCommands() + { + if (! defined('WP_CLI') || \WP_CLI !== true) { return; } - \WP_CLI::add_command( 'notification-buddypress dump-hooks', Cli\DumpHooks::class ); + \WP_CLI::add_command('notification-buddypress dump-hooks', Cli\DumpHooks::class); } /** @@ -121,15 +130,18 @@ public function cli_commands() { * @since 2.0.0 * @return void */ - public function register_hooks() { + public function registerHooks() + { // Hook Runtime. $this->add_hooks(); // Hook all the components. - foreach ( $this->components as $component ) { - if ( is_object( $component ) ) { - $this->add_hooks( $component ); + foreach ($this->components as $component) { + if (! is_object($component)) { + continue; } + + $this->add_hooks($component); } } @@ -137,9 +149,14 @@ public function register_hooks() { * Gets filesystem * * @since 2.0.0 - * @return Filesystem|null + * @return Filesystem */ - public function get_filesystem() { + public function getFilesystem() + { + if ($this->filesystem === null) { + throw new \Exception('Filesystem has not been invoked yet.'); + } + return $this->filesystem; } @@ -148,16 +165,22 @@ public function get_filesystem() { * * @since 2.0.0 * @throws \Exception When component is already registered. - * @param string $name Component name. - * @param mixed $component Component. + * @param mixed $component Component. * @return $this */ - public function add_component( $name, $component ) { - if ( isset( $this->components[ $name ] ) ) { - throw new \Exception( sprintf( 'Component %s is already added.', $name ) ); + public function addComponent($component) + { + if (! is_object($component)) { + throw new \Exception('Component has to be an object.'); } - $this->components[ $name ] = $component; + $name = get_class($component); + + if (isset($this->components[$name])) { + throw new \Exception(sprintf('Component %s is already added.', $name)); + } + + $this->components[$name] = $component; return $this; } @@ -166,20 +189,22 @@ public function add_component( $name, $component ) { * Gets runtime component * * @since 2.0.0 - * @param string $name Component name. - * @return mixed Component or null + * @param string $name Component name. + * @return object|null Component or null */ - public function component( $name ) { - return isset( $this->components[ $name ] ) ? $this->components[ $name ] : null; + public function component($name) + { + return $this->components[$name] ?? null; } /** * Gets runtime components * * @since 2.0.0 - * @return array + * @return array<class-string, object> */ - public function components() { + public function components() + { return $this->components; } @@ -190,9 +215,13 @@ public function components() { * @since 2.0.0 * @return void */ - public function singletons() { - $this->add_component( 'admin/settings', new Admin\Settings() ); - $this->add_component( 'frontend/handler', new Frontend\NotificationHandler() ); + public function singletons() + { + $this->addComponent( + new Internationalization('notification-buddypress', $this->getFilesystem()->path('resources/languages')) + ); + $this->addComponent(new Admin\Settings()); + $this->addComponent(new Frontend\NotificationHandler()); } /** @@ -201,16 +230,16 @@ public function singletons() { * @since 2.0.0 * @return void */ - public function actions() { - $this->register_hooks(); - - notification_register_settings( [ $this->component( 'admin/settings' ), 'register_trigger_settings' ], 20 ); - notification_register_settings( [ $this->component( 'admin/settings' ), 'register_carrier_settings' ], 30 ); + public function actions() + { + $this->registerHooks(); // DocHooks compatibility. - if ( ! DocHooksHelper::is_enabled() && $this->get_filesystem()->exists( 'compat/register-hooks.php' ) ) { - include_once $this->get_filesystem()->path( 'compat/register-hooks.php' ); + if (DocHooksHelper::is_enabled() || !$this->getFilesystem()->exists('compat/register-hooks.php')) { + return; } + + include_once $this->getFilesystem()->path('compat/register-hooks.php'); } /** @@ -221,9 +250,10 @@ public function actions() { * @since 2.0.0 * @return void */ - public function elements() { + public function elements() + { array_map( - [ $this, 'load_element' ], + [$this, 'loadElement'], [ 'carriers', 'recipients', @@ -242,15 +272,19 @@ public function elements() { * * @since 2.0.0 * @param string $element Element name. - * @param class-string $class_name Element Registerer class name. + * @param class-string $className Element Registerer class name. * @return void */ - public function load_element( $element, $class_name ) { - if ( apply_filters( 'notification/buddypress/load/element/' . $element, true ) ) { - if ( is_callable( [ $class_name, 'register' ] ) ) { - $class_name::register(); - } + public function loadElement($element, $className) + { + if (! apply_filters('notification/buddypress/load/element/' . $element, true)) { + return; + } + + if (! is_callable([$className, 'register'])) { + return; } - } + $className::register(); + } } diff --git a/uninstall.php b/uninstall.php index c1e7368..dd58cd8 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,10 +1,18 @@ <?php +/** + * Plugin uninstall script + * + * @package notification/buddypress + */ + +declare(strict_types=1); + /** * Plugin uninstallation file * * @package notification/buddypress */ -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { +if (! defined('WP_UNINSTALL_PLUGIN')) { die; }