*/ protected function input_properties(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function required_input(): array { return array(); } /** * @since 0.0.34 * @return array */ protected function output_properties(): array { return array( 'locations' => array( 'type' => 'array', 'items' => array( 'type' => 'object', 'additionalProperties' => true ), 'description' => __( 'One row per location.', 'acrossai-abilities-manager' ), ), 'count' => array( 'type' => 'integer' ), ); } /** * @since 0.0.34 * @return array */ protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ); } /** * @since 0.0.34 * @param array $input Input. * @return array|WP_Error */ protected function run( array $input ) { $descriptions = array( 'site_wide_header' => __( 'In the site head, on every page, via wp_head.', 'acrossai-abilities-manager' ), 'site_wide_body' => __( 'Immediately after the opening body tag, via wp_body_open. Requires theme support for that hook.', 'acrossai-abilities-manager' ), 'site_wide_footer' => __( 'In the site footer, on every page, via wp_footer.', 'acrossai-abilities-manager' ), 'everywhere' => __( 'Runs on every request, front end and admin, with no output position.', 'acrossai-abilities-manager' ), 'admin_only' => __( 'Runs in wp-admin only.', 'acrossai-abilities-manager' ), 'before_post' => __( 'Before the post, on single post views.', 'acrossai-abilities-manager' ), 'after_post' => __( 'After the post, on single post views.', 'acrossai-abilities-manager' ), 'before_content' => __( 'Before the post content.', 'acrossai-abilities-manager' ), 'after_content' => __( 'After the post content.', 'acrossai-abilities-manager' ), 'before_paragraph' => __( 'Before a given paragraph of the content.', 'acrossai-abilities-manager' ), 'after_paragraph' => __( 'After a given paragraph of the content.', 'acrossai-abilities-manager' ), ); $rows = array(); foreach ( Snippet_Repository::LOCATIONS as $location ) { $rows[] = array( 'location' => $location, 'description' => $descriptions[ $location ] ?? '', ); } return array( 'locations' => $rows, 'count' => count( $rows ), ); } }