File Editor
Directories:
.. (Back)
ajax
capabilities
endpoints
exceptions
filters
formatter
google_search_console
import
listeners
menu
metabox
notifiers
pages
roles
services
statistics
taxonomy
tracking
views
watchers
Files:
admin-settings-changed-listener.php
ajax.php
class-admin-asset-analysis-worker-location.php
class-admin-asset-dev-server-location.php
class-admin-asset-location.php
class-admin-asset-manager.php
class-admin-asset-seo-location.php
class-admin-editor-specific-replace-vars.php
class-admin-gutenberg-compatibility-notification.php
class-admin-help-panel.php
class-admin-init.php
class-admin-recommended-replace-vars.php
class-admin-user-profile.php
class-admin-utils.php
class-admin.php
class-asset.php
class-bulk-description-editor-list-table.php
class-bulk-editor-list-table.php
class-bulk-title-editor-list-table.php
class-collector.php
class-config.php
class-database-proxy.php
class-export.php
class-expose-shortlinks.php
class-gutenberg-compatibility.php
class-meta-columns.php
class-my-yoast-proxy.php
class-option-tab.php
class-option-tabs-formatter.php
class-option-tabs.php
class-paper-presenter.php
class-plugin-availability.php
class-plugin-conflict.php
class-premium-popup.php
class-premium-upsell-admin-block.php
class-primary-term-admin.php
class-product-upsell-notice.php
class-remote-request.php
class-schema-person-upgrade-notification.php
class-suggested-plugins.php
class-wincher-dashboard-widget.php
class-yoast-columns.php
class-yoast-dashboard-widget.php
class-yoast-form.php
class-yoast-input-validation.php
class-yoast-network-admin.php
class-yoast-network-settings-api.php
class-yoast-notification-center.php
class-yoast-notification.php
class-yoast-notifications.php
class-yoast-plugin-conflict.php
index.php
interface-collection.php
interface-installable.php
Create New File
Create
Edit File: class-collector.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin */ /** * Collects the data from the added collection objects. */ class WPSEO_Collector { /** * Holds the collections. * * @var WPSEO_Collection[] */ protected $collections = []; /** * Adds a collection object to the collections. * * @param WPSEO_Collection $collection The collection object to add. * * @return void */ public function add_collection( WPSEO_Collection $collection ) { $this->collections[] = $collection; } /** * Collects the data from the collection objects. * * @return array The collected data. */ public function collect() { $data = []; foreach ( $this->collections as $collection ) { $data = array_merge( $data, $collection->get() ); } return $data; } /** * Returns the collected data as a JSON encoded string. * * @return false|string The encode string. */ public function get_as_json() { return WPSEO_Utils::format_json_encode( $this->collect() ); } }
Save Changes
Rename File
Rename